﻿Function.prototype.createDelegate=function(obj,args,appendArgs){var method=this;return function(){var callArgs=args||arguments;if(appendArgs===true){callArgs=Array.prototype.slice.call(arguments,0);callArgs=callArgs.concat(args);}else if(typeof appendArgs=="number"){callArgs=Array.prototype.slice.call(arguments,0);var applyArgs=[appendArgs,0].concat(args);Array.prototype.splice.apply(callArgs,applyArgs);};return method.apply(obj||window,callArgs);};};var EWS={};EWS.LenB=function(str){return str.replace(/[^\x00-\xff]/g,"**").length;};EWS.MidB=function(str,start,len){var newstr='';if(str==undefined){return newstr;};if(start==undefined){return str;};if(len==undefined){len=EWS.LenB(str);};var total=str.length;var end=0;var currAmount=0;var regular=/[^\x00-\xff]/;for(var i=0;i<total;i++){currAmount++;var temp=str.substring(i,i+1);if(regular.test(temp)){end+=2;}else{end++;};if(end>=len){break;};};return str.substring(0,currAmount);};EWS.applyTemplate=function(str,obj){var arr=str.match(/\{(\w*)\}/g);if(arr!=null){for(var i=0,len=arr.length;i<len;i++){var t=arr[i].replace("{","");t=t.replace("}","");str=str.replace(arr[i],obj[t]);};return str;}else{return str;};};function LogoPng24Fix(){if($.browser.msie){var version=$.browser.version;if(version==6.0){var img=$('#logo img');if(img.length==0){return;}var imgTarget=img[0];var ImgObj=new Image();ImgObj.src=imgTarget.src;var fun=function(ImgObj){if(imgTarget.src.match(/\.png$/i)!=null){var url=window.location.href;if(url.match(/\.local/i)!=null){url='http://www1.khews.local/theme/global/style/img/apalt.gif';}else{url='http://www1.khews.com/theme/global/style/img/apalt.gif';}imgTarget.style.cssText='width:'+ImgObj.width+'px;height:'+ImgObj.height+'px;background:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+imgTarget.src+'",sizingMethod="crop");';imgTarget.src=url;}};if(ImgObj.readyState=="complete"){fun(ImgObj);}ImgObj.onreadystatechange=function(){if(this.readyState=="complete"){fun(ImgObj);}};}}};$(document).ready(LogoPng24Fix);var menuIndex=0;function menuTurn(way,menuCount,n){if(menuCount<=n){return;};if(way==0){var index=menuIndex-1;}else if(way==1){var index=menuIndex+1;};if(menuCount-index>=n&&index>=0){menuIndex=index;var dis,cls;for(var i=0;i<menuCount;i++){if(i>=menuIndex&&i<(menuIndex+n)){dis='';}else{dis='none';};if(i==(menuIndex+n-1)){cls='last';}else{cls='';};var menu_lv1=document.getElementById('ewsmenuList_'+i);menu_lv1.style.display=dis;menu_lv1.className=cls;for(var j=0;1==1;j++){var menu_lv2=document.getElementById('ewsmenuList_'+i+'_'+j);if(!menu_lv2){break;};if(menu_lv2.getElementsByTagName('ul').length){if((i+2-menuIndex)>=n){menu_lv2.className=j==0?'left first':(!document.getElementById('ewsmenuList_'+i+'_'+(j+1))?'left last':'left');}else{menu_lv2.className=j==0?'right first':(!document.getElementById('ewsmenuList_'+i+'_'+(j+1))?'right last':'right');};menu_lv2.getElementsByTagName('li')[0].className='first';}else{menu_lv2.className=j==0?'first':(!document.getElementById('ewsmenuList_'+i+'_'+(j+1))?'last':'');};};};};};function sideMenuLoad(id,selectId){var str='';var position='<p>当前位置 : 首页 >> ';for(var i=0;i<sideMenuData.length;i++){if(sideMenuData[i].ID==id){str="<h3 id='sideMenu_1'>"+sideMenuData[i].label+"</h3><div class='rank_a'><ul id='sideMenu_2'>";position+=sideMenuData[i].label;var menu2=sideMenuData[i].children;var str2='';var position2='';var menu2_len=menu2.length;for(var j=0;j<menu2_len;j++){var menu3=menu2[j].children;if(menu2[j].ID==selectId){position2=' >> '+menu2[j].label;};if(menu3.length>0){if(menu2[j].ID==selectId){dis='';}else{dis='none';};var menu_cls='alt';if(j==0){var menu_cls='first alt';};if(j==menu2_len-1){var menu_cls='last alt';};if(menu2[j].IsLink==0){var href=menu2[j].ID+'.shtml';}else{var href=menu2[j].LinkPath;};str2+="<li class='"+menu_cls+"'><a href='"+href+"'>"+menu2[j].label+"</a>";var str3='';var menu3_len=menu3.length;for(var k=0;k<menu3_len;k++){if(menu3[k].ID==selectId){dis='';position2=' >> '+menu2[j].label+' >> '+menu3[k].label;};var menu_cls='';if(k==0){var menu_cls='first';};if(k==menu3_len-1){var menu_cls='last';};if(menu3[k].IsLink==0){var href=menu3[k].ID+'.shtml';}else{var href=menu3[k].LinkPath;};str3+="<li class='"+menu_cls+"'><a href='"+href+"'>"+menu3[k].label+"</a></li>";};str2+='<a class="status" href="javascript:void(0);" onclick="sideMenuExpand('+"'"+'menu2_'+j+"'"+')" ></a><div id="menu2_'+j+'" class="rank_b" style="display:'+dis+'"><ul>';str2=str2+str3+"</ul></div></li>";}else{var menu_cls='';if(j==0){var menu_cls='first';};if(j==menu2_len-1){var menu_cls='last';};if(menu2[j].IsLink==0){var href=menu2[j].ID+'.shtml';}else{var href=menu2[j].LinkPath;};str2+="<li class='"+menu_cls+"'><a href='"+href+"'>"+menu2[j].label+"</a></li>";};};str=str+str2+"</ul></div>";break;};};position=position+position2+'</p>';if(document.getElementById('position')){document.getElementById('position').innerHTML=position;};return str;};function sideMenuExpand(clickId){var sideMenu_2=document.getElementById('sideMenu_2');var disDiv=sideMenu_2.getElementsByTagName('div');for(var i=0;i<disDiv.length;i++){disDiv[i].style.display='none';};document.getElementById(clickId).style.display='';};function slidePlayer_load(width,height){var imgs=document.getElementById('slidePlayer').getElementsByTagName('img');var divs=document.getElementById('slidePlayer').getElementsByTagName('div');for(var i=0;i<imgs.length;i++){var w=imgs[i].width;var h=imgs[i].height;var wMatch=width-w;var hMatch=height-h;if(wMatch<0||hMatch<0){if(wMatch<hMatch){imgs[i].width=width;imgs[i].height=h*width/w;}else{imgs[i].height=height;imgs[i].width=w*height/h;}}divs[i].style.width=width+'px';divs[i].style.height=height+'px';}var marquee1=new Marquee('slidePlayer');marquee1.Direction='top';marquee1.Step=10;marquee1.Width=width;marquee1.Height=height;marquee1.Timer=50;marquee1.DelayTime=5000;marquee1.WaitTime=3000;marquee1.ScrollStep=height;marquee1.Start();}function Marquee(){this.ID=document.getElementById(arguments[0]);if(!this.ID){alert("您要设置的\""+arguments[0]+"\"初始化错误\r\n请检查标签ID设置是否正确!");this.ID=-1;return;};this.Direction=this.Width=this.Height=this.DelayTime=this.WaitTime=this.Correct=this.CTL=this.StartID=this.Stop=this.MouseOver=0;this.Step=1;this.Timer=30;this.DirectionArray={"top":0,"bottom":1,"left":2,"right":3};if(typeof arguments[1]=="number"||typeof arguments[1]=="string")this.Direction=arguments[1];if(typeof arguments[2]=="number")this.Step=arguments[2];if(typeof arguments[3]=="number")this.Width=arguments[3];if(typeof arguments[4]=="number")this.Height=arguments[4];if(typeof arguments[5]=="number")this.Timer=arguments[5];if(typeof arguments[6]=="number")this.DelayTime=arguments[6];if(typeof arguments[7]=="number")this.WaitTime=arguments[7];if(typeof arguments[8]=="number")this.ScrollStep=arguments[8];this.ID.style.overflow=this.ID.style.overflowX=this.ID.style.overflowY="hidden";this.ID.noWrap=true;this.IsNotOpera=(navigator.userAgent.toLowerCase().indexOf("opera")==-1);if(arguments.length>=7)this.Start();};Marquee.prototype.Start=function(){if(this.ID==-1)return;if(this.WaitTime<800)this.WaitTime=800;if(this.Timer<20)this.Timer=20;if(this.Width==0)this.Width=parseInt(this.ID.style.width);if(this.Height==0)this.Height=parseInt(this.ID.style.height);if(typeof this.Direction=="string")this.Direction=this.DirectionArray[this.Direction.toString().toLowerCase()];this.HalfWidth=Math.round(this.Width/2);this.HalfHeight=Math.round(this.Height/2);this.BakStep=this.Step;this.ID.style.width=this.Width+"px";this.ID.style.height=this.Height+"px";if(typeof this.ScrollStep!="number")this.ScrollStep=this.Direction>1?this.Width:this.Height;var msobj=this;var timer=this.Timer;var delaytime=this.DelayTime;var waittime=this.WaitTime;msobj.StartID=function(){msobj.Scroll()};msobj.Continue=function(){if(msobj.MouseOver==1){setTimeout(msobj.Continue,delaytime);}else{clearInterval(msobj.TimerID);msobj.CTL=msobj.Stop=0;msobj.TimerID=setInterval(msobj.StartID,timer);}};msobj.Pause=function(){msobj.Stop=1;clearInterval(msobj.TimerID);setTimeout(msobj.Continue,delaytime);};msobj.Begin=function(){msobj.ClientScroll=msobj.Direction>1?msobj.ID.scrollWidth:msobj.ID.scrollHeight;if((msobj.Direction<=1&&msobj.ClientScroll<=msobj.Height+msobj.Step)||(msobj.Direction>1&&msobj.ClientScroll<=msobj.Width+msobj.Step))return;msobj.ID.innerHTML+=msobj.ID.innerHTML;msobj.TimerID=setInterval(msobj.StartID,timer);if(msobj.ScrollStep<0)return;msobj.ID.onmousemove=function(event){if(msobj.ScrollStep==0&&msobj.Direction>1){var event=event||window.event;if(window.event){if(msobj.IsNotOpera){msobj.EventLeft=event.srcElement.id==msobj.ID.id?event.offsetX-msobj.ID.scrollLeft:event.srcElement.offsetLeft-msobj.ID.scrollLeft+event.offsetX;}else{msobj.ScrollStep=null;return;}}else{msobj.EventLeft=event.layerX-msobj.ID.scrollLeft;}msobj.Direction=msobj.EventLeft>msobj.HalfWidth?3:2;msobj.AbsCenter=Math.abs(msobj.HalfWidth-msobj.EventLeft);msobj.Step=Math.round(msobj.AbsCenter*(msobj.BakStep*2)/msobj.HalfWidth);}};msobj.ID.onmouseover=function(){if(msobj.ScrollStep==0)return;msobj.MouseOver=1;clearInterval(msobj.TimerID);};msobj.ID.onmouseout=function(){if(msobj.ScrollStep==0){if(msobj.Step==0)msobj.Step=1;return;}msobj.MouseOver=0;if(msobj.Stop==0){clearInterval(msobj.TimerID);msobj.TimerID=setInterval(msobj.StartID,timer);}};};setTimeout(msobj.Begin,waittime);};Marquee.prototype.Scroll=function(){switch(this.Direction){case 0:this.CTL+=this.Step;if(this.CTL>=this.ScrollStep&&this.DelayTime>0){this.ID.scrollTop+=this.ScrollStep+this.Step-this.CTL;this.Pause();return;}else{if(this.ID.scrollTop>=this.ClientScroll){this.ID.scrollTop-=this.ClientScroll;}this.ID.scrollTop+=this.Step;}break;case 1:this.CTL+=this.Step;if(this.CTL>=this.ScrollStep&&this.DelayTime>0){this.ID.scrollTop-=this.ScrollStep+this.Step-this.CTL;this.Pause();return;}else{if(this.ID.scrollTop<=0){this.ID.scrollTop+=this.ClientScroll;}this.ID.scrollTop-=this.Step;}break;case 2:this.CTL+=this.Step;if(this.CTL>=this.ScrollStep&&this.DelayTime>0){this.ID.scrollLeft+=this.ScrollStep+this.Step-this.CTL;this.Pause();return;}else{if(this.ID.scrollLeft>=this.ClientScroll){this.ID.scrollLeft-=this.ClientScroll;}this.ID.scrollLeft+=this.Step;}break;case 3:this.CTL+=this.Step;if(this.CTL>=this.ScrollStep&&this.DelayTime>0){this.ID.scrollLeft-=this.ScrollStep+this.Step-this.CTL;this.Pause();return;}else{if(this.ID.scrollLeft<=0){this.ID.scrollLeft+=this.ClientScroll;}this.ID.scrollLeft-=this.Step;}break;}};function PicAD_CLS(){var _this=this;this.main=function(){this.PicList=document.getElementById('IndexPicList');this.PicListEls=this.PicList.getElementsByTagName('img');this.index=0;this.intervalFN();this.timeID=setInterval(function(){_this.intervalFN();},2500);};this.intervalFN=function(){for(var index=0;index<this.PicListEls.length;index++){if(this.index%this.PicListEls.length==index){this.PicListEls[index].style.display="";}else{this.PicListEls[index].style.display="none";};};this.index++;};};function UpdateWebMenu(){var loca=window.location.toString();var pattern=/^http:\/\/(\w*\.*\w*\.*\w*\.*\w*)\//;var len=loca.lastIndexOf("/");var lk=loca.substring(0,len).replace('http://','');var MenuA=document.getElementsByName('ewsmenu_link');var MenuA_len=MenuA.length;for(var i=0;i<MenuA_len;i++){if(MenuA[i].href.indexOf('ewsscene.cfm')>-1){MenuA[i].href+='&lk='+lk;break;};};var menuLink=document.getElementsByName('ewsmenu_link');var menu_len=menuLink.length;var li=document.getElementById('menuContent').childNodes;var li_len=li.length;var timeID;for(var i=0;i<menu_len;i++){menuLink[i].onmouseover=function(){clearTimeout(timeID);for(var x=0;x<li_len;x++){if(li[x].className!=""){li[x].className="";};};if(this.parentNode.id){var idArr=this.parentNode.id.split("_");}else{var id=this.parentNode.parentNode.parentNode.id;if(id==""){id=this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;};var idArr=id.split("_");};if(idArr.length>=3){idArr.splice(2,1);};var newID=idArr.join("_");document.getElementById(newID).className="status";};menuLink[i].onmouseout=function(){var _this=this;timeID=setTimeout(function(){if(_this.parentNode.id){var idArr=_this.parentNode.id.split("_");}else{var id=_this.parentNode.parentNode.parentNode.id;if(id==""){id=_this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;};var idArr=id.split("_");};if(idArr.length>=3){idArr.splice(2,1);};var newID=idArr.join("_");document.getElementById(newID).className="";},300);};};};function getParam(name){var winParam=window.location.href.split("?");if(winParam.length>1){var urlParam=winParam[1].split('&');var urlLength=urlParam.length;for(var i=0;i<urlLength;i++){if(urlParam[i].indexOf(name+"=")>-1){return urlParam[i].split("=")[1];};};};return'';};EWS.PreLoadImage=function(arg){var IE=$.browser.msie;var Opera=$.browser.opera;var FF=$.browser.mozilla||$.browser.safari;this.ImgPath=arg.path==undefined?"":arg.path;this.Length=arg.arrSrc.length;this.LoadedLen=0;var self=this;if(self.Length<1){if(arg.callBack){if(arg.scope!=undefined){arg.callBack.call(arg.scope,arg.arrSrc);}else{arg.callBack(arg.arrSrc);};};return;};if(Opera){for(var i=0;i<self.Length;i++){var tmpImg=new Image();tmpImg.src=this.ImgPath+arg.arrSrc[i];tmpImg.onload=function(){self.ProcessImg(this.id,this.width,this.height);self.LoadedLen++;if(arg.success){if(arg.scope!=undefined){arg.success.call(arg.scope,arg.arrSrc);}else{arg.success(arg.arrSrc);};};if(self.LoadedLen==self.Length&&arg.complete){if(arg.scope!=undefined){arg.complete.call(arg.scope,arg.arrSrc);}else{arg.complete(arg.arrSrc);};};};tmpImg.onerror=function(){self.LoadedLen++;if(arg.error){if(arg.scope!=undefined){arg.error.call(arg.scope,arg.arrSrc);}else{arg.error(arg.arrSrc);};};if(self.LoadedLen==self.Length&&arg.complete){if(arg.scope!=undefined){arg.complete.call(arg.scope,arg.arrSrc);}else{arg.complete(arg.arrSrc);};};};};return;};this.CalculateScale=function(num1,num2){var Temp=num2/num1;if(Temp.length>1){return num2;}else{return parseFloat(Temp.toString().substring(0,4));};};this.ProcessImg=function(id,w,h){var img=document.getElementById(id);if(img==undefined){return;};img.src=self.ImgPath+arg.arrSrc[self.LoadedLen].src;if(img.className=="noimage"){img.className="";};if(arg.maxWidth==undefined&&arg.maxHeight==undefined){img.width=w;img.height=h;}else{if(arg.maxWidth==arg.maxHeight){if(w>h){var wScale=self.CalculateScale(w,arg.maxWidth);if(wScale<=1){newWidth=arg.maxWidth;newHeight=wScale*h;}else{newHeight=w;newWidth=h;}}else if(w<h){var hScale=self.CalculateScale(h,arg.maxHeight);if(hScale<=1){newHeight=arg.maxHeight;newWidth=hScale*w;}else{newHeight=h;newWidth=w;}}else{var wScale=self.CalculateScale(w,arg.maxWidth);if(wScale<=1){newHeight=w*wScale;newWidth=newHeight;}else{newHeight=w;newWidth=newHeight;}}}else if(arg.maxWidth>arg.maxHeight){if(w>h){var wScale=self.CalculateScale(w,arg.maxWidth);if(wScale<=1){if(h*wScale>arg.maxHeight){newHeight=arg.maxHeight;newWidth=self.CalculateScale(h,arg.maxHeight)*w;}else{newWidth=arg.maxWidth;newHeight=h*wScale;}}else{newWidth=w;newHeight=h;}}else if(w==h){var wScale=self.CalculateScale(w,arg.maxWidth);if(wScale<=1){newHeight=arg.maxHeight;newWidth=self.CalculateScale(h,arg.maxHeight)*w;}else{if(h>arg.maxHeight){newWidth=self.CalculateScale(h,arg.maxHeight)*w;newHeight=self.CalculateScale(h,arg.maxHeight)*h;}else{newWidth=w;newHeight=h;}}}else{var hScale=self.CalculateScale(h,arg.maxHeight);if(hScale<=1){if(hScale*w>arg.maxWidth){newWidth=arg.maxWidth;newHeight=self.CalculateScale(w,arg.maxWidth)*h;}else{newWidth=hScale*w;newHeight=arg.maxHeight;}}else{newWidth=w;newHeight=h;}}}else{if(w>=h){var wScale=self.CalculateScale(w,arg.maxWidth);if(wScale<=1){newWidth=wScale*w;newHeight=wScale*h;}else{newWidth=w;newHeight=h;}}else if(w<h){var hScale=self.CalculateScale(h,arg.maxHeight);if(hScale*w>arg.maxWidth){newWidth=arg.maxWidth;newHeight=self.CalculateScale(w,arg.maxWidth)*h;}else{newWidth=w*hScale;newHeight=h*hScale;}}}img.width=newWidth;img.height=newHeight;};};this.Loaded=function(img){self.LoadedLen++;if(arg.success){if(arg.scope!=undefined){arg.success.call(arg.scope,img);}else{arg.success(img);};};if(self.LoadedLen<self.Length){self.DownImg();}else{if(arg.complete){if(arg.scope!=undefined){arg.complete.call(arg.scope,arg.arrSrc);}else{arg.complete(arg.arrSrc);};};};};this.LoadError=function(img){self.LoadedLen++;if(arg.error){if(arg.scope!=undefined){arg.error.call(arg.scope,img);}else{arg.error(img);};};if(self.LoadedLen<self.Length){self.DownImg();}else{if(arg.complete){if(arg.scope!=undefined){arg.complete.call(arg.scope,arg.arrSrc);}else{arg.complete(arg.arrSrc);};};};};this.DownImg=function(){var tmpImg=new Image();tmpImg.id=arg.arrSrc[self.LoadedLen].id;tmpImg.src=self.ImgPath+arg.arrSrc[self.LoadedLen].src;var options={id:tmpImg.id,src:tmpImg.src,index:self.LoadedLen};if(IE){if(tmpImg.readyState=="complete"){options.width=tmpImg.width;options.height=tmpImg.height;self.ProcessImg(tmpImg.id,tmpImg.width,tmpImg.height);self.Loaded(options);}else{tmpImg.onreadystatechange=function(){if(this.readyState=="complete"){options.width=this.width;options.height=this.height;self.ProcessImg(this.id,this.width,this.height);self.Loaded(options);};};};}else{tmpImg.onload=function(){options.width=this.width;options.height=this.height;self.ProcessImg(this.id,this.width,this.height);self.Loaded(options);};};tmpImg.onerror=function(){self.LoadError(options);};};this.DownImg();};EWS.getCataLog=function(){var val=getParam('catName');if(val){val=val.split(',');};return val;};EWS.Anchor=function(){var _getLocation=function(){return window.location.href;};var _getAnchor=function(){var loc=_getLocation();var pos=loc.indexOf("#");if(pos==-1){return null;};var anchor=loc.substring(pos+1);if(anchor.length==0){return null;};return anchor.split("&");};return{set:function(name,value){if(name==""){return false;};var arrAnchor=_getAnchor();var loc=_getLocation();var pos=loc.indexOf("#");var href=loc.substring(0,pos);if(arrAnchor==null){window.location=href+"#"+name+"="+value;return false;};var result=false;$.each(arrAnchor,function(i,v){if(v.indexOf(name+"=")>-1){result=true;arrAnchor[i]=name+"="+value;return false;};});if(result==false){arrAnchor.push(name+"="+value);};window.location=href+"#"+arrAnchor.join("&");return result;},get:function(name){var arrAnchor=_getAnchor();if(arrAnchor==null){return null;};var result=null;$.each(arrAnchor,function(i,v){if(v.indexOf(name+"=")>-1){result=v.split("=")[1];return false;};});return result;},remove:function(name){if(name==""){return false;};var arrAnchor=_getAnchor();if(arrAnchor==null){return false;};var result=false;var newArr=$.grep(arrAnchor,function(n,i){if(n.indexOf(name+"=")>-1){result=true;return false;}else{return true;};});if(result){var loc=_getLocation();var pos=loc.indexOf("#");var href=loc.substring(0,pos);window.location=href+"#"+newArr.join("&");};return result;}};}();EWS.GetPageSize=function(){var scrW,scrH;if(window.innerHeight&&window.scrollMaxY){scrW=window.innerWidth+window.scrollMaxX;scrH=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){scrW=document.body.scrollWidth;scrH=document.body.scrollHeight;}else if(document.body){scrW=document.body.offsetWidth;scrH=document.body.offsetHeight;};var winW,winH;if(window.innerHeight){winW=window.innerWidth;winH=window.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){winW=document.documentElement.clientWidth;winH=document.documentElement.clientHeight;}else if(document.body){winW=document.body.clientWidth;winH=document.body.clientHeight;};var pageW=(scrW<winW)?winW:scrW;var pageH=(scrH<winH)?winH:scrH;return{PageW:pageW,PageH:pageH,WinW:winW,WinH:winH};};EWS.GetPageScroll=function(){var x,y;if(window.pageYOffset){y=window.pageYOffset;x=window.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){y=document.documentElement.scrollTop;x=document.documentElement.scrollLeft;}else if(document.body){y=document.body.scrollTop;x=document.body.scrollLeft;};return{X:x,Y:y};};jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;};var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;};expires='; expires='+date.toUTCString();};var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;};};};return cookieValue;};};(function($){function toIntegersAtLease(n){return n<10?'0'+n:n;}Date.prototype.toJSON=function(date){return this.getUTCFullYear()+'-'+toIntegersAtLease(this.getUTCMonth())+'-'+toIntegersAtLease(this.getUTCDate());};var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};$.quoteString=function(string){if(escapeable.test(string)){return'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==='string'){return c;}c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}return'"'+string+'"';};$.toJSON=function(o,compact){var type=typeof(o);if(type=="undefined")return"undefined";else if(type=="number"||type=="boolean")return o+"";else if(o===null)return"null";if(type=="string"){return $.quoteString(o);}if(type=="object"&&typeof o.toJSON=="function")return o.toJSON(compact);if(type!="function"&&typeof(o.length)=="number"){var ret=[];for(var i=0;i<o.length;i++){ret.push($.toJSON(o[i],compact));}if(compact)return"["+ret.join(",")+"]";else return"["+ret.join(", ")+"]";}if(type=="function"){throw new TypeError("Unable to convert object of type 'function' to json.");}var ret=[];for(var k in o){var name;type=typeof(k);if(type=="number")name='"'+k+'"';else if(type=="string")name=$.quoteString(k);else continue;var val=$.toJSON(o[k],compact);if(typeof(val)!="string"){continue;}if(compact)ret.push(name+":"+val);else ret.push(name+": "+val);}return"{"+ret.join(", ")+"}";};$.compactJSON=function(o){return $.toJSON(o,true);};$.evalJSON=function(src){return eval("("+src+")");};$.secureEvalJSON=function(src){var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,'@');filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']');filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered))return eval("("+src+")");else throw new SyntaxError("Error parsing JSON, source is not valid.");};})(jQuery);
