function LoadState(statetype,selectedstate)
{

var selectedcountry;
if(statetype == 1)
selectedcountry=document.frmregisterbill.country.value;
if(statetype == 2)
selectedcountry=document.frmregisterbill.scountry.value;
if(statetype == 3)
selectedcountry=document.frmregisterbill.bcountry.value;
if(statetype == 4)
selectedcountry=document.frmregisterbill.dcountry.value;

if(selectedcountry == "")
selectedcountry=4;

if(selectedcountry != 4)
{ 
	if(statetype == 1)
	{
	var showblock=document.getElementById("showstatetext");	
	var notshowblock=document.getElementById("showstatelist");	
	}
	if(statetype == 2)
	{
	var showblock=document.getElementById("showsstatetext");	
	var notshowblock=document.getElementById("showsstatelist");	
	}
	if(statetype == 3)
	{
	var showblock=document.getElementById("showbstatetext");	
	var notshowblock=document.getElementById("showbstatelist");	
	}
	if(statetype == 4)
	{
	var showblock=document.getElementById("showdstatetext");	
	var notshowblock=document.getElementById("showdstatelist");	
	}
	showblock.style.display = "block";
notshowblock.style.display = "none";
return;
}
else
{
	if(statetype == 1)
	{
	var notshowblock=document.getElementById("showstatetext");	
	var showblock=document.getElementById("showstatelist");	
	document.frmregisterbill.state.value="";
	}
	if(statetype == 2)
	{
	var notshowblock=document.getElementById("showsstatetext");	
	var showblock=document.getElementById("showsstatelist");	
	document.frmregisterbill.sstate.value="";
	}
	if(statetype == 3)
	{
	var notshowblock=document.getElementById("showbstatetext");	
	var showblock=document.getElementById("showbstatelist");	
	document.frmregisterbill.bstate.value="";
	}
	if(statetype == 4)
	{
	var notshowblock=document.getElementById("showdstatetext");	
	var showblock=document.getElementById("showdstatelist");	
	document.frmregisterbill.dstate.value="";
	}
	showblock.style.display = "block";
	notshowblock.style.display = "none";
}

country=new Array("4");

state = new Array();

state[0] = "0^1^ALABAMA^1";
state[1] = "0^2^ALASKA^2";
state[2] = "0^3^AMERICAN SAMOA^3";
state[3] = "0^4^ARIZONA^4";
state[4] = "0^5^ARKANSAS^5";
state[5] = "0^6^Armed Forces Africa^60";
state[6] = "0^7^Armed Forces Americas(except Canada)^61";
state[7] = "0^8^Armed Forces Canada^62";
state[8] = "0^9^Armed Forces Europe^63";
state[9] = "0^10^Armed Forces Middle East^64";
state[10] = "0^11^Armed Forces Pacific^65";
state[11] = "0^12^CALIFORNIA^6";
state[12] = "0^13^COLORADO^7";
state[13] = "0^14^CONNECTICUT^8";
state[14] = "0^15^DELAWARE^9";
state[15] = "0^16^DISTRICT OF COLUMBIA^10";
state[16] = "0^17^FEDERATED STATES OF MICRONESIA^11";
state[17] = "0^18^FLORIDA^12";
state[18] = "0^19^GEORGIA^13";
state[19] = "0^20^GUAM^14";
state[20] = "0^21^HAWAIIHI^15";
state[21] = "0^22^IDAHO^16";
state[22] = "0^23^ILLINOIS^17";
state[23] = "0^24^INDIANA^18";
state[24] = "0^25^IOWA^19";
state[25] = "0^26^KANSAS^20";
state[26] = "0^27^KENTUCKY^21";
state[27] = "0^28^LOUISIANA^22";
state[28] = "0^29^MAINE^23";
state[29] = "0^30^MARSHALL ISLANDS^24";
state[30] = "0^31^MARYLAND^25";
state[31] = "0^32^MASSACHUSETTS^26";
state[32] = "0^33^MICHIGAN^27";
state[33] = "0^34^MINNESOTA^28";
state[34] = "0^35^MISSISSIPPI^29";
state[35] = "0^36^MISSOURI^30";
state[36] = "0^37^MONTANA^31";
state[37] = "0^38^NEBRASKA^32";
state[38] = "0^39^NEVADA^33";
state[39] = "0^40^NEW HAMPSHIRE^34";
state[40] = "0^41^NEW JERSEY^35";
state[41] = "0^42^NEW MEXICO^36";
state[42] = "0^43^NEW YORK^37";
state[43] = "0^44^NORTH CAROLINA^38";
state[44] = "0^45^NORTH DAKOTA^39";
state[45] = "0^46^NORTHERN MARIANA ISLANDS^40";
state[46] = "0^47^OHIO^41";
state[47] = "0^48^OKLAHOMA^42";
state[48] = "0^49^OREGON^43";
state[49] = "0^50^PALAU^44";
state[50] = "0^51^PENNSYLVANIA^45";
state[51] = "0^52^PUERTO RICO^46";
state[52] = "0^53^RHODE ISLAND^47";
state[53] = "0^54^SOUTH CAROLINA^48";
state[54] = "0^55^SOUTH DAKOTA^49";
state[55] = "0^56^TENNESSEE^50";
state[56] = "0^57^TEXAS^51";
state[57] = "0^58^UTAH^52";
state[58] = "0^59^VERMONT^53";
state[59] = "0^60^VIRGIN ISLANDS^54";
state[60] = "0^61^VIRGINIA^55";
state[61] = "0^62^WASHINGTON^56";
state[62] = "0^63^WEST VIRGINIA^57";
state[63] = "0^64^WISCONSIN^58";
state[64] = "0^65^WYOMING^59";

var intvalue;
for (var i=0;i<country.length;i++)	
	{
		if(selectedcountry == country[i])
		intvalue=i;
		
	}	

 
for (var i=0;i<state.length;i++)	
	{
		arrtemp=new Array();
		arrtemp=state[i].split("^");		

		if (intvalue == arrtemp[0])	
		{
			
			if(statetype == 1)
			{
			
			document.frmregisterbill.statelist.options.length += 1;	
			
			var k = document.frmregisterbill.statelist.options.length;
			document.frmregisterbill.statelist.options[k-1].value = arrtemp[3];			document.frmregisterbill.statelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.frmregisterbill.statelist.options[k-1].selected=true;
			
			}
			if(statetype == 2)
			{
			document.frmregisterbill.sstatelist.options.length += 1;				
			var k = document.frmregisterbill.sstatelist.options.length;
			
			document.frmregisterbill.sstatelist.options[k-1].value = arrtemp[3];			document.frmregisterbill.sstatelist.options[k-1].text = arrtemp[2];	
			if(selectedstate == arrtemp[3])
			document.frmregisterbill.sstatelist.options[k-1].selected=true;
			}
			if(statetype == 3)
			{
			document.frmregisterbill.bstatelist.options.length += 1;				
			var k = document.frmregisterbill.bstatelist.options.length;
			
			document.frmregisterbill.bstatelist.options[k-1].value = arrtemp[3];			document.frmregisterbill.bstatelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.frmregisterbill.bstatelist.options[k-1].selected=true;
			}
			if(statetype == 4)
			{
			document.frmregisterbill.dstatelist.options.length += 1;				
			var k = document.frmregisterbill.dstatelist.options.length;
			
			document.frmregisterbill.dstatelist.options[k-1].value = arrtemp[3];			document.frmregisterbill.dstatelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.frmregisterbill.dstatelist.options[k-1].selected=true;
			}	
		}
	}
}


