
/*--- WEB VIEW POP ---*/

	//goto using puid (POPUP)
	function _gotopop(puid)
	{
		var myWin = window.open("/members/index.aspx?puid=" + puid, 'myWin', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=650,height=750');
	}

	//goto using url (POPUP)
	function _gotourlpop(url)
	{
		var myWin = window.open(url, 'myWin', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=650,height=750');
	}

	//another goto using url (POPUP) - for help popup links, mainly.
	function _popup(url)
	{
		var myWin = window.open(url, 'myWin', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=650,height=750');
	}

/*--- EMAIL VIEW POP ---*/



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;
	
  }


//returns an element based on name
function FindElement(e)
{
    
    var elm = null;
    for (i = 0; i < document.forms[0].elements.length; i++)
    {      
    if (document.forms[0].elements[i].name.indexOf(e) != -1)
        {            
            elm = document.forms[0].elements[i];
			break;
        }
    }
	return elm;
}



function goRegister(url)
{
	if (url == "") {
		url = "/online-program/sign-up.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;
}