// JavaScript Document
// FORM MODAL FUNCTION
function getForm (form_id,hostID,exitID) {
	//alert("FORM ID: " + form_id + ", HOST ID: " + hostID);
	$.colorbox.remove();
	$.colorbox.init();
			var g_width = "753";
			var g_height = "700";
	if (form_id == "1") {
		ModalStatus = 11;
			//alert("form_id = " + form_id);
			var g_url = "http://webadventures.rice.edu/forms/Contact.html?FID=" + form_id + "&HID=" + hostID;
			var g_title = "SUBMIT FEEDBACK";
	} else 	if (form_id == "2") {
			//alert("form_id = " + form_id);
		ModalStatus = 12;
			var g_url = "http://webadventures.rice.edu/forms/Join.html?FID=" + form_id;
			var g_title = "JOIN OUR MAILING LIST!";	
	} else 	if (form_id == "3") {
			//alert("form_id = " + form_id);
		ModalStatus = 13;
			var g_url = "http://webadventures.rice.edu/forms/Contact.html?FID=" + form_id + "&HID=" + hostID;
			var g_title = "TECHNICAL PROBLEM!";	
	} else 	if (form_id == "4") {
			//alert("form_id = " + form_id);
		ModalStatus = 14;
			var g_url = "http://webadventures.rice.edu/forms/Contact.html?FID=" + form_id + "&HID=" + hostID;
			var g_title = "FIELD TEST EVALUATION - PARTICIPATE!";	
	} else 	if (form_id == "5") {
			//alert("form_id = " + form_id);
		ModalStatus = 15;
			var g_url = "http://webadventures.rice.edu/forms/Contact.html?FID=" + form_id + "&HID=" + hostID;
			var g_title = "WORKSHOP INQUIRIES!";
	} else 	if (form_id == "6") {
			//alert("form_id = " + form_id);
			var g_width = "753";
			var g_height = "553";
		ModalStatus = 16;
			var g_url = "http://webadventures.rice.edu/forms/Privacy.html?FID=" + form_id + "&HID=" + hostID;
			var g_title = "CHILDREN'S PRIVACY POLICY!";		
	} else 	if (form_id == "7") {
			//alert("form_id = " + form_id);
		ModalStatus = 17;
			var GID = exitID.toString().substr(0,1);
			var g_url = "http://webadventures.rice.edu/forms/Game-Feedback.html?GID=" + GID + "&EID=" + exitID;
			var g_title = "GAME FEEDBACK!";
	}
			var g_innerwidth = "553";
			var g_innerheight = "435";
			var g_speed = "350";
			var g_transition = "elastic";	
			
			g_start_date = new Date();
			g_start_time = g_start_date.getTime();
			// SET FORM DATA			
			gCat = hType + " - FORM | MODAL (CANCELLED!!)";
			gAct = "Cancel Form | Form ID - " + form_id;
			gLab = g_title + " | " + navigator.appVersion + " | " + userIP;
			gVal = form_id;
			//alert("g_title: " + g_title);
			$("#cboxContent").css("background-color","#000000");
			$("#cboxContent").css("background-image","bg.jpg");
			//$("#cboxBottomRight").css("height","0");
			//$("#cboxBottomCenter").css("height","0");
			//$("#cboxBottomLeft").css("height","0");
			//$("#cboxContent").addClass('cboxExit').removeClass('cboxClose');
			//$("#cboxClose").css('background-image', 'url("/images/close_up_text.png")');
			//$("#cboxClose").css("background-image","images/close_up_text.png");
			//$("#cboxClose").css("backgroundRepeat","no-repeat");
			//$("#cboxClose.hover").css('background-image', 'url("/images/close_over_text.png")');
			//$("#cboxClose.hover").css("background-image","images/close_over_text.png");
			//$("#cboxClose.hover").css("backgroundRepeat","no-repeat");
			
	$.colorbox({iframe:true, title:"", href:g_url, scrolling:true, width:g_width, height:g_height,innerWidth:g_innerwidth, innerHeight:g_innerheight, speed:g_speed, 
	transition:g_transition, overlayClose:false,onComplete:function(
	){showFrame()}, onCleanup:function(){getRemove()} });
	function getRemove() {
		gameTime();
		var gDate = new Date();
		//alert("CATEGORY: " + hType + " - FORM (MODAL) ");
		_gaq.push(['_trackEvent', hType + ' | FORM | MODAL', 'Form Completed | Form ID | ' + form_id, g_title + ' | ' + navigator.appVersion + ' | ' + userIP + " | " + gDate, form_id]);
		ModalStatus = 0;		
	}
	function showFrame() {
		//$("#cboxLoadedContent").css("display","none");
			//alert("SHOW IFRAME!!!");
	}
}