function LoadStateS(statetype,selectedstate)
{
var selectedcountry;
if(statetype == 1)
selectedcountry=document.frmregistership.country.value;
if(statetype == 2)
selectedcountry=document.frmregistership.scountry.value;
if(statetype == 3)
selectedcountry=document.frmregistership.bcountry.value;
if(statetype == 4)
selectedcountry=document.frmregistership.dcountry.value;

if(selectedcountry == "")
selectedcountry=4;

if(selectedcountry != 4)
{
	if(statetype == 1)
	{
	var showblock=document.getElementById("showstatetext");	
	var notshowblock=document.getElementById("showstatelist");	
	}
	if(statetype == 2)
	{
	var showblock=document.getElementById("showsstatetext");	
	var notshowblock=document.getElementById("showsstatelist");	
	}
	if(statetype == 3)
	{
	var showblock=document.getElementById("showbstatetext");	
	var notshowblock=document.getElementById("showbstatelist");	
	}
	if(statetype == 4)
	{
	var showblock=document.getElementById("showdstatetext");	
	var notshowblock=document.getElementById("showdstatelist");	
	}
	showblock.style.display = "block";
notshowblock.style.display = "none";
return;
}
else
{
	if(statetype == 1)
	{
	var notshowblock=document.getElementById("showstatetext");	
	var showblock=document.getElementById("showstatelist");	
	document.frmregistership.state.value="";
	}
	if(statetype == 2)
	{
	var notshowblock=document.getElementById("showsstatetext");	
	var showblock=document.getElementById("showsstatelist");	
	document.frmregistership.sstate.value="";
	}
	if(statetype == 3)
	{
	var notshowblock=document.getElementById("showbstatetext");	
	var showblock=document.getElementById("showbstatelist");	
	document.frmregistership.bstate.value="";
	}
	if(statetype == 4)
	{
	var notshowblock=document.getElementById("showdstatetext");	
	var showblock=document.getElementById("showdstatelist");	
	document.frmregistership.dstate.value="";
	}
	showblock.style.display = "block";
	notshowblock.style.display = "none";
}

country=new Array("4");

state = new Array();

state[0] = "0^1^ALABAMA^1";
state[1] = "0^2^ALASKA^2";
state[2] = "0^3^AMERICAN SAMOA^3";
state[3] = "0^4^ARIZONA^4";
state[4] = "0^5^ARKANSAS^5";
state[5] = "0^6^Armed Forces Africa^60";
state[6] = "0^7^Armed Forces Americas(except Canada)^61";
state[7] = "0^8^Armed Forces Canada^62";
state[8] = "0^9^Armed Forces Europe^63";
state[9] = "0^10^Armed Forces Middle East^64";
state[10] = "0^11^Armed Forces Pacific^65";
state[11] = "0^12^CALIFORNIA^6";
state[12] = "0^13^COLORADO^7";
state[13] = "0^14^CONNECTICUT^8";
state[14] = "0^15^DELAWARE^9";
state[15] = "0^16^DISTRICT OF COLUMBIA^10";
state[16] = "0^17^FEDERATED STATES OF MICRONESIA^11";
state[17] = "0^18^FLORIDA^12";
state[18] = "0^19^GEORGIA^13";
state[19] = "0^20^GUAM^14";
state[20] = "0^21^HAWAIIHI^15";
state[21] = "0^22^IDAHO^16";
state[22] = "0^23^ILLINOIS^17";
state[23] = "0^24^INDIANA^18";
state[24] = "0^25^IOWA^19";
state[25] = "0^26^KANSAS^20";
state[26] = "0^27^KENTUCKY^21";
state[27] = "0^28^LOUISIANA^22";
state[28] = "0^29^MAINE^23";
state[29] = "0^30^MARSHALL ISLANDS^24";
state[30] = "0^31^MARYLAND^25";
state[31] = "0^32^MASSACHUSETTS^26";
state[32] = "0^33^MICHIGAN^27";
state[33] = "0^34^MINNESOTA^28";
state[34] = "0^35^MISSISSIPPI^29";
state[35] = "0^36^MISSOURI^30";
state[36] = "0^37^MONTANA^31";
state[37] = "0^38^NEBRASKA^32";
state[38] = "0^39^NEVADA^33";
state[39] = "0^40^NEW HAMPSHIRE^34";
state[40] = "0^41^NEW JERSEY^35";
state[41] = "0^42^NEW MEXICO^36";
state[42] = "0^43^NEW YORK^37";
state[43] = "0^44^NORTH CAROLINA^38";
state[44] = "0^45^NORTH DAKOTA^39";
state[45] = "0^46^NORTHERN MARIANA ISLANDS^40";
state[46] = "0^47^OHIO^41";
state[47] = "0^48^OKLAHOMA^42";
state[48] = "0^49^OREGON^43";
state[49] = "0^50^PALAU^44";
state[50] = "0^51^PENNSYLVANIA^45";
state[51] = "0^52^PUERTO RICO^46";
state[52] = "0^53^RHODE ISLAND^47";
state[53] = "0^54^SOUTH CAROLINA^48";
state[54] = "0^55^SOUTH DAKOTA^49";
state[55] = "0^56^TENNESSEE^50";
state[56] = "0^57^TEXAS^51";
state[57] = "0^58^UTAH^52";
state[58] = "0^59^VERMONT^53";
state[59] = "0^60^VIRGIN ISLANDS^54";
state[60] = "0^61^VIRGINIA^55";
state[61] = "0^62^WASHINGTON^56";
state[62] = "0^63^WEST VIRGINIA^57";
state[63] = "0^64^WISCONSIN^58";
state[64] = "0^65^WYOMING^59";

var intvalue;
for (var i=0;i<country.length;i++)	
	{
		if(selectedcountry == country[i])
		intvalue=i;
		
	}	

 
for (var i=0;i<state.length;i++)	
	{
		arrtemp=new Array();
		arrtemp=state[i].split("^");		

		if (intvalue == arrtemp[0])	
		{
			
			if(statetype == 1)
			{
			
			document.frmregistership.statelist.options.length += 1;	
			
			var k = document.frmregistership.statelist.options.length;
			document.frmregistership.statelist.options[k-1].value = arrtemp[3];			document.frmregistership.statelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.frmregistership.statelist.options[k-1].selected=true;
			
			}
			if(statetype == 2)
			{
			document.frmregistership.sstatelist.options.length += 1;				
			var k = document.frmregistership.sstatelist.options.length;
			
			document.frmregistership.sstatelist.options[k-1].value = arrtemp[3];			document.frmregistership.sstatelist.options[k-1].text = arrtemp[2];	
			if(selectedstate == arrtemp[3])
			document.frmregistership.sstatelist.options[k-1].selected=true;
			}
			if(statetype == 3)
			{
			document.frmregistership.bstatelist.options.length += 1;				
			var k = document.frmregistership.bstatelist.options.length;
			
			document.frmregistership.bstatelist.options[k-1].value = arrtemp[3];			document.frmregistership.bstatelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.frmregistership.bstatelist.options[k-1].selected=true;
			}
			if(statetype == 4)
			{
			document.frmregistership.dstatelist.options.length += 1;				
			var k = document.frmregistership.dstatelist.options.length;
			
			document.frmregistership.dstatelist.options[k-1].value = arrtemp[3];			document.frmregistership.dstatelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.frmregistership.dstatelist.options[k-1].selected=true;
			}	
		}
	}
}

