// General Scripts used on the site
//////////////////////////////////////////////////////////////////////////////////////
//  http://support.microsoft.com/kb/887741  just incase
function submitForm(appAction) {
	submitFormDo(appAction)
}
////////////////////////////////////////////////////////////////////////////////////////////
	// sumbitForm
	function submitFormDo(appAction) {
		
		if (appAction == "Save" || appAction == "Add adddress"){
			window.document.lgoCartForm.action = window.document.lgoCartForm.formLocationUpdate.value;
		}else{
			window.document.lgoCartForm.action = window.document.lgoCartForm.formLocationFinal.value;
		}

		window.document.lgoCartForm.appAction.value = appAction;
		window.document.lgoCartForm.submit();
		
	}
//////////////////////////////////////////////////////////////////////////////////////
// Preload the loader images

var checkoutLoaderImage = new Image();
checkoutLoaderImage.src = "images/checkoutLoader.gif";

var longLoaderImage = new Image();
longLoaderImage.src = "images/longLoaderImage.gif";

var loadingImage = new Image();
loadingImage.src = "images/loading.gif";

//////////////////////////////////////////////////////////////////////////////////////
function registerPurchase() {
	
	// Create a new AJAX Object to send registration data to DB
		var registration_ajaxObject = new ajaxClass();
		
		// To load a previous order check if orderID_Load input is valid.
		var orderID_Load = document.getElementById('lgoID').value;
		
		// Prepare URL for request
		var requestURL = "registrationCalls.php?do=registerOrder&orderID_Load="+orderID_Load;
		requestURL = requestURL + "&registrant=" + document.getElementById("registrant").value;
		requestURL = requestURL + "&email=" + document.getElementById("email").value

				
			registration_ajaxObject.generateRequest(
									requestURL,		// The URL of the request
									"GET",					// The Method of the request
									true,	 				// freeze the browser t/f
									"registrationComplete",	// successfully function
									"text",	 				// expected format xml/text
									this					// Scope of the call
									 );
			
			registration_ajaxObject.sendRequest(); // use the object to send the request
		
		// need to display a loader

}
//////////////////////////////////////////////////////////////////////////////////////
function registrationComplete(){

	var regDiv =  document.getElementById("registration");
	regDiv.style.display = "none";
	
	var eraseDiv = document.getElementById("eraseRow");
	eraseDiv.style.display = "none";

	var GCdiv = document.getElementById("GCCell");
	GCdiv.style.display = "";
}
//////////////////////////////////////////////////////////////////////////////////////
