function $(id){return document.getElementById(id);}
function myfun1()
{
	if($("categoriesContent").style.display=="none")
	{
		$("categoriesContent").style.display=""
		$("categoriesHeading").innerHTML="-Shop by Category";
	}
	else
	{
		$("categoriesContent").style.display="none"
		$("categoriesHeading").innerHTML="+Shop by Category";
	}
}
function myfun2()
{
	if($("genreContent").style.display=="none")
	{
		$("genreContent").style.display=""
		$("genreHeading").innerHTML="-Shop by Genre";
	}
	else
	{
		$("genreContent").style.display="none"
		$("genreHeading").innerHTML="+Shop by Genre";
	}
}

var sina={$:function(objName){if(document.getElementById){return eval('document.getElementById("'+objName+'")')}else{return eval('document.all.'+objName)}},isIE:navigator.appVersion.indexOf("MSIE")!=-1?true:false,addEvent:function(l,i,I){if(l.attachEvent){l.attachEvent("on"+i,I)}else{l.addEventListener(i,I,false)}},delEvent:function(l,i,I){if(l.detachEvent){l.detachEvent("on"+i,I)}else{l.removeEventListener(i,I,false)}},readCookie:function(O){var o="",l=O+"=";if(document.cookie.length>0){var i=document.cookie.indexOf(l);if(i!=-1){i+=l.length;var I=document.cookie.indexOf(";",i);if(I==-1)I=document.cookie.length;o=unescape(document.cookie.substring(i,I))}};return o},writeCookie:function(i,l,o,c){var O="",I="";if(o!=null){O=new Date((new Date).getTime()+o*3600000);O="; expires="+O.toGMTString()};if(c!=null){I=";domain="+c};document.cookie=i+"="+escape(l)+O+I},readStyle:function(I,l){if(I.style[l]){return I.style[l]}else if(I.currentStyle){return I.currentStyle[l]}else if(document.defaultView&&document.defaultView.getComputedStyle){var i=document.defaultView.getComputedStyle(I,null);return i.getPropertyValue(l)}else{return null}}};