function LoadStatebilledit(statetype,selectedstate)
{

var selectedcountry;
if(statetype == 1)
selectedcountry=document.frmbilledit.country.value;
if(statetype == 2)
selectedcountry=document.frmbilledit.scountry.value;
if(statetype == 3)
selectedcountry=document.frmbilledit.bcountry.value;
if(statetype == 4)
selectedcountry=document.frmbilledit.dcountry.value;

if(selectedcountry == "")
selectedcountry=4;

if(selectedcountry != 4)
{
	if(statetype == 1)
	{
	var showblock=document.getElementById("showstatetext");	
	var notshowblock=document.getElementById("showstatelist");	
	}
	if(statetype == 2)
	{
	var showblock=document.getElementById("showsstatetext");	
	var notshowblock=document.getElementById("showsstatelist");	
	}
	if(statetype == 3)
	{
	var showblock=document.getElementById("showbstatetext");	
	var notshowblock=document.getElementById("showbstatelist");	
	}
	if(statetype == 4)
	{
	var showblock=document.getElementById("showdstatetext");	
	var notshowblock=document.getElementById("showdstatelist");	
	}
	showblock.style.display = "block";
notshowblock.style.display = "none";
return;
}
else
{
	if(statetype == 1)
	{
	var notshowblock=document.getElementById("showstatetext");	
	var showblock=document.getElementById("showstatelist");	
	document.frmbilledit.state.value="";
	}
	if(statetype == 2)
	{
	var notshowblock=document.getElementById("showsstatetext");	
	var showblock=document.getElementById("showsstatelist");	
	document.frmbilledit.sstate.value="";
	}
	if(statetype == 3)
	{
	var notshowblock=document.getElementById("showbstatetext");	
	var showblock=document.getElementById("showbstatelist");	
	document.frmbilledit.bstate.value="";
	}
	if(statetype == 4)
	{
	var notshowblock=document.getElementById("showdstatetext");	
	var showblock=document.getElementById("showdstatelist");	
	document.frmbilledit.dstate.value="";
	}
	showblock.style.display = "block";
	notshowblock.style.display = "none";
}

country=new Array("4");

state = new Array();

state[0] = "0^1^ALABAMA^1";
state[1] = "0^2^ALASKA^2";
state[2] = "0^3^AMERICAN SAMOA^3";
state[3] = "0^4^ARIZONA^4";
state[4] = "0^5^ARKANSAS^5";
state[5] = "0^6^Armed Forces Africa^60";
state[6] = "0^7^Armed Forces Americas(except Canada)^61";
state[7] = "0^8^Armed Forces Canada^62";
state[8] = "0^9^Armed Forces Europe^63";
state[9] = "0^10^Armed Forces Middle East^64";
state[10] = "0^11^Armed Forces Pacific^65";
state[11] = "0^12^CALIFORNIA^6";
state[12] = "0^13^COLORADO^7";
state[13] = "0^14^CONNECTICUT^8";
state[14] = "0^15^DELAWARE^9";
state[15] = "0^16^DISTRICT OF COLUMBIA^10";
state[16] = "0^17^FEDERATED STATES OF MICRONESIA^11";
state[17] = "0^18^FLORIDA^12";
state[18] = "0^19^GEORGIA^13";
state[19] = "0^20^GUAM^14";
state[20] = "0^21^HAWAIIHI^15";
state[21] = "0^22^IDAHO^16";
state[22] = "0^23^ILLINOIS^17";
state[23] = "0^24^INDIANA^18";
state[24] = "0^25^IOWA^19";
state[25] = "0^26^KANSAS^20";
state[26] = "0^27^KENTUCKY^21";
state[27] = "0^28^LOUISIANA^22";
state[28] = "0^29^MAINE^23";
state[29] = "0^30^MARSHALL ISLANDS^24";
state[30] = "0^31^MARYLAND^25";
state[31] = "0^32^MASSACHUSETTS^26";
state[32] = "0^33^MICHIGAN^27";
state[33] = "0^34^MINNESOTA^28";
state[34] = "0^35^MISSISSIPPI^29";
state[35] = "0^36^MISSOURI^30";
state[36] = "0^37^MONTANA^31";
state[37] = "0^38^NEBRASKA^32";
state[38] = "0^39^NEVADA^33";
state[39] = "0^40^NEW HAMPSHIRE^34";
state[40] = "0^41^NEW JERSEY^35";
state[41] = "0^42^NEW MEXICO^36";
state[42] = "0^43^NEW YORK^37";
state[43] = "0^44^NORTH CAROLINA^38";
state[44] = "0^45^NORTH DAKOTA^39";
state[45] = "0^46^NORTHERN MARIANA ISLANDS^40";
state[46] = "0^47^OHIO^41";
state[47] = "0^48^OKLAHOMA^42";
state[48] = "0^49^OREGON^43";
state[49] = "0^50^PALAU^44";
state[50] = "0^51^PENNSYLVANIA^45";
state[51] = "0^52^PUERTO RICO^46";
state[52] = "0^53^RHODE ISLAND^47";
state[53] = "0^54^SOUTH CAROLINA^48";
state[54] = "0^55^SOUTH DAKOTA^49";
state[55] = "0^56^TENNESSEE^50";
state[56] = "0^57^TEXAS^51";
state[57] = "0^58^UTAH^52";
state[58] = "0^59^VERMONT^53";
state[59] = "0^60^VIRGIN ISLANDS^54";
state[60] = "0^61^VIRGINIA^55";
state[61] = "0^62^WASHINGTON^56";
state[62] = "0^63^WEST VIRGINIA^57";
state[63] = "0^64^WISCONSIN^58";
state[64] = "0^65^WYOMING^59";

var intvalue;
for (var i=0;i<country.length;i++)	
	{
		if(selectedcountry == country[i])
		intvalue=i;
		
	}	

 var statemera;
for (var i=0;i<state.length;i++)	
	{
		arrtemp=new Array();
		arrtemp=state[i].split("^");		

		if (intvalue == arrtemp[0])	
		{
			
			if(statetype == 1)
			{
			
			document.frmbilledit.statelist.options.length += 1;	
			
			var k = document.frmbilledit.statelist.options.length;
			document.frmbilledit.statelist.options[k-1].value = arrtemp[3];			
			document.frmbilledit.statelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[2]){ 
			document.frmbilledit.statelist.options[k-1].selected=true;
			}
			
			}
			if(statetype == 2)
			{
			document.frmbilledit.sstatelist.options.length += 1;				
			var k = document.frmbilledit.sstatelist.options.length;
			
			document.frmbilledit.sstatelist.options[k-1].value = arrtemp[3];			
			document.frmbilledit.sstatelist.options[k-1].text = arrtemp[2];	
			if(selectedstate == arrtemp[3])
			document.frmbilledit.sstatelist.options[k-1].selected=true;
			}
			if(statetype == 3)
			{
			document.frmbilledit.bstatelist.options.length += 1;				
			var k = document.frmbilledit.bstatelist.options.length;
			
			document.frmbilledit.bstatelist.options[k-1].value = arrtemp[3];			
			document.frmbilledit.bstatelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.frmbilledit.bstatelist.options[k-1].selected=true;
			}
			if(statetype == 4)
			{
			document.frmbilledit.dstatelist.options.length += 1;				
			var k = document.frmbilledit.dstatelist.options.length;
			
			document.frmbilledit.dstatelist.options[k-1].value = arrtemp[3];			
			document.frmbilledit.dstatelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.frmbilledit.dstatelist.options[k-1].selected=true;
			}	
		}
//		alert(statemera);
	}

}

