// JavaScript Document

window.onload=function(e) {
	var urlArg = document.location.search.substring(3);
	setDemoRequest(urlArg);
	callFixForIE();
}

var productNames = new Array (
'ATS Enterprise',
'ATS Professional',
'ATS Hourly',
'nowHIRE E-Verify',
'ATS Elite Edition',
'NowHIRE IVR',
'RESUMate Pro',
'RESUMate Lite',
'I-9 Comply',
'Import Express',
'ATS Custom'
);

function setDemoRequest(arg) {
	var elt = document.getElementById('00N50000001Sqxe');

	if(elt)
		elt.value = productNames[arg];
	
	var retElt = document.getElementById("retURL");
	
	if(retElt) {
	   if(3 == arg) retElt.value = "http://www.nowhire.com/Everify_Demo_Thankyou.htm";
	   else if(5 == arg) retElt.value = "http://www.nowhire.com/IVR_Demo_Thankyou.htm";
	   else if(arg >= 6 && arg <= 7) retElt.value = "http://www.nowhire.com/RESUMate_Demo_Thankyou.htm";
	   else if(8 == arg) retElt.value = "http://www.nowhire.com/I9_Demo_Thankyou.htm";
	   else retElt.value = "http://www.nowhire.com/ATS_Demo_Thankyou.htm";
	}
}

function callFixForIE() {
	fls = document.getElementsByTagName("object");
	for (var a = 0; a < fls.length; a++){fls[a].outerHTML = fls[a].outerHTML;}
}