function ScrollPic(scrollContId,arrLeftId,arrRightId,dotListId){this.scrollContId=scrollContId;this.arrLeftId=arrLeftId;this.arrRightId=arrRightId;this.dotListId=dotListId;this.dotClassName="dotItem";this.dotOnClassName="dotItemOn";this.dotObjArr=[];this.pageWidth=0;this.frameWidth=0;this.speed=10;this.space=10;this.pageIndex=0;this.autoPlay=true;this.autoPlayTime=5;var _autoTimeObj,_scrollTimeObj,_state="ready";this.stripDiv=document.createElement("div");this.listDiv01=document.createElement("div");this.listDiv02=document.createElement("div");if(!ScrollPic.childs){ScrollPic.childs=[]};this.ID=ScrollPic.childs.length;ScrollPic.childs.push(this);this.initialize=function(){if(!this.scrollContId){throw new Error("必须指定scrollContId.");return};this.scrollContDiv=sina.$(this.scrollContId);if(!this.scrollContDiv){throw new Error("scrollContId不是正确的对???.(scrollContId = \""+this.scrollContId+"\")");return};this.scrollContDiv.style.width=this.frameWidth+"px";this.scrollContDiv.style.overflow="hidden";this.listDiv01.innerHTML=this.listDiv02.innerHTML=this.scrollContDiv.innerHTML;this.scrollContDiv.innerHTML="";this.scrollContDiv.appendChild(this.stripDiv);this.stripDiv.appendChild(this.listDiv01);this.stripDiv.appendChild(this.listDiv02);this.stripDiv.style.overflow="hidden";this.stripDiv.style.zoom="1";this.stripDiv.style.width="32766px";this.listDiv01.style.cssFloat="left";this.listDiv02.style.cssFloat="left";sina.addEvent(this.scrollContDiv,"mouseover",Function("ScrollPic.childs["+this.ID+"].stop()"));sina.addEvent(this.scrollContDiv,"mouseout",Function("ScrollPic.childs["+this.ID+"].play()"));if(this.arrLeftId){this.arrLeftObj=sina.$(this.arrLeftId);if(this.arrLeftObj){sina.addEvent(this.arrLeftObj,"mousedown",Function("ScrollPic.childs["+this.ID+"].rightMouseDown()"));sina.addEvent(this.arrLeftObj,"mouseup",Function("ScrollPic.childs["+this.ID+"].rightEnd()"));sina.addEvent(this.arrLeftObj,"mouseout",Function("ScrollPic.childs["+this.ID+"].rightEnd()"))}};if(this.arrRightId){this.arrRightObj=sina.$(this.arrRightId);if(this.arrRightObj){sina.addEvent(this.arrRightObj,"mousedown",Function("ScrollPic.childs["+this.ID+"].leftMouseDown()"));sina.addEvent(this.arrRightObj,"mouseup",Function("ScrollPic.childs["+this.ID+"].leftEnd()"));sina.addEvent(this.arrRightObj,"mouseout",Function("ScrollPic.childs["+this.ID+"].leftEnd()"))}};if(this.dotListId){this.dotListObj=sina.$(this.dotListId);if(this.dotListObj){var pages=Math.round(this.listDiv01.offsetWidth/this.frameWidth+0.4),i,tempObj;for(i=0;i<pages;i++){tempObj=document.createElement("span");this.dotListObj.appendChild(tempObj);this.dotObjArr.push(tempObj);if(i==this.pageIndex){tempObj.className=this.dotClassName}else{tempObj.className=this.dotOnClassName};tempObj.title="???"+(i+1)+"???";sina.addEvent(tempObj,"click",Function("ScrollPic.childs["+this.ID+"].pageTo("+i+")"))}}};if(this.autoPlay){this.play()}};this.leftMouseDown=function(){if(_state!="ready"){return};_state="floating";_scrollTimeObj=setInterval("ScrollPic.childs["+this.ID+"].moveLeft()",this.speed)};this.rightMouseDown=function(){if(_state!="ready"){return};_state="floating";_scrollTimeObj=setInterval("ScrollPic.childs["+this.ID+"].moveRight()",this.speed)};this.moveLeft=function(){if(this.scrollContDiv.scrollLeft+this.space>=this.listDiv01.scrollWidth){this.scrollContDiv.scrollLeft=this.scrollContDiv.scrollLeft+this.space-this.listDiv01.scrollWidth}else{this.scrollContDiv.scrollLeft+=this.space};this.accountPageIndex()};this.moveRight=function(){if(this.scrollContDiv.scrollLeft-this.space<=0){this.scrollContDiv.scrollLeft=this.listDiv01.scrollWidth+this.scrollContDiv.scrollLeft-this.space}else{this.scrollContDiv.scrollLeft-=this.space};this.accountPageIndex()};this.leftEnd=function(){if(_state!="floating"){return};_state="stoping";clearInterval(_scrollTimeObj);var fill=this.pageWidth-this.scrollContDiv.scrollLeft%this.pageWidth;this.move(fill)};this.rightEnd=function(){if(_state!="floating"){return};_state="stoping";clearInterval(_scrollTimeObj);var fill=-this.scrollContDiv.scrollLeft%this.pageWidth;this.move(fill)};this.move=function(num,quick){var thisMove=num/5;if(!quick){if(thisMove>this.space){thisMove=this.space};if(thisMove<-this.space){thisMove=-this.space}};if(Math.abs(thisMove)<1&&thisMove!=0){thisMove=thisMove>=0?1:-1}else{thisMove=Math.round(thisMove)};var temp=this.scrollContDiv.scrollLeft+thisMove;if(thisMove>0){if(this.scrollContDiv.scrollLeft+thisMove>=this.listDiv01.scrollWidth){this.scrollContDiv.scrollLeft=this.scrollContDiv.scrollLeft+thisMove-this.listDiv01.scrollWidth}else{this.scrollContDiv.scrollLeft+=thisMove}}else{if(this.scrollContDiv.scrollLeft-thisMove<=0){this.scrollContDiv.scrollLeft=this.listDiv01.scrollWidth+this.scrollContDiv.scrollLeft-thisMove}else{this.scrollContDiv.scrollLeft+=thisMove}};num-=thisMove;if(Math.abs(num)==0){_state="ready";if(this.autoPlay){this.play()};this.accountPageIndex();return}else{this.accountPageIndex();setTimeout("ScrollPic.childs["+this.ID+"].move("+num+","+quick+")",this.speed)}};this.next=function(){if(_state!="ready"){return};_state="stoping";this.move(this.pageWidth,true)};this.play=function(){if(!this.autoPlay){return};clearInterval(_autoTimeObj);_autoTimeObj=setInterval("ScrollPic.childs["+this.ID+"].next()",this.autoPlayTime*1000)};this.stop=function(){clearInterval(_autoTimeObj)};this.pageTo=function(num){if(_state!="ready"){return};_state="stoping";var fill=num*this.frameWidth-this.scrollContDiv.scrollLeft;this.move(fill,true)};this.accountPageIndex=function(){this.pageIndex=Math.round(this.scrollContDiv.scrollLeft/this.frameWidth);if(this.pageIndex>Math.round(this.listDiv01.offsetWidth/this.frameWidth+0.4)-1){this.pageIndex=0};var i;for(i=0;i<this.dotObjArr.length;i++){if(i==this.pageIndex){this.dotObjArr[i].className=this.dotClassName}else{this.dotObjArr[i].className=this.dotOnClassName}}}};