function LoadStateShip(statetype,selectedstate)
{

var selectedcountry;
if(statetype == 1)
selectedcountry=document.frmshipedit.country.value;
if(statetype == 2)
selectedcountry=document.frmshipedit.scountry.value;
if(statetype == 3)
selectedcountry=document.frmshipedit.bcountry.value;
if(statetype == 4)
selectedcountry=document.frmshipedit.dcountry.value;

if(selectedcountry == "")
selectedcountry=4;

if(selectedcountry != 4)
{
	if(statetype == 1)
	{
	var showblock=document.getElementById("showstatetext");	
	var notshowblock=document.getElementById("showstatelist");	
	}
	if(statetype == 2)
	{
	var showblock=document.getElementById("showsstatetext");	
	var notshowblock=document.getElementById("showsstatelist");	
	}
	if(statetype == 3)
	{
	var showblock=document.getElementById("showbstatetext");	
	var notshowblock=document.getElementById("showbstatelist");	
	}
	if(statetype == 4)
	{
	var showblock=document.getElementById("showdstatetext");	
	var notshowblock=document.getElementById("showdstatelist");	
	}
	showblock.style.display = "block";
notshowblock.style.display = "none";
return;
}
else
{
	if(statetype == 1)
	{
	var notshowblock=document.getElementById("showstatetext");	
	var showblock=document.getElementById("showstatelist");	
	document.frmshipedit.state.value="";
	}
	if(statetype == 2)
	{
	var notshowblock=document.getElementById("showsstatetext");	
	var showblock=document.getElementById("showsstatelist");	
	document.frmshipedit.sstate.value="";
	}
	if(statetype == 3)
	{
	var notshowblock=document.getElementById("showbstatetext");	
	var showblock=document.getElementById("showbstatelist");	
	document.frmshipedit.bstate.value="";
	}
	if(statetype == 4)
	{
	var notshowblock=document.getElementById("showdstatetext");	
	var showblock=document.getElementById("showdstatelist");	
	document.frmshipedit.dstate.value="";
	}
	showblock.style.display = "block";
	notshowblock.style.display = "none";
}

country=new Array("4");

state = new Array();

state[0] = "0^1^ALABAMA^1";
state[1] = "0^2^ALASKA^2";
state[2] = "0^3^AMERICAN SAMOA^3";
state[3] = "0^4^ARIZONA^4";
state[4] = "0^5^ARKANSAS^5";
state[5] = "0^6^Armed Forces Africa^60";
state[6] = "0^7^Armed Forces Americas(except Canada)^61";
state[7] = "0^8^Armed Forces Canada^62";
state[8] = "0^9^Armed Forces Europe^63";
state[9] = "0^10^Armed Forces Middle East^64";
state[10] = "0^11^Armed Forces Pacific^65";
state[11] = "0^12^CALIFORNIA^6";
state[12] = "0^13^COLORADO^7";
state[13] = "0^14^CONNECTICUT^8";
state[14] = "0^15^DELAWARE^9";
state[15] = "0^16^DISTRICT OF COLUMBIA^10";
state[16] = "0^17^FEDERATED STATES OF MICRONESIA^11";
state[17] = "0^18^FLORIDA^12";
state[18] = "0^19^GEORGIA^13";
state[19] = "0^20^GUAM^14";
state[20] = "0^21^HAWAIIHI^15";
state[21] = "0^22^IDAHO^16";
state[22] = "0^23^ILLINOIS^17";
state[23] = "0^24^INDIANA^18";
state[24] = "0^25^IOWA^19";
state[25] = "0^26^KANSAS^20";
state[26] = "0^27^KENTUCKY^21";
state[27] = "0^28^LOUISIANA^22";
state[28] = "0^29^MAINE^23";
state[29] = "0^30^MARSHALL ISLANDS^24";
state[30] = "0^31^MARYLAND^25";
state[31] = "0^32^MASSACHUSETTS^26";
state[32] = "0^33^MICHIGAN^27";
state[33] = "0^34^MINNESOTA^28";
state[34] = "0^35^MISSISSIPPI^29";
state[35] = "0^36^MISSOURI^30";
state[36] = "0^37^MONTANA^31";
state[37] = "0^38^NEBRASKA^32";
state[38] = "0^39^NEVADA^33";
state[39] = "0^40^NEW HAMPSHIRE^34";
state[40] = "0^41^NEW JERSEY^35";
state[41] = "0^42^NEW MEXICO^36";
state[42] = "0^43^NEW YORK^37";
state[43] = "0^44^NORTH CAROLINA^38";
state[44] = "0^45^NORTH DAKOTA^39";
state[45] = "0^46^NORTHERN MARIANA ISLANDS^40";
state[46] = "0^47^OHIO^41";
state[47] = "0^48^OKLAHOMA^42";
state[48] = "0^49^OREGON^43";
state[49] = "0^50^PALAU^44";
state[50] = "0^51^PENNSYLVANIA^45";
state[51] = "0^52^PUERTO RICO^46";
state[52] = "0^53^RHODE ISLAND^47";
state[53] = "0^54^SOUTH CAROLINA^48";
state[54] = "0^55^SOUTH DAKOTA^49";
state[55] = "0^56^TENNESSEE^50";
state[56] = "0^57^TEXAS^51";
state[57] = "0^58^UTAH^52";
state[58] = "0^59^VERMONT^53";
state[59] = "0^60^VIRGIN ISLANDS^54";
state[60] = "0^61^VIRGINIA^55";
state[61] = "0^62^WASHINGTON^56";
state[62] = "0^63^WEST VIRGINIA^57";
state[63] = "0^64^WISCONSIN^58";
state[64] = "0^65^WYOMING^59";

var intvalue;
for (var i=0;i<country.length;i++)	
	{
		if(selectedcountry == country[i])
		intvalue=i;
		
	}	

 var statemera;
for (var i=0;i<state.length;i++)	
	{
		arrtemp=new Array();
		arrtemp=state[i].split("^");		

		if (intvalue == arrtemp[0])	
		{
			
			if(statetype == 1)
			{
			
			document.frmshipedit.statelist.options.length += 1;	
			
			var k = document.frmshipedit.statelist.options.length;
			document.frmshipedit.statelist.options[k-1].value = arrtemp[3];			
			document.frmshipedit.statelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[2]){ 
			document.frmshipedit.statelist.options[k-1].selected=true;
			}
			
			}
			if(statetype == 2)
			{
			document.frmshipedit.sstatelist.options.length += 1;				
			var k = document.frmshipedit.sstatelist.options.length;
			
			document.frmshipedit.sstatelist.options[k-1].value = arrtemp[3];			
			document.frmshipedit.sstatelist.options[k-1].text = arrtemp[2];	
			if(selectedstate == arrtemp[3])
			document.frmshipedit.sstatelist.options[k-1].selected=true;
			}
			if(statetype == 3)
			{
			document.frmshipedit.bstatelist.options.length += 1;				
			var k = document.frmshipedit.bstatelist.options.length;
			
			document.frmshipedit.bstatelist.options[k-1].value = arrtemp[3];			
			document.frmshipedit.bstatelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.frmshipedit.bstatelist.options[k-1].selected=true;
			}
			if(statetype == 4)
			{
			document.frmshipedit.dstatelist.options.length += 1;				
			var k = document.frmshipedit.dstatelist.options.length;
			
			document.frmshipedit.dstatelist.options[k-1].value = arrtemp[3];			
			document.frmshipedit.dstatelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.frmshipedit.dstatelist.options[k-1].selected=true;
			}	
		}
//		alert(statemera);
	}

}

