function _gotoprintpopup(id) {
	myWin = window.open("/publicsite/index.aspx?print=true&puid=" + id, 'myWin', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width670,height=750');
}

function _popup(url) {	
	myWin = window.open(url, 'blank', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=670,height=780');
}

/*--- 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');
	}

/*--- 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 = "/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;
}


//listen for input types
function addEvent(elm, evType, fn, useCapture) {
	if(elm.addEventListener) {
	elm.addEventListener(evType, fn, useCapture); return true;
	}
	else if (elm.attachEvent) {
		var r = elm.attachEvent('on' + evType, fn); return r;
	} else {
		elm['on' + evType] = fn;
	}
}

// removes the square border for IE checkboxes, radio and image buttons
function removeCheckBoxBorders() {
	var el = document.getElementsByTagName("input");
	for (i=0;i<el.length;i++) {
		var type = el[i].getAttribute("type");
		if((type=="checkbox")||(type=="radio")||(type=="image")) {
			el[i].style.border = "none";
		}
	}
}
addEvent(window, 'load', removeCheckBoxBorders, false);

//cvv pop up
function popToggle(obj){	

		var myWin = window.open('/' +  obj, 'myWin', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=385,height=455');

}  



function Expand(e) 
{ 
    g = document.getElementById(e);
    if (g.style.display == 'none') 
        g.style.display = 'block'; 
    else 
        g.style.display = 'none';
}