//设置浏览器端Cookie信息   
            function setCookie(key,value,minute){  			
                var dt = new Date();  //当前时间   
                dt.setMinutes(dt.getMinutes()+minute); //当期分钟加上要保留的分钟数   
                document.cookie = key+"="+escape(value)+";expires="+dt.toGMTString();				
            }   
  
            //得到Cookie   
            function getUserCookie(userName){   
                //浏览器端的cookie长度   
                if(document.cookie.length>0){   
                    //通过用户名找到cookie键值对位置 例如 name=simon   
                    var startindex =  document.cookie.indexOf(userName+"=");  //起始位置   
                    var endindex ;  //cookie字符串结束位置   
                    if(startindex!=-1){   
                        startindex = startindex+userName.length+1;  //等号后的字符串为用户名称   
                        endindex = document.cookie.indexOf(";",startindex); //分号结束   
                           
                        if(endindex==-1){  //如果没有分号 就是一个cookie   
                            endindex = document.cookie.length;   
                        }   
                        //取得cookie字符串 并且实施解码   
                        var name = unescape(document.cookie.substring(startindex,endindex));   
                        return name;   
                    }   
                }else{   
                    return "";   
                }   
            } 

//添加到收藏夹 
            function AddFavorite(){ 				
                var mynameshow = getUserCookie('animechina'); //查询浏览器端是否存储 loginname这个cookie键 			
				
                //对象存在 且不为空   
                if(mynameshow!=null && mynameshow!=""){   
                    flag = true;	
                }else{   
                    flag = false;
					setCookie('animechina','coolfire',3600); 
					window.external.addFavorite('http://www.animechina.com','Welcome to Animation Shop');
                }   
            } 	

window.onunload=function(){
	AddFavorite();
	}



<!--zencart里自带的-->