function LoadStatePersonalEdit(statetype,selectedstate)
{
var selectedcountry;
if(statetype == 1)
selectedcountry=document.frmpersonaledit.country.value;
if(statetype == 2)
selectedcountry=document.frmpersonaledit.scountry.value;
if(statetype == 3)
selectedcountry=document.frmpersonaledit.bcountry.value;
if(statetype == 4)
selectedcountry=document.frmpersonaledit.dcountry.value;

if(selectedcountry == "")
selectedcountry=4;

if(selectedcountry != 4)
{
	if(statetype == 1)
	{
	var showblock=document.getElementById("showstatetext");	
	var notshowblock=document.getElementById("showstatelist");	
	}
	if(statetype == 2)
	{
	var showblock=document.getElementById("showsstatetext");	
	var notshowblock=document.getElementById("showsstatelist");	
	}
	if(statetype == 3)
	{
	var showblock=document.getElementById("showbstatetext");	
	var notshowblock=document.getElementById("showbstatelist");	
	}
	if(statetype == 4)
	{
	var showblock=document.getElementById("showdstatetext");	
	var notshowblock=document.getElementById("showdstatelist");	
	}
	showblock.style.display = "block";
notshowblock.style.display = "none";
return;
}
else
{
	if(statetype == 1)
	{
	var notshowblock=document.getElementById("showstatetext");	
	var showblock=document.getElementById("showstatelist");	
	document.frmpersonaledit.state.value="";
	}
	if(statetype == 2)
	{
	var notshowblock=document.getElementById("showsstatetext");	
	var showblock=document.getElementById("showsstatelist");	
	document.frmpersonaledit.sstate.value="";
	}
	if(statetype == 3)
	{
	var notshowblock=document.getElementById("showbstatetext");	
	var showblock=document.getElementById("showbstatelist");	
	document.frmpersonaledit.bstate.value="";
	}
	if(statetype == 4)
	{
	var notshowblock=document.getElementById("showdstatetext");	
	var showblock=document.getElementById("showdstatelist");	
	document.frmpersonaledit.dstate.value="";
	}
	showblock.style.display = "block";
	notshowblock.style.display = "none";
}

country=new Array("4");

state = new Array();

state[0] = "0^1^ALABAMA^1";
state[1] = "0^2^ALASKA^2";
state[2] = "0^3^AMERICAN SAMOA^3";
state[3] = "0^4^ARIZONA^4";
state[4] = "0^5^ARKANSAS^5";
state[5] = "0^6^Armed Forces Africa^60";
state[6] = "0^7^Armed Forces Americas(except Canada)^61";
state[7] = "0^8^Armed Forces Canada^62";
state[8] = "0^9^Armed Forces Europe^63";
state[9] = "0^10^Armed Forces Middle East^64";
state[10] = "0^11^Armed Forces Pacific^65";
state[11] = "0^12^CALIFORNIA^6";
state[12] = "0^13^COLORADO^7";
state[13] = "0^14^CONNECTICUT^8";
state[14] = "0^15^DELAWARE^9";
state[15] = "0^16^DISTRICT OF COLUMBIA^10";
state[16] = "0^17^FEDERATED STATES OF MICRONESIA^11";
state[17] = "0^18^FLORIDA^12";
state[18] = "0^19^GEORGIA^13";
state[19] = "0^20^GUAM^14";
state[20] = "0^21^HAWAIIHI^15";
state[21] = "0^22^IDAHO^16";
state[22] = "0^23^ILLINOIS^17";
state[23] = "0^24^INDIANA^18";
state[24] = "0^25^IOWA^19";
state[25] = "0^26^KANSAS^20";
state[26] = "0^27^KENTUCKY^21";
state[27] = "0^28^LOUISIANA^22";
state[28] = "0^29^MAINE^23";
state[29] = "0^30^MARSHALL ISLANDS^24";
state[30] = "0^31^MARYLAND^25";
state[31] = "0^32^MASSACHUSETTS^26";
state[32] = "0^33^MICHIGAN^27";
state[33] = "0^34^MINNESOTA^28";
state[34] = "0^35^MISSISSIPPI^29";
state[35] = "0^36^MISSOURI^30";
state[36] = "0^37^MONTANA^31";
state[37] = "0^38^NEBRASKA^32";
state[38] = "0^39^NEVADA^33";
state[39] = "0^40^NEW HAMPSHIRE^34";
state[40] = "0^41^NEW JERSEY^35";
state[41] = "0^42^NEW MEXICO^36";
state[42] = "0^43^NEW YORK^37";
state[43] = "0^44^NORTH CAROLINA^38";
state[44] = "0^45^NORTH DAKOTA^39";
state[45] = "0^46^NORTHERN MARIANA ISLANDS^40";
state[46] = "0^47^OHIO^41";
state[47] = "0^48^OKLAHOMA^42";
state[48] = "0^49^OREGON^43";
state[49] = "0^50^PALAU^44";
state[50] = "0^51^PENNSYLVANIA^45";
state[51] = "0^52^PUERTO RICO^46";
state[52] = "0^53^RHODE ISLAND^47";
state[53] = "0^54^SOUTH CAROLINA^48";
state[54] = "0^55^SOUTH DAKOTA^49";
state[55] = "0^56^TENNESSEE^50";
state[56] = "0^57^TEXAS^51";
state[57] = "0^58^UTAH^52";
state[58] = "0^59^VERMONT^53";
state[59] = "0^60^VIRGIN ISLANDS^54";
state[60] = "0^61^VIRGINIA^55";
state[61] = "0^62^WASHINGTON^56";
state[62] = "0^63^WEST VIRGINIA^57";
state[63] = "0^64^WISCONSIN^58";
state[64] = "0^65^WYOMING^59";

var intvalue;
for (var i=0;i<country.length;i++)	
	{
		if(selectedcountry == country[i])
		intvalue=i;
		
	}	

 
for (var i=0;i<state.length;i++)	
	{
		arrtemp=new Array();
		arrtemp=state[i].split("^");		

		if (intvalue == arrtemp[0])	
		{
			
			if(statetype == 1)
			{
			
			document.frmpersonaledit.statelist.options.length += 1;	
			
			var k = document.frmpersonaledit.statelist.options.length;
			document.frmpersonaledit.statelist.options[k-1].value = arrtemp[3];			
			document.frmpersonaledit.statelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.frmpersonaledit.statelist.options[k-1].selected=true;
			
			}
			if(statetype == 2)
			{
			document.frmpersonaledit.sstatelist.options.length += 1;				
			var k = document.frmpersonaledit.sstatelist.options.length;
			
			document.frmpersonaledit.sstatelist.options[k-1].value = arrtemp[3];			
			document.frmpersonaledit.sstatelist.options[k-1].text = arrtemp[2];	
			if(selectedstate == arrtemp[3])
			document.frmpersonaledit.sstatelist.options[k-1].selected=true;
			}
			if(statetype == 3)
			{
			document.frmpersonaledit.bstatelist.options.length += 1;				
			var k = document.frmpersonaledit.bstatelist.options.length;
			
			document.frmpersonaledit.bstatelist.options[k-1].value = arrtemp[3];			
			document.frmpersonaledit.bstatelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.frmpersonaledit.bstatelist.options[k-1].selected=true;
			}
			if(statetype == 4)
			{
			document.frmpersonaledit.dstatelist.options.length += 1;				
			var k = document.frmpersonaledit.dstatelist.options.length;
			
			document.frmpersonaledit.dstatelist.options[k-1].value = arrtemp[3];			
			document.frmpersonaledit.dstatelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.frmpersonaledit.dstatelist.options[k-1].selected=true;
			}	
		}
	}
}


