﻿Sys.Net.WebRequestExecutor.prototype.checkError=function(){var b=null;if(this.get_aborted()){b.Error.create("请求异常中止。",{name:"RequestAbortedError"})}else{if(this.get_timedOut()){b=Error.create("请求超时。",{name:"RequestTimeoutError"})}else{var a;try{a=this.get_statusCode()}catch(b){a=0}if(a<100||a>=600){b=Error.create("连接服务器发生异常。",{name:"ConnectionError"})}else{if(a<200||a>=300){b=Error.create("HTTP Error",{name:"HTTPError",statusCode:a,statusText:this.get_statusText()})}}}}return b};Type.registerNamespace("Simples");Simples.Random=function(){this.today=new Date();this.seed=this.today.getTime()};Simples.Random.prototype={getFloatRand:function(){this.seed=(this.seed*9301+49297)%233280;return this.seed/(233280)},getIntRand:function(a){return Math.ceil(this.getFloatRand()*a)}};Simples.Random.registerClass("Simples.Random");Simples.ImageSwitch=function(a){this.index=1;this.images=a;this.type=["ScrollIn","ScrollOut","ScrollIn","ScrollOut","FlyIn","FlyOut"];this.direction=["TopDown","LeftRight","DownTop","RightLeft","LeftRight","RightLeft"];this.animated=false;this.interval;this.loaded;this.random=new Simples.Random();this.speed=500};Simples.ImageSwitch.prototype={Preload:function(){this.loaded=true;for(var a in this.images){$.ImagePreload(this.images[a])}},SwitchAds:function(){var b=this;var a=b.index;if(b.random){a=b.random.getIntRand(7)-1}if(!b.animated){b.animated=true;$("#ads").ImageSwitch({Type:b.type[a],Direction:b.direction[a],NewImage:b.images[b.index],Speed:b.speed},function(){b.index++;if(b.index>=b.images.length){b.index=0}b.animated=false})}},StartAds:function(){if(!this.loaded){this.Preload()}this.StopAds();var a=Function.createDelegate(this,this.SwitchAds);this.interval=setInterval(a,3000)},StopAds:function(){if(this.interval){clearInterval(this.interval)}}};Simples.ImageSwitch.registerClass("Simples.ImageSwitch");Simples.Tools=function(){throw Error.notImplemented()};Simples.Tools.prototype={};Simples.Tools.getLoadingPic=function(b){if(!b){b=34}var a='<span style="font-size:0px;display:table-cell;vertical-align:middle;line-height:'+(b-2)+'px;">&nbsp;<img src="/App_Images/large-loading.gif" alt="" style="vertical-align:middle;" /></span>';var c=String.format("<div style='width:34px;height:{0}px;line-height:{0}px;margin:auto;'>{1}</div>",b,a);return c};Simples.Tools.serialize=function(b){var a=Sys.Serialization.JavaScriptSerializer;return a.serialize(b)};Simples.Tools.deserialize=function(b){try{var a=Sys.Serialization.JavaScriptSerializer;return a.deserialize(b)}catch(c){return""}};Simples.Tools.webRequest=function(c){var b=Simples.Tools.serialize(c.parameterValue);var a=new Sys.Net.WebRequest();a.set_httpVerb("POST");if((!!c.methodName)&&c.methodName!=""){a.set_url(c.url+"/"+c.methodName)}else{a.set_url(c.url)}a.set_body('{"'+c.parameterName+'":'+b+"}");a.get_headers()["Content-Length"]=b.length;a.get_headers()["Content-Type"]="application/json;charset=utf-8";a.set_userContext(c);a.add_completed(Simples.Tools.webRequestCompleted);a.invoke()};Simples.Tools.webRequestCompleted=function(e,b){var d=e.get_webRequest().get_userContext();var a=e.checkError();if(a){d.onFailedMethod(a,d.userContext,d.methodName);return}var c=Simples.Tools.deserialize(e.get_responseData());if(c.d){c=c.d}d.onSuccessMethod(c,d.userContext,d.methodName)};Simples.Tools.registerClass("Simples.Tools");Simples.RotatorPic=function(a){Simples.RotatorPic.initializeBase(this,[a]);this._adWidth=0;this._adHeight=0;this._textHeight=0;this._swfHeight=0;this._swfContent="";this._adClassID=0;this._adAmount=0;this._focusNo=1};Simples.RotatorPic.prototype={initialize:function(){Simples.RotatorPic.callBaseMethod(this,"initialize");this._swfHeight=this._adHeight+this._textHeight;this._loadPic()},dispose:function(){Simples.RotatorPic.callBaseMethod(this,"dispose")},_loadPic:function(){IGeneralService.GetBannerAD([this._adClassID,this._adAmount],this._onSuccessMethod,this._onFailedMethod,this)},_onSuccessMethod:function(a,c,b){c.swfContent=new Sys.StringBuilder();c.swfContent.append('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+c._adWidth+'" height="'+c._swfHeight+'">');c.swfContent.append('<param name="allowScriptAccess" value="sameDomain">');c.swfContent.append('<param name="movie" value="/App_Images/focus'+c._focusNo+'.swf">');c.swfContent.append('<param name="quality" value="high">');c.swfContent.append('<param name="bgcolor" value="#F0F0F0">');c.swfContent.append('<param name="menu" value="false">');c.swfContent.append('<param name=wmode value="opaque">');c.swfContent.append('<param name="FlashVars" value="pics='+a[1]+"&links="+a[2]+"&texts="+a[0]+"&borderwidth="+c._adWidth+"&borderheight="+c._adHeight+"&textheight="+c._textHeight+'">');c.swfContent.append('<embed src="/App_Images/focus'+c._focusNo+'.swf" FlashVars="pics='+a[1]+"&links="+a[2]+"&texts="+a[0]+"&pic_width="+c._adWidth+"&pic_height="+c._adHeight+' quality="high" width="'+c._adWidth+'" height="'+c._swfHeight+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');c.swfContent.append("</object>");c.get_element().innerHTML=c.swfContent.toString()},_onFailedMethod:function(c,b,a){b.get_element().innerHTML=String.format('<div style="margin:auto;margin-top:{0}px;">{1}</div>',b.swfHeight/2-15,c.get_message())},get_adWidth:function(){return this._adWidth},set_adWidth:function(a){this._adWidth=a},get_adHeight:function(){return this._adHeight},set_adHeight:function(a){this._adHeight=a},get_textHeight:function(){return this._textHeight},set_textHeight:function(a){this._textHeight=a},get_adClassID:function(){return this._adClassID},set_adClassID:function(a){this._adClassID=a},get_adAmount:function(){return this._adAmount},set_adAmount:function(a){this._adAmount=a},get_focusNo:function(){return this._focusNo},set_focusNo:function(a){this._focusNo=a}};Simples.RotatorPic.registerClass("Simples.RotatorPic",Sys.UI.Control);Simples.Scroll=function(a){Simples.Scroll.initializeBase(this,[a]);this._isStart=true;this._speed=50;this._step=1;this._direction="up";this._interval=""};Simples.Scroll.prototype={initialize:function(){Simples.Scroll.callBaseMethod(this,"initialize");$addHandlers(this.get_element(),{mouseover:this.stop,mouseout:this.start},this);this._temp;this._scrollDiv=$(this.get_element()).find("div:first");if((!!this._scrollDiv)&&this._scrollDiv.css("display")=="none"){var a=this._scrollDiv.width();if(typeof(a)=="number"){this._scrollDiv.css({width:a,"margin-right":"100px",overflow:"hidden"}).show()}}this._scrollElementDiv=$(this.get_element());this._scrollElementDiv.css({position:"relative",overflow:"hidden"});this._scrollElementTable=this._scrollElementDiv.find(">table");this._scrollElementTable.css({position:"relative","border-spacing":"0px","border-collapse":"collapse"});this._scrollElementTd=this._scrollElementTable.find("td:first");this._bounds=Sys.UI.DomElement.getBounds(this.get_element());this._scrollElementBounds=Sys.UI.DomElement.getBounds(this._scrollElementTable[0]);if(this._direction=="up"||this._direction=="down"){this.y=Math.ceil(this._bounds.height/this._scrollElementBounds.height);if(this.y==Number.POSITIVE_INFINITY){return}for(this._i=0;this._i<this.y;this._i++){this._scrollElementDiv.append(this._scrollElementTable.clone())}}else{if(this._direction=="left"||this._direction=="right"){this._scrollElementTd.css("white-space","nowrap");this.x=Math.ceil(this._bounds.width/this._scrollElementBounds.width);if(this.x==Number.POSITIVE_INFINITY){return}for(this._i=0;this._i<this.x;this._i++){this._scrollElementTd.parent().append(this._scrollElementTd.clone())}this._scrollElementTable.css("width",this._scrollElementBounds.width*(this.x+1)+"px")}}this._scrollDelegate=Function.createDelegate(this,this.scroll);this.start()},dispose:function(){$clearHandlers(this.get_element());Simples.Scroll.callBaseMethod(this,"dispose")},start:function(){this._interval=setInterval(this._scrollDelegate,this._speed)},stop:function(){clearInterval(this._interval)},scroll:function(){switch(this._direction){case"up":if(this._scrollElementDiv.scrollTop()>=this._scrollElementBounds.height){this._scrollElementDiv.scrollTop(0)}else{this._temp=this._scrollElementDiv.scrollTop();this._temp+=this._step;this._scrollElementDiv.scrollTop(this._temp)}break;case"down":if(this._scrollElementDiv.scrollTop()<=0){this._scrollElementDiv.scrollTop(this._scrollElementBounds.height)}else{this._temp=this._scrollElementDiv.scrollTop();this._temp-=this._step;this._scrollElementDiv.scrollTop(this._temp)}break;case"left":if(this._scrollElementDiv.scrollLeft()>=this._scrollElementBounds.width){this._scrollElementDiv.scrollLeft(0)}else{this._temp=this._scrollElementDiv.scrollLeft();this._temp+=this._step;this._scrollElementDiv.scrollLeft(this._temp)}break;case"right":if(this._scrollElementDiv.scrollLeft()<=0){this._scrollElementDiv.scrollLeft(this._scrollElementBounds.width)}else{this._temp=this._scrollElementDiv.scrollLeft();this._temp-=this._step;this._scrollElementDiv.scrollLeft(this._temp)}break;default:break}},get_direction:function(){return this._direction},set_direction:function(a){this._direction=a},get_speed:function(){return this._speed},set_speed:function(a){this._speed=a},get_step:function(){return this._step},set_step:function(a){this._step=a}};Simples.Scroll.registerClass("Simples.Scroll",Sys.UI.Control);Simples.ShowTab=function(a){Simples.ShowTab.initializeBase(this,[a]);this._topClass="";this._bottomClass="";this._eventName="click";this._defaultIndex=0;this.changeTabCallback=Function.createCallback(this.changeTab,this)};Simples.ShowTab.prototype={initialize:function(){Simples.ShowTab.callBaseMethod(this,"initialize");this._ulCss="myTabs";this._liCssNormal="tabsNormal";this._liCssSelected="tabsSelected";this._panelHide="tabsPanelHide";this._panelShow="tabsPanelShow";this._divElement=$(this.get_element());this._divElement.find("ul").addClass(this._ulCss);this._liElements=this._divElement.find(this._topClass+'>ul>li:has(a[href^="#"])');this._panelElements=this._divElement.find(this._bottomClass+">div");this._divElement=null;this._liElements.addClass(this._liCssNormal).slice(this._defaultIndex,this._defaultIndex+1).removeClass().addClass(this._liCssSelected);this._panelElements.addClass(this._panelHide).slice(this._defaultIndex,this._defaultIndex+1).removeClass().addClass(this._panelShow);this._liElements.each(function(a){$addHandler(this,a._eventName,a.changeTabCallback)},[this]);this.raise_changeCompleted("changeCompleted",this._defaultIndex)},dispose:function(){this._liElements.each(function(a){$removeHandler(this,a._eventName,a.changeTabCallback)},[this]);this.changeTabCallback=null;Simples.ShowTab.callBaseMethod(this,"dispose")},changeTab:function(b,a){b.preventDefault();a._defaultIndex=a._liElements.index(this);a._liElements.removeClass().addClass(a._liCssNormal).slice(a._defaultIndex,a._defaultIndex+1).removeClass().addClass(a._liCssSelected);a._panelElements.removeClass().addClass(a._panelHide).slice(a._defaultIndex,a._defaultIndex+1).removeClass().addClass(a._panelShow);a.raise_changeCompleted("changeCompleted",a._defaultIndex)},add_changeCompleted:function(a){this.get_events().addHandler("changeCompleted",a)},remove_changeCompleted:function(a){this.get_events().removeHandler("changeCompleted",a)},raise_changeCompleted:function(b,a){this.tempHandler=this.get_events().getHandler(b);if(this.tempHandler){this.tempHandler(this,a)}},get_eventName:function(){return this._eventName},set_eventName:function(a){this._eventName=a},get_defaultIndex:function(){return this._defaultIndex},set_defaultIndex:function(a){this._defaultIndex=a},get_topClass:function(){return this._topClass},set_topClass:function(a){this._topClass=a},get_bottomClass:function(){return this._bottomClass},set_bottomClass:function(a){this._bottomClass=a}};Simples.ShowTab.registerClass("Simples.ShowTab",Sys.UI.Control);Simples.ListNews=function(){Simples.ListNews.initializeBase(this);this.classID=10000;this.className="";this.showNumber=20;this.textWidth=34;this.isChild=false;this.moreText="";this.moreUrl="";this.moreCss="";this.imageUrl="";this.titleClass="";this.titleCurClass="";this.tableStyle="";this.tableCss="";this.target="_blank";this.repeaterColumn="1";this.todayColor="#FF0000";this.timeFormat="MM-dd HH:mm";this.width=0;this.height=0;this.url="/Services/NewsService.svc";this.methodName="GetListNews";this.parameterName="Arr";this.arr=[]};Simples.ListNews.prototype={initialize:function(){Simples.ListNews.callBaseMethod(this,"initialize")},dispose:function(){Simples.ListNews.callBaseMethod(this,"dispose")},getListNews:function(a,d){if(!("classID" in d)){d.classID=this.classID}if(!("className" in d)){d.className=this.className}var c=d.className+"_"+d.classID;if(this.arr[c]){return}if(!("showNumber" in d)){d.showNumber=this.showNumber}if(!("textWidth" in d)){d.textWidth=this.textWidth}if(!("isChild" in d)){d.isChild=this.isChild}if(!("moreText" in d)){d.moreText=this.moreText}if(!("moreUrl" in d)){d.moreUrl=this.moreUrl}if(!("moreCss" in d)){d.moreCss=this.moreCss}if(!("imageUrl" in d)){d.imageUrl=this.imageUrl}if(!("titleClass" in d)){d.titleClass=this.titleClass}if(!("titleCurClass" in d)){d.titleCurClass=this.titleCurClass}if(!("tableStyle" in d)){d.tableStyle=this.tableStyle}if(!("tableCss" in d)){d.tableCss=this.tableCss}if(!("target" in d)){d.target=this.target}if(!("repeaterColumn" in d)){d.repeaterColumn=this.repeaterColumn}if(!("todayColor" in d)){d.todayColor=this.todayColor}if(!("timeFormat" in d)){d.timeFormat=this.timeFormat}if(!("width" in d)){d.width=this.width}if(!("height" in d)){d.height=this.height}var b={};b.url=this.url;b.methodName=this.methodName;b.userContext={uniqueID:c,element:a,arr:this.arr};b.onSuccessMethod=this._onSuccessMethod;b.onFailedMethod=this._onFailedMethod;b.parameterName=this.parameterName;b.parameterValue=[d.classID,d.className,d.showNumber,d.textWidth,d.isChild,d.moreText,d.moreUrl,d.moreCss,d.imageUrl,d.titleClass,d.titleCurClass,d.tableStyle,d.tableCss,d.target,d.repeaterColumn,d.todayColor,d.timeFormat,d.width,d.height];$(a).html("").append($(Simples.Tools.getLoadingPic($(a).height())));Simples.Tools.webRequest(b)},_onSuccessMethod:function(a,c,b){c.element.innerHTML=a;c.arr[c.uniqueID]=true},_onFailedMethod:function(c,b,a){b.element.innerHTML=c.message}};Simples.ListNews.registerClass("Simples.ListNews",Sys.Component);Simples.ShowrankTab=function(f,b,d,e,c,a){this._delayID=0;this._delayTime=f?f:0;this._defaultClass=b?b:"defaultClass";this._currentClass=d?d:"currentClass";this._defaultBodyClass=e?e:"";this._currentBodyClass=c?c:"";this._bodyElementName=a?a:"tabBody";this._changeCompleted=null;this._element};Simples.ShowrankTab.prototype={delayTab:function(a){this._element=a;this._delayID=window.setTimeout(Function.createDelegate(this,this.executeTab),this._delayTime)},executeTab:function(){if(!$(this._element).hasClass(this._currentClass)){var a=this._element.id.split("_");var b=null;$(String.format("{0}[id^='{1}_{2}']",this._element.tagName,a[0],a[1])).removeClass().addClass(this._defaultClass).filter(String.format("[id='{0}']",this._element.id)).removeClass().addClass(this._currentClass);if(this._defaultBodyClass==""&&this._currentBodyClass==""){b=$(String.format("div[id^='{0}_{1}']",this._bodyElementName,a[1])).hide().filter(String.format("[id='{0}_{1}_{2}']",this._bodyElementName,a[1],a[2])).show()}else{b=$(String.format("div[id^='{0}_{1}']",this._bodyElementName,a[1])).removeClass().addClass(this._defaultBodyClass).filter(String.format("[id='{0}_{1}_{2}']",this._bodyElementName,a[1],a[2])).removeClass().addClass(this._currentBodyClass)}if(b.length==1){if(this._changeCompleted){this._changeCompleted(b[0])}}}},clear:function(){window.clearInterval(this._delayID)}};Simples.ShowrankTab.registerClass("Simples.ShowrankTab");