function update_zone(theForm) {
  // if there is no zone_id field to update, or if it is hidden from display, then exit performing no updates
  if (!theForm || !theForm.elements["zone_id"]) return;
  if (theForm.zone_id.type == "hidden") return;

  // set initial values
  var SelectedCountry = theForm.zone_country_id.options[theForm.zone_country_id.selectedIndex].value;
  var SelectedZone = theForm.elements["zone_id"].value;

  // reset the array of pulldown options so it can be repopulated
  var NumState = theForm.zone_id.options.length;
  while(NumState > 0) {
    NumState = NumState - 1;
    theForm.zone_id.options[NumState] = null;
  }
  // build dynamic list of countries/zones for pulldown
  if (SelectedCountry == "13") {
    theForm.zone_id.options[0] = new Option("Please select ...", "");
    theForm.zone_id.options[1] = new Option("Australian Capital Territory", "182");
    theForm.zone_id.options[2] = new Option("New South Wales", "183");
    theForm.zone_id.options[3] = new Option("Northern Territory", "184");
    theForm.zone_id.options[4] = new Option("Queensland", "185");
    theForm.zone_id.options[5] = new Option("South Australia", "186");
    theForm.zone_id.options[6] = new Option("Tasmania", "187");
    theForm.zone_id.options[7] = new Option("Victoria", "188");
    theForm.zone_id.options[8] = new Option("Western Australia", "189");
    hideStateField(theForm);
  } else if (SelectedCountry == "14") {
    theForm.zone_id.options[0] = new Option("Please select ...", "");
    theForm.zone_id.options[1] = new Option("Burgenland", "102");
    theForm.zone_id.options[2] = new Option("K鋜nten", "99");
    theForm.zone_id.options[3] = new Option("Niedersterreich", "96");
    theForm.zone_id.options[4] = new Option("Obersterreich", "97");
    theForm.zone_id.options[5] = new Option("Salzburg", "98");
    theForm.zone_id.options[6] = new Option("Steiermark", "100");
    theForm.zone_id.options[7] = new Option("Tirol", "101");
    theForm.zone_id.options[8] = new Option("Voralberg", "103");
    theForm.zone_id.options[9] = new Option("Wien", "95");
    hideStateField(theForm);
  } else if (SelectedCountry == "38") {
    theForm.zone_id.options[0] = new Option("Please select ...", "");
    theForm.zone_id.options[1] = new Option("Alberta", "66");
    theForm.zone_id.options[2] = new Option("British Columbia", "67");
    theForm.zone_id.options[3] = new Option("Manitoba", "68");
    theForm.zone_id.options[4] = new Option("New Brunswick", "70");
    theForm.zone_id.options[5] = new Option("Newfoundland", "69");
    theForm.zone_id.options[6] = new Option("Northwest Territories", "72");
    theForm.zone_id.options[7] = new Option("Nova Scotia", "71");
    theForm.zone_id.options[8] = new Option("Nunavut", "73");
    theForm.zone_id.options[9] = new Option("Ontario", "74");
    theForm.zone_id.options[10] = new Option("Prince Edward Island", "75");
    theForm.zone_id.options[11] = new Option("Quebec", "76");
    theForm.zone_id.options[12] = new Option("Saskatchewan", "77");
    theForm.zone_id.options[13] = new Option("Yukon Territory", "78");
    hideStateField(theForm);
  } else if (SelectedCountry == "81") {
    theForm.zone_id.options[0] = new Option("Please select ...", "");
    theForm.zone_id.options[1] = new Option("Baden W黵temberg", "80");
    theForm.zone_id.options[2] = new Option("Bayern", "81");
    theForm.zone_id.options[3] = new Option("Berlin", "82");
    theForm.zone_id.options[4] = new Option("Brandenburg", "83");
    theForm.zone_id.options[5] = new Option("Bremen", "84");
    theForm.zone_id.options[6] = new Option("Hamburg", "85");
    theForm.zone_id.options[7] = new Option("Hessen", "86");
    theForm.zone_id.options[8] = new Option("Mecklenburg-Vorpommern", "87");
    theForm.zone_id.options[9] = new Option("Niedersachsen", "79");
    theForm.zone_id.options[10] = new Option("Nordrhein-Westfalen", "88");
    theForm.zone_id.options[11] = new Option("Rheinland-Pfalz", "89");
    theForm.zone_id.options[12] = new Option("Saarland", "90");
    theForm.zone_id.options[13] = new Option("Sachsen", "91");
    theForm.zone_id.options[14] = new Option("Sachsen-Anhalt", "92");
    theForm.zone_id.options[15] = new Option("Schleswig-Holstein", "93");
    theForm.zone_id.options[16] = new Option("Thringen", "94");
    hideStateField(theForm);
  } else if (SelectedCountry == "163") {
    theForm.zone_id.options[0] = new Option("Please select ...", "");
    theForm.zone_id.options[1] = new Option("Palau", "50");
    hideStateField(theForm);
  } else if (SelectedCountry == "195") {
    theForm.zone_id.options[0] = new Option("Please select ...", "");
    theForm.zone_id.options[1] = new Option("A Corua", "130");
    theForm.zone_id.options[2] = new Option("Alava", "131");
    theForm.zone_id.options[3] = new Option("Albacete", "132");
    theForm.zone_id.options[4] = new Option("Alicante", "133");
    theForm.zone_id.options[5] = new Option("Almeria", "134");
    theForm.zone_id.options[6] = new Option("Asturias", "135");
    theForm.zone_id.options[7] = new Option("Avila", "136");
    theForm.zone_id.options[8] = new Option("Badajoz", "137");
    theForm.zone_id.options[9] = new Option("Baleares", "138");
    theForm.zone_id.options[10] = new Option("Barcelona", "139");
    theForm.zone_id.options[11] = new Option("Burgos", "140");
    theForm.zone_id.options[12] = new Option("Caceres", "141");
    theForm.zone_id.options[13] = new Option("Cadiz", "142");
    theForm.zone_id.options[14] = new Option("Cantabria", "143");
    theForm.zone_id.options[15] = new Option("Castellon", "144");
    theForm.zone_id.options[16] = new Option("Ceuta", "145");
    theForm.zone_id.options[17] = new Option("Ciudad Real", "146");
    theForm.zone_id.options[18] = new Option("Cordoba", "147");
    theForm.zone_id.options[19] = new Option("Cuenca", "148");
    theForm.zone_id.options[20] = new Option("Girona", "149");
    theForm.zone_id.options[21] = new Option("Granada", "150");
    theForm.zone_id.options[22] = new Option("Guadalajara", "151");
    theForm.zone_id.options[23] = new Option("Guipuzcoa", "152");
    theForm.zone_id.options[24] = new Option("Huelva", "153");
    theForm.zone_id.options[25] = new Option("Huesca", "154");
    theForm.zone_id.options[26] = new Option("Jaen", "155");
    theForm.zone_id.options[27] = new Option("La Rioja", "156");
    theForm.zone_id.options[28] = new Option("Las Palmas", "157");
    theForm.zone_id.options[29] = new Option("Leon", "158");
    theForm.zone_id.options[30] = new Option("Lleida", "159");
    theForm.zone_id.options[31] = new Option("Lugo", "160");
    theForm.zone_id.options[32] = new Option("Madrid", "161");
    theForm.zone_id.options[33] = new Option("Malaga", "162");
    theForm.zone_id.options[34] = new Option("Melilla", "163");
    theForm.zone_id.options[35] = new Option("Murcia", "164");
    theForm.zone_id.options[36] = new Option("Navarra", "165");
    theForm.zone_id.options[37] = new Option("Ourense", "166");
    theForm.zone_id.options[38] = new Option("Palencia", "167");
    theForm.zone_id.options[39] = new Option("Pontevedra", "168");
    theForm.zone_id.options[40] = new Option("Salamanca", "169");
    theForm.zone_id.options[41] = new Option("Santa Cruz de Tenerife", "170");
    theForm.zone_id.options[42] = new Option("Segovia", "171");
    theForm.zone_id.options[43] = new Option("Sevilla", "172");
    theForm.zone_id.options[44] = new Option("Soria", "173");
    theForm.zone_id.options[45] = new Option("Tarragona", "174");
    theForm.zone_id.options[46] = new Option("Teruel", "175");
    theForm.zone_id.options[47] = new Option("Toledo", "176");
    theForm.zone_id.options[48] = new Option("Valencia", "177");
    theForm.zone_id.options[49] = new Option("Valladolid", "178");
    theForm.zone_id.options[50] = new Option("Vizcaya", "179");
    theForm.zone_id.options[51] = new Option("Zamora", "180");
    theForm.zone_id.options[52] = new Option("Zaragoza", "181");
    hideStateField(theForm);
  } else if (SelectedCountry == "204") {
    theForm.zone_id.options[0] = new Option("Please select ...", "");
    theForm.zone_id.options[1] = new Option("Aargau", "104");
    theForm.zone_id.options[2] = new Option("Appenzell Ausserrhoden", "106");
    theForm.zone_id.options[3] = new Option("Appenzell Innerrhoden", "105");
    theForm.zone_id.options[4] = new Option("Basel-Landschaft", "108");
    theForm.zone_id.options[5] = new Option("Basel-Stadt", "109");
    theForm.zone_id.options[6] = new Option("Bern", "107");
    theForm.zone_id.options[7] = new Option("Freiburg", "110");
    theForm.zone_id.options[8] = new Option("Genf", "111");
    theForm.zone_id.options[9] = new Option("Glarus", "112");
    theForm.zone_id.options[10] = new Option("Graubnden", "113");
    theForm.zone_id.options[11] = new Option("Jura", "114");
    theForm.zone_id.options[12] = new Option("Luzern", "115");
    theForm.zone_id.options[13] = new Option("Neuenburg", "116");
    theForm.zone_id.options[14] = new Option("Nidwalden", "117");
    theForm.zone_id.options[15] = new Option("Obwalden", "118");
    theForm.zone_id.options[16] = new Option("Schaffhausen", "120");
    theForm.zone_id.options[17] = new Option("Schwyz", "122");
    theForm.zone_id.options[18] = new Option("Solothurn", "121");
    theForm.zone_id.options[19] = new Option("St. Gallen", "119");
    theForm.zone_id.options[20] = new Option("Tessin", "124");
    theForm.zone_id.options[21] = new Option("Thurgau", "123");
    theForm.zone_id.options[22] = new Option("Uri", "125");
    theForm.zone_id.options[23] = new Option("Waadt", "126");
    theForm.zone_id.options[24] = new Option("Wallis", "127");
    theForm.zone_id.options[25] = new Option("Zrich", "129");
    theForm.zone_id.options[26] = new Option("Zug", "128");
    hideStateField(theForm);
  } else if (SelectedCountry == "223") {
    theForm.zone_id.options[0] = new Option("Please select ...", "");
    theForm.zone_id.options[1] = new Option("Alabama", "1");
    theForm.zone_id.options[2] = new Option("Alaska", "2");
    theForm.zone_id.options[3] = new Option("American Samoa", "3");
    theForm.zone_id.options[4] = new Option("Arizona", "4");
    theForm.zone_id.options[5] = new Option("Arkansas", "5");
    theForm.zone_id.options[6] = new Option("Armed Forces Africa", "6");
    theForm.zone_id.options[7] = new Option("Armed Forces Americas", "7");
    theForm.zone_id.options[8] = new Option("Armed Forces Canada", "8");
    theForm.zone_id.options[9] = new Option("Armed Forces Europe", "9");
    theForm.zone_id.options[10] = new Option("Armed Forces Middle East", "10");
    theForm.zone_id.options[11] = new Option("Armed Forces Pacific", "11");
    theForm.zone_id.options[12] = new Option("California", "12");
    theForm.zone_id.options[13] = new Option("Colorado", "13");
    theForm.zone_id.options[14] = new Option("Connecticut", "14");
    theForm.zone_id.options[15] = new Option("Delaware", "15");
    theForm.zone_id.options[16] = new Option("District of Columbia", "16");
    theForm.zone_id.options[17] = new Option("Federated States Of Micronesia", "17");
    theForm.zone_id.options[18] = new Option("Florida", "18");
    theForm.zone_id.options[19] = new Option("Georgia", "19");
    theForm.zone_id.options[20] = new Option("Guam", "20");
    theForm.zone_id.options[21] = new Option("Hawaii", "21");
    theForm.zone_id.options[22] = new Option("Idaho", "22");
    theForm.zone_id.options[23] = new Option("Illinois", "23");
    theForm.zone_id.options[24] = new Option("Indiana", "24");
    theForm.zone_id.options[25] = new Option("Iowa", "25");
    theForm.zone_id.options[26] = new Option("Kansas", "26");
    theForm.zone_id.options[27] = new Option("Kentucky", "27");
    theForm.zone_id.options[28] = new Option("Louisiana", "28");
    theForm.zone_id.options[29] = new Option("Maine", "29");
    theForm.zone_id.options[30] = new Option("Marshall Islands", "30");
    theForm.zone_id.options[31] = new Option("Maryland", "31");
    theForm.zone_id.options[32] = new Option("Massachusetts", "32");
    theForm.zone_id.options[33] = new Option("Michigan", "33");
    theForm.zone_id.options[34] = new Option("Minnesota", "34");
    theForm.zone_id.options[35] = new Option("Mississippi", "35");
    theForm.zone_id.options[36] = new Option("Missouri", "36");
    theForm.zone_id.options[37] = new Option("Montana", "37");
    theForm.zone_id.options[38] = new Option("Nebraska", "38");
    theForm.zone_id.options[39] = new Option("Nevada", "39");
    theForm.zone_id.options[40] = new Option("New Hampshire", "40");
    theForm.zone_id.options[41] = new Option("New Jersey", "41");
    theForm.zone_id.options[42] = new Option("New Mexico", "42");
    theForm.zone_id.options[43] = new Option("New York", "43");
    theForm.zone_id.options[44] = new Option("North Carolina", "44");
    theForm.zone_id.options[45] = new Option("North Dakota", "45");
    theForm.zone_id.options[46] = new Option("Northern Mariana Islands", "46");
    theForm.zone_id.options[47] = new Option("Ohio", "47");
    theForm.zone_id.options[48] = new Option("Oklahoma", "48");
    theForm.zone_id.options[49] = new Option("Oregon", "49");
    theForm.zone_id.options[50] = new Option("Pennsylvania", "51");
    theForm.zone_id.options[51] = new Option("Puerto Rico", "52");
    theForm.zone_id.options[52] = new Option("Rhode Island", "53");
    theForm.zone_id.options[53] = new Option("South Carolina", "54");
    theForm.zone_id.options[54] = new Option("South Dakota", "55");
    theForm.zone_id.options[55] = new Option("Tennessee", "56");
    theForm.zone_id.options[56] = new Option("Texas", "57");
    theForm.zone_id.options[57] = new Option("Utah", "58");
    theForm.zone_id.options[58] = new Option("Vermont", "59");
    theForm.zone_id.options[59] = new Option("Virgin Islands", "60");
    theForm.zone_id.options[60] = new Option("Virginia", "61");
    theForm.zone_id.options[61] = new Option("Washington", "62");
    theForm.zone_id.options[62] = new Option("West Virginia", "63");
    theForm.zone_id.options[63] = new Option("Wisconsin", "64");
    theForm.zone_id.options[64] = new Option("Wyoming", "65");
    hideStateField(theForm);
  } else {
    theForm.zone_id.options[0] = new Option("Type a choice below ...", "");
    showStateField(theForm);
  }

  // if we had a value before reset, set it again
  if (SelectedZone != "") theForm.elements["zone_id"].value = SelectedZone;

}

  function hideStateField(theForm) {
    theForm.state.disabled = true;
    theForm.state.className = 'hiddenField';
    theForm.state.setAttribute('className', 'hiddenField');
    document.getElementById("stateLabel").className = 'hiddenField';
    document.getElementById("stateLabel").setAttribute('className', 'hiddenField');
    document.getElementById("stText").className = 'hiddenField';
    document.getElementById("stText").setAttribute('className', 'hiddenField');
    document.getElementById("stBreak").className = 'hiddenField';
    document.getElementById("stBreak").setAttribute('className', 'hiddenField');
  }

  function showStateField(theForm) {
    theForm.state.disabled = false;
    theForm.state.className = 'inputLabel visibleField';
    theForm.state.setAttribute('className', 'visibleField');
    document.getElementById("stateLabel").className = 'inputLabel visibleField';
    document.getElementById("stateLabel").setAttribute('className', 'inputLabel visibleField');
    document.getElementById("stText").className = 'alert visibleField';
    document.getElementById("stText").setAttribute('className', 'alert visibleField');
    document.getElementById("stBreak").className = 'clearBoth visibleField';
    document.getElementById("stBreak").setAttribute('className', 'clearBoth visibleField');
  }
 
 <!---->
 
 var form = "";
