/* function big() makes layers long */
function big(lyr) {

document.all[lyr].style.height='46px'; }

/* small() makes selected layer shorter (height property)*/

function small(lyr) {

document.all[lyr].style.height='10px';

}

/* start() makes all layers short to start with (height property)*/
 
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function CheckEmail(txtField)
{	
	var test1='@';
	var test2='.';
	check=0
	var varStr = txtField.value;
	varLen = varStr.length;
	flag=0;
	flag1=0;
	flag2=1;
	if(flag2 == 1)
	{
		for(i=0;i<varLen;i++)
		{
			if( test1 == varStr.charAt(i))  
			{
				if(varStr.length==1)
				{
					check=1
				}
				flag=1;		
			}
			if(test2 == varStr.charAt(i))
			{
				if(varStr.charAt(i-1)==test2)
				{
					check=1
				}					
				flag1=1;
			}
			if(i==(varLen-1))
			{	
				if( ((flag==0) & (flag1==0)) | ((flag==1) & (flag1==0)) | ((flag==0) & (flag1==1)) | (check==1))
				{
					return false;
					break;
				}
				else
				{
					return true;
				}
			}
		}
	}		
}
function IsEmpty(obj)
 {
	var s = new String(obj);
	var blnEmpty = true;
	var strSpace = " ";
	var i,j;
	if(s.length!=0)
	{	
		for(i=0;i<s.length;i++)
		{	
			if(s.charAt(i)!= strSpace)
			{	
				blnEmpty = false;
			}
		}
	}			
	return(blnEmpty);		
}
function CheckInvalidChars(strpString)
{
	chr1='"';
	chr2="'";
	badChars=chr1 + chr2;
	for(j=0;j<strpString.length;j++)
	{
		if(badChars.indexOf(strpString.charAt(j),0) != -1)
		{
			return false;
		}
	}
	return true;
}
function checkall()
{

if(!document.frm1.Q0[0].checked && !document.frm1.Q0[1].checked)
  {
	alert("Please check Question No.1");

	return false;
  }
else if(!document.frm1.Q1[0].checked && !document.frm1.Q1[1].checked)
  {
	alert("Please check Question No.2");

	return false;
  }
else if(!document.frm1.Q2[0].checked && !document.frm1.Q2[1].checked)
  {
	alert("Please check Question No.3")

	return false
  }
else if(!document.frm1.Q3[0].checked && !document.frm1.Q3[1].checked)
  {
	alert("Please check Question No.4")

	return false
  }
else if(!document.frm1.Q4[0].checked && !document.frm1.Q4[1].checked)
  {
	alert("Please check Question No.5")

	return false
  }
else if(!document.frm1.Q5[0].checked && !document.frm1.Q5[1].checked)
  {
	alert("Please check Question No.6")
	return false
  }
else if(!document.frm1.Q6[0].checked && !document.frm1.Q6[1].checked)
  {
	alert("Please check Question No.7")

	return false
  }
 
  if(IsEmpty(document.frm1.firstName.value))
	{
		alert('Please enter First Name');
		document.frm1.firstName.focus();
		return false;
	}
	if(CheckInvalidChars(document.frm1.firstName.value)==false)
	{
		window.alert('Please enter only characters in First Name');
		document.frm1.firstName.focus();
		return false;
	}
  if(IsEmpty(document.frm1.Last_Name.value))
	{
		alert('Please enter Last Name');
		document.frm1.Last_Name.focus();
		return false;
	}
	if(CheckInvalidChars(document.frm1.Last_Name.value)==false)
	{
		window.alert('Please enter only characters in Last Name');
		document.frm1.Last_Name.focus();
		return false;
	}
	if(IsEmpty(document.frm1.Country.value))
	{
		alert('Please select a country');
		document.frm1.Country.focus();
		return false;
	}
	if(IsEmpty(document.frm1.State_Prov.value))
	{
		alert('Please select a State or Prov');
		document.frm1.State_Prov.focus();
		return false;
	}
	if(IsEmpty(document.frm1.txtsCity.value))
	{
		alert('Please enter City');
		document.frm1.txtsCity.focus();
		return false;
	}
	if(CheckInvalidChars(document.frm1.txtsCity.value)==false)
	{
		window.alert('Please enter only characters in City');
		document.frm1.txtsCity.focus();
		return false;
	}	
   if(IsEmpty(document.frm1.txtsAddress.value))
	{
		alert('Please enter Address');
		document.frm1.txtsAddress.focus();
		return false;
	}
	if(CheckInvalidChars(document.frm1.txtsAddress.value)==false)
	{
		window.alert('Please enter only characters in Address');
		document.frm1.txtsAddress.focus();
		return false;
	}
	if(IsEmpty(document.frm1.txtsZipCode.value))
	{
		alert('Please enter Zip Code');
		document.frm1.txtsZipCode.focus();
		return false;
	}
	if(CheckInvalidChars(document.frm1.txtsZipCode.value)==false)
	{
		window.alert('Please enter only characters in Zip Code');
		document.frm1.txtsZipCode.focus();
		return false;
	}
	if(IsEmpty(document.frm1.txtsPhone.value))
	{
		alert('Please enter Phone');
		document.frm1.txtsPhone.focus();
		return false;
	}
	if(CheckInvalidChars(document.frm1.txtsPhone.value)==false)
	{
		window.alert('Please enter only characters in Phone');
		document.frm1.txtsPhone.focus();
		return false;
	}
	if(IsEmpty(document.frm1.email.value))
	{
		alert('Please enter EMail');
		document.frm1.email.focus();
		return false;
	}
	if(CheckInvalidChars(document.frm1.email.value)==false)
	{
		window.alert('Please enter only characters in EMail');
		document.frm1.email.focus();
		return false;
	}
	if(CheckEmail(document.frm1.email)==false)
	{
		window.alert('Please enter Valid EMail');
		document.frm1.email.focus();
		return false;
	}
 return true
 
 
}

