usingNamespace("Web")["StateManager"]={Cookies:{Name:{CFG:"NV_CONFIGURATION",LOGIN:"CustomerInfo",CART:"NV_CARTINFO",CPCOMBO:"CELL_PHONE_COMBO",PRDLIST:"ProductList"},get:function(n,k){if(String.isNullOrEmpty(n)){return"";};var hc=Sys.Web.Cookies.Helper.get(n);if(String.isNullOrEmpty(k)){debug.output("Get Cookie",[n+"="+hc.toString().decodeURI()]);return hc.toString().decodeURI();};debug.output("Get SubCookie",[n+"="+hc.getKeyValue(k)]);return hc.getKeyValue(k);},save:function(n,v){var hc=new Sys.Web.Cookies.HttpCookie(n);try{var c;if(null!=(c=Web.Config.CookieMapping[n])){hc.domain=c[0];var ad=Number.parse(c[1]);if(ad>0){var d=new Date();d.setTime(d.getTime()+ad*1000);hc.expires=d;};hc.path=c[2];hc.secure=c[3];}}catch(ex){};switch(Object.getTypeName(v)){case"String":hc.value=v;break;case"Object":for(var k in v){hc.setKey(k,v[k]);};break;default:return;};debug.output("Save Cookies",hc.toHttpCookieString());debug.assert(hc.toString().length>0,"Save Empty Cookies",hc.toHttpCookieString());Sys.Web.Cookies.Helper.save(hc);},clear:function(n){var hc=new Sys.Web.Cookies.HttpCookie(n);try{var c;if(null!=(c=Web.Config.CookieMapping[n])){hc.domain=c[0];hc.path=c[2];hc.secure=c[3];};}catch(ex){};Sys.Web.Cookies.Helper.clear(hc);}}};usingNamespace("Web.UI")["ResourceManager"]={Image:{build:function(n){if(String.isNullOrEmpty(n)){return;};var p=Web.Config.Environment.Path.Images+n;switch(Web.Environment.Protocol()){case Web.Enum.Protocol.http:return Web.Config.Environment.Url.HttpCache+p;case Web.Enum.Protocol.https:return Web.Config.Environment.Url.HttpsCache+p;default:return p;};}},Scripts:{build:function(){}},Css:{build:function(){}},Url:{build:function(p){if(String.isNullOrEmpty(p)){return;};switch(Web.Environment.Protocol()){case Web.Enum.Protocol.http:return Web.UI.ResourceManager.Url.www(p);case Web.Enum.Protocol.https:return Web.UI.ResourceManager.Url.secure(p);default:return p;};},combine:function(url,qs){return url+((qs.length>0)?"?"+qs:qs);},www:function(p){return Web.Config.Environment.Url.WWW+String.parse(p);},shopper:function(p){return Web.Config.Environment.Url.Shopper+String.parse(p);},secure:function(p){return Web.Config.Environment.Url.Secure+String.parse(p);}}};usingNamespace("Web.UI")["Control"]={create:function(n,a){var o=document.createElement(n);Web.UI.Control.setAttribute(o,a);return o;},appendChild:function(p,c){if(null!=p&&null!=c&&null!=p["appendChild"]){p.appendChild(c);};},removeChild:function(p,c){if(null!=p&&null!=c&&null!=p["removeChild"]){if(Web.Environment.Browser.isIE()){Web.UI.Control.purge(c);};p.removeChild(c);};},appendInnerHTML:function(p,h){if(null!=p&&null!=p["innerHTML"]){p.innerHTML+=h;};},replaceInnerHTML:function(p,h){if(null!=p&&null!=p["innerHTML"]){if(Web.Environment.Browser.isIE()){Web.UI.Control.purge(p,true);};p.innerHTML=h;};},setAttribute:function(o,a){if(Object.isNull(o)||Object.isNull(a)){return;};for(var n in a){var co=o;var p=n.split(".");for(var i=0;i<p.length-1;++i){if(!co[p[i]]){co={};}else{co=co[p[i]]};};co[p[p.length-1]]=a[n];};},purge:function(d,onlyChildren){if(null==d){return;};if(!onlyChildren){var a=d.attributes,i,l,n;if(a){l=a.length;for(i=0;i<l;++i){n=[i].name;if(typeof(d[n])==='function'){d[n]=null;};};};};if(["select","tr"].contains(d.nodeName.toLowerCase())){return;};a=d.childNodes;if(a){l=a.length;for(i=0;i<l;++i){Web.UI.Control.purge(d.childNodes[i]);};};},openWindow:function(url,target,w,h,t,l,a){if(!Number.isNumeric(w)||!Number.isNumeric(h)){throw new Error("Invalid window width or height.");};var we=Web.Environment;t=",top="+(Number.isNumeric(t)?t:0);l=",left="+(Number.isNumeric(l)?l:0);a=",directories=0"+(a?(","+a.toString()):"");if(we.OS.isWin()&&we.Browser.isAol()){w+=20;h+=20;};if(a.search(/scrollbars=(1|true)/ig)>=0){if(we.OS.isMac()&&we.Browser.isNetscape()){w+=17};if(we.OS.isWin()){w+=16;}};w="width="+w;h=",height="+h;window.open(url,target,w+h+t+l+a);},addCss:function(o,a){if(Object.isNull(o)){return;};var cl=o.className.split(" ");switch(Object.getTypeName(a)){case"String":if(!cl.contains(a)){cl.add(a);};break;case"Array":for(var i=0;i<a.length;++i){if(!cl.contains(a[i])){cl.add(a[i]);};};break;default:};Web.UI.Control.setAttribute(o,{"className":cl.join(" ")});},removeCss:function(o,a){if(Object.isNull(o)){return;};var cl=o.className.split(" ");switch(Object.getTypeName(a)){case"String":cl.remove(a);break;case"Array":for(var i=0;i<a.length;++i){cl.remove(a[i]);};break;default:};Web.UI.Control.setAttribute(o,{"className":cl.join(" ")});},replaceCss:function(o,a,r){if(Object.isNull(o)){return;};var cl=o.className.split(" ");switch(Object.getTypeName(a)){case"String":cl.remove(a);break;case"Array":for(var i=0;i<a.length;++i){cl.remove(a[i]);};break;default:};switch(Object.getTypeName(r)){case"String":cl.add(r);break;case"Array":cl.addRange(r);break;default:};Web.UI.Control.setAttribute(o,{"className":cl.join(" ")});},clearCss:function(o){Web.UI.Control.setAttribute(o,{"className":""});}};usingNamespace("Web.UI")["Form"]={clickone:true,postBack:function(c,a,b){var command=$('Command');var args=$('Args');command.value=a;args.value=b;Web.UI.Form.submit(c);},reset:function(n){var f;if(null!=(f=Web.UI.Form.get(n))){f.reset();};},submit:function(n){debug.output("clickone",Web.UI.Form.clickone);var f;if(Web.UI.Form.clickone&&null!=(f=Web.UI.Form.get(n))){f.submit();Web.UI.Form.clickone=false;};},get:function(n){return document.forms[n]||null;},getElement:function(n,eln){return Web.UI.Form.getElements(n,eln);},getElements:function(n,eln){var f;if(null!=(f=Web.UI.Form.get(n))){if(!String.isNullOrEmpty(eln)){return f[eln];}else{return f.elements;};};return null;},getValuesBase:function(items){if(!items){return[];};if(!String.isNullOrEmpty(items.type)){items=[items];};var values=[];for(var i=0;i<items.length;++i){switch(items[i].type){case"radio":if(items[i].checked&&!String.isNullOrEmpty(items[i].value)){values.add(items[i].value);};break;case"checkbox":if(items[i].checked&&!String.isNullOrEmpty(items[i].value)){values.add(items[i].value);};break;case"select-multipe":var options=items[i].options;for(var j=0;j<options.length;++j){if(options[j].selected&&!String.isNullOrEmpty(options[j].value)){values.add(options[j].value);};};break;case"select-one":default:if(!String.isNullOrEmpty(items[i].value)){values.add(items[i].value);};};};return values;},setValue:function(n,eln,v){var el=Web.UI.Form.getElement(n,eln);if(el){el["value"]=v;};},getValue:function(n,eln){var wuf=Web.UI.Form;var el=wuf.getElement(n,eln);return wuf.getValuesBase(el)[0]||"";},getValues:function(n,eln){var wuf=Web.UI.Form;var values=[];switch(Object.getTypeName(eln)){case"String":var el=wuf.getElement(n,eln);values.addRange(wuf.getValuesBase(el));break;case"Array":for(var i=0;i<eln.length;++i){var el=wuf.getElement(n,eln[i]);values.addRange(wuf.getValuesBase(el));};break;default:var els=wuf.getElements(n);values.addRange(wuf.getValuesBase(els));};return values;},selectedOptions:function(n,eln,v){var wuf=Web.UI.Form;if(Object.isNull(v)){return;};if(Object.getTypeName(v)!="Array"){v=[v.toString()];};var el=wuf.getElement(n,eln);if(el.options){for(var i=0;i<el.options.length;++i){if(v.contains(el.options[i].value)){el.options[i].selected=true;};};};}};usingNamespace("Web.UI.Form")["Radio"]={allowCancelForm:function(){for(var i=0;i<arguments.length;++i){var f=null;if(null!=(f=document.forms[arguments[i]])){for(var j=0;j<f.elements.length;++j){if(f.elements[j].type=="radio"){Web.UI.Form.Radio.allowCancel(f.elements[j]);};};};};},allowCancelElement:function(n,eln){var items=Web.UI.Form.getElement(n,eln);if(!items){return;};if(!items.length){items=[items];};for(var j=0;j<items.length;++j){if(items[j].type=="radio"){Web.UI.Form.Radio.allowCancel(f.elements[j]);};};},allowCancel:function(o){if(o){var oName=o.name;var oId=o["id"]||null;var fName=(o.form)?o.form.name:"Undefined";o["__checked"]=usingNamespace("Runtime.Control.Forms."+fName+".Radio."+oName);if(!oId){if(!o["__checked"]["__createId"]){o["__checked"]["__createId"]=oName+"_"+0;};var tId=o["__checked"]["__createId"].split("_");tId[1]=(tId[1]-0)+1;o.id=tId.join("_");o["__checked"]["__createId"]=o.id;};var cId=o.defaultChekced?o.id:"";o["__checked"]["__id"]=cId;o.attachEvent("onclick",Web.UI.Form.Radio.cancel);};},cancel:function(){var io=window.event.srcElement;var nId="";if(io["__checked"]["__id"]==io.id){io.checked=false;}else{nId=io.id;};io["__checked"]["__id"]=nId;}};usingNamespace("Web.UI.Image")["Rotation"]={index:0,pointer:null,rimage:null,imgList:[],hrefList:[],time:4000,type:{"LEFT":"L","RIGHT":"R"},addImage:function(n,h){Rotation.imgList.push(n);Rotation.hrefList.push(h);},_slide:function(idx){var r=Rotation;var ro=r.rimage;var co=(ro.childNodes!=null&&ro.childNodes.length>0)?ro.childNodes[0]:null;ro.style.backgroundImage="url('"+r.imgList[idx]+"')";if(co!=null&&co.href){co.href=r.hrefList[idx];};},slide:function(rtype){var r=Rotation;var sf=false;switch(rtype){case r.type.LEFT:r.index--;sf=true;break;case r.type.RIGHT:r.index++;sf=true;break;default:r.index++;break;};if(r.index==r.imgList.length){r.index=0;}else if(r.index<0){r.index=r.imgList.length-1;};if(sf){r.stop(r.pointer);};r._slide(r.index);if(sf){r.start();};},left:function(){Rotation.slide(Rotation.type.LEFT);},right:function(){Rotation.slide(Rotation.type.RIGHT);},start:function(){var r=Rotation;if(r.imgList.length>1){r.pointer=setInterval((function(){r.slide();}),r.time);};},stop:function(p){clearInterval(p);}};
