//  ---------- Confirm Submit of form -------------//
function ConfirmSubmit(message)
{
var agree = confirm(message);
if (agree)
	return true ;
else
	return false ;
}
//  ------------------  End  ---------------  //

// ------Sets Focus to all first form inputs on page -------//
function init() {
document.getElementsByTagName('input')[0].focus();
}
window.onload = init;
//  ------------------  End  --------------- //

// ------ Checks and Unchecks Email Options and Categories Checkboxes on Register Page ------- //
var checkflag = "true"; // Initial value is Uncheck All with all items checked //
function check(field, buttonfield) {
if (checkflag == "false") {
	for (i = 0; i < field.length; i++) {
	field[i].checked = true;
	}
	checkflag = "true";
	buttonfield.value = "Uncheck All";
	}
else {
	for (i = 0; i < field.length; i++) {
	field[i].checked = false; 
	}
	checkflag = "false";
	buttonfield.value = "Check All";
	}
}
//  ------------------  End  --------------- //

// ------ Checks and Unchecks Categories Checkboxes on My Details Page ------- //
var checkflag2 = "true"; // Initial value is Uncheck All with all items checked //
function check2(field, buttonfield) {
if (checkflag2 == "false") {
	for (i = 0; i < field.length; i++) {
	field[i].checked = true;
	}
	checkflag2 = "true";
	buttonfield.value = "Uncheck All";
	}
else {
	for (i = 0; i < field.length; i++) {
	field[i].checked = false; 
	}
	checkflag2 = "false";
	buttonfield.value = "Check All";
	}
}
//  ------------------  End  --------------- //