usingNamespace("Web")["StateManager"]={Cookies:{Name:{CFG:"NV_CONFIGURATION",LOGIN:(Web.Config.SiteCookieInfo.bizUnit=="B2B")?"NV_B2BCUSTOMERLOGIN":"NV_CUSTOMERLOGIN",CART:"NV_CARTINFO",CPCOMBO:"CELL_PHONE_COMBO",PRDLIST:"NV_PRDLIST",CARTPAGEINFO:"NV_CARTPAGEINFO"},get:function(n,k){if(String.isNullOrEmpty(n)){return "";};var hc=Sys.Web.Cookies.Helper.get(n);if(String.isNullOrEmpty(k)){return hc.toString().decodeURI();};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;};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"]={reset:function(n){var f;if(null!=(f=Web.UI.Form.get(n))){f.reset();};},submit:function(n){var f;if(null!=(f=Web.UI.Form.get(n))){f.submit();};},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);}};usingNamespace("Web.Plugin")["Flash"]={installedSign:0,version:0,check:function(){var wpf=Web.Plugin.Flash;if(navigator.plugins&&navigator.plugins.length){var x=navigator.plugins["Shockwave Flash"];if(x){wpf.installedSign=2;if(x.description){var y=x.description;wpf.version=y.charAt(y.indexOf('.')-1);};}else{wpf.installedSign=1;};if(navigator.plugins["Shockwave Flash 2.0"]){wpf.installedSign=2;wpf.version=2;};}else if(navigator.mimeTypes&&navigator.mimeTypes.length){var x=navigator.mimeTypes['application/x-shockwave-flash'];wpf.installedSign=(x&&x.enabledPlugin)?2:1;}else{for(var i=8;i>=0;i--){var obj="ShockwaveFlash.ShockwaveFlash."+i;try{var flash = new ActiveXObject(obj);wpf.installedSign=2;wpf.version=i;break;}catch(e){};};};},isInstalled:function(){var wpf=Web.Plugin.Flash;wpf.check();return (wpf.installedSign==2&&wpf.version)?true:false;}};usingNamespace("Web.UI.Provider")["ICalendar"]=(function(){this.setDisplayControl=function(){};this.setInputControl=function(){};this.setCalendar=function(){};this.render=function(){};}).registerInterface("Web.UI.Provider.ICalendar");usingNamespace("Web.UI.Control")["Calendar"]=(function(){var instance=calendarControl=this;var defaultUIProvider=(function(){var instance=this;defaultUIProvider.initializeClass(instance,arguments);}).registerClass("Web.UI.Control.Calendar.DefualtUIProvider","","Web.UI.Provider.ICalendar");var Calendar=function(date,uiProvider){var calendar=instance=this;var helper=calendarControl.Helper;var calDate=date;var ui=uiProvider;this.getCalendar=function(){var days=helper.LAST_DAY_OF_MONTH.clone();var today=helper.getRawDate(new Date());var cc=helper.getRawDate(calDate);var cd=helper.getRawDate(helper.getMonthBeginDate(calDate));if(cd.m==2&&helper.isLeapYear(cd.y)){days[2]++;};var pd=helper.getRawDate(helper.createDate(cd.y,cd.m,0));var nd=helper.getRawDate(helper.createDate(cd.y,cd.m,days[cd.m]+1));var cal={today:{date:new Date(),calendar:helper.createCalendarDate(today.y,today.m,today.d,today.w)},current:{date:calDate,calendar:helper.createCalendarDate(cc.y,cc.m,cc.d,cc.w)},prevMonth:[],currentMonth:[],nextMonth:[]};if(pd.w!=6){for(var i=0;i<=pd.w;++i){cal.prevMonth.push(helper.createCalendarDate(pd.y,pd.m,pd.d-pd.w+i,i));};};for(var i=0;i<days[cd.m];++i){cal.currentMonth.push(helper.createCalendarDate(cd.y,cd.m,cd.d+i,((cd.w+i)%7)));};if(nd.w!=0){for(var i=0;i<=(6-nd.w);++i){cal.nextMonth.push(helper.createCalendarDate(nd.y,nd.m,nd.d+i,((nd.w+i)%7)));};};return cal;};this.UI=ui;this.setUIProvider=function(o){if(typeof(o)==="function"){calendar.UI=ui=new o();};};this.prevMonth=function(){calendar.changeMonth(-1);};this.nextMonth=function(){calendar.changeMonth(1);};this.prevYear=function(){calendar.changeYear(-1);};this.nextYear=function(){calendar.changeYear(1);};this.changeMonth=function(m){calendar.setDate(calendarControl.Helper.changeMonth(calDate,m));};this.changeYear=function(y){calendar.setDate(calendarControl.Helper.changeYear(calDate,y));};this.setDate=function(date){if(!date instanceof Date){date=new Date();};calDate=date;ui.render();};ui.setCalendar(calendar);};this.create=function(date,uiProvider){var ui=defaultUIProvider;if(typeof(uiProvider)==="function"){ui=uiProvider;};return new Calendar(date||new Date(),new ui());};this.Helper={LAST_DAY_OF_MONTH:[0,31,28,31,30,31,30,31,31,30,31,30,31],createDate:function(y,m,d){return new Date(y,m-1,d);},getRawDate:function(date){var raw={m:0,d:0,y:0,w:0};if(date instanceof Date){raw.m=date.getMonth()+1;raw.d=date.getDate();raw.y=date.getFullYear();raw.w=date.getDay();};return raw;},createCalendarDate:function(y,m,d,w){return({year:y,month:m,day:d,week:w});},changeMonth:function(date,m){var helper=calendarControl.Helper;var dt=helper.getRawDate(date);dt.m+=m;var y=Math.floor(dt.m/12);dt.m=dt.m-y*12;if(dt.m<=0){--y;dt.m+=12;};return helper.changeYear(helper.createDate(dt.y,dt.m,dt.d),y);},changeYear:function(date,y){var helper=calendarControl.Helper;var dt=helper.getRawDate(date);return helper.createDate(dt.y+y,dt.m,dt.d);},isLeapYear:function(y){return (y%400==0||y%4==0&&y%100!=0);},getMonthBeginDate:function(date){if(!(date instanceof Date)){date=new Date();};date.setDate(1);return date;}};}).registerStaticClass("Web.UI.Control.Calendar");