function pop500(params) {
	if (typeof(params) == "undefined")
		params = 'rt500';
	params = '?signup_cust=' + params;
	var popURL = "/signup_account.php" + params;
	pop(popURL);
}

function popGAD(params,gad) {
	if (typeof(params) == "undefined")
		params = 'rt500';
	params = '?signup_cust=' + params + '&gad=' + gad;
	var popURL = "/signup_account.php" + params;
	pop(popURL);
}

function write500(params) {
        if (typeof(params) == "undefined")
                params = 'rt500';
        params = '?signup_cust=' + params; 
        var popURL = "/signup_account.php" + params;
        write(popURL);
}

function popReferral(params) {
	params = '?sf_id=' + params;
	var popURL = "/preview/index.php" + params;
	//var popURL = "/signup_referral.php" + params;
	popNormal(popURL);
}

function popDemo(params) {
	if (typeof(params) == "undefined")
		params = '0';
	params = '?meeting=' + params;
	var popURL = "/signup_demo.php"+params;
	pop(popURL);
}

function popTraining(params) {
	if (typeof(params) == "undefined")
		params = '0';
	params = '?meeting=' + params;
	var popURL = "/signup_training.php"+params;
	pop(popURL);
}

function popOutlookScheduler(url) {
  var agent = navigator.userAgent.toLowerCase();
  var isIE = ((agent.indexOf("msie") != -1));
	if(isIE) {
		window.open(url,"_pop","height=300,width=400,scrollbars=yes,resize=yes,resizable=yes,toolbar=no,status=no,titlebar=no,left=300,top=300");
	}
	else {
		window.open(url,"_pop","height=200,width=400,scrollbars=yes,resize=yes,resizable=yes,toolbar=no,status=no,titlebar=no,screenX=300,screenY=300");
	}
}

function popRequestHelp() {
	var popURL = "/help_request.php";
	pop(popURL);
}

function popRequestEvent() {
	var popURL = "/event_request.php";
	pop(popURL);
}

function pop(url) {
	window.open(url,"_pop","height=400,width=400,top=0,scrollbars=yes,resize=yes,resizable=yes,toolbar=no,status=no,titlebar=no");
}

function popMkto(url) {
	window.open(url,"_pop","height=600,width=460,top=0,scrollbars=yes,resize=yes,resizable=yes,toolbar=no,status=no,titlebar=no");
}

function popSized(url,x,y){
	var params = "height=" + y + ",width=" + x + ",top=0,scrollbars=yes,resize=yes,resizable=yes,toolbar=no,status=no,titlebar=no";
	window.open(url,"_pop",params);
}

function popSS(url) {
        window.open(url,"_pop","height=620,width=840,top=0,scrollbars=yes,resize=yes,resizable=yes,toolbar=no,status=no,titlebar=no");
}

function popNormal(url) {
        window.open(url,"_pop","height=620,width=840,top=0,scrollbars=yes,resize=yes,resizable=yes,menubar=yes,toolbar=yes,status=yes,titlebar=yes");
}

function write(url) {
	var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
		try {
 			 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}
	@end @*/

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}

if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}

	var element = document.getElementById("popform");
	element.innerHTML = '';
	xmlhttp.open("GET", url);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			element.innerHTML = xmlhttp.responseText;
			element.style.display = "block";
			document.getElementById("screen").style.display = "block";
		}
	}
	xmlhttp.send(null);
}

function tutorial(xml) {
	var tutorial = window.open("/tutorials/tutorial.php?xml="+xml,"_tutorial","directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no");
	tutorial.moveTo(0,0);
	if (screen.width <= 1024 && screen.height <= 768) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = 1024;
		h = 768;
	}
	tutorial.resizeTo(w,h);

}

function popTestPartWindow()

{

  //here we get location from address bar and split it out then use only first

  //array created to get hostname to use and pass into url.  I did it this way

  //because I was having trouble getting subString to work correctly.

  var urlHostname = window.location.toString();

  var hostnameValue=urlHostname.split("=");

  var popURL="https://core.readytalk.com/interface/participantTest.jsp?host=readytalk";

        var xWidth=screen.availWidth;

        var yHeight=screen.availHeight;

        getWindow=window.open(popURL,"test","height=400,width=650,screenX=" + (xWidth/4) + ",screenY=" + (yHeight/4) + ",top=" + (xWidth/4) + ",left=" + (yHeight/4)+ "");

}



function popTestChairWindow()

{

  //here we get location from address bar and split it out then use only first

  //array created to get hostname to use and pass into url.  I did it this way

  //because I was having trouble getting subString to work correctly.

  var urlHostname = window.location.toString();

  var hostnameValue=urlHostname.split("=");

  var popURL="https://core.readytalk.com/interface/chairpersonTest.jsp?host=readytalk";

        var xWidth=screen.availWidth;

        var yHeight=screen.availHeight;

        getWindow=window.open(popURL,"test","height=450,width=650,screenX=" + (xWidth/4) + ",screenY=" + (yHeight/4) + ",top=" + (xWidth/4) + ",left=" + (yHeight/4)+ "");

}