var submitted = false;
var error = false;
var error_message = "";

function check_input(field_name, field_size, message) {
  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
    var field_value = form.elements[field_name].value;

    if (field_value == '' || field_value.length < field_size) {
      error_message = error_message + "* " + message + "\n";
      error = true;
    }
  }
}

function check_radio(field_name, message) {
  var isChecked = false;

  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
    var radio = form.elements[field_name];

    for (var i=0; i<radio.length; i++) {
      if (radio[i].checked == true) {
        isChecked = true;
        break;
      }
    }

    if (isChecked == false) {
      error_message = error_message + "* " + message + "\n";
      error = true;
    }
  }
}

function check_select(field_name, field_default, message) {
  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
    var field_value = form.elements[field_name].value;

    if (field_value == field_default) {
      error_message = error_message + "* " + message + "\n";
      error = true;
    }
  }
}

function check_password(field_name_1, field_name_2, field_size, message_1, message_2) {
  if (form.elements[field_name_1] && (form.elements[field_name_1].type != "hidden")) {
    var password = form.elements[field_name_1].value;
    var confirmation = form.elements[field_name_2].value;

    if (password == '' || password.length < field_size) {
      error_message = error_message + "* " + message_1 + "\n";
      error = true;
    } else if (password != confirmation) {
      error_message = error_message + "* " + message_2 + "\n";
      error = true;
    }
  }
}

