// JavaScript Document

<!--Generates Guest's Post Conference Survey//-->

// var mywindow
// mywindow=null
// function opentwowindow()
// {
// mywindow=window.open("/join/participant-survey.php","null","scrollbars=yes,resizable=yes,width=800,height=600,left=100,top=100")
// }


<!--Generates Host's Post Conference Survey//-->



	   <!--
	   function Init()
	   {
			document.role_form.reset();
			document.host_form.reset();
			document.guest_form.reset();

		   //MBR Code: Use querystring to initialize the form
		   var sRole = GetQueryString()["role"];
		   if (sRole) {
				SelectRole(sRole)
				if (sRole != '')
				{
					document.role_form.role[0].checked = sRole.toLowerCase() == 'host';
					document.role_form.role[1].checked = sRole.toLowerCase() == 'guest';
				}
				
		   }	
			
			<!-- document.guest_form.proxy.value = get_proxy();  -->// Test for proxy ** This is critical
			//if (document.guest_form.proxy.value == '') 
			//	document.guest_form.proxy.checked = false;
			//else
			//	document.guest_form.proxy.checked = true;			
			
			//default proxy handling to checked.
			<!-- document.guest_form.proxy.checked = true;			 -->
				
			document.guest_form.cust.value = "INF";
			document.guest_form.SecSvcProv.value = "";
			document.guest_form.brand.value = "lawconferencing";
			<!-- document.guest_form.enablehttps.checked = true; -->
			document.guest_form.enablecookies.checked = true;
			
			<!-- document.host_form.proxy.value = get_proxy(); -->
			//if (document.host_form.proxy.value == '') 
			//	document.host_form.proxy.checked = false;
			//else
			//	document.host_form.proxy.checked = true;
						
			//default proxy handling to checked.
			<!-- document.guest_form.proxy.checked = true;			 -->

				
			document.host_form.cust.value = "INF";
			document.host_form.SecSvcProv.value = "";
			document.host_form.brand.value = "lawconferencing";
			<!-- document.host_form.enablehttps.checked = true; -->
			document.host_form.enablecookies.checked = true;
			
			// Define whether form fields are required or optional
			document.guest_form.code.required= true;
			document.guest_form.fname.required= true;
			document.guest_form.comp.required= true;
			document.guest_form.email.required= true;
			document.host_form.UserName.required= true;
			document.host_form.Password.required= true;
			document.host_form.fname.required= true;
			document.host_form.comp.required= false;
			document.host_form.email.required= false;
	
		   var sRole = GetQueryString()["role"];
		   if (sRole) {
				SelectRole(sRole)
		   }	
		   
			

			// Look for a stored cookie with user login information
			GetCookie();
		   
		   //MBR Code: Use querystring to initialize the form
			GetHostParms();
			GetPartParms();
			
			ScheduleSession();
			document.role_form.focus();  // Set cursor focus to the first form field
		}

		function ScheduleSession()
		{
			var sSchedId = GetQueryString()["schedid"];
			if (sSchedId)
			{
				document.guest_form.code.value = sSchedId;
				document.host_form.mode.value = "scheduled";
				
				if (document.host_form.Password.value != sSchedId)
				{
					document.host_form.Password.value = sSchedId;
					document.host_form.UserName.value = "";
				}
//				if (sSchedId.indexOf('s-') == 0)
//				{
//					document.guest_form.code.disabled = true;
//					document.host_form.Password.disabled = true;
//				}
			}
		}

		function GuestLogon()
		{
			var actionURL = 'https://www.conferenceservers.com/meetme/meetme.asp?';
			document.guest_form.action = actionURL;
			var errString = "";
			if ((document.guest_form.code.value == "") && (document.guest_form.code.required == true)) errString += "     - Enter the Participant Code provided by your host\n";
			if ((document.guest_form.fname.value == "") && (document.guest_form.fname.required == true)) errString += "     - Provide your name\n";
			if ((document.guest_form.comp.value == "") && (document.guest_form.comp.required == true)) errString += "     - Provide your company name\n";
			if ((document.guest_form.email.value == "") && (document.guest_form.email.required == true)) errString += "     - Provide your email address\n";
			if (errString != "") {
				errString = "Please make the following changes before clicking the LOG IN button:\n\n" + errString;
				alert(errString);
				document.guest_form.code.focus();
				
			}
			else {
				// Everything looks good -- return value "true" to the form so it is submitted
				SetCookie();
				document.guest_form.submit();
				
				return true;
			}
		}
		
		function HostLogon()
		{
			var actionURL = 'https://www.conferenceservers.com/webagent/webagent.asp?';
			document.host_form.action = actionURL;
			var errString = "";
			if (document.host_form.brand.value == "") errString += "     - Select a service type\n";
			if ((document.host_form.UserName.value == "") && (document.host_form.UserName.required == true)) errString += "     - Enter the Chair Code\n";
			if ((document.host_form.Password.value == "") && (document.host_form.Password.required == true)) errString += "     - Enter the Participant Code\n";
			if ((document.host_form.fname.value == "") && (document.host_form.fname.required == true)) errString += "     - Provide your name\n";
			if ((document.host_form.comp.value == "") && (document.host_form.comp.required == true)) errString += "     - Provide your company name\n";
			if ((document.host_form.email.value == "") && (document.host_form.email.required == true)) errString += "     - Provide your email address\n";
			if (errString != "") {
				errString = "Please make the following changes before clicking the LOG IN button:\n\n" + errString;
				alert(errString);
				document.host_form.UserName.focus();
				
			}
			else {
				// Everything looks good -- return value "true" to the form so it is submitted
				SetCookie();
				document.host_form.submit();
				
				return true;
			}f
		}
		
		function ShowDiv(sName)
		{
			var oDiv = document.getElementById(sName);
			oDiv.style.display = "";
		}
		
		function HideDiv(sName)
		{
			var oDiv = document.getElementById(sName);
			oDiv.style.display = "none";
		}
		
		function SelectRole(sRole)
		<!--Select host or guest//-->
		{
			if (sRole == "host")
			{
				HideDiv('guestlogin_div');
				ShowDiv('hostlogin_div');			
				document.host_form.UserName.focus();
			}
			else if (sRole == "guest")
			{
				HideDiv('hostlogin_div');
				ShowDiv('guestlogin_div');
				if (document.host_form.mode.value == "scheduled")
				{
					document.guest_form.fname.focus();
				}
				else document.guest_form.code.focus();
			}
		}
		
		function SelectService(sBrand)
		{
			document.host_form.brand.value = sBrand;
			document.host_form.UserName.focus();  // Set cursor focus to the first form field
		}
		
		function UpshiftCode(box)
		{
			if (box.value.indexOf("s-") != 0)
			{
				box.value = box.value.toUpperCase();
			}
		}
		
		function GetCookie()
		{
		if (document.cookie == "") return false;
		var wholeCookie = unescape(document.cookie);
		if (wholeCookie.indexOf("wdCookie")== -1) return false;
		var smallCookie = wholeCookie.split(";");
		var wdCookie;
		var i;
		for (i=0; i<smallCookie.length; i++)
		{
		var temp = smallCookie[i].indexOf("wdCookie");
		if (temp != -1)
			{ wdCookie = smallCookie[i]; }
		}
		wdCookie = wdCookie.substring(12, wdCookie.length);
		var wipInfo = wdCookie.split("|");
		for (i=0; i<13; i++)
		{
		var custValue = wipInfo[i];
    	custValue = custValue.split("=");
		custValue = custValue[1];
		wipInfo[i] = custValue;
		}
//		document.guest_form.code.value 		= wipInfo[0];
		document.guest_form.fname.value 	= wipInfo[1];
		document.guest_form.comp.value 		= unescape(wipInfo[2]);
		document.guest_form.email.value 	= wipInfo[3];
		document.guest_form.pnum.value 		= wipInfo[4];
		document.guest_form.pext.value 		= wipInfo[5];
		document.host_form.UserName.value 	= wipInfo[6];
		document.host_form.Password.value 	= wipInfo[7];
		document.host_form.fname.value 		= wipInfo[8];
		document.host_form.comp.value 		= unescape(wipInfo[9]);
		document.host_form.email.value 		= wipInfo[10];
		document.host_form.pnum.value 		= wipInfo[11];
		document.host_form.pext.value 		= wipInfo[12];
		}

		function SetCookie()
		{	
			var the_date = new Date("December 31, 2010");
			var cookieDate = the_date.toGMTString();
			var guestCode =	document.guest_form.code.value;
			var guestName = document.guest_form.fname.value;
			var guestComp = document.guest_form.comp.value;
			var guestEmail = document.guest_form.email.value;
			var guestPhone = document.guest_form.pnum.value;
			var guestExt = document.guest_form.pext.value;
			var hostId = document.host_form.UserName.value;
			var hostPassword = document.host_form.Password.value;
			var hostName = document.host_form.fname.value;
			var hostComp = document.host_form.comp.value;
			var hostEmail = document.host_form.email.value;
			var hostPhone = document.host_form.pnum.value;
			var hostExt = document.host_form.pext.value;
			var wdCookie = "guestCode=" + guestCode + "|guestName="+ guestName + "|guestComp=" + guestComp + "|guestEmail=" + guestEmail + "|guestPhone=" + guestPhone + "|guestExt=" + guestExt;
				wdCookie = wdCookie + "|hostId="+ hostId + "|hostPassword=" + hostPassword + "|hostName=" + hostName + "|hostComp=" + hostComp + "|hostEmail=" + hostEmail + "|hostPhone=" + hostPhone + "|hostExt=" + hostExt;
				wdCookie = "wdCookie=" + escape(wdCookie);
				wdCookie = wdCookie + ";Expires=" + cookieDate + ";Path=/" + ";Domain=.lawconferencing.com";	
				document.cookie = wdCookie;
		}
		
		 //MBR Code: Use querystring to initialize the form
		function GetHostParms()
		{
		   var sChair = GetQueryString()["chair"];
		   var sPart = GetQueryString()["part"];
		   var sName = GetQueryString()["name"];
		   var sCompany = GetQueryString()["company"];
		   var sEmail = GetQueryString()["email"];
		   
			if (sChair != null && sChair != '') {
				document.host_form.UserName.value 	= sChair.toUpperCase();
			}
			if (sPart != null && sPart != '') {
				document.host_form.Password.value 	= sPart.toUpperCase();
			}
			if (sName != null && sName != '') {
				document.host_form.fname.value 	= sName;
			}
			if (sCompany != null && sCompany != '') {
				document.host_form.comp.value 	= sCompany;
			}
			if (sEmail != null && sName != '') {
				document.host_form.email.value 	= sEmail;
			}
		}
		
		 //MBR Code: Use querystring to initialize the form
		function GetPartParms()
		{
		   var sPart = GetQueryString()["part"];
		   var sName = GetQueryString()["name"];
		   var sCompany = GetQueryString()["company"];
		   var sEmail = GetQueryString()["email"];
		   
			if (sPart != null && sPart != '') {
				document.guest_form.code.value 	= sPart.toUpperCase();
			}
			if (sName != null && sName != '') {
				document.guest_form.fname.value = sName;
			}
			if (sCompany != null && sCompany != '') {
				document.guest_form.comp.value 	= sCompany;
			}
			if (sEmail != null && sEmail != '') {
				document.guest_form.email.value = sEmail;
			}
		}
		
	//-->