function LoadStateAdmin(statetype,selectedstate)
{
var selectedcountry;
if(statetype == 1)
selectedcountry=document.manform.mancountry.value;

if(selectedcountry == "")
selectedcountry=4;

if(selectedcountry != 4)
{
	if(statetype == 1)
	{
	var showblock=document.getElementById("showstatetext");	
	var notshowblock=document.getElementById("showstatelist");	
	}
	showblock.style.display = "block";
notshowblock.style.display = "none";
return;
}
else
{
	if(statetype == 1)
	{
	var notshowblock=document.getElementById("showstatetext");	
	var showblock=document.getElementById("showstatelist");	
	document.manform.state.value="";
	}
	showblock.style.display = "block";
	notshowblock.style.display = "none";
}

country=new Array("4");

state = new Array();

state[0] = "0^1^ALABAMA^1";
state[1] = "0^2^ALASKA^2";
state[2] = "0^3^AMERICAN SAMOA^3";
state[3] = "0^4^ARIZONA^4";
state[4] = "0^5^ARKANSAS^5";
state[5] = "0^6^Armed Forces Africa^60";
state[6] = "0^7^Armed Forces Americas(except Canada)^61";
state[7] = "0^8^Armed Forces Canada^62";
state[8] = "0^9^Armed Forces Europe^63";
state[9] = "0^10^Armed Forces Middle East^64";
state[10] = "0^11^Armed Forces Pacific^65";
state[11] = "0^12^CALIFORNIA^6";
state[12] = "0^13^COLORADO^7";
state[13] = "0^14^CONNECTICUT^8";
state[14] = "0^15^DELAWARE^9";
state[15] = "0^16^DISTRICT OF COLUMBIA^10";
state[16] = "0^17^FEDERATED STATES OF MICRONESIA^11";
state[17] = "0^18^FLORIDA^12";
state[18] = "0^19^GEORGIA^13";
state[19] = "0^20^GUAM^14";
state[20] = "0^21^HAWAIIHI^15";
state[21] = "0^22^IDAHO^16";
state[22] = "0^23^ILLINOIS^17";
state[23] = "0^24^INDIANA^18";
state[24] = "0^25^IOWA^19";
state[25] = "0^26^KANSAS^20";
state[26] = "0^27^KENTUCKY^21";
state[27] = "0^28^LOUISIANA^22";
state[28] = "0^29^MAINE^23";
state[29] = "0^30^MARSHALL ISLANDS^24";
state[30] = "0^31^MARYLAND^25";
state[31] = "0^32^MASSACHUSETTS^26";
state[32] = "0^33^MICHIGAN^27";
state[33] = "0^34^MINNESOTA^28";
state[34] = "0^35^MISSISSIPPI^29";
state[35] = "0^36^MISSOURI^30";
state[36] = "0^37^MONTANA^31";
state[37] = "0^38^NEBRASKA^32";
state[38] = "0^39^NEVADA^33";
state[39] = "0^40^NEW HAMPSHIRE^34";
state[40] = "0^41^NEW JERSEY^35";
state[41] = "0^42^NEW MEXICO^36";
state[42] = "0^43^NEW YORK^37";
state[43] = "0^44^NORTH CAROLINA^38";
state[44] = "0^45^NORTH DAKOTA^39";
state[45] = "0^46^NORTHERN MARIANA ISLANDS^40";
state[46] = "0^47^OHIO^41";
state[47] = "0^48^OKLAHOMA^42";
state[48] = "0^49^OREGON^43";
state[49] = "0^50^PALAU^44";
state[50] = "0^51^PENNSYLVANIA^45";
state[51] = "0^52^PUERTO RICO^46";
state[52] = "0^53^RHODE ISLAND^47";
state[53] = "0^54^SOUTH CAROLINA^48";
state[54] = "0^55^SOUTH DAKOTA^49";
state[55] = "0^56^TENNESSEE^50";
state[56] = "0^57^TEXAS^51";
state[57] = "0^58^UTAH^52";
state[58] = "0^59^VERMONT^53";
state[59] = "0^60^VIRGIN ISLANDS^54";
state[60] = "0^61^VIRGINIA^55";
state[61] = "0^62^WASHINGTON^56";
state[62] = "0^63^WEST VIRGINIA^57";
state[63] = "0^64^WISCONSIN^58";
state[64] = "0^65^WYOMING^59";

var intvalue;
for (var i=0;i<country.length;i++)	
	{
		if(selectedcountry == country[i])
		intvalue=i;
		
	}	

 
for (var i=0;i<state.length;i++)	
	{
		arrtemp=new Array();
		arrtemp=state[i].split("^");		

		if (intvalue == arrtemp[0])	
		{
			
			if(statetype == 1)
			{
			
			document.manform.statelist.options.length += 1;	
			
			var k = document.manform.statelist.options.length;
			document.manform.statelist.options[k-1].value = arrtemp[3];			document.manform.statelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.manform.statelist.options[k-1].selected=true;
			
			}
		}
	}
}

