

function assigntoBottomEmailValue(emailValue, e) {
	txtEmailToAssign = FindElement(e);
	txtEmailToAssign.value = emailValue;
}

function assigntoTopEmailValue(emailValue, e) {
	var elm = null;
	for (i = 0; i < document.forms[0].elements.length; i++) {
		if (document.forms[0].elements[i].name.indexOf(e) != -1) {
			if(document.forms[0].elements[i].name.indexOf('funneltop1') == -1) {
			elm = document.forms[0].elements[i];
			break;
			}
		}
	}
	elm.value = emailValue;
  }

function goRegister(url) {
	if (url == "") {
		url = "/publicsite/funnel/register.aspx";
	}
	
	widthofwin = window.screen.width;
	heightofwin = window.screen.height;

	if (widthofwin > 800) {
		widthofwingo = 900
		heightofwingo = 850
	}
	if (widthofwin < 800) {
		widthofwingo = 630
		heightofwingo = 450
	}

    try {
		// If the opener of this page was a popunder, close the popunder
		if(self.opener.winID == "popunder") {
			self.opener.window.close();
		}

		if(self.opener.closed==false) {
			self.opener.doPopUnder = false;
			self.opener.location.href = url;
			window.close();
		}
		else	{
			var win3 = window.open(url,'signupwin','toolbar=1,location=1,scrollbars=1,directories=1,status=1,menubar=1,resizable=1,width='+widthofwingo+',height='+heightofwingo);
		}
	}
	catch(e) {
		var win3 = window.open(url,'signupwin','toolbar=1,location=1,scrollbars=1,directories=1,status=1,menubar=1,resizable=1,width='+widthofwingo+',height='+heightofwingo);
	}
	finally {
		self.close();
	}
}

function checkClose() {
	setTimeout("checkClose_Part2()",100);
}

function checkClose_Part2() {
	try {
		if(window.opener.winID == "main" || window.opener.name == "main") self.close();
	}
	catch(e){}
}

function noPop() {
	doPopUnder = false;
}