<!--Drop down

function positionFooter() {
	if (document.all) { 
		h = document.all['content'].clientHeight + 110;
		if (h > document.body.clientHeight - 40) {
			document.all('footer').style.posTop = h + 12;
		} else {
			document.all('footer').style.posTop = document.body.clientHeight - 40;
		}
		document.all('footer').style.visibility='visible';
	} else if (document.getElementById) { 
		oLayer1 = document.getElementById('content');
		oFooter = document.getElementById('footer');
		h = oLayer1.offsetHeight + 110; 
	    if (h > window.innerHeight - 40) {
		  oFooter.style.top = h + 12;
		} else {
		  oFooter.style.top = window.innerHeight - 40;
		}
		oFooter.style.visibility='visible';
	} else if (document.layers) {
		oLayer1 = document.layers['content'];
		oFooter = document.layers['footer'];
		h = oLayer1.document.height + 110;
		if (h > window.innerHeight - 40) {
		  oFooter.pageY = h + 12;
		} else {
		  oFooter.pageY = window.innerHeight -40;
		}
		oFooter.style.visibility='visible';
	}
	preLoadRolloverImages();
}

function hideFooter() {
	if (document.all) { 
		h = document.all['content'].clientHeight + 110;
		document.all('footer').style.visibility='hidden';
	} else if (document.getElementById) { 
		oLayer1 = document.getElementById('content');
		oFooter = document.getElementById('footer');
		h = oLayer1.offsetHeight + 110; 
		oFooter.style.visibility='hidden';
	} else if (document.layers) {
		oLayer1 = document.layers['content'];
		oFooter = document.layers['footer'];
		h = oLayer1.document.height + 110;
		oFooter.style.visibility='hidden';
	}
}

function preLoadRolloverImages()
{
	MM_preloadImages(
		'assets/images/Header2_r4_c10_over.gif',
		'assets/images/Header2_r2_c10_over.gif'
	);
}

//-->
