function popup(filename, width, height)
{
	window.open(filename,"PopUpPage","toolbar=no,height="+height+",width="+width+",screenX=1,screenY=1,resizable,scrollbars");
}

function popupscroll(filename, width, height)
{
    window.open(filename,"PopUpPage","toolbar=no,height="+height+",width="+width+",screenX=1,screenY=1,resizable,scrollbars");
}

var isIE = document.all ? true : false;
var isDOM = document.getElementById ? true : false;
var isNS4 = document.layers ? true : false;

function checkOption(cardChosenText, form)
{
	if( cardChosenText == "Switch" || cardChosenText == "Solo" )
	{
		if (isDOM)
		{
			document.getElementById('switch_solo_issueno').style.display = 'inline';
		}
		else if (isIE)
		{
			eval("document.switch_solo_issueno.style.visibility='visible';");
		}
		else if(isNS4)
		{
			eval("document.layers['switch_solo_issueno'].visibility='show';");
		}
	}
	else
	{

		if (isDOM)
		{
			document.getElementById('switch_solo_issueno').style.display = 'none';
		}
		else if (isIE)
		{
			eval("document.switch_solo_issueno.style.visibility='hidden';");
		}
		else if(isNS4)
		{
			eval("document.layers['switch_solo_issueno'].visibility='hide';");
		}
	}
}

function changeCountry() {
    document.regSignupform.chcountry.value="true";
    document.regSignupform.submit();
}

function choosePricingSelection( id )
{
	document.regSignupform.pricingselectionid.value=id;
}

function getPricingSelection(buttons)
{
    if(buttons.type=="hidden")
    {
        return buttons.value;
    }
    for (var i = 0; i < buttons.length; i++)
    {
        if (buttons[i].checked)
            return buttons[i].value;
    }
}

function handlePricingSelection()
{
    var ps = getPricingSelection(document.regSignupform.pricingselectionid);
    if (ps == "PS-REG-PSI-99CENTS-1MO" || ps.substr(0,10) == "PS-SUB-PSI")
    {
        document.getElementById("freetrialtext").style.visibility = "hidden";
    }
    else
    {
        document.getElementById("freetrialtext").style.visibility = "visible";
    }
}

function setupPage()
{
	daForm = document.regSignupform;
	ccTypeSelect = daForm.ccType;
	checkOption(ccTypeSelect.options[ccTypeSelect.selectedIndex].text, daForm);
	handlePricingSelection();
}