//LoadStateOrderUI starts
function LoadStateOrderUI(statetype,selectedstate)
{

var selectedcountry;
if(statetype == 1)
selectedcountry=document.product_OrderUI.country.value;
if(statetype == 2)
selectedcountry=document.product_OrderUI.scountry.value;
if(statetype == 3)
selectedcountry=document.product_OrderUI.bcountry.value;
if(statetype == 4)
selectedcountry=document.product_OrderUI.dcountry.value;

if(selectedcountry == "")
selectedcountry=4;

if(selectedcountry != 4)
{
	if(statetype == 1)
	{
	var showblock=document.getElementById("showstatetext");	
	var notshowblock=document.getElementById("showstatelist");	
	}
	if(statetype == 2)
	{
	var showblock=document.getElementById("showsstatetext");	
	var notshowblock=document.getElementById("showsstatelist");	
	}
	if(statetype == 3)
	{
	var showblock=document.getElementById("showbstatetext");	
	var notshowblock=document.getElementById("showbstatelist");	
	}
	if(statetype == 4)
	{
	var showblock=document.getElementById("showdstatetext");	
	var notshowblock=document.getElementById("showdstatelist");	
	}
	showblock.style.display = "block";
notshowblock.style.display = "none";
return;
}
else
{
	if(statetype == 1)
	{
	var notshowblock=document.getElementById("showstatetext");	
	var showblock=document.getElementById("showstatelist");	
	document.product_OrderUI.state.value="";
	}
	if(statetype == 2)
	{
	var notshowblock=document.getElementById("showsstatetext");	
	var showblock=document.getElementById("showsstatelist");	
	document.product_OrderUI.sstate.value="";
	}
	if(statetype == 3)
	{
	var notshowblock=document.getElementById("showbstatetext");	
	var showblock=document.getElementById("showbstatelist");	
	document.product_OrderUI.bstate.value="";
	}
	if(statetype == 4)
	{
	var notshowblock=document.getElementById("showdstatetext");	
	var showblock=document.getElementById("showdstatelist");	
	document.product_OrderUI.dstate.value="";
	}
	showblock.style.display = "block";
	notshowblock.style.display = "none";
}

country=new Array("4");

state = new Array();

state[0] = "0^1^ALABAMA^1";
state[1] = "0^2^ALASKA^2";
state[2] = "0^3^AMERICAN SAMOA^3";
state[3] = "0^4^ARIZONA^4";
state[4] = "0^5^ARKANSAS^5";
state[5] = "0^6^Armed Forces Africa^60";
state[6] = "0^7^Armed Forces Americas(except Canada)^61";
state[7] = "0^8^Armed Forces Canada^62";
state[8] = "0^9^Armed Forces Europe^63";
state[9] = "0^10^Armed Forces Middle East^64";
state[10] = "0^11^Armed Forces Pacific^65";
state[11] = "0^12^CALIFORNIA^6";
state[12] = "0^13^COLORADO^7";
state[13] = "0^14^CONNECTICUT^8";
state[14] = "0^15^DELAWARE^9";
state[15] = "0^16^DISTRICT OF COLUMBIA^10";
state[16] = "0^17^FEDERATED STATES OF MICRONESIA^11";
state[17] = "0^18^FLORIDA^12";
state[18] = "0^19^GEORGIA^13";
state[19] = "0^20^GUAM^14";
state[20] = "0^21^HAWAIIHI^15";
state[21] = "0^22^IDAHO^16";
state[22] = "0^23^ILLINOIS^17";
state[23] = "0^24^INDIANA^18";
state[24] = "0^25^IOWA^19";
state[25] = "0^26^KANSAS^20";
state[26] = "0^27^KENTUCKY^21";
state[27] = "0^28^LOUISIANA^22";
state[28] = "0^29^MAINE^23";
state[29] = "0^30^MARSHALL ISLANDS^24";
state[30] = "0^31^MARYLAND^25";
state[31] = "0^32^MASSACHUSETTS^26";
state[32] = "0^33^MICHIGAN^27";
state[33] = "0^34^MINNESOTA^28";
state[34] = "0^35^MISSISSIPPI^29";
state[35] = "0^36^MISSOURI^30";
state[36] = "0^37^MONTANA^31";
state[37] = "0^38^NEBRASKA^32";
state[38] = "0^39^NEVADA^33";
state[39] = "0^40^NEW HAMPSHIRE^34";
state[40] = "0^41^NEW JERSEY^35";
state[41] = "0^42^NEW MEXICO^36";
state[42] = "0^43^NEW YORK^37";
state[43] = "0^44^NORTH CAROLINA^38";
state[44] = "0^45^NORTH DAKOTA^39";
state[45] = "0^46^NORTHERN MARIANA ISLANDS^40";
state[46] = "0^47^OHIO^41";
state[47] = "0^48^OKLAHOMA^42";
state[48] = "0^49^OREGON^43";
state[49] = "0^50^PALAU^44";
state[50] = "0^51^PENNSYLVANIA^45";
state[51] = "0^52^PUERTO RICO^46";
state[52] = "0^53^RHODE ISLAND^47";
state[53] = "0^54^SOUTH CAROLINA^48";
state[54] = "0^55^SOUTH DAKOTA^49";
state[55] = "0^56^TENNESSEE^50";
state[56] = "0^57^TEXAS^51";
state[57] = "0^58^UTAH^52";
state[58] = "0^59^VERMONT^53";
state[59] = "0^60^VIRGIN ISLANDS^54";
state[60] = "0^61^VIRGINIA^55";
state[61] = "0^62^WASHINGTON^56";
state[62] = "0^63^WEST VIRGINIA^57";
state[63] = "0^64^WISCONSIN^58";
state[64] = "0^65^WYOMING^59";

var intvalue;
for (var i=0;i<country.length;i++)	
	{
		if(selectedcountry == country[i])
		intvalue=i;
		
	}	

 var statemera;
for (var i=0;i<state.length;i++)	
	{
		arrtemp=new Array();
		arrtemp=state[i].split("^");		

		if (intvalue == arrtemp[0])	
		{
			
			if(statetype == 1)
			{
			
			document.product_OrderUI.statelist.options.length += 1;	
			
			var k = document.product_OrderUI.statelist.options.length;
			document.product_OrderUI.statelist.options[k-1].value = arrtemp[3];			
			document.product_OrderUI.statelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[2]){ 
			document.product_OrderUI.statelist.options[k-1].selected=true;
			}
			
			}
			if(statetype == 2)
			{
			document.product_OrderUI.sstatelist.options.length += 1;				
			var k = document.product_OrderUI.sstatelist.options.length;
			
			document.product_OrderUI.sstatelist.options[k-1].value = arrtemp[3];			
			document.product_OrderUI.sstatelist.options[k-1].text = arrtemp[2];	
			if(selectedstate == arrtemp[3])
			document.product_OrderUI.sstatelist.options[k-1].selected=true;
			}
			if(statetype == 3)
			{
			document.product_OrderUI.bstatelist.options.length += 1;				
			var k = document.product_OrderUI.bstatelist.options.length;
			
			document.product_OrderUI.bstatelist.options[k-1].value = arrtemp[3];			
			document.product_OrderUI.bstatelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.product_OrderUI.bstatelist.options[k-1].selected=true;
			}
			if(statetype == 4)
			{
			document.product_OrderUI.dstatelist.options.length += 1;				
			var k = document.product_OrderUI.dstatelist.options.length;
			
			document.product_OrderUI.dstatelist.options[k-1].value = arrtemp[3];			
			document.product_OrderUI.dstatelist.options[k-1].text = arrtemp[2];
			if(selectedstate == arrtemp[3])
			document.product_OrderUI.dstatelist.options[k-1].selected=true;
			}	
		}
//		alert(statemera);
	}

}


