/*---------------------------------------------------------------*\
	EDIT HISTORY ::::::::::::: 
									:: yyyy-mm-dd Initial Creation XXX
	FILENAME ::::::::::::::::: termsOfUse.js
	DEPENDANCIES ::::::::::::: jquery.js, thickbox.js, thickbox.css
										imput button with an id = "Submit"
										CheckBox with id = "isAgreed_cb"
										label with id = "isAgreed_lbl"
										form with id = "visitor"
	DESCRIPTION :::::::::::::: 
\*----------------------------------------------------------------*/
var termsofUseAgrement_div;

/*---------------------------------------------------------------*\
	This function is intended to be run on page load.  
	The pages in mind are the login page and the vistor registration page.
	 It sets up the submit button to work with the thickbox feature.
\*----------------------------------------------------------------*/
function init() {
	btn_Submit = document.getElementById("Submit");
	btn_Submit.alt="#TB_inline?height=400&width=550&inlineId=termsOfUseAgrement&modal=true";
	btn_Submit.title="Terms Of Use Agreement"
	btn_Submit.onSubmit = "return false;";
	
	cb_isAgreed = document.getElementById("isAgreed_cb");
	cb_isAgreed.checked = false;
	
	alt="#TB_inline?height=300&width=400&inlineId=myOnPageContent" ;
	
	var lbl_isAgreed 	= document.getElementById("isAgreed_lbl");
	lbl_isAgreed.style.color = color='#000000';
}

/*---------------------------------------------------------------*\
	On submital form, check if user has agreed to terms. If not, don't submit form.
\*----------------------------------------------------------------*/
function register() {
	var cb_isAgreed 	= document.getElementById("isAgreed_cb");
	
	if (cb_isAgreed.checked == false) {
		// Then pop Up user agreement
		//display the agreement
		doMustAgreeToUseAgreement();
	} else {
		//Submit data.
		doSubmitalOfUseAgreement();
	}
}

function doSubmitalOfUseAgreement() {
	document.visitor.submit();
}

function doMustAgreeToUseAgreement() {
	var lbl_isAgreed 	= document.getElementById("isAgreed_lbl");
	lbl_isAgreed.style.color = color='red';
}

function closeUseAgreement() {
	tb_remove();
}


//display screen. Set Check Box.


