(function($){function toIntegersAtLease(n)
{return n<10?'0'+n:n;}
Date.prototype.toJSON=function(date)
{return date.getUTCFullYear()+'-'+
toIntegersAtLease(date.getUTCMonth()+1)+'-'+
toIntegersAtLease(date.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)
{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();if(type!="function"&&typeof(o.length)=="number")
{var ret=[];for(var i=0;i<o.length;i++){ret.push($.toJSON(o[i]));}
return"["+ret.join(", ")+"]";}
if(type=="function"){throw new TypeError("Unable to convert object of type 'function' to json.");}
ret=[];for(var k in o){var name;var type=typeof(k);if(type=="number")
name='"'+k+'"';else if(type=="string")
name=$.quoteString(k);else
continue;val=$.toJSON(o[k]);if(typeof(val)!="string"){continue;}
ret.push(name+": "+val);}
return"{"+ret.join(", ")+"}";}
$.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);window.dhtmlHistory={isIE:false,isOpera:false,isSafari:false,isKonquerer:false,isGecko:false,isSupported:false,create:function(options){var that=this;var UA=navigator.userAgent.toLowerCase();var platform=navigator.platform.toLowerCase();var vendor=navigator.vendor||"";if(vendor==="KDE"){this.isKonqueror=true;this.isSupported=false;}else if(typeof window.opera!=="undefined"){this.isOpera=true;this.isSupported=true;}else if(typeof document.all!=="undefined"){this.isIE=true;this.isSupported=true;}else if(vendor.indexOf("Apple Computer, Inc.")>-1){this.isSafari=true;this.isSupported=(platform.indexOf("mac")>-1);}else if(UA.indexOf("gecko")!=-1){this.isGecko=true;this.isSupported=true;}
window.historyStorage.setup(options);if(this.isSafari){this.createSafari();}else if(this.isOpera){this.createOpera();}
var initialHash=this.getCurrentLocation();this.currentLocation=initialHash;if(this.isIE){this.createIE(initialHash);}
var unloadHandler=function(){that.firstLoad=null;};this.addEventListener(window,'unload',unloadHandler);if(this.isIE){this.ignoreLocationChange=true;}else{if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.ignoreLocationChange=true;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true);}else{this.ignoreLocationChange=false;this.fireOnNewListener=true;}}
var locationHandler=function(){that.checkLocation();};setInterval(locationHandler,100);},initialize:function(){if(this.isIE){if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.fireOnNewListener=false;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true);}
else{this.fireOnNewListener=true;this.firstLoad=false;}}},addListener:function(listener){this.listener=listener;if(this.fireOnNewListener){this.fireHistoryEvent(this.currentLocation);this.fireOnNewListener=false;}},addEventListener:function(o,e,l){if(o.addEventListener){o.addEventListener(e,l,false);}else if(o.attachEvent){o.attachEvent('on'+e,function(){l(window.event);});}},add:function(newLocation,historyData){if(this.isSafari){newLocation=this.removeHash(newLocation);historyStorage.put(newLocation,historyData);this.currentLocation=newLocation;window.location.hash=newLocation;this.putSafariState(newLocation);}else{var that=this;var addImpl=function(){if(that.currentWaitTime>0){that.currentWaitTime=that.currentWaitTime-that.waitTime;}
newLocation=that.removeHash(newLocation);if(document.getElementById(newLocation)&&that.debugMode){var e="Exception: History locations can not have the same value as _any_ IDs that might be in the document,"
+" due to a bug in IE; please ask the developer to choose a history location that does not match any HTML"
+" IDs in this document. The following ID is already taken and cannot be a location: "+newLocation;throw new Error(e);}
historyStorage.put(newLocation,historyData);that.ignoreLocationChange=true;that.ieAtomicLocationChange=true;that.currentLocation=newLocation;window.location.hash=newLocation;if(that.isIE){that.iframe.src="/js/blank.html?"+newLocation;}
that.ieAtomicLocationChange=false;};window.setTimeout(addImpl,this.currentWaitTime);this.currentWaitTime=this.currentWaitTime+this.waitTime;}},isFirstLoad:function(){return this.firstLoad;},getVersion:function(){return"0.6";},getCurrentLocation:function(){var r=(this.isSafari?this.getSafariState():this.getCurrentHash());return r;},getCurrentHash:function(){var r=window.location.href;var i=r.indexOf("#");return(i>=0?r.substr(i+1):"");},PAGELOADEDSTRING:"DhtmlHistory_pageLoaded",listener:null,waitTime:200,currentWaitTime:0,currentLocation:null,iframe:null,safariHistoryStartPoint:null,safariStack:null,safariLength:null,ignoreLocationChange:null,fireOnNewListener:null,firstLoad:null,ieAtomicLocationChange:null,createIE:function(initialHash){this.waitTime=400;var styles=(historyStorage.debugMode?'width: 800px;height:80px;border:1px solid black;':historyStorage.hideStyles);var iframeID="rshHistoryFrame";var iframeHTML='<iframe frameborder="0" id="'+iframeID+'" style="'+styles+'" src="/js/blank.html?'+initialHash+'"></iframe>';document.write(iframeHTML);this.iframe=document.getElementById(iframeID);},createOpera:function(){this.waitTime=400;var imgHTML='<img src="javascript:location.href=\'javascript:dhtmlHistory.checkLocation();\';" style="'+historyStorage.hideStyles+'" />';document.write(imgHTML);},createSafari:function(){var formID="rshSafariForm";var stackID="rshSafariStack";var lengthID="rshSafariLength";var formStyles=historyStorage.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var inputStyles=(historyStorage.debugMode?'width:800px;height:20px;border:1px solid black;margin:0;padding:0;':historyStorage.hideStyles);var safariHTML='<form id="'+formID+'" style="'+formStyles+'">'
+'<input type="text" style="'+inputStyles+'" id="'+stackID+'" value="[]"/>'
+'<input type="text" style="'+inputStyles+'" id="'+lengthID+'" value=""/>'
+'</form>';document.write(safariHTML);this.safariStack=document.getElementById(stackID);this.safariLength=document.getElementById(lengthID);if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.safariHistoryStartPoint=history.length;this.safariLength.value=this.safariHistoryStartPoint;}else{this.safariHistoryStartPoint=this.safariLength.value;}},getSafariStack:function(){var r=this.safariStack.value;return historyStorage.fromJSON(r);},getSafariState:function(){var stack=this.getSafariStack();var state=stack[history.length-this.safariHistoryStartPoint-1];return state;},putSafariState:function(newLocation){var stack=this.getSafariStack();stack[history.length-this.safariHistoryStartPoint]=newLocation;this.safariStack.value=historyStorage.toJSON(stack);},fireHistoryEvent:function(newHash){var historyData=historyStorage.get(newHash);this.listener.call(null,newHash,historyData);},checkLocation:function(){if(!this.isIE&&this.ignoreLocationChange){this.ignoreLocationChange=false;return;}
if(!this.isIE&&this.ieAtomicLocationChange){return;}
var hash=this.getCurrentLocation();if(hash==this.currentLocation){return;}
this.ieAtomicLocationChange=true;if(this.isIE&&this.getIframeHash()!=hash){this.iframe.src="/js/blank.html?"+hash;}
else if(this.isIE){return;}
this.currentLocation=hash;this.ieAtomicLocationChange=false;this.fireHistoryEvent(hash);},getIframeHash:function(){var doc=this.iframe.contentWindow.document;var hash=String(doc.location.search);if(hash.length==1&&hash.charAt(0)=="?"){hash="";}
else if(hash.length>=2&&hash.charAt(0)=="?"){hash=hash.substring(1);}
return hash;},removeHash:function(hashValue){var r;if(hashValue===null||hashValue===undefined){r=null;}
else if(hashValue===""){r="";}
else if(hashValue.length==1&&hashValue.charAt(0)=="#"){r="";}
else if(hashValue.length>1&&hashValue.charAt(0)=="#"){r=hashValue.substring(1);}
else{r=hashValue;}
return r;},iframeLoaded:function(newLocation){if(this.ignoreLocationChange){this.ignoreLocationChange=false;return;}
var hash=String(newLocation.search);if(hash.length==1&&hash.charAt(0)=="?"){hash="";}
else if(hash.length>=2&&hash.charAt(0)=="?"){hash=hash.substring(1);}
window.location.hash=hash;this.fireHistoryEvent(hash);}};window.historyStorage={setup:function(options){if(typeof options!=="undefined"){if(options.debugMode){this.debugMode=options.debugMode;}
if(options.toJSON){this.toJSON=options.toJSON;}
if(options.fromJSON){this.fromJSON=options.fromJSON;}}
var formID="rshStorageForm";var textareaID="rshStorageField";var formStyles=this.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var textareaStyles=(historyStorage.debugMode?'width: 800px;height:80px;border:1px solid black;':historyStorage.hideStyles);var textareaHTML='<form id="'+formID+'" style="'+formStyles+'">'
+'<textarea id="'+textareaID+'" style="'+textareaStyles+'"></textarea>'
+'</form>';document.write(textareaHTML);this.storageField=document.getElementById(textareaID);if(typeof window.opera!=="undefined"&&this.storageField!=null){this.storageField.focus();}},put:function(key,value){this.assertValidKey(key);if(this.hasKey(key)){this.remove(key);}
this.storageHash[key]=value;this.saveHashTable();},get:function(key){this.assertValidKey(key);this.loadHashTable();var value=this.storageHash[key];if(value===undefined){value=null;}
return value;},remove:function(key){this.assertValidKey(key);this.loadHashTable();delete this.storageHash[key];this.saveHashTable();},reset:function(){this.storageField.value="";this.storageHash={};},hasKey:function(key){this.assertValidKey(key);this.loadHashTable();return(typeof this.storageHash[key]!=="undefined");},isValidKey:function(key){return(typeof key==="string");},showStyles:'border:0;margin:0;padding:0;',hideStyles:'left:-1000px;top:-1000px;width:1px;height:1px;border:0;position:absolute;',debugMode:false,storageHash:{},hashLoaded:false,storageField:null,assertValidKey:function(key){var isValid=this.isValidKey(key);if(!isValid&&this.debugMode){throw new Error("Please provide a valid key for window.historyStorage. Invalid key = "+key+".");}},loadHashTable:function(){if(!this.hashLoaded&&this.storageField!=null){var serializedHashTable=this.storageField.value;if(serializedHashTable!==""&&serializedHashTable!==null){this.storageHash=this.fromJSON(serializedHashTable);this.hashLoaded=true;}}},saveHashTable:function(){this.loadHashTable();var serializedHashTable=this.toJSON(this.storageHash);if(this.storageField!=null)
this.storageField.value=serializedHashTable;},toJSON:function(o){return o.toJSONString();},fromJSON:function(s){return s.parseJSON();}};function Class(){}
Class.prototype.construct=function(){};Class.__asMethod__=function(func,superClass){return function(){var currentSuperClass=this.$;this.$=superClass;var ret=func.apply(this,arguments);this.$=currentSuperClass;return ret;};};Class.extend=function(def){var classDef=function(){if(arguments[0]!==Class){this.construct.apply(this,arguments);}};var proto=new this(Class);var superClass=this.prototype;for(var n in def){var item=def[n];if(item instanceof Function){item=Class.__asMethod__(item,superClass);}
proto[n]=item;}
proto.$=superClass;classDef.prototype=proto;classDef.extend=this.extend;return classDef;};var PageList=Class.extend({construct:function(pageIndex,totalPage,totalSize,callbackFunction,isScroll){this.pageIndex=pageIndex;this.totalPage=totalPage;this.total=totalSize;this.callbackFunction=callbackFunction;this.isScroll=isScroll;this.tailNumber=8;this.headNumber=8;this.width=3;this.twoend=2;if(this.pageIndex-1>0){this.prev=this.pageIndex-1;}else{this.prev=0;}
if(this.pageIndex<this.totalPage){this.next=this.pageIndex+1;}else{this.next=0;}
this.class_prefix="p";},displayList:function(){var result="";if(this.total==0){}else{if(this.totalPage<=1){result+="<div align='center' class='p_total'><div class='p_bar'>"+page_total+" ("+this.total+")</div></div></div>";}else{result="<div class='"+this.class_prefix+"_bar' align='center'><nobr>";result+=this.getPrevPageNum()+"&nbsp;&nbsp;";if(this.totalPage>(this.twoend*2+this.width*2+1)){result+=this.getHead();result+=this.getCurPageNum(this.pageIndex);result+=this.getTail();}else{for(var i=1;i<=this.totalPage;i++){if(i!=this.pageIndex){result+=this.getPageNum(i);}else{result+=this.getCurPageNum(i);}}}
result+="&nbsp;&nbsp;"+this.getNextPageNum();result+="</nobr>";result+="<div align='center' class='p_total'>"+page_total+" ("+this.total+")</div></div>";}}
return result;},getHead:function(){var result="";if(this.pageIndex-this.headNumber>1){var start=(this.pageIndex-this.width<this.totalPage-this.headNumber?this.pageIndex-this.width:this.totalPage-this.headNumber);for(var i=1;i<=this.twoend;i++){result+=this.getPageNum(i);}
if(start>this.twoend+1){result+="<span class='nolink'>&nbsp;...&nbsp;</span>";}
for(var i=start;i<this.pageIndex;i++){result+=this.getPageNum(i);}}else{for(var i=1;i<this.pageIndex;i++){result+=this.getPageNum(i);}}
return result;},getTail:function(){var result="";if(this.pageIndex+this.tailNumber<this.totalPage){var end=(this.pageIndex+this.width<this.headNumber?this.headNumber:this.pageIndex+this.width);for(var i=this.pageIndex+1;i<=end;i++){result+=this.getPageNum(i);}
if(end<this.totalPage-this.twoend){result+="<span class='nolink'>&nbsp;...&nbsp;</span>";}
for(var i=this.totalPage-this.twoend+1;i<=this.totalPage;i++){result+=this.getPageNum(i);}}else{for(var i=this.pageIndex+1;i<=this.totalPage;i++){result+=this.getPageNum(i);}}
return result;},getPageNum:function(index){var f=this.callbackFunction+"("+index+");";if(this.isScroll){f+="scroll(0,0);";}
return"<a href=\"#\" onclick=\""+f+";addHistory("+index+");return false\" class='"+this.class_prefix+"_num'>"+index+"</a>";},getCurPageNum:function(index){return"<span class='pageon'>"+index+"</span>";},getPrevPageNum:function(){if(this.prev>0){var f=this.callbackFunction+"("+this.prev+");";if(this.isScroll){f+="scroll(0,0);";}
var prev_ten;if(this.pageIndex>10){var prev_ten_num=this.pageIndex-10;var t=this.callbackFunction+"("+prev_ten_num+");";prev_ten="<a href=\"#\" onclick=\""+t+";addHistory("+prev_ten_num+");return false\" class='"+this.class_prefix+"_num'>"+prev_ten_page+"</a>"}else{prev_ten="";}
return"<a href=\"#\" onclick=\""+f+";addHistory("+this.prev+");return false\" class='"+this.class_prefix+"_num'>"+prev_page+"</a>"+prev_ten;}else{return prev_page;}},getNextPageNum:function(){if(this.next>0){var f=this.callbackFunction+"("+this.next+");";if(this.isScroll){f+="scroll(0,0);";}
var next_ten;if(this.totalPage-this.pageIndex>=10){var next_ten_num=this.pageIndex+10;var t=this.callbackFunction+"("+next_ten_num+");";next_ten="<a href=\"#\" onclick=\""+t+";addHistory("+next_ten_num+");return false\" class='"+this.class_prefix+"_num'>"+next_ten_page+"</a>"}else{next_ten="";}
return next_ten+"<a href=\"#\" onclick=\""+f+";addHistory("+this.next+");return false\" class='"+this.class_prefix+"_num'>"+next_page+"</a>";}else{return next_page;}}});var SmallPageList=PageList.extend({construct:function(pageIndex,totalPage,totalSize,callbackFunction){this.pageIndex=pageIndex;this.totalPage=totalPage;this.total=totalSize;this.callbackFunction=callbackFunction;this.tailNumber=1;this.headNumber=1;this.width=1;this.twoend=1;if(this.pageIndex-1>0){this.prev=this.pageIndex-1;}else{this.prev=0;}
if(this.pageIndex<this.totalPage){this.next=this.pageIndex+1;}else{this.next=0;}
this.class_prefix="sp";}});