
var pLeft,pTop;function centerWindow(myWin) 
{		var screenX;
	var screenY;

	myDoc = myWin.document.body;
	if (sWidth > 800 || sHeight > 600) 
	{
		screenX = (screen.availWidth / 2) - ((myDoc != null && myDoc.clientWidth > 0) ? (myDoc.clientWidth / 2) : 250);
		screenY = (screen.availHeight / 2) - ((myDoc != null && myDoc.clientHeight > 0) ? (myDoc.clientHeight / 2) : 120);
		myWin.window.moveTo(screenX, screenY);
	}
}

function openWin() { _toAuditorium.doSubmit(0,0);}function openWinConf() { _toAuditorium.doSubmit(1,0);}
function openWinReg(sQuery) 
{
	pLeft = (sWidth - aWidth) / 2;
	pTop = (sHeight - aHeight) / 2 - 40;
	if (pTop < 0)
	{
		pTop = 0;
	}
	if (pLeft < 0)
	{
		pLeft = 0;
	}
	
	var aWindow=window.open(baseURL + "lobby/popup-reg.asp?" + "eventid=" + eventid + "&lang=" + lang + "&rndkey=" + rndkey + "&referral=" + referral + "&temp_id=" + audi_temp_id, "thewindow", "width="+aWidth+", height="+aHeight+", top="+pTop+", left="+pLeft+", toolbar=0, location=0, statusbar=0, menubar=0, resizable=0, scrollbars=1");
	if (aWindow)
	{
		aWindow.focus();
	}
}


function downloadCE(i){	var theWidth= 100;	var theHeight = 75
	pLeft = (sWidth - theWidth) / 2;
	pTop = ((sHeight - theHeight) / 2 );
	aTemplatesID=TemplatesID.split("|");
	//var aWindow=window.open(baseURL + "lobby/ce/make_cert.asp?" + "eventid=" + eventid + "&lang=" + lang + "&rndkey=" + rndkey + "&referral=" + referral + "&download=1&userEmail=" + userId,"thewindow","width="+theWidth+",height="+theHeight+",top="+pTop+",left="+pLeft+"");
	var aWindow=window.open(baseURL + "lobby/ce/make_cert.asp?" + "TID=" + aTemplatesID[i] + "&eventid=" + eventid + "&lang=" + lang + "&rndkey=" + rndkey + "&referral=" + referral + "&download=1&userEmail=" + userId,"thewindow","width="+theWidth+",height="+theHeight+",top="+pTop+",left="+pLeft+"");
	if (aWindow)
	{
		aWindow.focus();
	}
}

function downloadVCal(){	var theWidth= 100;	var theHeight = 75
	pLeft = (sWidth - theWidth) / 2;
	pTop = ((sHeight - theHeight) / 2 );

	var aWindow=window.open(baseURL + "lobby/forms/buildVCal.asp?" + "eventid=" + eventid + "&lang=" + lang + "&rndkey=" + rndkey + "&referral=" + referral,"thewindow","width="+theWidth+",height="+theHeight+",top="+pTop+",left="+pLeft+"");
	if (aWindow)
	{
		aWindow.focus();
	}
}

function openSubReg(iSubEventID, sLang) 
{	var sURL;
	pLeft = (sWidth - aWidth) / 2;
	pTop = ((sHeight - aHeight) / 2 ) - 40;
	if (pTop < 0)
	{
		pTop = 0;
	}
	if (pLeft < 0)
	{
		pLeft = 0;
	}
	sURL = baseURL + "lobby/popup-reg.asp?" + "eventid=" + eventid + "&lang=" + sLang + "&rndkey=" + rndkey + "&referral=" + referral;	sURL += "&subeventid=" + iSubEventID + "&slaveregistration=slaveevent&screenW=" + sWidth + "&screenH=" + sHeight;
	var aWindow=window.open( sURL, "thewindow","width="+aWidth+",height="+aHeight+",top="+pTop+",left="+pLeft+",toolbar=0,location=0,statusbar=0,menubar=0,resizable=0, scrollbars=1");
	if (aWindow)
	{
		aWindow.focus();
	}
}

function openSub(iSubEventID, sLang) 
{	var sURL;
	pLeft = (sWidth - aWidth) / 2;
	pTop = ((sHeight - aHeight) / 2 ) - 40;
	if (pTop < 0)
	{
		pTop = 0;
	}
	if (pLeft < 0)
	{
		pLeft = 0;
	}
	sURL = baseURL + "auditorium/index.asp?" + "eventid=" + iSubEventID + "&lang=" + sLang;
	var aWindow=window.open( sURL, "thewindow","width="+aWidth+",height="+aHeight+",top="+pTop+",left="+pLeft+",toolbar=0,location=0,statusbar=0,menubar=0,resizable=0, scrollbars=1");
	if (aWindow)
	{
		aWindow.focus();
	}
}

function openProceed()
{
	pLeft = (sWidth - aWidth) / 2;
	pTop = ((sHeight - aHeight) / 2 ) - 40;
	if (pTop < 0)
	{
		pTop = 0;
	}
	if (pLeft < 0)
	{
		pLeft = 0;
	}
	//document.cookie="screensize="+screensize+"; path=/";

	var aWindow=window.open(baseURL + "lobby/proceed.asp?" + "eventid=" + eventid + "&lang=" + lang + "&rndkey=" + rndkey + "&referral=" + referral, "thewindow", "width="+aWidth+", height="+aHeight+", top="+pTop+", left="+pLeft+", toolbar=0, location=0, statusbar=0, menubar=0, resizable=0, scrollbars=1");
	if (aWindow)
	{
		aWindow.focus();
	}
	
}

function openCop()
{
	aWindow=window.open("http://webcast.streamlogics.com/standard_includes/" + lang + "/copyright.htm","copwindow","width=300,height=450,toolbar=no,menubar=no,status=no,scrollbars=yes,resize=no");
	if (aWindow)
	{
		if (aWindow.opener == null) aWindow.opener = window;
	}
}

function toLobby(){
	document.location.href = baseURL + "lobby/index.asp?" + "eventid=" + eventid + "&lang=" + lang + "&rndkey=" + rndkey + "&referral=" + referral + "&stage=1";
}

function toReg(){	document.location.href = baseURL + "lobby/index.asp?" + "eventid=" + eventid + "&lang=" + lang + "&rndkey=" + rndkey + "&referral=" + referral + "&stage=2";
}
function toProceed(){	document.location.href = baseURL + "lobby/index.asp?" + "eventid=" + eventid + "&lang=" + lang + "&rndkey=" + rndkey + "&referral=" + referral + "&stage=3";
}

