var eventwindow = "";

function launchPresenterWindow(server, applicationwebpath,BID,SID,IID,VID,screenname,email,AID,OID,End_Link,width,height) {
	eventwindow = window.open("http://"+server+"/" + applicationwebpath + "/presenter/frameset.cfm?Support=0&BID=" + BID + "&J=1&SID=" + SID + "&IID=" + IID + "&VID=" + VID + "&name=" + screenname + "&email=" + email + "&AID=" + AID + "&OID=" + OID + "&EndLink=" + End_Link, "console", "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=" + width + "&height=" + height);
   if (eventwindow != null)
   	eventwindow.focus();
}

function launchParticipantWindow(server, applicationwebpath,Media_type,BID,SID,IID,VID,firstname,lastname,email,width,height, polling) {
	eventwindow = window.open("http://" + server + "/" + applicationwebpath + "/public/frameset.cfm?Media_type=" + Media_type + "	&BID=" + BID + "&SID=" + SID + "&IID=" + IID + "&VID=" + VID + "&firstname=" + firstname + "&lastname=" + lastname + "&email=" + email + "&polling="+polling, "console", "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=" + width + ",height=" + height);
   if (eventwindow != null)
   	eventwindow.focus();
}

function checkJava(document)
{
	   var versionFlag = false;

		try
		{

			if(window.navigator.javaEnabled())
			{
				var strVendor = new String(document.ClientApplet.getVendor());
				var strVersion = new String(document.ClientApplet.getVersion());

				arrVersion = new Array();
				arrVersion = strVersion.split('.');

				majorVersion = arrVersion[0]+"."+arrVersion[1];

				
				if (parseFloat(majorVersion) < 1.5)
				{
					versionFlag = false;
				}
				else
				{
					versionFlag = true;
				}
			}
			else
			{
				versionFlag = false;
			}
			
				
		}
		catch (e)
		{	
			versionFlag = false;
		}
		

		if (versionFlag == false)
		{
			location.href='/VCallCommon/html/javamsg.html';
		}
	}
   

	function getParameters() {
		document.parameters.screenheight.value = screen.height;
		document.parameters.screenwidth.value = screen.width;
		document.parameters.OS.value = navigator.platform;
		document.parameters.browser.value = navigator.appVersion;
		document.parameters.java.value = navigator.javaEnabled();
		checkJava();
		}


	function checkEmailAddress(field) {
		var goodEmail = field.value.match(/\b(^(\S+@).+((\.aero)|(\.biz)|(\.com)|(\.coop)|(\.edu)|(\.gov)|(\.info)|(\.int)|(\.mil)|(\.museum)|(\.name)|(\.net)|(\.org)|(\.pro)|(\.us)|(\..{2,2}))$)\b/gi);
		if (goodEmail){
  		 good = true
		} else {
   			alert('Please enter a valid e-mail address.')
   			field.focus()
   			good = false
   		}


	}

   function LogoutCallback(result)
   {

   }


   function SendLogout (VID, IID)
   {
      WILink.VCall.VCallWebServices.VCallScriptServices.Logout (VID, IID, IID, LogoutCallback);
   }