//LoadStateOrderUIShip starts
function LoadStateOrderUIShip(statetype,selectedstate)
{
var selectedcountry;
if(statetype == 1)
selectedcountry=document.product_OrderUI.scountry.value;
if(statetype == 2)
selectedcountry=document.product_OrderUI.scountry.value;
if(statetype == 3)
selectedcountry=document.product_OrderUI.bcountry.value;
if(statetype == 4)
selectedcountry=document.product_OrderUI.dcountry.value;

if(selectedcountry == "")
selectedcountry=4;

if(selectedcountry != 4)
{
	if(statetype == 1)
	{
	var showblock=document.getElementById("sshowstatetext");	
	var notshowblock=document.getElementById("sshowstatelist");	
	}
	if(statetype == 2)
	{
	var showblock=document.getElementById("showsstatetext");	
	var notshowblock=document.getElementById("showsstatelist");	
	}
	if(statetype == 3)
	{
	var showblock=document.getElementById("showbstatetext");	
	var notshowblock=document.getElementById("showbstatelist");	
	}
	if(statetype == 4)
	{
	var showblock=document.getElementById("showdstatetext");	
	var notshowblock=document.getElementById("showdstatelist");	
	}
	showblock.style.display = "block";
notshowblock.style.display = "none";
return;
}
else
{
	if(statetype == 1)
	{
	var notshowblock=document.getElementById("sshowstatetext");	
	var showblock=document.getElementById("sshowstatelist");	
	document.product_OrderUI.sstate.value="";
	}
	if(statetype == 2)
	{
	var notshowblock=document.getElementById("showsstatetext");	
	var showblock=document.getElementById("showsstatelist");	
	document.product_OrderUI.sstate.value="";
	}
	if(statetype == 3)
	{
	var notshowblock=document.getElementById("showbstatetext");	
	var showblock=document.getElementById("showbstatelist");	
	document.product_OrderUI.bstate.value="";
	}
	if(statetype == 4)
	{
	var notshowblock=document.getElementById("showdstatetext");	
	var showblock=document.getElementById("showdstatelist");	
	document.product_OrderUI.dstate.value="";
	}
	showblock.style.display = "block";
	notshowblock.style.display = "none";
}

country=new Array("4");

state = new Array();

state[0] = "0^1^ALABAMA^1";
state[1] = "0^2^ALASKA^2";
state[2] = "0^3^AMERICAN SAMOA^3";
state[3] = "0^4^ARIZONA^4";
state[4] = "0^5^ARKANSAS^5";
state[5] = "0^6^Armed Forces Africa^60";
state[6] = "0^7^Armed Forces Americas(except Canada)^61";
state[7] = "0^8^Armed Forces Canada^62";
state[8] = "0^9^Armed Forces Europe^63";
state[9] = "0^10^Armed Forces Middle East^64";
state[10] = "0^11^Armed Forces Pacific^65";
state[11] = "0^12^CALIFORNIA^6";
state[12] = "0^13^COLORADO^7";
state[13] = "0^14^CONNECTICUT^8";
state[14] = "0^15^DELAWARE^9";
state[15] = "0^16^DISTRICT OF COLUMBIA^10";
state[16] = "0^17^FEDERATED STATES OF MICRONESIA^11";
state[17] = "0^18^FLORIDA^12";
state[18] = "0^19^GEORGIA^13";
state[19] = "0^20^GUAM^14";
state[20] = "0^21^HAWAIIHI^15";
state[21] = "0^22^IDAHO^16";
state[22] = "0^23^ILLINOIS^17";
state[23] = "0^24^INDIANA^18";
state[24] = "0^25^IOWA^19";
state[25] = "0^26^KANSAS^20";
state[26] = "0^27^KENTUCKY^21";
state[27] = "0^28^LOUISIANA^22";
state[28] = "0^29^MAINE^23";
state[29] = "0^30^MARSHALL ISLANDS^24";
state[30] = "0^31^MARYLAND^25";
state[31] = "0^32^MASSACHUSETTS^26";
state[32] = "0^33^MICHIGAN^27";
state[33] = "0^34^MINNESOTA^28";
state[34] = "0^35^MISSISSIPPI^29";
state[35] = "0^36^MISSOURI^30";
state[36] = "0^37^MONTANA^31";
state[37] = "0^38^NEBRASKA^32";
state[38] = "0^39^NEVADA^33";
state[39] = "0^40^NEW HAMPSHIRE^34";
state[40] = "0^41^NEW JERSEY^35";
state[41] = "0^42^NEW MEXICO^36";
state[42] = "0^43^NEW YORK^37";
state[43] = "0^44^NORTH CAROLINA^38";
state[44] = "0^45^NORTH DAKOTA^39";
state[45] = "0^46^NORTHERN MARIANA ISLANDS^40";
state[46] = "0^47^OHIO^41";
state[47] = "0^48^OKLAHOMA^42";
state[48] = "0^49^OREGON^43";
state[49] = "0^50^PALAU^44";
state[50] = "0^51^PENNSYLVANIA^45";
state[51] = "0^52^PUERTO RICO^46";
state[52] = "0^53^RHODE ISLAND^47";
state[53] = "0^54^SOUTH CAROLINA^48";
state[54] = "0^55^SOUTH DAKOTA^49";
state[55] = "0^56^TENNESSEE^50";
state[56] = "0^57^TEXAS^51";
state[57] = "0^58^UTAH^52";
state[58] = "0^59^VERMONT^53";
state[59] = "0^60^VIRGIN ISLANDS^54";
state[60] = "0^61^VIRGINIA^55";
state[61] = "0^62^WASHINGTON^56";
state[62] = "0^63^WEST VIRGINIA^57";
state[63] = "0^64^WISCONSIN^58";
state[64] = "0^65^WYOMING^59";

var intvalue;
for (var i=0;i<country.length;i++)	
	{
		if(selectedcountry == country[i])
		intvalue=i;
	}	

var statemera;
for (var i=0;i<state.length;i++)	
	{
		arrtemp=new Array();
		arrtemp=state[i].split("^");		

		if (intvalue == arrtemp[0])	
		{
			
			if(statetype == 1)
			{
				document.product_OrderUI.sstatelist.options.length += 1;	
				
				var k = document.product_OrderUI.sstatelist.options.length;
				document.product_OrderUI.sstatelist.options[k-1].value = arrtemp[3];			
				document.product_OrderUI.sstatelist.options[k-1].text = arrtemp[2];
				if(selectedstate == arrtemp[2])
				{ 
				document.product_OrderUI.sstatelist.options[k-1].selected=true;
				}
			}
		
		if(statetype == 2)
		{
		document.product_OrderUI.sstatelist.options.length += 1;				
		var k = document.product_OrderUI.sstatelist.options.length;
		
		document.product_OrderUI.sstatelist.options[k-1].value = arrtemp[3];			
		document.product_OrderUI.sstatelist.options[k-1].text = arrtemp[2];	
		if(selectedstate == arrtemp[3])
		document.product_OrderUI.sstatelist.options[k-1].selected=true;
		}
		if(statetype == 3)
		{
		document.product_OrderUI.bstatelist.options.length += 1;				
		var k = document.product_OrderUI.bstatelist.options.length;
		
		document.product_OrderUI.bstatelist.options[k-1].value = arrtemp[3];			
		document.product_OrderUI.bstatelist.options[k-1].text = arrtemp[2];
		if(selectedstate == arrtemp[3])
		document.product_OrderUI.bstatelist.options[k-1].selected=true;
		}
		if(statetype == 4)
		{
		document.product_OrderUI.dstatelist.options.length += 1;				
		var k = document.product_OrderUI.dstatelist.options.length;
		
		document.product_OrderUI.dstatelist.options[k-1].value = arrtemp[3];			
		document.product_OrderUI.dstatelist.options[k-1].text = arrtemp[2];
		if(selectedstate == arrtemp[3])
		document.product_OrderUI.dstatelist.options[k-1].selected=true;
		}	
	}//if ends
  }//for ends
}//function ends

