function selectArea(a,j,e){var a=$(a);if(!a){return}var c=a.value;var f=a.getParent();var g=a.getNext();var h=a.getParent("*[package]");var i=h.getElement("input[type=hidden]");var d=function(m){var n=[];var l=true;var k=$ES("select",h);k.each(function(o){if(o.getValue()!="_NULL_"&&l){n.push($(o.options[o.selectedIndex]).get("text"))}else{l=false}});if(m.value!="_NULL_"){$E("input",h).value=h.get("package")+":"+n.join("/")+":"+m.value}else{$E("input",h).value=function(p){var o=k.indexOf(p)-1;if(o>=0){return h.get("package")+":"+n.join("/")+":"+k[o].value}return""}(m)}};if(c=="_NULL_"&&g&&(g.getTag()=="span"&&g.hasClass("x-areaSelect"))){a.nextSibling.empty();d(a)}else{var b=$(a.options[a.selectedIndex]);if(b.get("has_c")){new Request({onSuccess:function(k){if(g&&(g.getTag()=="span"&&g.hasClass("x-region-child"))){var l=g}else{var l=new Element("span",{"class":"x-region-child"}).inject(f)}d(a);if(k){l.set("html",k);if(i){i.retrieve("sel"+e,$empty)();i.retrieve("onsuc",$empty)()}}else{a.getAllNext().remove();d(a);i.retrieve("lastsel",$empty)(a)}}}).get("index.php?ctl=default&act=sel_region&p[0]="+j+"&p[1]="+e);if($("shipping")){$("shipping").setText("")}}else{a.getAllNext().remove();d(a);if(!b.get("has_c")&&b.value!="_NULL_"){i.retrieve("lastsel",$empty)(a)}}}};