// JavaScript Document
function isNumeric(e)
{
	var key = (window.event) ? e.keyCode: e.which;
	//8 - bckspace
	//13 - enter (for double width chars)
	if ((key < 48 || key > 57) && key!=8 && key!=13 && key!=0)
	{
		return false;
	}
	else
	{
		return true;
	}
}

function getParams()
{
	var idx = document.URL.indexOf('?');
	var params = new Array();
	if (idx != -1)
	{
		var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
		for (var i=0; i<pairs.length; i++) {
			nameVal = pairs[i].split('=');
			params[nameVal[0]] = nameVal[1];
		}
	}
	return params;
}				


function ShowForm(category)
{ 
	var trQuestion4Others = getRef("trQuestion4Others");
	var trQuestion4Yahoo = getRef("trQuestion4Yahoo");

	getSty("trQuestion2").display = "block";
	getSty("trQuestion3").display = "block";
	getSty("trQuestion5").display = "block";
	
	if (category == "Others")
	{
		getSty("trQuestion4Others").display = "block";
		getSty("divQuestion4OtherInformation").display = "block";
		getSty("trQuestion4Yahoo").display = "none";
		getSty("divQuestion4YahooInformation").display = "none";
	}
	else
	{
		getSty("trQuestion4Yahoo").display = "block";
		getSty("divQuestion4YahooInformation").display = "block";
		getSty("trQuestion4Others").display = "none";
		getSty("divQuestion4OtherInformation").display = "none";
	}
}

/* Para pagina de selecao de plano */
function ShowForm(category)
{ 
	if (category == "TerminalOthers")
	{
		getSty("DivTerminal2").display = "block";
		getSty("DivTerminal3").display = "none";
	}
	else
	{
		getSty("DivTerminal3").display = "block";
		getSty("DivTerminal2").display = "none";
	}
}


function set_ifrHeight(ifrID)
{
	//get height of contents page
	var ifr_height = parent.document.getElementById('applyform_table_ifr').contentWindow.document.body.scrollHeight;
	//set height of iframe
	parent.document.getElementById('applyform_table_ifr').height = ifr_height;
	return false;	
}