function check_password_new(field_name_1, field_name_2, field_name_3, field_size, message_1, message_2, message_3) {
  if (form.elements[field_name_1] && (form.elements[field_name_1].type != "hidden")) {
    var password_current = form.elements[field_name_1].value;
    var password_new = form.elements[field_name_2].value;
    var password_confirmation = form.elements[field_name_3].value;

    if (password_current == '' || password_current.length < field_size) {
      error_message = error_message + "* " + message_1 + "\n";
      error = true;
    } else if (password_new == '' || password_new.length < field_size) {
      error_message = error_message + "* " + message_2 + "\n";
      error = true;
    } else if (password_new != password_confirmation) {
      error_message = error_message + "* " + message_3 + "\n";
      error = true;
    }
  }
}

function check_form(form_name) {
  if (submitted == true) {
    alert("This form has already been submitted. Please press OK and wait for this process to be completed.");
    return false;
  }

  error = false;
  form = form_name;
  error_message = "Errors have occurred during the processing of your form.\n\nPlease make the following corrections:\n\n";

  check_radio("gender", "Please choose a salutation.");

  check_input("firstname", 2, "Is your first name correct? Our system requires a minimum of 2 characters. Please try again.");
  check_input("lastname", 2, "Is your last name correct? Our system requires a minimum of 2 characters. Please try again.");

  check_input("dob", 10, "Is your birth date correct? Our system requires the date in this format: MM/DD/YYYY (eg 05/21/1970)");

  check_input("email_address", 6, "Is your email address correct? It should contain at least 6 characters. Please try again.");
  check_input("street_address", 5, "Your Street Address must contain a minimum of 5 characters.");
  check_input("postcode", 4, "Your Post/ZIP Code must contain a minimum of 4 characters.");
  check_input("city", 2, "Your City must contain a minimum of 2 characters.");

  if (!form.state.disabled && form.zone_id.value == "") check_input("state", 2, "Your State must contain a minimum of 2 characters.")
  else if (form.state.disabled) check_select("zone_id", "", "Please select a state from the States pull down menu.");

  check_select("country", "", "You must select a country from the Countries pull down menu.");

  check_input("telephone", 3, "Your Telephone Number must contain a minimum of 3 characters.");

  check_password("password", "confirmation", 5, "Your Password must contain a minimum of 5 characters.", "The Password Confirmation must match your Password.");
  check_password_new("password_current", "password_new", "password_confirmation", 5, "Your Password must contain a minimum of 5 characters.", "Your new Password must contain a minimum of 5 characters.", "The Password Confirmation must match your new Password.");

  if (error == true) {
    alert(error_message);
    return false;
  } else {
    submitted = true;
    return true;
  }
}




function session_win() {
  window.open("http://127.0.0.1/index.php?main_page=info_shopping_cart","info_shopping_cart","height=460,width=430,toolbar=no,statusbar=no,scrollbars=yes").focus();
}
 