function ClearOptions(OptionList)
{
	for (x=OptionList.length; x>=0; x--)
	OptionList[x] = null;
}
function AddToOptionList(OptionList, OptionValue, OptionText)
{
OptionList[OptionList.length] = new Option(OptionText, OptionValue);
}
function changeState_Prov() 
{	
	var i,j
	var country = document.frm1.Country;
	var state = document.frm1.State_Prov;
	ClearOptions(state);
	if(country[country.selectedIndex].value == "") 
	{
		AddToOptionList(state, "", "Select a State or Prov");
	}
	else if(country[country.selectedIndex].value == "USA") 
	{
		AddToOptionList(state, "", "Select a State or Prov");
		AddToOptionList(state,"AL","Alabama");
		AddToOptionList(state,"AK","Alaska");
		AddToOptionList(state,"AZ","Arizona");
		AddToOptionList(state,"AR","Arkansas");
		AddToOptionList(state,"CA","California");
		AddToOptionList(state,"CO","Colorado");
		AddToOptionList(state,"CT","Connecticut");
		AddToOptionList(state,"DC","DC");
		AddToOptionList(state,"DE","Delaware");
		AddToOptionList(state,"FL","Florida");
		AddToOptionList(state,"GA","Georgia");
		AddToOptionList(state,"GU","Guam");
		AddToOptionList(state,"HA","Hawaii");
		AddToOptionList(state,"ID","Idaho");
		AddToOptionList(state,"IL","Illinois");
		AddToOptionList(state,"IN","Indiana");
		AddToOptionList(state,"IA","Iowa");
		AddToOptionList(state,"KS","Kansas");
		AddToOptionList(state,"KY","Kentucky");
		AddToOptionList(state,"LA","Louisiana");
		AddToOptionList(state,"ME","Maine");
		AddToOptionList(state,"MD","Maryland");
		AddToOptionList(state,"MA","Massachusetts");
		AddToOptionList(state,"MI","Michigan");
		AddToOptionList(state,"MN","Minnesota");
		AddToOptionList(state,"MS","Mississippi");
		AddToOptionList(state,"MO","Missouri");
		AddToOptionList(state,"MT","Montana");
		AddToOptionList(state,"NE","Nebraska");
		AddToOptionList(state,"NV","Nevada");
		AddToOptionList(state,"NH","NewHampshire");
		AddToOptionList(state,"NJ","NewJersey");
		AddToOptionList(state,"NM","NewMexico");
		AddToOptionList(state,"NY","NewYork");
		AddToOptionList(state,"NC","NorthCarolina");
		AddToOptionList(state,"ND","NorthDakota");
		AddToOptionList(state,"OH","Ohio");
		AddToOptionList(state,"OK","Oklahoma");
		AddToOptionList(state,"OR","Oregon");
		AddToOptionList(state,"PA","Pennsylvania");
		AddToOptionList(state,"RI","RhodeIsland");
		AddToOptionList(state,"SC","SouthCarolina");
		AddToOptionList(state,"SD","SouthDakota");
		AddToOptionList(state,"TN","Tennessee");
		AddToOptionList(state,"TX","Texas");
		AddToOptionList(state,"UT","Utah");
		AddToOptionList(state,"VT","Vermont");
		AddToOptionList(state,"VA","Virginia");
		AddToOptionList(state,"WA","Washington");
		AddToOptionList(state,"WV","WestVirginia");
		AddToOptionList(state,"WI","Wisconsin");
		AddToOptionList(state,"WY","Wyoming");
	}
	else if(country[country.selectedIndex].value == "Canada") 
	{
		AddToOptionList(state, "", "Select a State or Prov");
		AddToOptionList(state,"AB","Alberta");
		AddToOptionList(state,"BC","British Columbia");
		AddToOptionList(state,"MB","Manitoba");
		AddToOptionList(state,"NB","New Brunswick");
		AddToOptionList(state,"NL","Newfoundland");
		AddToOptionList(state,"NT","Northwest Territories");
		AddToOptionList(state,"NS","Nova Scotia");
		AddToOptionList(state,"NV","Nunavut");
		AddToOptionList(state,"ON","Ontario");
		AddToOptionList(state,"PE","Prince Edward Islands");
		AddToOptionList(state,"QC","Quebec");
		AddToOptionList(state,"SK","Saskatchewan");
		AddToOptionList(state,"YK","Yukon");
	}
	else if(country[country.selectedIndex].value == "Australia") 
	{
AddToOptionList(state, "", "Select a State or Prov");
AddToOptionList(state, "ACT","Australian Capital Territory");
AddToOptionList(state, "NSW","New South Wales");
AddToOptionList(state, "NT","Northern Territory");
AddToOptionList(state, "QLD","Queensland");
AddToOptionList(state, "SA","South Australia");
AddToOptionList(state, "TAS","Tasmania");
AddToOptionList(state, "VIC","Victoria");
AddToOptionList(state, "WA","Western Australia");
	}
}