
/*--- 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=678,height=750');
	}

/*--- EMAIL VIEW POP ---*/

function _popup(url) {
	myWin = window.open(url, 'blank', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=675,height=780');
}

function Expand(e) 
{ 
    g = document.getElementById(e);
    if (g.style.display == 'none') 
        g.style.display = 'block'; 
    else 
        g.style.display = 'none';
}

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;
}





 

function switchID(a,b,c)
{
   //alert(id);
    var off;
    var on;
    off = document.getElementById(a);
    off.style.display = 'none';
    off = document.getElementById(b);
    off.style.display = 'none';
    on= document.getElementById(c);
    on.style.display = 'inline';
}

 

function switchTabImg(img)
{
        if(img == "1")
        {
            document.getElementById("tabHot").setAttribute('src', '/images/publicsite/topnav/2/whatshot-on.gif');
            document.getElementById("tabPlan").setAttribute('src', '/images/publicsite/topnav/2/jilliansplan-off.gif');
        }
        else
        {
            document.getElementById("tabHot").setAttribute('src', '/images/publicsite/topnav/2/whatshot-off.gif');
            document.getElementById("tabPlan").setAttribute('src', '/images/publicsite/topnav/2/jilliansplan-on.gif');
        }
}

function startTimer(i) { 
        //i will turn on or off
        if(i == "on")
            myInterval =  setInterval('flipMUnit()',10000);
        else
            clearInterval(myInterval);
           
}

 

function flipMUnit(showID) 
{
       
        if(document.getElementById('DeniseNews').style.display ==  'inline' )
        {
        document.getElementById('DeniseNews').style.display = 'none';
        document.getElementById('DeniseStore').style.display = 'inline';
        document.getElementById('AboutProgram').style.display = 'none';
        //tabs
        document.getElementById('rotTab1').className = '';
        document.getElementById('rotTab2').className = 'On';
        document.getElementById('rotTab3').className = '';
        }
        else if(document.getElementById('DeniseStore').style.display ==  'inline')
        {
        document.getElementById('DeniseNews').style.display = 'none';
        document.getElementById('DeniseStore').style.display = 'none';
        document.getElementById('AboutProgram').style.display = 'inline';
        //tabs
        document.getElementById('rotTab1').className = '';
        document.getElementById('rotTab2').className = '';
        document.getElementById('rotTab3').className = 'On';
        }
        else if(document.getElementById('AboutProgram').style.display ==  'inline' )
        {
        document.getElementById('DeniseNews').style.display = 'inline';
        document.getElementById('DeniseStore').style.display = 'none';
        document.getElementById('AboutProgram').style.display = 'none';
         //tabs
        document.getElementById('rotTab1').className = 'On';
        document.getElementById('rotTab2').className = '';
        document.getElementById('rotTab3').className = '';
        }

}


function showTab(showID) 
{
       
        if(showID == 'DeniseStore' )
        {
        document.getElementById('DeniseNews').style.display = 'none';
        document.getElementById('DeniseStore').style.display = 'inline';
        document.getElementById('AboutProgram').style.display = 'none';
        //tabs
        document.getElementById('rotTab1').className = '';
        document.getElementById('rotTab2').className = 'On';
        document.getElementById('rotTab3').className = '';
        }
        else if(showID == 'AboutProgram')
        {
        document.getElementById('DeniseNews').style.display = 'none';
        document.getElementById('DeniseStore').style.display = 'none';
        document.getElementById('AboutProgram').style.display = 'inline';
        //tabs
        document.getElementById('rotTab1').className = '';
        document.getElementById('rotTab2').className = '';
        document.getElementById('rotTab3').className = 'On';
        }
        else if(showID == 'DeniseNews')
        {
        document.getElementById('DeniseNews').style.display = 'inline';
        document.getElementById('DeniseStore').style.display = 'none';
        document.getElementById('AboutProgram').style.display = 'none';
         //tabs
        document.getElementById('rotTab1').className = 'On';
        document.getElementById('rotTab2').className = '';
        document.getElementById('rotTab3').className = '';
        }

}

/*Gymticket.com*/
function validateWidget(zipCodeID) {
if (zipCodeID == '')return false;
window.open('http://www.gymticket.com/?c=4777&zip=' + zipCodeID + '&titlecolor=%23000000&darkbgcolor=%23FFFFFF&lightbgcolor=%23E4F1F1&bordercolor=%23CCE5E5&navbgcolor=%23E5EBEB&filter=all','','scrollbars=1,resizable=1,width=725,height=625');
}
