// Pop up a new window
function popup(url,width,height,scrollbars) 
{
	var popwidth = width;
	var popheight = height;
	var leftoffset = (screen.width - popwidth - 10)/2;
	var topoffset = (screen.height - popheight - 40)/2;
	window.open(url,'_blank','titlebar=no,resizable=no,scrollbars=' + scrollbars + ',width=' + popwidth + ',height=' + popheight + ',left=' + leftoffset + ',top=' + topoffset);
}

// Show answer on join.aspx page
function showAnswer(id)
{	
  if (id != 'answer1') document.getElementById('answer1').style.display = 'none';
	if (id != 'answer2') document.getElementById('answer2').style.display = 'none';
	if (id != 'answer3') document.getElementById('answer3').style.display = 'none';
	if (id != 'answer4') document.getElementById('answer4').style.display = 'none';
	if (id != 'answer5') document.getElementById('answer5').style.display = 'none';
	var answerStyle= document.getElementById(id).style;
	if (answerStyle.display == 'block') answerStyle.display = 'none';
	else answerStyle.display = 'block';
}


function ShowButtonAsProcessing(btn)
{
	btn.value = "...processing";	
	__doPostBack(btn.name,'');
	btn.disabled = true;
}

function tabIt(from,to)
{
	if (from.getAttribute&&from.value.length==from.getAttribute("maxlength"))
	to.focus()
}



function ShowDistrictOther()
{
	if(document.MainForm.District.selectedIndex == document.MainForm.District.length-1) 
	{
		//alert(document.MainForm.HealthIns.length);
		document.getElementById('District_Other').style.visibility = "visible";
	}
	else
	{
		document.getElementById('District_Other').style.visibility = "hidden";
	}
}

function ShowCountyOther()
{
	if(document.MainForm.County.selectedIndex == document.MainForm.County.length-1) 
	{
		//alert(document.MainForm.HealthIns.length);
		document.getElementById('County_Other').style.visibility = "visible";
	}
	else
	{
		document.getElementById('County_Other').style.visibility = "hidden";
	}
}

function ShowHealth()
{	
	if(document.MainForm.HealthInsurance.selectedIndex == document.MainForm.HealthInsurance.length-1) 
	{
		//alert(document.MainForm.HealthIns.length);
		document.getElementById('HealthInsuranceTable').style.display = "block";
	}
	else
	{
		document.getElementById('HealthInsuranceTable').style.display = "none";
	}
}

function ShowOtherHealth()
{
	if(document.MainForm.HealthInsuranceCo.selectedIndex == document.MainForm.HealthInsuranceCo.length-1) 
	{
		//alert(document.MainForm.HealthIns.length);  HealthInsuranceCo
		document.getElementById('HealthInsuranceOther').style.visibility = "visible";
	}
	else
	{
		document.getElementById('HealthInsuranceOther').style.visibility = "hidden";
	}
}

function ShowPFOther()
{
	if(document.MainForm.PFI.selectedIndex == document.MainForm.PFI.length-1) 
	{
		//alert(document.MainForm.HealthIns.length);
		document.getElementById('PFI_Other').style.visibility = "visible";
	}
	else
	{
		document.getElementById('PFI_Other').style.visibility = "hidden";
	}
}

function ShowReferral_Other()
{	
	if(document.MainForm.Referral_5.checked) 
	{
		//alert(document.MainForm.HealthIns.length);
		document.getElementById('Referral_Other').style.visibility = "visible";
	}
	else
	{
		document.getElementById('Referral_Other').style.visibility = "hidden";
	}
}

function ShowProfessionOther()
{
	if(document.MainForm.Profession.selectedIndex == document.MainForm.Profession.length-1) 
	{
		//alert(document.MainForm.HealthIns.length);
		document.getElementById('Profession_Other').style.visibility = "visible";
	}
	else
	{
		document.getElementById('Profession_Other').style.visibility = "hidden";
	}
}

function ShowSpecialtyOther()
{
	if(document.MainForm.Specialty.selectedIndex == document.MainForm.Specialty.length-1) 
	{
		//alert(document.MainForm.HealthIns.length);
		document.getElementById('Specialty_Other').style.visibility = "visible";
	}
	else
	{
		document.getElementById('Specialty_Other').style.visibility = "hidden";
	}
}

function ShowPracticeTypeOther()
{
	if(document.MainForm.PracticeType.selectedIndex == document.MainForm.PracticeType.length-1) 
	{
		//alert(document.MainForm.HealthIns.length);
		document.getElementById('PracticeType_Other').style.visibility = "visible";
	}
	else
	{
		document.getElementById('PracticeType_Other').style.visibility = "hidden";
	}
}

function ShowCountryOther()
{
	if(document.MainForm.Country.selectedIndex == document.MainForm.Country.length-1) 
	{
		//alert(document.MainForm.HealthIns.length);
		document.getElementById('Country_Other').style.visibility = "visible";
	}
	else
	{
		document.getElementById('Country_Other').style.visibility = "hidden";
	}
}

