// Checks a vote has been cast on the vote page
function checkForVote(source, arguments){

	var rbs = document.getElementsByTagName('input');
	var i;
	var blnRes = false;

	if (rbs){
		for (i = 0; i < rbs.length; i++){
			if (rbs[i].id.indexOf('rblAnswers') != -1){
				if (rbs[i].checked){
					blnRes = true;
					break;
				}
			}
		}		
	}
	arguments.IsValid = blnRes;
}

// On the send email page, checks that at least one recipient has been specified
function checkSendTo(source, arguments){
	
	var cbs = document.getElementsByTagName('input');
	var i;
	var blnRes = false
	
	if (cbs){
		for (i = 0; i < cbs.length; i++){
			if (cbs[i].type == 'checkbox'){
				if (cbs[i].checked){
					blnRes = true;
					break;
				}
			}
		}
	}
	arguments.IsValid = blnRes;
}

// Opens up the preview window to show what the email is going to look like
function showPreview(){
	var newWindow = window.open('emailpreview.aspx', 'EmailPreview', 'status=no,scrollbars=yes,resizable=no,width=445,height=400')
	newWindow.focus();
}


/*openBrWindow(strURL,'JobDeatils','status=no,scrollbars=yes,resizable=yes,width=445,height=310');
	newWindow.focus();
}

function openBrWindow(theURL,winName,features) {
  newWindow=window.open(theURL,winName,features);
}
*/
