
var Prototype={Version:'1.5.1',Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf('AppleWebKit/')>-1,Gecko:navigator.userAgent.indexOf('Gecko')>-1&&navigator.userAgent.indexOf('KHTML')==-1},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:(document.createElement('div').__proto__!==document.createElement('form').__proto__)},ScriptFragment:'<script[^>]*>([\u0001-\uFFFF]*?)</script>',JSONFilter:/^\/\*-secure-\s*(.*)\s*\*\/\s*$/,emptyFunction:function(){},K:function(x){return x}}
var Class={create:function(){return function(){this.initialize.apply(this,arguments);}}}
var Abstract=new Object();Object.extend=function(destination,source){for(var property in source){destination[property]=source[property];}
return destination;}
Object.extend(Object,{inspect:function(object){try{if(object===undefined)return'undefined';if(object===null)return'null';return object.inspect?object.inspect():object.toString();}catch(e){if(e instanceof RangeError)return'...';throw e;}},isFunction:function(object){return typeof object=="function";},isString:function(object){return typeof object=="string";},isNumber:function(object){return typeof object=="number";},isUndefined:function(object){return typeof object=="undefined";},toJSON:function(object){var type=typeof object;switch(type){case'undefined':case'function':case'unknown':return;case'boolean':return object.toString();}
if(object===null)return'null';if(object.toJSON)return object.toJSON();if(object.ownerDocument===document)return;var results=[];for(var property in object){var value=Object.toJSON(object[property]);if(value!==undefined)
results.push(property.toJSON()+': '+value);}
return'{'+results.join(', ')+'}';},keys:function(object){var keys=[];for(var property in object)
keys.push(property);return keys;},values:function(object){var values=[];for(var property in object)
values.push(object[property]);return values;},clone:function(object){return Object.extend({},object);}});var $A=Array.from=function(iterable){if(!iterable)return[];if(iterable.toArray){return iterable.toArray();}else{var results=[];for(var i=0,length=iterable.length;i<length;i++)
results.push(iterable[i]);return results;}}
Function.prototype.bind=function(){var __method=this,args=$A(arguments),object=args.shift();return function(){return __method.apply(object,args.concat($A(arguments)));}}
Function.prototype.bindAsEventListener=function(object){var __method=this,args=$A(arguments),object=args.shift();return function(event){return __method.apply(object,[event||window.event].concat(args));}}
Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16);},succ:function(){return this+1;},times:function(iterator){$R(0,this,true).each(iterator);return this;},toPaddedString:function(length,radix){var string=this.toString(radix||10);return'0'.times(length-string.length)+string;},toJSON:function(){return isFinite(this)?this.toString():'null';}});Date.prototype.toJSON=function(){return'"'+this.getFullYear()+'-'+
(this.getMonth()+1).toPaddedString(2)+'-'+
this.getDate().toPaddedString(2)+'T'+
this.getHours().toPaddedString(2)+':'+
this.getMinutes().toPaddedString(2)+':'+
this.getSeconds().toPaddedString(2)+'"';};var Try={these:function(){var returnValue;for(var i=0,length=arguments.length;i<length;i++){var lambda=arguments[i];try{returnValue=lambda();break;}catch(e){}}
return returnValue;}}
Object.extend(String,{interpret:function(value){return value==null?'':String(value);},specialChar:{'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','\\':'\\\\'}});Object.extend(String.prototype,{gsub:function(pattern,replacement){var result='',source=this,match;replacement=arguments.callee.prepareReplacement(replacement);while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length);}else{result+=source,source='';}}
return result;},sub:function(pattern,replacement,count){replacement=this.gsub.prepareReplacement(replacement);count=count===undefined?1:count;return this.gsub(pattern,function(match){if(--count<0)return match[0];return replacement(match);});},scan:function(pattern,iterator){this.gsub(pattern,iterator);return this;},truncate:function(length,truncation){length=length||30;truncation=truncation===undefined?'...':truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:this;},strip:function(){return this.replace(/^\s+/,'').replace(/\s+$/,'');},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,'');},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,'img'),'');},extractScripts:function(){var matchAll=new RegExp(Prototype.ScriptFragment,'img');var matchOne=new RegExp(Prototype.ScriptFragment,'im');return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||['',''])[1];});},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)});},escapeHTML:function(){var self=arguments.callee;self.text.data=this;return self.div.innerHTML;},unescapeHTML:function(){var div=document.createElement('div');div.innerHTML=this.stripTags();return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject('',function(memo,node){return memo+node.nodeValue}):div.childNodes[0].nodeValue):'';},toQueryParams:function(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match)return{};return match[1].split(separator||'&').inject({},function(hash,pair){if((pair=pair.split('='))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join('='):pair[0];if(value!=undefined)value=decodeURIComponent(value);if(key in hash){if(hash[key].constructor!=Array)hash[key]=[hash[key]];hash[key].push(value);}
else hash[key]=value;}
return hash;});},toArray:function(){return this.split('');},succ:function(){return this.slice(0,this.length-1)+
String.fromCharCode(this.charCodeAt(this.length-1)+1);},times:function(count){var result='';for(var i=0;i<count;i++)result+=this;return result;},camelize:function(){var parts=this.split('-'),len=parts.length;if(len==1)return parts[0];var camelized=this.charAt(0)=='-'?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++)
camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1);return camelized;},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();},underscore:function(){return this.gsub(/::/,'/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();},dasherize:function(){return this.gsub(/_/,'-');},inspect:function(useDoubleQuotes){var escapedString=this.gsub(/[\x00-\x1f\\]/,function(match){var character=String.specialChar[match[0]];return character?character:'\\u00'+match[0].charCodeAt().toPaddedString(2,16);});if(useDoubleQuotes)return'"'+escapedString.replace(/"/g,'\\"')+'"';return"'"+escapedString.replace(/'/g,'\\\'')+"'";},toJSON:function(){return this.inspect(true);},unfilterJSON:function(filter){return this.sub(filter||Prototype.JSONFilter,'#{1}');},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(json)))
return eval('('+json+')');}catch(e){}
throw new SyntaxError('Badly formed JSON string: '+this.inspect());},include:function(pattern){return this.indexOf(pattern)>-1;},startsWith:function(pattern){return this.indexOf(pattern)===0;},endsWith:function(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d;},empty:function(){return this=='';},blank:function(){return/^\s*$/.test(this);}});if(Prototype.Browser.WebKit||Prototype.Browser.IE)Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');},unescapeHTML:function(){return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');}});String.prototype.gsub.prepareReplacement=function(replacement){if(typeof replacement=='function')return replacement;var template=new Template(replacement);return function(match){return template.evaluate(match)};}
String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement('div'),text:document.createTextNode('')});with(String.prototype.escapeHTML)div.appendChild(text);var Template=Class.create();Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype={initialize:function(template,pattern){this.template=template.toString();this.pattern=pattern||Template.Pattern;},evaluate:function(object){return this.template.gsub(this.pattern,function(match){var before=match[1];if(before=='\\')return match[2];return before+String.interpret(object[match[3]]);});}}
var $break={},$continue=new Error('"throw $continue" is deprecated, use "return" instead');var Enumerable={each:function(iterator){var index=0;try{this._each(function(value){iterator(value,index++);});}catch(e){if(e!=$break)throw e;}
return this;},eachSlice:function(number,iterator){var index=-number,slices=[],array=this.toArray();while((index+=number)<array.length)
slices.push(array.slice(index,index+number));return slices.map(iterator);},all:function(iterator){var result=true;this.each(function(value,index){result=result&&!!(iterator||Prototype.K)(value,index);if(!result)throw $break;});return result;},any:function(iterator){var result=false;this.each(function(value,index){if(result=!!(iterator||Prototype.K)(value,index))
throw $break;});return result;},collect:function(iterator){var results=[];this.each(function(value,index){results.push((iterator||Prototype.K)(value,index));});return results;},detect:function(iterator){var result;this.each(function(value,index){if(iterator(value,index)){result=value;throw $break;}});return result;},findAll:function(iterator){var results=[];this.each(function(value,index){if(iterator(value,index))
results.push(value);});return results;},grep:function(pattern,iterator){var results=[];this.each(function(value,index){var stringValue=value.toString();if(stringValue.match(pattern))
results.push((iterator||Prototype.K)(value,index));})
return results;},include:function(object){var found=false;this.each(function(value){if(value==object){found=true;throw $break;}});return found;},inGroupsOf:function(number,fillWith){fillWith=fillWith===undefined?null:fillWith;return this.eachSlice(number,function(slice){while(slice.length<number)slice.push(fillWith);return slice;});},inject:function(memo,iterator){this.each(function(value,index){memo=iterator(memo,value,index);});return memo;},invoke:function(method){var args=$A(arguments).slice(1);return this.map(function(value){return value[method].apply(value,args);});},max:function(iterator){var result;this.each(function(value,index){value=(iterator||Prototype.K)(value,index);if(result==undefined||value>=result)
result=value;});return result;},min:function(iterator){var result;this.each(function(value,index){value=(iterator||Prototype.K)(value,index);if(result==undefined||value<result)
result=value;});return result;},partition:function(iterator){var trues=[],falses=[];this.each(function(value,index){((iterator||Prototype.K)(value,index)?trues:falses).push(value);});return[trues,falses];},pluck:function(property){var results=[];this.each(function(value,index){results.push(value[property]);});return results;},reject:function(iterator){var results=[];this.each(function(value,index){if(!iterator(value,index))
results.push(value);});return results;},sortBy:function(iterator){return this.map(function(value,index){return{value:value,criteria:iterator(value,index)};}).sort(function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0;}).pluck('value');},toArray:function(){return this.map();},zip:function(){var iterator=Prototype.K,args=$A(arguments);if(typeof args.last()=='function')
iterator=args.pop();var collections=[this].concat(args).map($A);return this.map(function(value,index){return iterator(collections.pluck(index));});},size:function(){return this.toArray().length;},inspect:function(){return'#<Enumerable:'+this.toArray().inspect()+'>';}}
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});if(Prototype.Browser.WebKit){$A=Array.from=function(iterable){if(!iterable)return[];if(!(typeof iterable=='function'&&iterable=='[object NodeList]')&&iterable.toArray){return iterable.toArray();}else{var results=[];for(var i=0,length=iterable.length;i<length;i++)
results.push(iterable[i]);return results;}}}
Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse)
Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(iterator){for(var i=0,length=this.length;i<length;i++)
iterator(this[i]);},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];},compact:function(){return this.select(function(value){return value!=null;});},flatten:function(){return this.inject([],function(array,value){return array.concat(value&&value.constructor==Array?value.flatten():[value]);});},without:function(){var values=$A(arguments);return this.select(function(value){return!values.include(value);});},withoutArray:function(values){return this.select(function(value){return!values.include(value);});},indexOf:function(object){for(var i=0,length=this.length;i<length;i++)
if(this[i]==object)return i;return-1;},reverse:function(inline){return(inline!==false?this:this.toArray())._reverse();},reduce:function(){return this.length>1?this:this[0];},uniq:function(sorted){return this.inject([],function(array,value,index){if(0==index||(sorted?array.last()!=value:!array.include(value)))
array.push(value);return array;});},clone:function(){return[].concat(this);},size:function(){return this.length;},inspect:function(){return'['+this.map(Object.inspect).join(', ')+']';},toJSON:function(){var results=[];this.each(function(object){var value=Object.toJSON(object);if(value!==undefined)results.push(value);});return'['+results.join(', ')+']';}});Array.prototype.toArray=Array.prototype.clone;function $w(string){string=string.strip();return string?string.split(/\s+/):[];}
if(Prototype.Browser.Opera){Array.prototype.concat=function(){var array=[];for(var i=0,length=this.length;i<length;i++)array.push(this[i]);for(var i=0,length=arguments.length;i<length;i++){if(arguments[i].constructor==Array){for(var j=0,arrayLength=arguments[i].length;j<arrayLength;j++)
array.push(arguments[i][j]);}else{array.push(arguments[i]);}}
return array;}}
var Hash=function(object){if(object instanceof Hash)this.merge(object);else Object.extend(this,object||{});};Object.extend(Hash,{toQueryString:function(obj){var parts=[];parts.add=arguments.callee.addPair;this.prototype._each.call(obj,function(pair){if(!pair.key)return;var value=pair.value;if(value&&typeof value=='object'){if(value.constructor==Array)value.each(function(value){parts.add(pair.key,value);});return;}
parts.add(pair.key,value);});return parts.join('&');},toJSON:function(object){var results=[];this.prototype._each.call(object,function(pair){var value=Object.toJSON(pair.value);if(value!==undefined)results.push(pair.key.toJSON()+': '+value);});return'{'+results.join(', ')+'}';}});Hash.toQueryString.addPair=function(key,value,prefix){key=encodeURIComponent(key);if(value===undefined)this.push(key);else this.push(key+'='+(value==null?'':encodeURIComponent(value)));}
Object.extend(Hash.prototype,Enumerable);Object.extend(Hash.prototype,{_each:function(iterator){for(var key in this){var value=this[key];if(value&&value==Hash.prototype[key])continue;var pair=[key,value];pair.key=key;pair.value=value;iterator(pair);}},keys:function(){return this.pluck('key');},values:function(){return this.pluck('value');},merge:function(hash){return $H(hash).inject(this,function(mergedHash,pair){mergedHash[pair.key]=pair.value;return mergedHash;});},remove:function(){var result;for(var i=0,length=arguments.length;i<length;i++){var value=this[arguments[i]];if(value!==undefined){if(result===undefined)result=value;else{if(result.constructor!=Array)result=[result];result.push(value)}}
delete this[arguments[i]];}
return result;},toQueryString:function(){return Hash.toQueryString(this);},inspect:function(){return'#<Hash:{'+this.map(function(pair){return pair.map(Object.inspect).join(': ');}).join(', ')+'}>';},toJSON:function(){return Hash.toJSON(this);}});function $H(object){if(object instanceof Hash)return object;return new Hash(object);};if(function(){var i=0,Test=function(value){this.key=value};Test.prototype.key='foo';for(var property in new Test('bar'))i++;return i>1;}())Hash.prototype._each=function(iterator){var cache=[];for(var key in this){var value=this[key];if((value&&value==Hash.prototype[key])||cache.include(key))continue;cache.push(key);var pair=[key,value];pair.key=key;pair.value=value;iterator(pair);}};ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(start,end,exclusive){this.start=start;this.end=end;this.exclusive=exclusive;},_each:function(iterator){var value=this.start;while(this.include(value)){iterator(value);value=value.succ();}},include:function(value){if(value<this.start)
return false;if(this.exclusive)
return value<this.end;return value<=this.end;}});var $R=function(start,end,exclusive){return new ObjectRange(start,end,exclusive);}
var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')})||false;},activeRequestCount:0}
Ajax.Responders={responders:[],_each:function(iterator){this.responders._each(iterator);},regsiter:function(responder){if(!this.include(responder))
this.responders.push(responder);},unregsiter:function(responder){this.responders=this.responders.without(responder);},dispatch:function(callback,request,transport,json){this.each(function(responder){if(typeof responder[callback]=='function'){try{responder[callback].apply(responder,[request,transport,json]);}catch(e){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.regsiter({onCreate:function(){Ajax.activeRequestCount++;},onComplete:function(){Ajax.activeRequestCount--;}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(options){this.options={method:'post',asynchronous:true,contentType:'application/x-www-form-urlencoded',encoding:'UTF-8',parameters:''}
Object.extend(this.options,options||{});this.options.method=this.options.method.toLowerCase();if(typeof this.options.parameters=='string')
this.options.parameters=this.options.parameters.toQueryParams();}}
Ajax.Request=Class.create();Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{_complete:false,initialize:function(url,options){this.transport=Ajax.getTransport();this.setOptions(options);this.request(url);},request:function(url){this.url=url;this.method=this.options.method;var params=Object.clone(this.options.parameters);if(!['get','post'].include(this.method)){params['_method']=this.method;this.method='post';}
this.parameters=params;if(params=Hash.toQueryString(params)){if(this.method=='get')
this.url+=(this.url.include('?')?'&':'?')+params;else if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))
params+='&_=';}
try{if(this.options.onCreate)this.options.onCreate(this.transport);Ajax.Responders.dispatch('onCreate',this,this.transport);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous)
setTimeout(function(){this.respondToReadyState(1)}.bind(this),10);this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=='post'?(this.options.postBody||params):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType)
this.onStateChange();}
catch(e){this.dispatchException(e);}},onStateChange:function(){var readyState=this.transport.readyState;if(readyState>1&&!((readyState==4)&&this._complete))
this.respondToReadyState(this.transport.readyState);},setRequestHeaders:function(){var headers={'X-Requested-With':'XMLHttpRequest','X-Prototype-Version':Prototype.Version,'Accept':'text/javascript, text/html, application/xml, text/xml, */*'};if(this.method=='post'){headers['Content-type']=this.options.contentType+
(this.options.encoding?'; charset='+this.options.encoding:'');if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005)
headers['Connection']='close';}
if(typeof this.options.requestHeaders=='object'){var extras=this.options.requestHeaders;if(typeof extras.push=='function')
for(var i=0,length=extras.length;i<length;i+=2)
headers[extras[i]]=extras[i+1];else
$H(extras).each(function(pair){headers[pair.key]=pair.value});}
for(var name in headers)
this.transport.setRequestHeader(name,headers[name]);},success:function(){return!this.transport.status||(this.transport.status>=200&&this.transport.status<300);},respondToReadyState:function(readyState){var state=Ajax.Request.Events[readyState];var transport=this.transport,json=this.evalJSON();if(state=='Complete'){try{this._complete=true;var temp_status;try{temp_status=this.transport.status}
catch(e){}
if(!temp_status)return;(this.options['on'+this.transport.status]||this.options['on'+(this.success()?'Success':'Failure')]||Prototype.emptyFunction)(transport,json);}catch(e){this.dispatchException(e);}
var contentType=this.getHeader('Content-type');if(contentType&&contentType.strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i))
this.evalResponse();}
try{(this.options['on'+state]||Prototype.emptyFunction)(transport,json);Ajax.Responders.dispatch('on'+state,this,transport,json);}catch(e){this.dispatchException(e);}
if(state=='Complete'){this.transport.onreadystatechange=Prototype.emptyFunction;}},getHeader:function(name){try{return this.transport.getResponseHeader(name);}catch(e){return null}},evalJSON:function(){try{var json=this.getHeader('X-JSON');return json?json.evalJSON():null;}catch(e){return null}},evalResponse:function(){try{return eval((this.transport.responseText||'').unfilterJSON());}catch(e){this.dispatchException(e);}},dispatchException:function(exception){(this.options.onException||Prototype.emptyFunction)(this,exception);Ajax.Responders.dispatch('onException',this,exception);}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(container,url,options){this.container={success:(container.success||container),failure:(container.failure||(container.success?null:container))}
this.transport=Ajax.getTransport();this.setOptions(options);var onComplete=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(transport,param){this.updateContent();onComplete(transport,param);}).bind(this);this.request(url);},updateContent:function(){var receiver=this.container[this.success()?'success':'failure'];var response=this.transport.responseText;if(!this.options.evalScripts)response=response.stripScripts();if(receiver=$(receiver)){if(this.options.insertion)
new this.options.insertion(receiver,response);else
receiver.update(response);}
if(this.success()){if(this.onComplete)
setTimeout(this.onComplete.bind(this),10);}}});function $(element){if(arguments.length>1){for(var i=0,elements=[],length=arguments.length;i<length;i++)
elements.push($(arguments[i]));return elements;}
if(typeof element=='string')
element=document.getElementById(element);return Element.extend(element);}
if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(expression,parentElement){var results=[];var query=document.evaluate(expression,$(parentElement)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var i=0,length=query.snapshotLength;i<length;i++)
results.push(query.snapshotItem(i));return results;};document.getElementsByClassName=function(className,parentElement){var q=".//*[contains(concat(' ', @class, ' '), ' "+className+" ')]";return document._getElementsByXPath(q,parentElement);}}else document.getElementsByClassName=function(className,parentElement){var children=($(parentElement)||document.body).getElementsByTagName('*');var elements=[],child;for(var i=0,length=children.length;i<length;i++){child=children[i];if(Element.hasClassName(child,className))
elements.push(Element.extend(child));}
return elements;};if(!window.Element)var Element={};Element.extend=function(element){var F=Prototype.BrowserFeatures;if(!element||!element.tagName||element.nodeType==3||element._extended||F.SpecificElementExtensions||element==window)
return element;var methods={},tagName=element.tagName,cache=Element.extend.cache,T=Element.Methods.ByTag;if(!F.ElementExtensions){Object.extend(methods,Element.Methods),Object.extend(methods,Element.Methods.Simulated);}
if(T[tagName])Object.extend(methods,T[tagName]);for(var property in methods){var value=methods[property];if(typeof value=='function'&&!(property in element))
element[property]=cache.findOrStore(value);}
element._extended=Prototype.emptyFunction;return element;};Element.extend.cache={findOrStore:function(value){return this[value]=this[value]||function(){return value.apply(null,[this].concat($A(arguments)));}}};Element.Methods={visible:function(_b6){return $(_b6).style.display!="none";},toggle:function(){for(var i=0;i<arguments.length;i++){var _b8=$(arguments[i]);Element[Element.visible(_b8)?"hide":"show"](_b8);}},hide:function(){for(var i=0;i<arguments.length;i++){var _ba=$(arguments[i]);_ba.style.display="none";}},show:function(){for(var i=0;i<arguments.length;i++){var _bc=$(arguments[i]);_bc.style.display="";}},remove:function(_bd){_bd=$(_bd);_bd.parentNode.removeChild(_bd);},update:function(_be,_bf){$(_be).innerHTML=_bf.stripScripts();setTimeout(function(){_bf.evalScripts();},10);},replace:function(_c0,_c1){_c0=$(_c0);if(_c0.outerHTML){_c0.outerHTML=_c1.stripScripts();}else{var _c2=_c0.ownerDocument.createRange();_c2.selectNodeContents(_c0);_c0.parentNode.replaceChild(_c2.createContextualFragment(_c1.stripScripts()),_c0);}
setTimeout(function(){_c1.evalScripts();},10);},getHeight:function(_c3){_c3=$(_c3);return _c3.offsetHeight;},classNames:function(_c4){return new Element.ClassNames(_c4);},hasClassName:function(_c5,_c6){if(!(_c5=$(_c5))){return;}
return Element.classNames(_c5).include(_c6);},addClassName:function(_c7,_c8){if(!(_c7=$(_c7))){return;}
return Element.classNames(_c7).add(_c8);},removeClassName:function(_c9,_ca){if(!(_c9=$(_c9))){return;}
return Element.classNames(_c9).remove(_ca);},cleanWhitespace:function(_cb){_cb=$(_cb);for(var i=0;i<_cb.childNodes.length;i++){var _cd=_cb.childNodes[i];if(_cd.nodeType==3&&!/\S/.test(_cd.nodeValue)){Element.remove(_cd);}}},empty:function(_ce){return $(_ce).innerHTML.match(/^\s*$/);},childOf:function(_cf,_d0){_cf=$(_cf),_d0=$(_d0);while(_cf=_cf.parentNode){if(_cf==_d0){return true;}}
return false;},up:function(element,expression,index){element=$(element);if(arguments.length==1)return $(element.parentNode);var ancestors=element.ancestors();return expression?Selector.findElement(ancestors,expression,index):ancestors[index||0];},ancestors:function(element){return $(element).recursivelyCollect('parentNode');},descendants:function(element){return $A($(element).getElementsByTagName('*')).each(Element.extend);},firstDescendant:function(element){element=$(element).firstChild;while(element&&element.nodeType!=1)element=element.nextSibling;return $(element);},down:function(element,expression,index){element=$(element);if(arguments.length==1)return element.firstDescendant();var descendants=element.descendants();return expression?Selector.findElement(descendants,expression,index):descendants[index||0];},scrollTo:function(_d1){_d1=$(_d1);var x=_d1.x?_d1.x:_d1.offsetLeft,y=_d1.y?_d1.y:_d1.offsetTop;window.scrollTo(x,y);},getStyle:function(_d4,_d5){_d4=$(_d4);var _d6=_d4.style[_d5.camelize()];if(!_d6){if(document.defaultView&&document.defaultView.getComputedStyle){var css=document.defaultView.getComputedStyle(_d4,null);_d6=css?css.getPropertyValue(_d5):null;}else{if(_d4.currentStyle){_d6=_d4.currentStyle[_d5.camelize()];}}}
if(window.opera&&["left","top","right","bottom"].include(_d5)){if(Element.getStyle(_d4,"position")=="static"){_d6="auto";}}
return _d6=="auto"?null:_d6;},setStyle:function(_d8,_d9){_d8=$(_d8);for(var _da in _d9){_d8.style[_da.camelize()]=_d9[_da];}},getDimensions:function(_db){_db=$(_db);if(Element.getStyle(_db,"display")!="none"){return{width:_db.offsetWidth,height:_db.offsetHeight};}
var els=_db.style;var _dd=els.visibility;var _de=els.position;els.visibility="hidden";els.position="absolute";els.display="";var _df=_db.clientWidth;var _e0=_db.clientHeight;els.display="none";els.position=_de;els.visibility=_dd;return{width:_df,height:_e0};},makePositioned:function(_e1){_e1=$(_e1);var pos=Element.getStyle(_e1,"position");if(pos=="static"||!pos){_e1._madePositioned=true;_e1.style.position="relative";if(window.opera){_e1.style.top=0;_e1.style.left=0;}}},undoPositioned:function(_e3){_e3=$(_e3);if(_e3._madePositioned){_e3._madePositioned=undefined;_e3.style.position=_e3.style.top=_e3.style.left=_e3.style.bottom=_e3.style.right="";}},makeClipping:function(_e4){_e4=$(_e4);if(_e4._overflow){return;}
_e4._overflow=_e4.style.overflow;if((Element.getStyle(_e4,"overflow")||"visible")!="hidden"){_e4.style.overflow="hidden";}},undoClipping:function(_e5){_e5=$(_e5);if(_e5._overflow){return;}
_e5.style.overflow=_e5._overflow;_e5._overflow=undefined;}};Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf,childElements:Element.Methods.immediateDescendants});if(Prototype.Browser.Opera){Element.Methods._getStyle=Element.Methods.getStyle;Element.Methods.getStyle=function(element,style){switch(style){case'left':case'top':case'right':case'bottom':if(Element._getStyle(element,'position')=='static')return null;default:return Element._getStyle(element,style);}};}
else if(Prototype.Browser.IE){Element.Methods.getStyle=function(element,style){element=$(element);style=(style=='float'||style=='cssFloat')?'styleFloat':style.camelize();var value=element.style[style];if(!value&&element.currentStyle)value=element.currentStyle[style];if(style=='opacity'){if(value=(element.getStyle('filter')||'').match(/alpha\(opacity=(.*)\)/))
if(value[1])return parseFloat(value[1])/100;return 1.0;}
if(value=='auto'){if((style=='width'||style=='height')&&(element.getStyle('display')!='none'))
return element['offset'+style.capitalize()]+'px';return null;}
return value;};Element.Methods.setOpacity=function(element,value){element=$(element);var filter=element.getStyle('filter'),style=element.style;if(value==1||value===''){style.filter=filter.replace(/alpha\([^\)]*\)/gi,'');return element;}else if(value<0.00001)value=0;style.filter=filter.replace(/alpha\([^\)]*\)/gi,'')+'alpha(opacity='+(value*100)+')';return element;};Element.Methods.update=function(element,html){element=$(element);html=typeof html=='undefined'?'':html.toString();var tagName=element.tagName.toUpperCase();if(['THEAD','TBODY','TR','TD'].include(tagName)){var div=document.createElement('div');switch(tagName){case'THEAD':case'TBODY':div.innerHTML='<table><tbody>'+html.stripScripts()+'</tbody></table>';depth=2;break;case'TR':div.innerHTML='<table><tbody><tr>'+html.stripScripts()+'</tr></tbody></table>';depth=3;break;case'TD':div.innerHTML='<table><tbody><tr><td>'+html.stripScripts()+'</td></tr></tbody></table>';depth=4;}
$A(element.childNodes).each(function(node){element.removeChild(node)});depth.times(function(){div=div.firstChild});$A(div.childNodes).each(function(node){element.appendChild(node)});}else{element.innerHTML=html.stripScripts();}
setTimeout(function(){html.evalScripts()},10);return element;}}
else if(Prototype.Browser.Gecko){Element.Methods.setOpacity=function(element,value){element=$(element);element.style.opacity=(value==1)?0.999999:(value==='')?'':(value<0.00001)?0:value;return element;};}
Element._attributeTranslations={names:{colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc"},values:{_getAttr:function(element,attribute){return element.getAttribute(attribute,2);},_flag:function(element,attribute){return $(element).hasAttribute(attribute)?attribute:null;},style:function(element){return element.style.cssText.toLowerCase();},title:function(element){var node=element.getAttributeNode('title');return node.specified?node.nodeValue:null;}}};(function(){Object.extend(this,{href:this._getAttr,src:this._getAttr,type:this._getAttr,disabled:this._flag,checked:this._flag,readonly:this._flag,multiple:this._flag});}).call(Element._attributeTranslations.values);Element.Methods.Simulated={hasAttribute:function(element,attribute){var t=Element._attributeTranslations,node;attribute=t.names[attribute]||attribute;node=$(element).getAttributeNode(attribute);return node&&node.specified;}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement('div').__proto__){window.HTMLElement={};window.HTMLElement.prototype=document.createElement('div').__proto__;Prototype.BrowserFeatures.ElementExtensions=true;}
Element.hasAttribute=function(element,attribute){if(element.hasAttribute)return element.hasAttribute(attribute);return Element.Methods.Simulated.hasAttribute(element,attribute);};Element.addMethods=function(methods){var F=Prototype.BrowserFeatures,T=Element.Methods.ByTag;if(!methods){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{"FORM":Object.clone(Form.Methods),"INPUT":Object.clone(Form.Element.Methods),"SELECT":Object.clone(Form.Element.Methods),"TEXTAREA":Object.clone(Form.Element.Methods)});}
if(arguments.length==2){var tagName=methods;methods=arguments[1];}
if(!tagName)Object.extend(Element.Methods,methods||{});else{if(tagName.constructor==Array)tagName.each(extend);else extend(tagName);}
function extend1(tagName){tagName=tagName.toUpperCase();if(!Element.Methods.ByTag[tagName])
Element.Methods.ByTag[tagName]={};Object.extend(Element.Methods.ByTag[tagName],methods);}
function copy(methods,destination,onlyIfAbsent){onlyIfAbsent=onlyIfAbsent||false;var cache=Element.extend.cache;for(var property in methods){var value=methods[property];if(!onlyIfAbsent||!(property in destination))
destination[property]=cache.findOrStore(value);}}
function findDOMClass(tagName){var klass;var trans={"OPTGROUP":"OptGroup","TEXTAREA":"TextArea","P":"Paragraph","FIELDSET":"FieldSet","UL":"UList","OL":"OList","DL":"DList","DIR":"Directory","H1":"Heading","H2":"Heading","H3":"Heading","H4":"Heading","H5":"Heading","H6":"Heading","Q":"Quote","INS":"Mod","DEL":"Mod","A":"Anchor","IMG":"Image","CAPTION":"TableCaption","COL":"TableCol","COLGROUP":"TableCol","THEAD":"TableSection","TFOOT":"TableSection","TBODY":"TableSection","TR":"TableRow","TH":"TableCell","TD":"TableCell","FRAMESET":"FrameSet","IFRAME":"IFrame"};if(trans[tagName])klass='HTML'+trans[tagName]+'Element';if(window[klass])return window[klass];klass='HTML'+tagName+'Element';if(window[klass])return window[klass];klass='HTML'+tagName.capitalize()+'Element';if(window[klass])return window[klass];window[klass]={};window[klass].prototype=document.createElement(tagName).__proto__;return window[klass];}
if(F.ElementExtensions){copy(Element.Methods,HTMLElement.prototype);copy(Element.Methods.Simulated,HTMLElement.prototype,true);}
if(F.SpecificElementExtensions){for(var tag in Element.Methods.ByTag){var klass=findDOMClass(tag);if(typeof klass=="undefined")continue;copy(T[tag],klass.prototype);}}
Object.extend(Element,Element.Methods);delete Element.ByTag;};var Toggle={display:Element.toggle};Abstract.Insertion=function(adjacency){this.adjacency=adjacency;}
Abstract.Insertion.prototype={initialize:function(element,content){this.element=$(element);this.content=content.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content);}catch(e){var tagName=this.element.tagName.toUpperCase();if(['TBODY','TR'].include(tagName)){this.insertContent(this.contentFromAnonymousTable());}else{throw e;}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange)this.initializeRange();this.insertContent([this.range.createContextualFragment(this.content)]);}
setTimeout(function(){content.evalScripts()},10);},contentFromAnonymousTable:function(){var div=document.createElement('div');div.innerHTML='<table><tbody>'+this.content+'</tbody></table>';return $A(div.childNodes[0].childNodes[0].childNodes);}}
var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion('beforeBegin'),{initializeRange:function(){this.range.setStartBefore(this.element);},insertContent:function(fragments){fragments.each((function(fragment){this.element.parentNode.insertBefore(fragment,this.element);}).bind(this));}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion('afterBegin'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true);},insertContent:function(fragments){fragments.reverse(false).each((function(fragment){this.element.insertBefore(fragment,this.element.firstChild);}).bind(this));}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion('beforeEnd'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element);},insertContent:function(fragments){fragments.each((function(fragment){this.element.appendChild(fragment);}).bind(this));}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion('afterEnd'),{initializeRange:function(){this.range.setStartAfter(this.element);},insertContent:function(fragments){fragments.each((function(fragment){this.element.parentNode.insertBefore(fragment,this.element.nextSibling);}).bind(this));}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(element){this.element=$(element);},_each:function(iterator){this.element.className.split(/\s+/).select(function(name){return name.length>0;})._each(iterator);},set:function(className){this.element.className=className;},add:function(classNameToAdd){if(this.include(classNameToAdd))return;this.set($A(this).concat(classNameToAdd).join(' '));},remove:function(classNameToRemove){if(!this.include(classNameToRemove))return;this.set($A(this).without(classNameToRemove).join(' '));},toString:function(){return $A(this).join(' ');}};Object.extend(Element.ClassNames.prototype,Enumerable);var Selector=Class.create();Selector.prototype={initialize:function(expression){this.expression=expression.strip();this.compileMatcher();},compileMatcher:function(){if(Prototype.BrowserFeatures.XPath&&!(/\[[\w-]*?:/).test(this.expression))
return this.compileXPathMatcher();var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return;}
this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(typeof c[i]=='function'?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],'');break;}}}
this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join('\n'));Selector._cache[this.expression]=this.matcher;},compileXPathMatcher:function(){var e=this.expression,ps=Selector.patterns,x=Selector.xpath,le,m;if(Selector._cache[e]){this.xpath=Selector._cache[e];return;}
this.matcher=['.//*'];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){if(m=e.match(ps[i])){this.matcher.push(typeof x[i]=='function'?x[i](m):new Template(x[i]).evaluate(m));e=e.replace(m[0],'');break;}}}
this.xpath=this.matcher.join('');Selector._cache[this.expression]=this.xpath;},findElements:function(root){root=root||document;if(this.xpath)return document._getElementsByXPath(this.xpath,root);return this.matcher(root);},match:function(element){return this.findElements(document).include(element);},toString:function(){return this.expression;},inspect:function(){return"#<Selector:"+this.expression.inspect()+">";}};Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:'/following-sibling::*',tagName:function(m){if(m[1]=='*')return'';return"[local-name()='"+m[1].toLowerCase()+"' or local-name()='"+m[1].toUpperCase()+"']";},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:"[@#{1}]",attr:function(m){m[3]=m[5]||m[6];return new Template(Selector.xpath.operators[m[2]]).evaluate(m);},pseudo:function(m){var h=Selector.xpath.pseudos[m[1]];if(!h)return'';if(typeof h==='function')return h(m);return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);},operators:{'=':"[@#{1}='#{3}']",'!=':"[@#{1}!='#{3}']",'^=':"[starts-with(@#{1}, '#{3}')]",'$=':"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",'*=':"[contains(@#{1}, '#{3}')]",'~=':"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",'|=':"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{'first-child':'[not(preceding-sibling::*)]','last-child':'[not(following-sibling::*)]','only-child':'[not(preceding-sibling::* or following-sibling::*)]','empty':"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",'checked':"[@checked]",'disabled':"[@disabled]",'enabled':"[not(@disabled)]",'not':function(m){var e=m[6],p=Selector.patterns,x=Selector.xpath,le,m,v;var exclusion=[];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in p){if(m=e.match(p[i])){v=typeof x[i]=='function'?x[i](m):new Template(x[i]).evaluate(m);exclusion.push("("+v.substring(1,v.length-1)+")");e=e.replace(m[0],'');break;}}}
return"[not("+exclusion.join(" and ")+")]";},'nth-child':function(m){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",m);},'nth-last-child':function(m){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",m);},'nth-of-type':function(m){return Selector.xpath.pseudos.nth("position() ",m);},'nth-last-of-type':function(m){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",m);},'first-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-of-type'](m);},'last-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-last-of-type'](m);},'only-of-type':function(m){var p=Selector.xpath.pseudos;return p['first-of-type'](m)+p['last-of-type'](m);},nth:function(fragment,m){var mm,formula=m[6],predicate;if(formula=='even')formula='2n+0';if(formula=='odd')formula='2n+1';if(mm=formula.match(/^(\d+)$/))
return'['+fragment+"= "+mm[1]+']';if(mm=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(mm[1]=="-")mm[1]=-1;var a=mm[1]?Number(mm[1]):1;var b=mm[2]?Number(mm[2]):0;predicate="[((#{fragment} - #{b}) mod #{a} = 0) and "+"((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(predicate).evaluate({fragment:fragment,a:a,b:b});}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);   c = false;',className:'n = h.className(n, r, "#{1}", c); c = false;',id:'n = h.id(n, r, "#{1}", c);        c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}"); c = false;',attr:function(m){m[3]=(m[5]||m[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m);},pseudo:function(m){if(m[6])m[6]=m[6].replace(/"/g,'\\"');return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|\s|(?=:))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\]]*?)\4|([^'"][^\]]*?)))?\]/},handlers:{concat:function(a,b){for(var i=0,node;node=b[i];i++)
a.push(node);return a;},mark:function(nodes){for(var i=0,node;node=nodes[i];i++)
node._counted=true;return nodes;},unmark:function(nodes){for(var i=0,node;node=nodes[i];i++)
node._counted=undefined;return nodes;},index:function(parentNode,reverse,ofType){parentNode._counted=true;if(reverse){for(var nodes=parentNode.childNodes,i=nodes.length-1,j=1;i>=0;i--){node=nodes[i];if(node.nodeType==1&&(!ofType||node._counted))node.nodeIndex=j++;}}else{for(var i=0,j=1,nodes=parentNode.childNodes;node=nodes[i];i++)
if(node.nodeType==1&&(!ofType||node._counted))node.nodeIndex=j++;}},unique:function(nodes){if(nodes.length==0)return nodes;var results=[],n;for(var i=0,l=nodes.length;i<l;i++)
if(!(n=nodes[i])._counted){n._counted=true;results.push(Element.extend(n));}
return Selector.handlers.unmark(results);},descendant:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
h.concat(results,node.getElementsByTagName('*'));return results;},child:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++){for(var j=0,children=[],child;child=node.childNodes[j];j++)
if(child.nodeType==1&&child.tagName!='!')results.push(child);}
return results;},adjacent:function(nodes){for(var i=0,results=[],node;node=nodes[i];i++){var next=this.nextElementSibling(node);if(next)results.push(next);}
return results;},laterSibling:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
h.concat(results,Element.nextSiblings(node));return results;},nextElementSibling:function(node){while(node=node.nextSibling)
if(node.nodeType==1)return node;return null;},previousElementSibling:function(node){while(node=node.previousSibling)
if(node.nodeType==1)return node;return null;},tagName:function(nodes,root,tagName,combinator){tagName=tagName.toUpperCase();var results=[],h=Selector.handlers;if(nodes){if(combinator){if(combinator=="descendant"){for(var i=0,node;node=nodes[i];i++)
h.concat(results,node.getElementsByTagName(tagName));return results;}else nodes=this[combinator](nodes);if(tagName=="*")return nodes;}
for(var i=0,node;node=nodes[i];i++)
if(node.tagName.toUpperCase()==tagName)results.push(node);return results;}else return root.getElementsByTagName(tagName);},id:function(nodes,root,id,combinator){var targetNode=$(id),h=Selector.handlers;if(!nodes&&root==document)return targetNode?[targetNode]:[];if(nodes){if(combinator){if(combinator=='child'){for(var i=0,node;node=nodes[i];i++)
if(targetNode.parentNode==node)return[targetNode];}else if(combinator=='descendant'){for(var i=0,node;node=nodes[i];i++)
if(Element.descendantOf(targetNode,node))return[targetNode];}else if(combinator=='adjacent'){for(var i=0,node;node=nodes[i];i++)
if(Selector.handlers.previousElementSibling(targetNode)==node)
return[targetNode];}else nodes=h[combinator](nodes);}
for(var i=0,node;node=nodes[i];i++)
if(node==targetNode)return[targetNode];return[];}
return(targetNode&&Element.descendantOf(targetNode,root))?[targetNode]:[];},className:function(nodes,root,className,combinator){if(nodes&&combinator)nodes=this[combinator](nodes);return Selector.handlers.byClassName(nodes,root,className);},byClassName:function(nodes,root,className){if(!nodes)nodes=Selector.handlers.descendant([root]);var needle=' '+className+' ';for(var i=0,results=[],node,nodeClassName;node=nodes[i];i++){nodeClassName=node.className;if(nodeClassName.length==0)continue;if(nodeClassName==className||(' '+nodeClassName+' ').include(needle))
results.push(node);}
return results;},attrPresence:function(nodes,root,attr){var results=[];for(var i=0,node;node=nodes[i];i++)
if(Element.hasAttribute(node,attr))results.push(node);return results;},attr:function(nodes,root,attr,value,operator){if(!nodes)nodes=root.getElementsByTagName("*");var handler=Selector.operators[operator],results=[];for(var i=0,node;node=nodes[i];i++){var nodeValue=Element.readAttribute(node,attr);if(nodeValue===null)continue;if(handler(nodeValue,value))results.push(node);}
return results;},pseudo:function(nodes,name,value,root,combinator){if(nodes&&combinator)nodes=this[combinator](nodes);if(!nodes)nodes=root.getElementsByTagName("*");return Selector.pseudos[name](nodes,value,root);}},pseudos:{'first-child':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.previousElementSibling(node))continue;results.push(node);}
return results;},'last-child':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.nextElementSibling(node))continue;results.push(node);}
return results;},'only-child':function(nodes,value,root){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
if(!h.previousElementSibling(node)&&!h.nextElementSibling(node))
results.push(node);return results;},'nth-child':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root);},'nth-last-child':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true);},'nth-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,false,true);},'nth-last-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true,true);},'first-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,false,true);},'last-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,true,true);},'only-of-type':function(nodes,formula,root){var p=Selector.pseudos;return p['last-of-type'](p['first-of-type'](nodes,formula,root),formula,root);},getIndices:function(a,b,total){if(a==0)return b>0?[b]:[];return $R(1,total).inject([],function(memo,i){if(0==(i-b)%a&&(i-b)/a>=0)memo.push(i);return memo;});},nth:function(nodes,formula,root,reverse,ofType){if(nodes.length==0)return[];if(formula=='even')formula='2n+0';if(formula=='odd')formula='2n+1';var h=Selector.handlers,results=[],indexed=[],m;h.mark(nodes);for(var i=0,node;node=nodes[i];i++){if(!node.parentNode._counted){h.index(node.parentNode,reverse,ofType);indexed.push(node.parentNode);}}
if(formula.match(/^\d+$/)){formula=Number(formula);for(var i=0,node;node=nodes[i];i++)
if(node.nodeIndex==formula)results.push(node);}else if(m=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(m[1]=="-")m[1]=-1;var a=m[1]?Number(m[1]):1;var b=m[2]?Number(m[2]):0;var indices=Selector.pseudos.getIndices(a,b,nodes.length);for(var i=0,node,l=indices.length;node=nodes[i];i++){for(var j=0;j<l;j++)
if(node.nodeIndex==indices[j])results.push(node);}}
h.unmark(nodes);h.unmark(indexed);return results;},'empty':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(node.tagName=='!'||(node.firstChild&&!node.innerHTML.match(/^\s*$/)))continue;results.push(node);}
return results;},'not':function(nodes,selector,root){var h=Selector.handlers,selectorType,m;var exclusions=new Selector(selector).findElements(root);h.mark(exclusions);for(var i=0,results=[],node;node=nodes[i];i++)
if(!node._counted)results.push(node);h.unmark(exclusions);return results;},'enabled':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(!node.disabled)results.push(node);return results;},'disabled':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(node.disabled)results.push(node);return results;},'checked':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(node.checked)results.push(node);return results;}},operators:{'=':function(nv,v){return nv==v;},'!=':function(nv,v){return nv!=v;},'^=':function(nv,v){return nv.startsWith(v);},'$=':function(nv,v){return nv.endsWith(v);},'*=':function(nv,v){return nv.include(v);},'~=':function(nv,v){return(' '+nv+' ').include(' '+v+' ');},'|=':function(nv,v){return('-'+nv.toUpperCase()+'-').include('-'+v.toUpperCase()+'-');}},matchElements:function(elements,expression){var matches=new Selector(expression).findElements(),h=Selector.handlers;h.mark(matches);for(var i=0,results=[],element;element=elements[i];i++)
if(element._counted)results.push(element);h.unmark(matches);return results;},findElement:function(elements,expression,index){if(typeof expression=='number'){index=expression;expression=false;}
return Selector.matchElements(elements,expression||'*')[index||0];},findChildElements:function(element,expressions){var exprs=expressions.join(','),expressions=[];exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(m){expressions.push(m[1].strip());});var results=[],h=Selector.handlers;for(var i=0,l=expressions.length,selector;i<l;i++){selector=new Selector(expressions[i].strip());h.concat(results,selector.findElements(element));}
return(l>1)?h.unique(results):results;}});function $$(){return Selector.findChildElements(document,$A(arguments));}
var Form={reset:function(form){$(form).reset();return form;},serializeElements:function(elements,getHash){var data=elements.inject({},function(result,element){if(!element.disabled&&element.name){var key=element.name,value=$(element).getValue();if(value!=null){if(key in result){if(result[key].constructor!=Array)result[key]=[result[key]];result[key].push(value);}
else result[key]=value;}}
return result;});return getHash?data:Hash.toQueryString(data);}};Form.Methods={serialize:function(form,getHash){return Form.serializeElements(Form.getElements(form),getHash);},getElements:function(form){return $A($(form).getElementsByTagName('*')).inject([],function(elements,child){if(Form.Element.Serializers[child.tagName.toLowerCase()])
elements.push(Element.extend(child));return elements;});},getInputs:function(form,typeName,name){form=$(form);var inputs=form.getElementsByTagName('input');if(!typeName&&!name)return $A(inputs).map(Element.extend);for(var i=0,matchingInputs=[],length=inputs.length;i<length;i++){var input=inputs[i];if((typeName&&input.type!=typeName)||(name&&input.name!=name))
continue;matchingInputs.push(Element.extend(input));}
return matchingInputs;},disable:function(form){form=$(form);Form.getElements(form).invoke('disable');return form;},enable:function(form){form=$(form);Form.getElements(form).invoke('enable');return form;},findFirstElement:function(form){return $(form).getElements().find(function(element){return element.type!='hidden'&&!element.disabled&&['input','select','textarea'].include(element.tagName.toLowerCase());});},focusFirstElement:function(form){form=$(form);form.findFirstElement().activate();return form;},request:function(form,options){form=$(form),options=Object.clone(options||{});var params=options.parameters;options.parameters=form.serialize(true);if(params){if(typeof params=='string')params=params.toQueryParams();Object.extend(options.parameters,params);}
if(form.hasAttribute('method')&&!options.method)
options.method=form.method;return new Ajax.Request(form.readAttribute('action'),options);}}
Form.Element={focus:function(element){$(element).focus();return element;},select:function(element){$(element).select();return element;}}
Form.Element.Methods={serialize:function(element){element=$(element);if(!element.disabled&&element.name){var value=element.getValue();if(value!=undefined){var pair={};pair[element.name]=value;return Hash.toQueryString(pair);}}
return'';},getValue:function(element){element=$(element);var method=element.tagName.toLowerCase();return Form.Element.Serializers[method](element);},clear:function(element){$(element).value='';return element;},present:function(element){return $(element).value!='';},activate:function(element){element=$(element);try{element.focus();if(element.select&&(element.tagName.toLowerCase()!='input'||!['button','reset','submit'].include(element.type)))
element.select();}catch(e){}
return element;},disable:function(element){element=$(element);element.blur();element.disabled=true;return element;},enable:function(element){element=$(element);element.disabled=false;return element;}}
var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(element){switch(element.type.toLowerCase()){case'checkbox':case'radio':return Form.Element.Serializers.inputSelector(element);default:return Form.Element.Serializers.textarea(element);}},inputSelector:function(element){return element.checked?element.value:null;},textarea:function(element){return element.value;},select:function(element){return this[element.type=='select-one'?'selectOne':'selectMany'](element);},selectOne:function(element){var index=element.selectedIndex;return index>=0?this.optionValue(element.options[index]):null;},selectMany:function(element){var values,length=element.length;if(!length)return null;for(var i=0,values=[];i<length;i++){var opt=element.options[i];if(opt.selected)values.push(this.optionValue(opt));}
return values;},optionValue:function(opt){return Element.extend(opt).hasAttribute('value')?opt.value:opt.text;}}
Abstract.TimedObserver=function(){}
Abstract.TimedObserver.prototype={initialize:function(element,frequency,callback){this.frequency=frequency;this.element=$(element);this.callback=callback;this.lastValue=this.getValue();this.regsiterCallback();},regsiterCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){var value=this.getValue();var changed=('string'==typeof this.lastValue&&'string'==typeof value?this.lastValue!=value:String(this.lastValue)!=String(value));if(changed){this.callback(this.element,value);this.lastValue=value;}}}
Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=function(){}
Abstract.EventObserver.prototype={initialize:function(element,callback){this.element=$(element);this.callback=callback;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=='form')
this.regsiterFormCallbacks();else
this.regsiterCallback(this.element);},onElementEvent:function(){var value=this.getValue();if(this.lastValue!=value){this.callback(this.element,value);this.lastValue=value;}},regsiterFormCallbacks:function(){Form.getElements(this.element).each(this.regsiterCallback.bind(this));},regsiterCallback:function(element){if(element.type){switch(element.type.toLowerCase()){case'checkbox':case'radio':Event.observe(element,'click',this.onElementEvent.bind(this));break;default:Event.observe(element,'change',this.onElementEvent.bind(this));break;}}}}
Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element);}});if(!window.Event){var Event=new Object();}
Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,W3CList:['click','mousedown','mouseup','keydown','keyup','keypress','mouseover','mousemove','mouseout','load','unload','abort','error','select','change','submit','reset','focus','blur','resize','scroll'],element:function(event){return $(event.target||event.srcElement);},isLeftClick:function(event){return(((event.which)&&(event.which==1))||((event.button)&&(event.button==1)));},pointerX:function(event){if(event.pageX)
return event.pageX;else if(event.clientX)
return(event.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));else return(event.x+(document.documentElement.scrollLeft||document.body.scrollLeft));},pointerY:function(event){if(event.pageY)
return event.pageY;else if(event.clientY)
return(event.clientY+(document.documentElement.scrollTop||document.body.scrollTop));else
return(event.y+(document.documentElement.scrollTop||document.body.scrollTop));},stop:function(event){if(event.preventDefault){event.preventDefault();event.stopPropagation();}else{event.returnValue=false;event.cancelBubble=true;}},findElement:function(event,tagName){var element=Event.element(event);while(element.parentNode&&(!element.tagName||(element.tagName.toUpperCase()!=tagName.toUpperCase())))
element=element.parentNode;return element;},observers:false,_observeAndCache:function(element,name,observer,useCapture){if(!this.observers)this.observers=[];if(element.addEventListener){this.observers.push([element,name,observer,useCapture]);element.addEventListener(name,observer,useCapture);}else if(element.attachEvent){this.observers.push([element,name,observer,useCapture]);element.attachEvent('on'+name,observer);if(!this.W3CList.include(name)){if(!element._events)Object.extend(element,{_events:$H()});if(!element._events[name])element._events[name]=new Array();if(!element._events[name].include(observer))element._events[name].push(observer);}}},unloadCache:function(){if(!Event.observers)return;for(var i=0,length=Event.observers.length;i<length;i++){Event.stopObserving.apply(this,Event.observers[i]);Event.observers[i][0]=null;}
Event.observers=false;},observe:function(element,name,observer,useCapture){element=$(element);useCapture=useCapture||false;if(name=='keypress'&&(Prototype.Browser.WebKit||element.attachEvent))
name='keydown';Event._observeAndCache(element,name,observer,useCapture);},stopObserving:function(element,name,observer,useCapture){element=$(element);useCapture=useCapture||false;if(name=='keypress'&&(Prototype.Browser.WebKit||element.attachEvent))
name='keydown';if(element.removeEventListener){element.removeEventListener(name,observer,useCapture);}else if(element.detachEvent){try{if(typeof(element.detachEvent('on'+name,observer))=="undefined")throw new Error(0,"not w3C event");}catch(e){try{if(!this.W3CList.include(name)){if(element._events[name]){if(observer){var _index=element._events[name].indexOf(observer);if(_index!=-1)element._events[name].splice(_index,1);}else{delete element._events[name];}}}}catch(e){}}}}});if(Prototype.Browser.IE)
Event.observe(window,'unload',Event.unloadCache,false);var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},realOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.scrollTop||0;valueL+=element.scrollLeft||0;element=element.parentNode;}while(element);return[valueL,valueT];},cumulativeOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;}while(element);return[valueL,valueT];},positionedOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;if(element){if(element.tagName=='BODY')break;var p=Element.getStyle(element,'position');if(p=='relative'||p=='absolute')break;}}while(element);return[valueL,valueT];},offsetParent:function(element){if(element.offsetParent)return element.offsetParent;if(element==document.body)return element;while((element=element.parentNode)&&element!=document.body)
if(Element.getStyle(element,'position')!='static')
return element;return document.body;},within:function(element,x,y){if(this.includeScrollOffsets)
return this.withinIncludingScrolloffsets(element,x,y);this.xcomp=x;this.ycomp=y;this.offset=this.cumulativeOffset(element);return(y>=this.offset[1]&&y<this.offset[1]+element.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+element.offsetWidth);},withinIncludingScrolloffsets:function(element,x,y){var offsetcache=this.realOffset(element);this.xcomp=x+offsetcache[0]-this.deltaX;this.ycomp=y+offsetcache[1]-this.deltaY;this.offset=this.cumulativeOffset(element);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+element.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+element.offsetWidth);},overlap:function(mode,element){if(!mode)return 0;if(mode=='vertical')
return((this.offset[1]+element.offsetHeight)-this.ycomp)/element.offsetHeight;if(mode=='horizontal')
return((this.offset[0]+element.offsetWidth)-this.xcomp)/element.offsetWidth;},page:function(forElement){var valueT=0,valueL=0;var element=forElement;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body)
if(Element.getStyle(element,'position')=='absolute')break;}while(element=element.offsetParent);element=forElement;do{if(!window.opera||element.tagName=='BODY'){valueT-=element.scrollTop||0;valueL-=element.scrollLeft||0;}}while(element=element.parentNode);return[valueL,valueT];},clone:function(source,target){var options=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{})
source=$(source);var p=Position.page(source);target=$(target);var delta=[0,0];var parent=null;if(Element.getStyle(target,'position')=='absolute'){parent=Position.offsetParent(target);delta=Position.page(parent);}
if(parent==document.body){delta[0]-=document.body.offsetLeft;delta[1]-=document.body.offsetTop;}
if(options.setLeft)target.style.left=(p[0]-delta[0]+options.offsetLeft)+'px';if(options.setTop)target.style.top=(p[1]-delta[1]+options.offsetTop)+'px';if(options.setWidth)target.style.width=source.offsetWidth+'px';if(options.setHeight)target.style.height=source.offsetHeight+'px';},absolutize:function(element){element=$(element);if(element.style.position=='absolute')return;Position.prepare();var offsets=Position.positionedOffset(element);var top=offsets[1];var left=offsets[0];var width=element.clientWidth;var height=element.clientHeight;element._originalLeft=left-parseFloat(element.style.left||0);element._originalTop=top-parseFloat(element.style.top||0);element._originalWidth=element.style.width;element._originalHeight=element.style.height;element.style.position='absolute';element.style.top=top+'px';element.style.left=left+'px';element.style.width=width+'px';element.style.height=height+'px';},relativize:function(element){element=$(element);if(element.style.position=='relative')return;Position.prepare();element.style.position='relative';var top=parseFloat(element.style.top||0)-(element._originalTop||0);var left=parseFloat(element.style.left||0)-(element._originalLeft||0);element.style.top=top+'px';element.style.left=left+'px';element.style.height=element._originalHeight;element.style.width=element._originalWidth;}}
if(Prototype.Browser.WebKit){Position.cumulativeOffset=function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body)
if(Element.getStyle(element,'position')=='absolute')break;element=element.offsetParent;}while(element);return[valueL,valueT];}}
Element.addMethods();EnumerableExtend={getRange:function(iterator){var maxResult;var minResult=Number.MAX_VALUE;this.each(function(value,index){value=(iterator||Prototype.K)(value,index);if(isNaN(value))return;if(value>=(maxResult||value))maxResult=value;if(value<=minResult)minResult=value;});if(isNaN(minResult)||minResult==Number.MAX_VALUE)minResult=0;return $R(minResult,maxResult,true);},getMinElement:function(iterator){var result={lowestValue:Number.MAX_VALUE,key:"",value:""};this.each(function(value,index){resultValue=(iterator||Prototype.K)(value,index);if(resultValue<=result.lowestValue){result.lowestValue=resultValue;if(typeof(value.key)!="undefined"){result.key=value.key;result.value=value.value;}else{result.key=value;result.value=result.lowestValue;}}});return result;},getMinElements:function(iterator){var result={lowestValue:Number.MAX_VALUE,hash:$H()};this.each(function(value,index){resultValue=(iterator||Prototype.K)(value,index);if(resultValue<=result.lowestValue){if(resultValue<result.lowestValue){result.hash.clear();result.lowestValue=resultValue;}
if(typeof(value.key)!="undefined"){result.hash.put(value.key,value.value);}else{result.hash.put(value,resultValue);}}});return result;},NaN_num_min:function(iterator){var result;this.each(function(value,index){value=(iterator||Prototype.K)(value,index);if(!isNaN(value)&&value!=null&&(result==undefined||value<result))
result=value;});if(result==undefined)result=0;return result;}}
Object.extend(Array.prototype,EnumerableExtend);Object.extend(Hash.prototype,EnumerableExtend);Object.extendAndInit=function(destination,source){Object.extend(destination,source);destination.initialize.apply(destination,$A(arguments).slice(2));return destination;}
Object.extend(Event,{fireClick:function(element){element=$(element);if(element.dispatchEvent){var evtObj=document.createEvent('MouseEvents');evtObj.initMouseEvent("click",true,true,document.defaultView,1,0,0,0,0,false,false,true,false,0,null);element.dispatchEvent(evtObj);}
else if(element.fireEvent){element.fireEvent("onclick");}},fire:function(element,name){var element=$(element);if(element.fireEvent){try{element.fireEvent("on"+name);}catch(err){if(element._events){if(element._events[name]){var args=$A(arguments);args=args.slice(2);element._events[name].each(function(func){func.apply(element,args);});}}}}else{try{var evt=document.createEvent("UIEvents");evt.initUIEvent(name,true,true,window,1);var canceled=element.dispatchEvent(evt);}catch(err){}}}})
Element.addMethods({exist:$,getSingleNodeByAttribute:function(element,attribName,value){var children=($(element)||document.body).getElementsByTagName('*');return $A(children).detect(function(child){if(child.getAttribute(attribName)==value)return true;return false;});},_events:$H(),clear:function(element){$A($(element).childNodes).each(function(obj){element.removeChild(obj);});$(element).innerHTML="";},show:function(element){$(element).style.display='block';return element;}});Object.extend(Element,Element.Methods);Object.extend(String.prototype,{trim:String.prototype.strip});Object.extend(Array.prototype,{getSize:Array.prototype.size,hasIntersection:function(target){var results=false;this.each(function(value,index){if(target.indexOf(value)!=-1){results=true;throw $break;}});return results;}})
Object.extend(Hash.prototype,{put:function(key,value){this[key]=value},get:function(key){return this[key]},getSize:Hash.prototype.size,clear:function(){var self=this;this.each(function(p){delete self[p.key];})},first:function(){var self=this,result;this.each(function(p){result=p;throw $break;})
return result;},getIntersection:function(target){var results=[];this.each(function(value,index){if(target.indexOf(value.key)!=-1)results.push(value.key);});return results;}})
__$H=$H;$H=function(object){if(object instanceof Array)
object=({});return __$H(object);}
Class.eventClass=function(){var newClass=function(){this._events=$H();this.initialize.apply(this,arguments);}
Object.extend(newClass.prototype,{addEventListener:function(name,observer){name="on"+name;if(!this._events[name])this._events[name]=new Array();if(!this._events[name].include(observer))this._events[name].push(observer);},removeEventListener:function(name,observer){name="on"+name;if(!this._events||!this._events[name])return false;if(observer){var _index=this._events[name].indexOf(observer);if(_index!=-1)this._events[name].splice(_index,1);}else{delete this._events[name];}},fireEvent:function(name){if(name.substr(0,2)!="on")name="on"+name;if(!this._events[name])return false;var args=$A(arguments);args.shift();var sourceObj=this;this._events[name].each(function(func){func.apply(sourceObj,args);});}});return newClass;}
var UA=navigator.userAgent;var isKHTML=/Konqueror|Safari|KHTML/.test(UA);var isGecko=(/Gecko/.test(UA)&&!isKHTML);var isOpera=/Opera/.test(UA);var isIE=isMSIE=(/MSIE/.test(UA)&&!isOpera);var isWin=(UA.toLowerCase().indexOf("win")!=-1)?true:false;var isFirefox=(UA.indexOf("Firefox")!=-1)?true:false;var isMaxthon=/Maxthon/.test(UA)||/MyIE/.test(UA);var IEVer=getIEVer();function getIEVer(){var iVerNo=0;var sVer=navigator.userAgent;if(sVer.indexOf("MSIE")>-1){var sVerNo=sVer.split(";")[1];sVerNo=sVerNo.replace("MSIE","");iVerNo=parseFloat(sVerNo);}
return iVerNo;}
var _dom=document.all?(document.getElementById?2:1):(document.getElementById?4:(document.layers?3:0));Object.destroy=function(object){var removeF;if(removeF=(object.release||object.clear)){try{removeF.call(object);}catch(err){}}
try{for(key in object){if((object[key]instanceof Array)||(object[key]instanceof Hash)){object[key].clear();}}
for(key in object){delete object[key];}}catch(err){}}
function getCookie(){var cookieArr=document.cookie.split(";");var cookieHash=$H();for(var i=0;i<cookieArr.length;i++){if(cookieArr[i].indexOf("=")!=-1)
cookieHash[cookieArr[i].split("=")[0].trim()]=cookieArr[i].split("=")[1].trim();}
return cookieHash;}
function $E(html){html=typeof html=='undefined'?'':html.toString().strip();var regExp=/^<([a-z]+)\s*[^>]*>[\s\S]*<\/\1>$/i;var tagName=regExp.exec(html);if(tagName)tagName=tagName[1].toUpperCase();else throw new Error(0,"html parse Error");var div=$(document.createElement('div'));if(['THEAD','TBODY','TR','TD'].include(tagName)){switch(tagName){case'THEAD':case'TBODY':div.innerHTML='<table>'+html.stripScripts()+'</table>';depth=2;break;case'TR':div.innerHTML='<table><tbody>'+html.stripScripts()+'</tbody></table>';depth=3;break;case'TD':div.innerHTML='<table><tbody><tr>'+html.stripScripts()+'</tr></tbody></table>';depth=4;}}else{div.innerHTML=html.stripScripts();depth=1;}
depth.times(function(){div=div.firstChild});return Element.extend(div);}
if(!window.XMLDocument){var XMLDocument=new Object();}
Object.extend(XMLDocument,{normalize:function(element){$A(element.childNodes).each(function(node){if(node.nodeType==3&&node.nodeValue.trim()==""){element.removeChild(node);}
if(node.childNodes.length!=0)XMLDocument.normalize(node);});}});if(document.implementation.hasFeature("XPath","3.0"))
{XMLDocument.prototype.selectNodes=function(cXPathString,xNode)
{if(!xNode){xNode=this;}
var oNSResolver=this.createNSResolver(this.documentElement)
var aItems=this.evaluate(cXPathString,xNode,oNSResolver,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null)
var aResult=[];for(var i=0;i<aItems.snapshotLength;i++)
{aResult[i]=aItems.snapshotItem(i);}
return aResult;}
XMLDocument.prototype.selectSingleNode=function(cXPathString,xNode)
{if(!xNode){xNode=this;}
var xItems=this.selectNodes(cXPathString,xNode);if(xItems.length>0)
{return xItems[0];}
else
{return null;}}}
var _st=window.setTimeout;window.setTimeout=function(fRef,mDelay){if(typeof fRef=='function'){var argu=Array.prototype.slice.call(arguments,2);var f=(function(){fRef.apply(null,argu);});return _st(f,mDelay);}
return _st(fRef,mDelay);}
function getStrFromDate(date,noFill){date=date||new Date();var month=(date.getMonth()+1<10&&!noFill)?("0"+(date.getMonth()+1)):(date.getMonth()+1);var day=(date.getDate()<10&&!noFill)?("0"+date.getDate()):date.getDate();return date.getFullYear()+"-"+month+"-"+day;}
SystemObject=Class.eventClass();Object.extend(SystemObject.prototype,{initialize:function(){},status:new Object()});var System=new SystemObject();Array.mergeSort=function(arr1,arr2,compare){compare=compare||Array.defaultCompare;var resultArr=[];var len1=arr1.length,len2=arr2.length,i=0,j=0;while(i<len1&&j<len2){if(compare(arr1[i],arr2[j])>0){resultArr.push(arr2[j++]);}
else{resultArr.push(arr1[i++]);}}
while(i<len1)resultArr.push(arr1[i++])
while(j<len2)resultArr.push(arr2[j++])
return resultArr;}
Array.defaultCompare=function(a,b){if(a>b)return 1;if(a==b)return 0;if(a<b)return-1;if(a==undefined&&b==undefined)return 0;if(a==undefined)return 1;if(b==undefined)return-1;if(isNaN(a)&&isNaN(b))return 0;if(isNaN(a))return 1;if(isNaN(b))return-1;}
Object.extend(Array.prototype,{remove:function(obj){for(var i=0,n=0;i<this.length;i++){if(this[i]!=obj){this[n++]=this[i]}}
this.length-=1;},swap:function(i,j){var _tem=this[i];this[i]=this[j];this[j]=_tem;},__quickSort1:function(st,en){if(en-st<=6)return this.insertSort(st,en);var splitV=this[(st+en)>>1],i=st,j=en,_tem
do{while(i<=en&&this.compare(this[i],splitV)<0)i++;while(j>=st&&this.compare(this[j],splitV)>0)j--;if(i<=j){_tem=this[i];this[i]=this[j];this[j]=_tem;i++;j--;}}while(i<j)
if(st<j)this.__quickSort1(st,j);if(i<en)this.__quickSort1(i,en);},__quickSort2:function(st,en){},quickSort:function(compare){this.compare=compare||Array.defaultCompare;this.__quickSort1(0,this.length-1);return this;},defaultCompare:Array.defaultCompare,mergeSort:function(arr,compare){return Array.mergeSort(this,arr,compare);},insertSort:function(s,e,compare){s=s||0;e=e||this.length-1;compare=compare||this.compare||Array.defaultCompare;var tem,stopPostion;for(var i=s+1;i<=e;i++){tem=this[i];stopPostion=-1;for(var j=i-1;j>=s;j--){if(this.compare(this[j],tem)>0){this[j+1]=this[j];stopPostion=j;}
else break}
if(stopPostion!=-1)this[stopPostion]=tem;}}})
Fix=Class.create();Fix.prototype.initialize=function(el){this.el=$(el);this.iniTop=parseInt(this.el.style.top);this.scrolling=null;if(isGecko){el.style.position="fixed"}
else{if(isMSIE&&!isMaxthon)
window.attachEvent("onscroll",this.fixit.bind(this));else setInterval(this.dofix.bind(this),500);}}
Object.extend(Fix.prototype,{fixit:function(){if(!this.scrolling){this.scrolling=setTimeout(this.dofix.bind(this),200);}},dofix:function(){deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;this.el.style.top=(this.iniTop+deltaY)+"px";this.scrolling=null;}});function swf(b,params,vars){var s,s2='';var params=params||{};var fvars=vars&&vars.join('&');var src=b[0],id=b[1],width=b[2],height=b[3],ver=b[4];s='<object id="'+id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'">';s+='<param name="movie" value="'+src+'" />';for(var key in params){s+='<param name="'+key+'" value="'+params[key]+'" />';s2+=key+'="'+params[key]+'" ';};if(fvars&&fvars.length>0){s+='<param name="flashvars" value="'+fvars+'" />';s2+='flashvars="'+fvars+'"';}
s+='<embed type="application/x-shockwave-flash" src="'+src+'" width="'+width+'" height="'+height+'" id="emb_'+id+'" name="'+id+'" '+s2+' /></object>';return s;}
var TrimPath;(function(){if(TrimPath==null)
TrimPath=new Object();if(TrimPath.evalEx==null)
TrimPath.evalEx=function(src){return eval(src);};var UNDEFINED;if(Array.prototype.pop==null)
Array.prototype.pop=function(){if(this.length===0){return UNDEFINED;}
return this[--this.length];};if(Array.prototype.push==null)
Array.prototype.push=function(){for(var i=0;i<arguments.length;++i){this[this.length]=arguments[i];}
return this.length;};TrimPath.parseTemplate=function(tmplContent,optTmplName,optEtc){if(optEtc==null)
optEtc=TrimPath.parseTemplate_etc;var funcSrc=parse(tmplContent,optTmplName,optEtc);var func=TrimPath.evalEx(funcSrc,optTmplName,1);if(func!=null)
return new optEtc.Template(optTmplName,tmplContent,funcSrc,func,optEtc);return null;}
try{String.prototype.process=function(context,optFlags){var template=TrimPath.parseTemplate(this,null);if(template!=null)
return template.process(context,optFlags);return this;}}catch(e){}
TrimPath.parseTemplate_etc={};TrimPath.parseTemplate_etc.statementTag="forelse|for|if|elseif|else|var|macro";TrimPath.parseTemplate_etc.statementDef={"if":{delta:1,prefix:"if (",suffix:") {",paramMin:1},"else":{delta:0,prefix:"} else {"},"elseif":{delta:0,prefix:"} else if (",suffix:") {",paramDefault:"true"},"/if":{delta:-1,prefix:"}"},"for":{delta:1,paramMin:3,prefixFunc:function(stmtParts,state,tmplName,etc){if(stmtParts[2]!="in")
throw new etc.ParseError(tmplName,state.line,"bad for loop statement: "+stmtParts.join(' '));var iterVar=stmtParts[1];var listVar="__LIST__"+iterVar;return["var ",listVar," = ",stmtParts[3],";","var __LENGTH_STACK__;","if (typeof(__LENGTH_STACK__) == 'undefined' || !__LENGTH_STACK__.length) __LENGTH_STACK__ = new Array();","__LENGTH_STACK__[__LENGTH_STACK__.length] = 0;","if ((",listVar,") != null) { ","var ",iterVar,"_ct = 0;","for (var ",iterVar,"_index in ",listVar,") { ",iterVar,"_ct++;","if (typeof(",listVar,"[",iterVar,"_index]) == 'function') {continue;}","__LENGTH_STACK__[__LENGTH_STACK__.length - 1]++;","var ",iterVar," = ",listVar,"[",iterVar,"_index];"].join("");}},"forelse":{delta:0,prefix:"} } if (__LENGTH_STACK__[__LENGTH_STACK__.length - 1] == 0) { if (",suffix:") {",paramDefault:"true"},"/for":{delta:-1,prefix:"} }; delete __LENGTH_STACK__[__LENGTH_STACK__.length - 1];"},"var":{delta:0,prefix:"var ",suffix:";"},"macro":{delta:1,prefixFunc:function(stmtParts,state,tmplName,etc){var macroName=stmtParts[1].split('(')[0];return["var ",macroName," = function",stmtParts.slice(1).join(' ').substring(macroName.length),"{ var _OUT_arr = []; var _OUT = { write: function(m) { if (m) _OUT_arr.push(m); } }; "].join('');}},"/macro":{delta:-1,prefix:" return _OUT_arr.join(''); };"}}
TrimPath.parseTemplate_etc.modifierDef={"eat":function(v){return"";},"escape":function(s){return String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");},"capitalize":function(s){return String(s).toUpperCase();},"default":function(s,d){return s!=null?s:d;}}
TrimPath.parseTemplate_etc.modifierDef.h=TrimPath.parseTemplate_etc.modifierDef.escape;TrimPath.parseTemplate_etc.Template=function(tmplName,tmplContent,funcSrc,func,etc){this.process=function(context,flags){if(context==null)
context={};if(context._MODIFIERS==null)
context._MODIFIERS={};if(context.defined==null)
context.defined=function(str){return(context[str]!=undefined);};for(var k in etc.modifierDef){if(context._MODIFIERS[k]==null)
context._MODIFIERS[k]=etc.modifierDef[k];}
if(flags==null)
flags={};var resultArr=[];var resultOut={write:function(m){resultArr.push(m);}};try{func(resultOut,context,flags);}catch(e){if(flags.throwExceptions==true)
throw e;var result=new String(resultArr.join("")+"[ERROR: "+e.toString()+(e.message?'; '+e.message:'')+"]");result["exception"]=e;return result;}
return resultArr.join("");}
this.name=tmplName;this.source=tmplContent;this.sourceFunc=funcSrc;this.toString=function(){return"TrimPath.Template ["+tmplName+"]";}}
TrimPath.parseTemplate_etc.ParseError=function(name,line,message){this.name=name;this.line=line;this.message=message;}
TrimPath.parseTemplate_etc.ParseError.prototype.toString=function(){return("TrimPath template ParseError in "+this.name+": line "+this.line+", "+this.message);}
var parse=function(body,tmplName,etc){body=cleanWhiteSpace(body);var funcText=["var TrimPath_Template_TEMP = function(_OUT, _CONTEXT, _FLAGS) { with (_CONTEXT) {"];var state={stack:[],line:1};var endStmtPrev=-1;while(endStmtPrev+1<body.length){var begStmt=endStmtPrev;begStmt=body.indexOf("{",begStmt+1);while(begStmt>=0){var endStmt=body.indexOf('}',begStmt+1);var stmt=body.substring(begStmt,endStmt);var blockrx=stmt.match(/^\{(cdata|minify|eval)/);if(blockrx){var blockType=blockrx[1];var blockMarkerBeg=begStmt+blockType.length+1;var blockMarkerEnd=body.indexOf('}',blockMarkerBeg);if(blockMarkerEnd>=0){var blockMarker;if(blockMarkerEnd-blockMarkerBeg<=0){blockMarker="{/"+blockType+"}";}else{blockMarker=body.substring(blockMarkerBeg+1,blockMarkerEnd);}
var blockEnd=body.indexOf(blockMarker,blockMarkerEnd+1);if(blockEnd>=0){emitSectionText(body.substring(endStmtPrev+1,begStmt),funcText);var blockText=body.substring(blockMarkerEnd+1,blockEnd);if(blockType=='cdata'){emitText(blockText,funcText);}else if(blockType=='minify'){emitText(scrubWhiteSpace(blockText),funcText);}else if(blockType=='eval'){if(blockText!=null&&blockText.length>0)
funcText.push('_OUT.write( (function() { '+blockText+' })() );');}
begStmt=endStmtPrev=blockEnd+blockMarker.length-1;}}}else if(body.charAt(begStmt-1)!='$'&&body.charAt(begStmt-1)!='\\'){var offset=(body.charAt(begStmt+1)=='/'?2:1);if(body.substring(begStmt+offset,begStmt+10+offset).search(TrimPath.parseTemplate_etc.statementTag)==0)
break;}
begStmt=body.indexOf("{",begStmt+1);}
if(begStmt<0)
break;var endStmt=body.indexOf("}",begStmt+1);if(endStmt<0)
break;emitSectionText(body.substring(endStmtPrev+1,begStmt),funcText);emitStatement(body.substring(begStmt,endStmt+1),state,funcText,tmplName,etc);endStmtPrev=endStmt;}
emitSectionText(body.substring(endStmtPrev+1),funcText);if(state.stack.length!=0)
throw new etc.ParseError(tmplName,state.line,"unclosed, unmatched statement(s): "+state.stack.join(","));funcText.push("}}; TrimPath_Template_TEMP");return funcText.join("");}
var emitStatement=function(stmtStr,state,funcText,tmplName,etc){var parts=stmtStr.slice(1,-1).split(' ');var stmt=etc.statementDef[parts[0]];if(stmt==null){emitSectionText(stmtStr,funcText);return;}
if(stmt.delta<0){if(state.stack.length<=0)
throw new etc.ParseError(tmplName,state.line,"close tag does not match any previous statement: "+stmtStr);state.stack.pop();}
if(stmt.delta>0)
state.stack.push(stmtStr);if(stmt.paramMin!=null&&stmt.paramMin>=parts.length)
throw new etc.ParseError(tmplName,state.line,"statement needs more parameters: "+stmtStr);if(stmt.prefixFunc!=null)
funcText.push(stmt.prefixFunc(parts,state,tmplName,etc));else
funcText.push(stmt.prefix);if(stmt.suffix!=null){if(parts.length<=1){if(stmt.paramDefault!=null)
funcText.push(stmt.paramDefault);}else{for(var i=1;i<parts.length;i++){if(i>1)
funcText.push(' ');funcText.push(parts[i]);}}
funcText.push(stmt.suffix);}}
var emitSectionText=function(text,funcText){if(text.length<=0)
return;var nlPrefix=0;var nlSuffix=text.length-1;while(nlPrefix<text.length&&(text.charAt(nlPrefix)=='\n'))
nlPrefix++;while(nlSuffix>=0&&(text.charAt(nlSuffix)==' '||text.charAt(nlSuffix)=='\t'))
nlSuffix--;if(nlSuffix<nlPrefix)
nlSuffix=nlPrefix;if(nlPrefix>0){funcText.push('if (_FLAGS.keepWhitespace == true) _OUT.write("');var s=text.substring(0,nlPrefix).replace('\n','\\n');if(s.charAt(s.length-1)=='\n')
s=s.substring(0,s.length-1);funcText.push(s);funcText.push('");');}
var lines=text.substring(nlPrefix,nlSuffix+1).split('\n');for(var i=0;i<lines.length;i++){emitSectionTextLine(lines[i],funcText);if(i<lines.length-1)
funcText.push('_OUT.write("\\n");\n');}
if(nlSuffix+1<text.length){funcText.push('if (_FLAGS.keepWhitespace == true) _OUT.write("');var s=text.substring(nlSuffix+1).replace('\n','\\n');if(s.charAt(s.length-1)=='\n')
s=s.substring(0,s.length-1);funcText.push(s);funcText.push('");');}}
var emitSectionTextLine=function(line,funcText){var endMarkPrev='}';var endExprPrev=-1;while(endExprPrev+endMarkPrev.length<line.length){var begMark="${",endMark="}";var begExpr=line.indexOf(begMark,endExprPrev+endMarkPrev.length);if(begExpr<0)
break;if(line.charAt(begExpr+2)=='%'){begMark="${%";endMark="%}";}
var endExpr=line.indexOf(endMark,begExpr+begMark.length);if(endExpr<0)
break;emitText(line.substring(endExprPrev+endMarkPrev.length,begExpr),funcText);var exprArr=line.substring(begExpr+begMark.length,endExpr).replace(/\|\|/g,"#@@#").split('|');for(var k in exprArr){if(exprArr[k].replace)
exprArr[k]=exprArr[k].replace(/#@@#/g,'||');}
funcText.push('_OUT.write(');emitExpression(exprArr,exprArr.length-1,funcText);funcText.push(');');endExprPrev=endExpr;endMarkPrev=endMark;}
emitText(line.substring(endExprPrev+endMarkPrev.length),funcText);}
var emitText=function(text,funcText){if(text==null||text.length<=0)
return;text=text.replace(/\\/g,'\\\\');text=text.replace(/\n/g,'\\n');text=text.replace(/"/g,'\\"');funcText.push('_OUT.write("');funcText.push(text);funcText.push('");');}
var emitExpression=function(exprArr,index,funcText){var expr=exprArr[index];if(index<=0){funcText.push(expr);return;}
var parts=expr.split(':');funcText.push('_MODIFIERS["');funcText.push(parts[0]);funcText.push('"](');emitExpression(exprArr,index-1,funcText);if(parts.length>1){funcText.push(',');funcText.push(parts[1]);}
funcText.push(')');}
var cleanWhiteSpace=function(result){result=result.replace(/\t/g,"    ");result=result.replace(/\r\n/g,"\n");result=result.replace(/\r/g,"\n");result=result.replace(/^(\s*\S*(\s+\S+)*)\s*$/,'$1');return result;}
var scrubWhiteSpace=function(result){result=result.replace(/^\s+/g,"");result=result.replace(/\s+$/g,"");result=result.replace(/\s+/g," ");result=result.replace(/^(\s*\S*(\s+\S+)*)\s*$/,'$1');return result;}
TrimPath.parseDOMTemplate=function(elementId,optDocument,optEtc){if(optDocument==null)
optDocument=document;var element=optDocument.getElementById(elementId);var content=element.value;if(content==null)
content=element.innerHTML;content=content.replace(/&lt;/g,"<").replace(/&gt;/g,">");return TrimPath.parseTemplate(content,elementId,optEtc);}
TrimPath.processDOMTemplate=function(elementId,context,optFlags,optDocument,optEtc){return TrimPath.parseDOMTemplate(elementId,optDocument,optEtc).process(context,optFlags);}})();if(TourBao==undefined){var TourBao={};}
var TimerLater=function(timeout,handle,fun,args,type){timeout=timeout||0;handle=handle||{};var theFun=fun,funHandle;if(Object.isString(theFun))theFun=handle[fun]
if(!theFun){throw new TypeError("method undefined")}
var f=function(){if(args)
theFun.apply(handle,args);else theFun.apply(handle);}
funHandle=(type)?setInterval(f,timeout):setTimeout(f,timeout);var rs={interval:type,cancel:function(){if(this.interval){clearInterval(funHandle);}else{clearTimeout(funHandle);}}};return rs;}
var TimerControl=function(delay,period){var triggerTimer,runTimer,_self=this;function action(){runTimer=setTimeout(run,period);}
function run(){if(_self.run()===true){action();}else{runTimer=null;}}
this.reset=function(){this.stop();triggerTimer=setTimeout(action,delay);};this.run=function(){};this.stop=function(){if(triggerTimer){clearTimeout(triggerTimer);triggerTimer=null;}
if(runTimer){clearTimeout(runTimer);runTimer=null;}};};TourBao.CS_DHTML=Class.create();TourBao.CS_DHTML.prototype={initialize:function(divId){Object.extend(this,{selectedObj:null,offsetX:0,offsetY:0,scrollComps:false,timeout:0,defaultMenuTimeout:500,origFontSize:0,fontSizeEl:null,initialized:0,rootId:divId});$(this.rootId).CS_DHTML=this;},removeChild:function(parentId,childId){var parentId=parentId||0;var childId=childId||0;var parentEl=$(parentId);var childEl=$(childId);if(parentEl!=null&&childEl!=null){return parentEl.removeChild(childEl);}
return false;},setSelectedElement:function(evt){var target=(evt.target)?evt.target:evt.srcElement;if(target.id){this.selectedObj=$(target.id);}
return(this.selectedObj!=null);},engage:function(evt){var evt=(evt)?evt:event;this.setSelectedElement(evt);if(this.selectedObj){if(evt.clientY){this.offsetY=evt.clientY-((this.selectedObj.offsetTop)?this.selectedObj.offsetTop:0);}else if(evt.offsetY){this.offsetY=evt.offsetY-((evt.offsetY<-2)?0:$(this.rootId).body.scrollTop);}
return false;}},fadeMenu:function(evt,wrapId,iframeId,time){var wrapId=wrapId||null;var iframeId=iframeId||null;var time=time||this.defaultMenuTimeout;var evt=evt||null;var callback=this.switchMenuVisibility(wrapId,iframeId,'hidden');this.timeout=setTimeout(callback,time);if(evt!=null)evt.cancelBubble=true;},stopFadeMenu:function(){this.stopTimeout();},stopTimeout:function(){clearTimeout(this.timeout);},release:function(){if(this.selectedObj)this.selectedObj=null;return false;},getStyleObj:function(obj){var obj=obj||null;var el;if(obj.style)return obj.style;else{el=$(obj);return(el!=null)?el.style:null;}},setStyle:function(obj,attrib,value){var obj=obj||null;var attrib=attrib||null;var value=value||'';var styleObj=this.getStyleObj(obj);if(styleObj!=null&&attrib!=''){eval("styleObj."+attrib+" = '"+value+"'");return true;}
return false;},getStyle:function(obj,attrib){var obj=obj||null;var attrib=attrib||null;var styleObj=this.getStyleObj(obj);if(styleObj!=null&&attrib!=''){return eval('styleObj.'+attrib);}
return false;},shiftTo:function(obj,x,y){var obj=obj||null;var x=x||0;var y=y||0;if(this.setStyle(obj,'left',(typeof x=='string')?x:x.toString()+'px')&&this.setStyle(obj,'top',(typeof y=='string')?y:y.toString()+'px'))return true;else return false;},switchVisibility:function(obj,state){var obj=obj||null;var state=state||null;if(state=='visible'||state=='hidden'){return this.setStyle(obj,'visibility',state);}else{obj=$(obj);if(obj!=null&&obj.style){state=this.getComputedStyle(obj,'visibility');obj.style.visibility=(state=="hidden"||state==null)?"visible":"hidden";return true;}}
return false;},switchDisplay:function(obj,state){var obj=obj||null;var state=state||null;if(state=='block'||state=='none'){return this.setStyle(obj,'display',state);}
else{obj=$(obj);if(obj!=null&&obj.style){state=this.getComputedStyle(obj,'display');obj.style.display=(state=="none"||state==null)?"block":"none";return true;}}},switchMenuVisibility:function(wrapId,iframeId,state){var wrapId=wrapId||null;var iframeId=iframeId||null;var state=state||null;state=(state=='hidden')?'hidden':(state=='visible')?'visible':null;var wrapEl=$(wrapId);if(wrapEl!=null){this.switchVisibility(wrapId,state);if(iframeId!=null){state=(state=='hidden')?'none':(state=='visible')?'block':null;this.setStyle(iframeId,'height',wrapEl.offsetHeight-2);this.switchDisplay(iframeId,state);}}},setHeight:function(obj,h){var h=h||0;return this.setStyle(obj,'height',(typeof h=='string')?h:h.toString()+'px');},getHeight:function(obj){return this.getStyle(obj,'height');},setWidth:function(obj,w){var w=w||0;return this.setStyle(obj,'width',(typeof w=='string')?w:w.toString()+'px');},getWidth:function(obj){return this.getStyle(obj,'width');},addEventListener:function(obj,eventType,funcRef,captureFlag){var obj=obj||0;var eventType=eventType||0;var funcRef=funcRef||0;var captureFlag=captureFlag||true;if(obj&&eventType&&typeof funcRef=='function'){if(typeof obj=='string')obj=$(obj);if(obj!=null){if(obj.addEventListener)obj.addEventListener(eventType,funcRef,captureFlag);else if(obj.attachEvent)obj.attachEvent('on'+eventType,funcRef);else eval("obj.on"+eventType+"=funcRef");}}},cancelEvent:function(){return false;},getComputedStyle:function(obj,attrib){var obj=obj||null;var attrib=attrib||null;var curSize=null;if(typeof obj=="string")obj=$(obj);if(obj!=null&&attrib!=null){if(window.getComputedStyle){var compStyleObj=window.getComputedStyle(obj,"");curSize=compStyleObj.getPropertyValue(attrib);}else if(obj.currentStyle){var parts=attrib.split('-');attrib=parts[0];for(var i=1;i<parts.length;i++){attrib+=parts[i].substr(0,1).toUpperCase()+parts[i].substring(1,parts[i].length);}
curSize=eval('obj.currentStyle.'+attrib);}}
return curSize},createFontSizeTest:function(){var div=document.createElement('div');div.style.fontSize="11px";div.style.display="none";var text=document.createTextNode("test text");div.appendChild(text);this.fontSizeEl=div;},userFontResize:function(){if($(this.rootId).CS_DHTML&&$(rootId).CS_DHTML.fontSizeEl!=null){curSize=$(rootId).CS_DHTML.getComputedStyle($(this.rootId).CS_DHTML.fontSizeEl,'font-size');if(curSize!=null&&curSize!=$(this.rootId).CS_DHTML.origFontSize)history.go(0);}},moveScrollCompToSelectedItem:function(idRout){var idRoot=idRoot||null;var listItem=$(idRoot+'SelectedItem');var wrapStyle=this.getStyleObj(idRoot+'Wrapper');var wrapHeight=(wrapStyle!=null)?parseInt(wrapStyle.height):null
var listItemBottomY=listItem.offsetTop+listItem.offsetHeight;if(listItem!=null&&wrapHeight!=null&&listItemBottomY>wrapHeight){var panel=$(idRoot+'Panel');var bar=$(idRoot+'Bar');var pathStyle=this.getStyleObj(idRoot+'Path');if(panel==null||bar==null&&pathStyle==null)return;var newPanelY;var newBarY;newPanelY=0-listItem.offsetTop;newBarY=(listItemBottomY/panel.offsetHeight)*(parseInt(pathStyle.height)+bar.height);this.shiftTo(panel,null,newPanelY);this.shiftTo(bar,null,newBarY);}},moveScrollComp:function(evt){var evt=(evt)?evt:event;if(this.selectedObj!=null){var bar=this.selectedObj;var barStyle=this.getStyleObj(bar);var idRoot=bar.id.substring(0,bar.id.lastIndexOf("Bar"));var pathStyle=this.getStyleObj(idRoot+"Path");var wrapHeight=parseInt(this.getHeight(idRoot+"Wrapper"));var panel=$(idRoot+"Panel");var panelStyle=this.getStyleObj(panel);if(wrapHeight>=panel.offsetHeight){barStyle.top="0px";panelStyle.top="0px";return false;}
evt.cancelBubble=true;var newY=(evt.clientY)?(evt.clientY-this.offsetY):(evt.pageY)?(evt.pageY-this.offsetY):null;var barMaxY=parseInt(pathStyle.height)-bar.height;if(newY<0)newY=0;else if(newY>barMaxY)newY=barMaxY;this.shiftTo(bar,null,newY);var ratio=parseInt(barStyle.top)/(parseInt(pathStyle.height)-parseInt(bar.height));var newPanelTop=0-((panel.offsetHeight-wrapHeight)*ratio);panelStyle.top=newPanelTop+"px";return false}},setScrollDisplay:function(idRoot,state){var state=state||'none';this.switchDisplay(idRoot+'BarWrapper',state);},initScrollComp:function(idRoot){var bar=$(idRoot+"Bar");var wrapEl=$(idRoot+"Wrapper");var wrapStyle=(wrapEl!=null)?wrapEl.style:null;var panelEl=$(idRoot+"Panel");var barWrapperEl=$(idRoot+"BarWrapper");if(bar!=null&&wrapStyle!=null&&panelEl!=null){if(parseInt(wrapStyle.height)>=panelEl.offsetHeight&&barWrapperEl!=null){this.setScrollDisplay(idRoot,'none');var listWrapper=$(idRoot+'ListWrapper');var listWrapper=$(idRoot+'ListWrapper');if(listWrapper!=null)var panelWidth=listWrapper.offsetWidth;this.setHeight(idRoot+'Wrapper',panelEl.offsetHeight);var barWrapperWidth=this.getWidth(idRoot+'BarWrapper')
if(panelWidth!=null&&barWrapperWidth!=null){this.setWidth(panelEl,parseInt(panelWidth)+parseInt(barWrapperWidth));}}else{wrapEl.onmousedown=this.cancelEvent.bind(this);bar.onmousedown=this.engage.bind(this);var selectedItem=$(idRoot+'SelectedItem');if(this.initialized&&!this.scrollComps){$(this.rootId).onmousemove=this.moveScrollComp.bind(this);}
if(selectedItem!=null){this.moveScrollCompToSelectedItem(idRoot);}
this.scrollComps=true;}}},debug:function(str){var str=str||'here';alert(str);},preload:function(){this.createFontSizeTest();},onload:function(){if(this.scrollComps)
$(this.rootId).onmousemove=this.moveScrollComp.bind(this);$(this.rootId).onmouseup=this.release.bind(this);this.initialized=1;}};TourBao.JSWindowManager=Class.create();TourBao.JSWindowManager.prototype={initialize:function(){this.options=Object.extend({prefix:"$_",systemBarPostfix:"_system_bar",panelPostfix:"_panel",bottomBarPostfix:"_bottom_bar",titlePostfix:"_title",closePostfix:"_close"},arguments[0]||{});this.jsWindowList=[];this.baseIndex=10000;this.indexAdd=0;this.topIndex=99999;this.curWindow=null;Event.observe(document,"keyup",this._closeCurrentWindow.bindAsEventListener(this));},_closeCurrentWindow:function(event){if(this.curWindow&&event.keyCode==Event.KEY_ESC){this.curWindow.hiddenWindow();}},existWindow:function(id){var jsWindow=this.jsWindowList.detect(this._detectIter.bind(this,id));return jsWindow?true:false;},getWindow:function(id){return this.jsWindowList.detect(this._detectIter.bind(this,id));},createWindow:function(id,params){if($(id)!=null){alert("no id in window");return;}
var options=Object.extend({className:false,left:false,top:false,width:600,height:400,notKeepPos:true,onTop:false,hasSystemBar:true,hasBottomBar:true,systemBarClassName:"titlebar",handleClass:"$$_handle_class",titleId:false,title:"JSWindow",hasCloseId:true,closeId:false,hiddenOnClose:true,panelClassName:"content",useShadow:true,needCover:false,allowScroll:false,opacity:0.25,beforShowFunc:Prototype.emptyFunction,afterShowFunc:Prototype.emptyFunction,beforeHiddenFunc:Prototype.emptyFunction,afterHiddenFunc:Prototype.emptyFunction,beforeCloseFunc:Prototype.emptyFunction,afterCloseFunc:Prototype.emptyFunction},params||{});this._buildPos(options);if(options.onTop){options.zIndex=this.topIndex;}else{options.zIndex=this.baseIndex+(this.indexAdd++);}
if(options.titleId==false){options.titleId=this.options.prefix+id+this.options.systemBarPostfix+this.options.titlePostfix;}
if(options.hasSystemBar&&options.hasCloseId&&options.closeId==false){options.closeId=this.options.prefix+id+this.options.systemBarPostfix+this.options.closePostfix;}
var jsWindow=this._createJSWindow(id,options);jsWindow.windowHtml=this._createWindowHtml(id,options);if(options.hasSystemBar){jsWindow.systemBar=this._createSystemBar(jsWindow.windowHtml,id,options);}
jsWindow.panel=this._createPanel(jsWindow.windowHtml,id,options);if(options.hasBottomBar){jsWindow.bottomBar=this._createBottomBar(jsWindow.windowHtml,id,options);}
this.jsWindowList.push(jsWindow);return jsWindow;},_getContainer:function(options){return document.body;},_getLeft:function(width){var left=(document.documentElement.clientWidth-width)/2;if(left<10){left=10;}
return left;},_getTop:function(height,container){var top=document.documentElement.scrollTop+(document.documentElement.clientHeight-height)/2;if(top<10){top=10;}
return top;},_buildPos:function(options){if(!options.left){options.left=this._getLeft(options.width);options._caluLeft=true;}
if(!options.top){options.top=this._getTop(options.height,this._getContainer(options));options._caluTop=true;}},setPos:function(id,pos){var jsWindow=this.jsWindowList.detect(this._detectIter.bind(this,id));this._setPos(jsWindow,pos);return jsWindow;},_setPos:function(jsWindow,pos){if(jsWindow){Object.extend(jsWindow.options,pos);jsWindow.options.notKeepPos=true;this._buildPos(jsWindow.options);}},showWindow:function(id){var jsWindow=this.jsWindowList.detect(this._detectIter.bind(this,id));this._showWindow(jsWindow);return jsWindow;},_showWindow:function(jsWindow){if(jsWindow){this._showMode(jsWindow,true);jsWindow.options.beforShowFunc(jsWindow);if(jsWindow.options.notKeepPos){if(jsWindow.options._caluLeft){jsWindow.options.left=this._getLeft(jsWindow.options.width);}
jsWindow.windowHtml.style.left=jsWindow.options.left+"px";if(jsWindow.options._caluTop){jsWindow.options.top=this._getTop(jsWindow.options.height,jsWindow.containerDiv);}
jsWindow.windowHtml.style.top=jsWindow.options.top+"px";}
jsWindow.windowHtml.style.display="";if(this.options.delSelect){this._hideSelect(true);}
jsWindow.options.afterShowFunc(jsWindow);this.curWindow=jsWindow;}},_showMode:function(jsWindow,show){if(!jsWindow.options.needCover){return;}
var conDiv=jsWindow.containerDiv;var gapDiv=$(conDiv.id+"_gap");if(!gapDiv){gapDiv=document.createElement("div");gapDiv.id=conDiv.id+"_gap";gapDiv.style.position="absolute";gapDiv.style.display="none";gapDiv.style.left="0px";gapDiv.style.top="0px";gapDiv.style.backgroundColor="#ffffff";gapDiv.style.MozOpacity=""+jsWindow.options.opacity;gapDiv.style.filter="alpha(opacity="+jsWindow.options.opacity*100+")";gapDiv.style.width=conDiv.parentNode.scrollWidth+"px";gapDiv.style.height=conDiv.parentNode.scrollHeight+"px";gapDiv.style.zIndex=this.baseIndex-1;if(conDiv==document.body){conDiv.appendChild(gapDiv);}else{conDiv.parentNode.appendChild(gapDiv);}}
gapDiv.style.display=show?"block":"none";},updateTitle:function(id,title){var jsWindow=this.jsWindowList.detect(this._detectIter.bind(this,id));this._updateTitle(jsWindow,title);return jsWindow;},_updateTitle:function(jsWindow,title){if(jsWindow){jsWindow.options.title=title;$(jsWindow.options.titleId).innerHTML=title;}},hiddenWindow:function(id){var jsWindow=this.jsWindowList.detect(this._detectIter.bind(this,id));this._hiddenWindow(jsWindow);return jsWindow;},_hiddenWindow:function(jsWindow){if(jsWindow){this._showMode(jsWindow,false);jsWindow.options.beforeHiddenFunc(jsWindow);jsWindow.windowHtml.style.display="none";if(this.options.delSelect){this._hideSelect(false);}
jsWindow.options.afterHiddenFunc(jsWindow);if(this.curWindow==jsWindow){this.curWindow=null;}}},closeWindow:function(id){var jsWindow=this.jsWindowList.detect(this._detectIter.bind(this,id));return this._closeWindow(jsWindow);},_closeWindow:function(jsWindow){if(jsWindow){this._showMode(jsWindow,false);jsWindow.options.beforeCloseFunc(jsWindow);jsWindow.windowHtml.style.display="none";this._hideSelect(false);if(jsWindow.options.hasSystemBar){Element.remove(jsWindow.systemBar);jsWindow.systemBar=null;}
Element.remove(jsWindow.panel);jsWindow.panel=null;Element.remove(jsWindow.windowHtml);jsWindow.windowHtml=null;this.jsWindowList=this.jsWindowList.reject(this._detectIter.bind(this,jsWindow.id));jsWindow.options.afterCloseFunc();if(this.curWindow==jsWindow){this.curWindow=null;}}},focusWindow:function(jsWindow){if(jsWindow){this._focusWindow(jsWindow.id);}},_focusWindow:function(id){var pos=-1;this.indexAdd=0;for(var i=0;i<this.jsWindowList.length;i++){if(this.jsWindowList[i].id!=id){if(!this.jsWindowList[i].options.onTop){this.jsWindowList[i].options.zIndex=this.baseIndex+(this.indexAdd++);this.jsWindowList[i].windowHtml.style.zIndex=this.jsWindowList[i].options.zIndex;}}else{pos=i;}}
if(pos>-1){this.jsWindowList[pos].options.zIndex=this.baseIndex+(this.indexAdd++);this.jsWindowList[pos].windowHtml.style.zIndex=this.jsWindowList[pos].options.zIndex;this.curWindow=this.jsWindowList[pos];}},_detectIter:function(id,element){if(id==element.id){return true;}
return false;},_createWindowHtml:function(id,options){var windowHtml=document.createElement("div");windowHtml.id=this.options.prefix+id;windowHtml.className=(options.className?options.className:"");windowHtml.style.display="none";windowHtml.style.position="absolute";windowHtml.style.left=options.left+"px";windowHtml.style.top=options.top+"px";windowHtml.style.width=options.width+"px";if(!options.notKeepPos){windowHtml.container="in";}
if(options.height!="auto"){if(isIE){if(IEVer==7){windowHtml.style.minHeight=options.height+"px";windowHtml.style.height="auto";}else{windowHtml.style.height=options.height+"px";}}else{windowHtml.style.minHeight=options.height+"px";windowHtml.style.height="auto";}}
windowHtml.style.zIndex=options.zIndex;this._getContainer(options).appendChild(windowHtml);Event.observe(windowHtml.id,"click",this._focusWindow.bind(this,id));return windowHtml;},_createSystemBar:function(windowHtml,id,options){var systemBar=document.createElement("div");systemBar.id=this.options.prefix+id+this.options.systemBarPostfix;if(options.systemBarClassName){systemBar.className=options.systemBarClassName;}
var g_c_move="";var html="<div>";if(options.hasCloseId){html+="<span id =\""+options.closeId+"\" class=\"r\" title=\"close\">&nbsp;</span>";}
html+="<span style=\"display:block;width:80%\" id=\""+options.titleId+"\">"+options.title+"</span></div>";systemBar.innerHTML=html;windowHtml.appendChild(systemBar);if(options.hasCloseId){if(options.hiddenOnClose){Event.observe(options.closeId,"click",this.hiddenWindow.bind(this,id));}else{Event.observe(options.closeId,"click",this.closeWindow.bind(this,id));}}
return systemBar;},_createPanel:function(windowHtml,id,options){var panel=document.createElement("div");panel.id=this.options.prefix+id+this.options.panelPostfix;if(options.panelClassName){panel.className=options.panelClassName;}
windowHtml.appendChild(panel);return panel;},_createBottomBar:function(windowHtml,id,options){var bottomBar=document.createElement("div");bottomBar.id=this.options.prefix+id+this.options.bottomBarPostfix;if(options.systemBarClassName){bottomBar.className="bottomBar";}
var g_c_move="";var html="<div style='width:323px;margin:0px auto;'>";html+="<span id='$_closeBar' style='width:20px;height:20px;align:center;'><a style='color:#006c9e;font-weight:normal;'>关闭窗口</a></span>";html+="</div>";bottomBar.innerHTML=html;windowHtml.appendChild(bottomBar);Event.observe("$_closeBar","click",this.hiddenWindow.bind(this,id));return bottomBar;},_hideSelect:function(hide){if(isIE&&IEVer<7){var selectArray=document.getElementsByTagName("select");if(selectArray){for(var i=0;i<selectArray.length;i++){if(selectArray[i].getAttribute("nohide")!="true"){selectArray[i].style.visibility=(hide==true)?"hidden":"inherit";}}}}},_createJSWindow:function(id,options){var jsWindow={};jsWindow.id=id;jsWindow.options=options;jsWindow.containerDiv=this._getContainer(options);jsWindow.setPos=function(pos){this._setPos(jsWindow,pos);}.bind(this);jsWindow.showWindow=function(){this._showWindow(jsWindow);}.bind(this);jsWindow.updateTitle=function(title){this._updateTitle(jsWindow,title);}.bind(this);jsWindow.hiddenWindow=function(){this._hiddenWindow(jsWindow);}.bind(this);jsWindow.closeWindow=function(){this._closeWindow(jsWindow);}.bind(this);jsWindow.focusWindow=function(){this.focusWindow(jsWindow);}.bind(this);return jsWindow;}};TourBao.PICTURE=Class.create();TourBao.PICTURE.prototype={initialize:function(ulId){Object.extend(this,{num:1,time:2,t:null});var eve=ulId.childNodes;if(isIE){$('pictureUl').childNodes[0].className="SlideCurrent2";}else{$('pictureUl').childNodes[1].className="SlideCurrent2";}
this.timedCount();if(isIE){var length=ulId.childNodes.length;for(var i=0;i<length;i++){Event.observe(eve[i],"mouseover",this.changePicture.bind(this,i));Event.observe(eve[i],"mouseout",this.backChange.bind(this,i));}}else{for(var i=1;i<ulId.childNodes.length-1;i++){Event.observe(eve[i],"mouseover",this.changePicture.bind(this,i));Event.observe(eve[i],"mouseout",this.backChange.bind(this,i));}}},timedCount:function(){timeLater=TimerLater(4000,this,function(){this.changeByTime(this.time);if(this.time==1){this.cancelByTime(this.time+1);this.cancelByTime(this.time+2);}
if(this.time==2){this.cancelByTime(this.time-1);this.cancelByTime(this.time+1);}
if(this.time==3){this.cancelByTime(this.time-1);this.cancelByTime(this.time-2);}
this.time++;if(this.time>3)
this.time=1;this.timedCount();})},changeByTime:function(num){var index=num;var length=$('mainPictureUl').childNodes.length;if(isIE){$('pictureUl').childNodes[index-1].className="SlideCurrent2";for(var i=0;i<length;i++){if(i+""==index-1){$('mainPictureUl').childNodes[i].style.display="block";continue;}
$('mainPictureUl').childNodes[i].style.display="none";}}else{$('pictureUl').childNodes[index].className="SlideCurrent2";for(var i=1;i<length-1;i++){if(i+""==index){$('mainPictureUl').childNodes[i].style.display="block";continue;}
$('mainPictureUl').childNodes[i].style.display="none";}}},cancelByTime:function(num){var index=num;if(isIE){$('pictureUl').childNodes[index-1].className="";}else{$('pictureUl').childNodes[index].className="";}},changePicture:function(eve){if(timeLater){timeLater.cancel();}
var index=eve;var length=$('mainPictureUl').childNodes.length;if(isIE){for(var j=0;j<length;j++){if(j+""==index){$('pictureUl').childNodes[j].className="SlideCurrent2";continue;}
$('pictureUl').childNodes[j].className="";}
for(var i=0;i<length;i++){if(i+""==index){$('mainPictureUl').childNodes[i].style.display="block";continue;}
$('mainPictureUl').childNodes[i].style.display="none";}}else{for(var j=1;j<length-1;j++){if(j+""==index){$('pictureUl').childNodes[j].className="SlideCurrent2";continue;}
$('pictureUl').childNodes[j].className="";}
for(var i=1;i<length-1;i++){if(i+""==index){$('mainPictureUl').childNodes[i].style.display="block";continue;}
$('mainPictureUl').childNodes[i].style.display="none";}}},backChange:function(eve){var index=eve;if(isIE){$('pictureUl').childNodes[index].className="";this.timedCount();}else{$('pictureUl').childNodes[index].className="";this.timedCount();}}}
if(TourBao==undefined){var TourBao={};}
TourBao.ConfigConstant={_sh_prefix:'_sh',historyLength:3,historyLengthThreec:6,usePooling:true};TourBao.SortImgs={noSortImg:STYLE_PREFIX+"/images/button/noSort.gif",ascSortImg:STYLE_PREFIX+"/images/button/ascSort.gif",descSortImg:STYLE_PREFIX+"/images/button/descSort.gif"};TourBao.HideAndShowImgs={showImg:STYLE_PREFIX+"/images/button/show.gif",hideImg:STYLE_PREFIX+"/images/button/hide.gif",flightIntelShowImg:STYLE_PREFIX+"/images/button/intelshow.gif",flightIntelHideImg:STYLE_PREFIX+"/images/button/intelhide.gif",roundtripShowImg:STYLE_PREFIX+"/images/button/step_yuding.gif",roundtripHideImg:STYLE_PREFIX+"/images/button/step_yuding_hide.gif",showHistoryImg:STYLE_PREFIX+"/images/utils/search_icon2.gif",hideHistoryImg:STYLE_PREFIX+"/images/utils/search_icon.gif"}
TourBao.ConfigConstant.OneWayFlight=$H();TourBao.ConfigConstant.ForeignFlight=$H();TourBao.ConfigConstant.OneWayFlight.indexMap={code:0,wrapperName:1,imgUrl:2,deptAirport:3,arriAirport:4,deptTime:5,arriTime:6,deptDate:7,planeType:8,flightCourseSiteId:9,price:11,vendorId:12,updateTime:13,classType:14,airlineShortName:15,arriCity:16,classCode:17,jumpInfo:18,deptCity:19,origPrice:20,vendorList:10,lowestPrice:11,highestPrice:31,sortedVendorId:30,isExpanding:14,isCombined:16,isSelected:17,combinedWrapperName:18,isSameWrapper:19,vendorListSec:21,wrapperNameSec:22,deptTimeSec:23,arriTimeSec:24,deptAirportSec:25,arriAirPortSec:26,planeScale:19};TourBao.ConfigConstant.OneWayFlight.defaultSort=[[TourBao.ConfigConstant.OneWayFlight.indexMap.lowestPrice,false],[TourBao.ConfigConstant.OneWayFlight.indexMap.deptTime,false]];TourBao.ConfigConstant.flight=$H();TourBao.ConfigConstant.flight.filters=[{name:"lowestPrice",refIndex:11},{name:"deptTime",refIndex:5},{name:"arriTime",refIndex:6},{name:"Carrier",refIndex:1},{name:"wayType",refIndex:16}];TourBao.ConfigConstant.flight.sorts=[{name:"price",refIndex:11},{name:"deptTime",refIndex:5},{name:"arriTime",refIndex:6}];TourBao.ConfigConstant.ForeignFlight.indexMap={deptCity:0,arriCity:1,deptTime:2,arriTime:3,deptDate:4,transNum:5,flightCourseInfo:6,price:7,lowestPrice:7,tax:8,type:9,isExpanding:10,returnDeptTime:11,returnArriTime:12,updateTime:13,returnTransNum:14,vendorId:15,jumpInfo:16,currency:17};TourBao.ConfigConstant.ForeignFlight.detailIndexMap={code:0,airlineName:1,imgUrl:2,deptAirport:3,arriAirport:4,deptTime:5,arriTime:6,deptDate:7,planeType:8,flightCourseSiteId:9,type:10,stopTime:11,flyTime:12};TourBao.ConfigConstant.Hotel=$H();TourBao.ConfigConstant.Hotel.indexMap={type:0,type1:1,type2:2,price:3,hotelInnerId:4,vendorId:5,origPrice:6,updateTime:7,isUpdated:8,roomInnerId:9,breakfastType:10,broadbandType:11};TourBao.ConfigConstant.Hotel.listMap={name:-1,id:0,star:1,price:2,picUrl:3,facility:4,area:5,score:6,encodedLatLon:7,allLatLon:8,hotelBasicNum:9,pictureNum:10,weight:11};TourBao.InitInfo=$H();TourBao.ConfigConstant.TCProduct=$H();TourBao.ConfigConstant.TCProduct.listMap={id:0,brand:1,category:2,name:3,highestPrice:4,lowestPrice:5,vendorCount:6,vendorIdList:7,pictureUrl:8,description:9,productSiteList:10,updateTime:11,avgPrice:12,sortedProductSiteKeys:13,star:14,inStock:15};TourBao.CookieConstant={flight:'flight',domesticFlight:'domesticFlight',foreignFlight:'domesticFlight',hotel:'hotel',scene:'scene',trip:'trip',threec:'threec'};TourBao.HotCity={};TourBao.HotCity.FlightStr='';var where=new Array(28);function comefrom(loca,locacityStr){this.loca=loca;this.locacity=locacityStr.split("|");}
;function findProvince(city){var province="不限";for(var i=0;i<where.length;i++){for(var j=0;j<where[i].locacity.length;j++){if(where[i].locacity[j]==city){province=where[i].loca;break;}}}
if(province=="不限")
province="";return province;}
function select(province,city){with($(province)){var loca2=options[selectedIndex].text;}
for(i=0;i<where.length;i++){if(where[i].loca==loca2){loca3=where[i].locacity;with($(city)){for(j=0;j<loca3.length;j++){length=loca3.length;options[j].text=loca3[j];options[j].value=loca3[j];var loca4=options[selectedIndex].value;}
options[0].value="";}
break;}}}
function provinceCityInit(province,city){var p=$(province);if(p){with(p){length=where.length;options[0].text=where[0].loca;options[0].value="";for(k=1;k<where.length;k++){options[k].text=where[k].loca;options[k].value=where[k].loca;}
selectedIndex=0;}
with($(city)){loca3=where[0].locacity;length=loca3.length;options[0].text=loca3[0];options[0].value="";for(l=1;l<length;l++){options[l].text=loca3[l];options[l].value=loca3[l];}
selectedIndex=0;}}}
var type="";var ajaxType="";var firstClick;function changeHeaderCity(id){var item=$(id);if(id=="hotelChangeCity"){type="hotelChangeCity";}
else if(id=="headerCurrentCityInner"){type="innerChangeCity";}
else if(id=="specialChangeCity"){type="special";ajaxType=arguments[1];}else{type="header";}
var itemHeaderHotCity=$("headerHotCity");var itemHeaderAllCity=$("headerAllCity");var itemHeaderIframe=$("headerIframe");var x=0;var y=0;do{x+=item.offsetLeft;y+=item.offsetTop;item=item.offsetParent;}while(item!=null&&item.tagName.toUpperCase()!="BODY");itemHeaderHotCity.style.top=y+19+"px";itemHeaderHotCity.style.left=x+"px";itemHeaderAllCity.style.top=y+19+"px";itemHeaderAllCity.style.left=x+"px";itemHeaderHotCity.style.display="block";itemHeaderIframe.style.top=y+19+"px";itemHeaderIframe.style.left=x+2+"px";itemHeaderIframe.style.height=isIE?"150px":"150px";itemHeaderIframe.style.display="block";itemHeaderAllCity.style.display="none";}
function setCurrentCity(){if(type=="header"){var currentUrl=document.URL;var gotoUrl=FLIGHT_URL_PREFIX+"/From_"+$("headerCity").value+".html";if(currentUrl.match(/jingdian/))gotoUrl=SCENE_URL_PREFIX+"/From_"+$("headerCity").value+".html";if(currentUrl.match(/xianlu/))gotoUrl=TRIP_URL_PREFIX+"/From_"+$("headerCity").value+".html";if(currentUrl.match(/jipiao/))gotoUrl=FLIGHT_URL_PREFIX+"/From_"+$("headerCity").value+".html";if(currentUrl.match(/jiudian/)){if(currentUrl.match(/com\/$/)||currentUrl.match(/From/))
gotoUrl=HOTEL_URL_PREFIX+"/From_"+$("headerCity").value+".html";else gotoUrl=HOTEL_URL_PREFIX+"/"+$("headerCity").value+".html";}
if(currentUrl.match(/mapSearch/)){var mapType=currentUrl.substring(currentUrl.indexOf("mapType")+8);gotoUrl="/mapSearch/?currentCity="+$("headerCity").value+"&mapType="+mapType;}
hideHeaderCity();gotoUrl=encodeURI(gotoUrl);location.href=gotoUrl;}else if(type=="special"){var ajaxUrl="/special.do?ajaxType="+ajaxType+"&specialCity="+$("headerCity").value;hideHeaderCity();$('specialCurrentCity').innerHTML="<font color='#72A5C2'>"+$("headerCity").value+"</font>";ajaxUrl=encodeURI(ajaxUrl);new Ajax.Updater("fd_content",ajaxUrl,{onSuccess:function(){$('fd_content').innerHTML=arguments[0].responseText;}});}
else if(type=="innerChangeCity"||type=="hotelChangeCity"){setHeaderCurrentCity($("headerCity").value);}}
var index=0;function setHeaderCurrentCity(cityName,firstOnload){if(firstOnload)
return;if($("hotHotel")){var length=$("hotHotel").childNodes.length}
if($("innerCity_"+cityName)&&type!="header"){changeCity("innerCity_"+cityName);hideHeaderCity();return;}
if(type=="header"){var currentUrl=document.URL;var gotoUrl=FLIGHT_URL_PREFIX+"/From_"+cityName+".html";if(currentUrl.match(/jingdian/))gotoUrl=SCENE_URL_PREFIX+"/From_"+cityName+".html";if(currentUrl.match(/xianlu/))gotoUrl=TRIP_URL_PREFIX+"/From_"+cityName+".html";if(currentUrl.match(/jipiao/))gotoUrl=FLIGHT_URL_PREFIX+"/From_"+cityName+".html";if(currentUrl.match(/jiudian/)){if(currentUrl.match(/com\/$/)||currentUrl.match(/From/))
gotoUrl=HOTEL_URL_PREFIX+"/From_"+cityName+".html?currentCity="+cityName;else gotoUrl=HOTEL_URL_PREFIX+"/"+cityName+".html?currentCity="+cityName;}
if(currentUrl.match(/mapSearch/)){var mapType=currentUrl.substring(currentUrl.indexOf("mapType")+8);gotoUrl="/mapSearch/?currentCity="+cityName+"&mapType="+mapType;}
hideHeaderCity();gotoUrl=encodeURI(gotoUrl);location.href=gotoUrl;}else if(type=="special"){var ajaxUrl="/special.do?ajaxType="+ajaxType+"&specialCity="+cityName;hideHeaderCity();$('specialCurrentCity').innerHTML="<font color='#72A5C2'>"+cityName+"</font>";ajaxUrl=encodeURI(ajaxUrl);new Ajax.Updater("fd_content",ajaxUrl,{onSuccess:function(){$('fd_content').innerHTML=arguments[0].responseText;}});}else if(type=="innerChangeCity"){Element.show($("innerCity"));var courseDiv=document.createElement("div");courseDiv.id="innerCity_"+cityName;$("innerCity").appendChild(courseDiv);if(type=="innerChangeCity"){Element.show($("innerWaitState"));var ajaxUrl="/special.do?ajaxType=flight"+"&specialCity="+cityName;ajaxUrl=encodeURI(ajaxUrl);new Ajax.Request(ajaxUrl,{onComplete:function(originalRequest){var result=originalRequest.responseText;$("innerCity_"+cityName).innerHTML="";$("innerCity_"+cityName).innerHTML=result;Element.hide($("innerWaitState"));Element.show($("innerCity"));}});}
hideHeaderCity();changeCity("innerCity_"+cityName);}else if(type=="hotelChangeCity"){var isHotCity="杭州,北京,上海,广州,南京,厦门,三亚".match(cityName);if(isHotCity==null){var flag=false;var lastNode=null;index++;if(index>1&&$("hotHotel").childNodes[length-1].id!="三亚"){lastNode=$("hotHotel").childNodes[length-1];var newHotelLi=document.createElement("li");var newLink=document.createElement("a");newHotelLi.id=cityName;newHotelLi.className="special_fisrt_cur";newLink.innerHTML=cityName;newHotelLi.appendChild(newLink);$("hotHotel").removeChild(lastNode);$("hotHotel").appendChild(newHotelLi);}else{var newHotelLi=document.createElement("li");var newLink=document.createElement("a");newHotelLi.id=cityName;newHotelLi.className="special_fisrt_cur";newLink.innerHTML=cityName;newHotelLi.appendChild(newLink);$("hotHotel").appendChild(newHotelLi);hideHeaderCity();}}
if($("hotHotel_"+cityName)){if($("hotHotel").childNodes[length-1].id!="三亚"&&isHotCity!=null){lastNode=$("hotHotel").childNodes[length-1];$("hotHotel").removeChild(lastNode);}
changeHotHotelDiv(cityName);changeHotelTab(cityName);hideHeaderCity();return;}else{if($("hotHotel").childNodes[length-1].id!="三亚"&&isHotCity!=null){lastNode=$("hotHotel").childNodes[length-1];$("hotHotel").removeChild(lastNode);}
changeHotelTab(cityName);Element.show($("waitHotelState"));Element.hide($("hotHotelList"));var courseDiv=document.createElement("div");courseDiv.id="hotHotel_"+cityName;$("hotHotelList").appendChild(courseDiv);var ajaxUrl="/special.do?ajaxType=hotel"+"&specialCity="+cityName;hideHeaderCity();ajaxUrl=encodeURI(ajaxUrl);new Ajax.Request(ajaxUrl,{onComplete:function(req){var result=req.responseText;$("hotHotel_"+cityName).innerHTML=result;Element.hide($("waitHotelState"));Element.show($("hotHotelList"));}});changeHotHotelDiv(cityName);}}}
function showHeaderAllCity(){var itemHeaderHotCity=$("headerHotCity");var itemHeaderAllCity=$("headerAllCity");var itemHeaderIframe=$("headerIframe");provinceCityInit("headerProvince","headerCity");$("headerHotCity").style.display="none";$("headerAllCity").style.display="block";$("headerIframe").style.display="block";}
function hideHeaderCity(){$("headerHotCity").style.display="none";$("headerAllCity").style.display="none";$("headerIframe").style.display="none";}
function changeCity(showDiv){var length=$("innerCity").childNodes.length;if(isIE){for(var i=0;i<length-1;i++){if(showDiv==$("innerCity").childNodes[i].id)
Element.show($("innerCity").childNodes[i]);else
Element.hide($("innerCity").childNodes[i]);}}
for(var i=0;i<length;i++){if(showDiv==$("innerCity").childNodes[i].id){Element.show($("innerCity").childNodes[i]);}
else{Element.hide($("innerCity").childNodes[i]);}}}
var hotCityType="flight";var cityCtrl=new Object();var citySite=new Object();function hotCityImg(evt,popId,cityTextId,type){if($("CalFrame"))
$("CalFrame").style.display="none";if($("hotCityDiv").style.display=="block"&&$("hotCityIframe").style.display=="block"){if(evt.clientX<($("hotCityDiv").offsetLeft+$("hotCityDiv").offsetWidth)&&evt.clientX>$("hotCityDiv").offsetLeft){hideHotCity();return;}}
if(type!=null){hotCityType=type;}else{hotCityType="flight";}
rHotCity(evt,$(popId),$(cityTextId));}
function rHotCity(evt,popCtrl,cCtrl)
{if(hotCityType=="flight"){$("hotCityContent").innerHTML=TourBao.HotCity.FlightStr;}else{$("hotCityContent").innerHTML=TourBao.HotCity.HotelStr;}
evt.cancelBubble=true;cityCtrl=cCtrl;citySite=popCtrl;var point=fGetXY(citySite);with($("hotCityDiv").style)
{left=point.x+"px";top=point.y+popCtrl.offsetHeight+2+"px";display='block';zindex='99999';position='absolute';}
$("hotCityIframe").style.top=$("hotCityDiv").style.top;$("hotCityIframe").style.left=$("hotCityDiv").style.left;$("hotCityIframe").style.height=isIE?"150px":"138px";$("hotCityIframe").style.frameborder="0";$("hotCityIframe").style.display='block';$("hotCityDiv").focus();}
function setCity(ele)
{cityCtrl.value=ele.innerHTML.stripTags();hideHotCity();}
function hideHotCity()
{$("hotCityIframe").style.height=isIE?"150px":"138px";$("hotCityDiv").style.display="none";$("hotCityIframe").style.display="none";}
function Point(iX,iY)
{this.x=iX;this.y=iY;}
function fGetXY(aTag)
{var tmp=aTag;var pt=new Point(0,0);do{pt.x+=tmp.offsetLeft;pt.y+=tmp.offsetTop;tmp=tmp.offsetParent;}while(tmp!=null&&tmp.tagName.toUpperCase()!="BODY");return pt;}
function getCityDiv()
{var noSelectForIE="";var noSelectForFireFox="";if(document.all)
{noSelectForIE="onselectstart='return false;'";}
else
{noSelectForFireFox="-moz-user-select:none;";}
var cityDiv="";cityDiv+="<div id='hotCityDiv' onclick='event.cancelBubble=true' "+noSelectForIE+" style='"+noSelectForFireFox+"position:absolute;z-index:99999;display:none;width:282px;height:136px;border:1px #FFF solid;background:#FFFFFF;'><div id='hotCityContent'></div></div>";return cityDiv;}
function getIframe()
{var cityIframe="";cityIframe+="<iframe id='hotCityIframe' frameborder='0'  style='position:absolute;z-index:9999;display:none;width:282px;height:106px;border:1px #FFF solid;background:#FFFFFF;'></iframe>";return cityIframe;}
function showMoreCity()
{if($("moreCityDiv").style.display=="block"){$("moreCityDiv").style.display="none";$("up_moreCity").style.display="none";$("down_moreCity").style.display="block";$("hotCityIframe").style.height=isIE?"150px":"138px";}else{$("moreCityDiv").style.display="block";$("up_moreCity").style.display="block";$("down_moreCity").style.display="none";$("hotCityIframe").style.height=isIE?"240px":"240px";}}
with(document){write(getIframe());write(getCityDiv());Event.observe(document,"click",hideHotCity);}
if(dwr==null)var dwr={};if(dwr.engine==null)dwr.engine={};if(DWREngine==null)var DWREngine=dwr.engine;dwr.engine.setErrorHandler=function(handler){dwr.engine._errorHandler=handler;};dwr.engine.setWarningHandler=function(handler){dwr.engine._warningHandler=handler;};dwr.engine.setTextHtmlHandler=function(handler){dwr.engine._textHtmlHandler=handler;}
dwr.engine.setTimeout=function(timeout){dwr.engine._timeout=timeout;};dwr.engine.setPreHook=function(handler){dwr.engine._preHook=handler;};dwr.engine.setPostHook=function(handler){dwr.engine._postHook=handler;};dwr.engine.setHeaders=function(headers){dwr.engine._headers=headers;};dwr.engine.setParameters=function(parameters){dwr.engine._parameters=parameters;};dwr.engine.XMLHttpRequest=1;dwr.engine.IFrame=2;dwr.engine.ScriptTag=3;dwr.engine.setRpcType=function(newType){if(newType!=dwr.engine.XMLHttpRequest&&newType!=dwr.engine.IFrame&&newType!=dwr.engine.ScriptTag){dwr.engine._handleError(null,{name:"dwr.engine.invalidRpcType",message:"RpcType must be one of dwr.engine.XMLHttpRequest or dwr.engine.IFrame or dwr.engine.ScriptTag"});return;}
dwr.engine._rpcType=newType;};dwr.engine.setHttpMethod=function(httpMethod){if(httpMethod!="GET"&&httpMethod!="POST"){dwr.engine._handleError(null,{name:"dwr.engine.invalidHttpMethod",message:"Remoting method must be one of GET or POST"});return;}
dwr.engine._httpMethod=httpMethod;};dwr.engine.setOrdered=function(ordered){dwr.engine._ordered=ordered;};dwr.engine.setAsync=function(async){dwr.engine._async=async;};dwr.engine.setActiveReverseAjax=function(activeReverseAjax){if(activeReverseAjax){if(dwr.engine._activeReverseAjax)return;dwr.engine._activeReverseAjax=true;dwr.engine._poll();}
else{if(dwr.engine._activeReverseAjax&&dwr.engine._pollReq)dwr.engine._pollReq.abort();dwr.engine._activeReverseAjax=false;}};dwr.engine.setPollType=function(newPollType){if(newPollType!=dwr.engine.XMLHttpRequest&&newPollType!=dwr.engine.IFrame){dwr.engine._handleError(null,{name:"dwr.engine.invalidPollType",message:"PollType must be one of dwr.engine.XMLHttpRequest or dwr.engine.IFrame"});return;}
dwr.engine._pollType=newPollType;};dwr.engine.defaultErrorHandler=function(message,ex){dwr.engine._debug("Error: "+ex.name+", "+ex.message,true);if(message==null||message=="")alert("A server error has occured. More information may be available in the console.");else if(message.indexOf("0x80040111")!=-1)dwr.engine._debug(message);else alert(message);};dwr.engine.defaultWarningHandler=function(message,ex){dwr.engine._debug(message);};dwr.engine.beginBatch=function(){if(dwr.engine._batch){dwr.engine._handleError(null,{name:"dwr.engine.batchBegun",message:"Batch already begun"});return;}
dwr.engine._batch=dwr.engine._createBatch();};dwr.engine.endBatch=function(options){var batch=dwr.engine._batch;if(batch==null){dwr.engine._handleError(null,{name:"dwr.engine.batchNotBegun",message:"No batch in progress"});return;}
dwr.engine._batch=null;if(batch.map.callCount==0)return;if(options)dwr.engine._mergeBatch(batch,options);if(dwr.engine._ordered&&dwr.engine._batchesLength!=0){dwr.engine._batchQueue[dwr.engine._batchQueue.length]=batch;}
else{dwr.engine._sendData(batch);}};dwr.engine.setPollMethod=function(type){dwr.engine.setPollType(type);};dwr.engine.setMethod=function(type){dwr.engine.setRpcType(type);};dwr.engine.setVerb=function(verb){dwr.engine.setHttpMethod(verb);};dwr.engine._origScriptSessionId="${scriptSessionId}";dwr.engine._sessionCookieName="${sessionCookieName}";dwr.engine._allowGetForSafariButMakeForgeryEasier="${allowGetForSafariButMakeForgeryEasier}";dwr.engine._scriptTagProtection="${scriptTagProtection}";dwr.engine._defaultPath="${defaultPath}";dwr.engine._scriptSessionId=null;dwr.engine._getScriptSessionId=function(){if(dwr.engine._scriptSessionId==null){dwr.engine._scriptSessionId=dwr.engine._origScriptSessionId+Math.floor(Math.random()*1000);}
return dwr.engine._scriptSessionId;};dwr.engine._errorHandler=dwr.engine.defaultErrorHandler;dwr.engine._warningHandler=dwr.engine.defaultWarningHandler;dwr.engine._preHook=null;dwr.engine._postHook=null;dwr.engine._batches={};dwr.engine._batchesLength=0;dwr.engine._batchQueue=[];dwr.engine._rpcType=dwr.engine.XMLHttpRequest;dwr.engine._httpMethod="POST";dwr.engine._ordered=false;dwr.engine._async=true;dwr.engine._batch=null;dwr.engine._timeout=0;dwr.engine._DOMDocument=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"];dwr.engine._XMLHTTP=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];dwr.engine._activeReverseAjax=false;dwr.engine._pollType=dwr.engine.XMLHttpRequest;dwr.engine._outstandingIFrames=[];dwr.engine._pollReq=null;dwr.engine._pollCometInterval=200;dwr.engine._pollRetries=0;dwr.engine._maxPollRetries=0;dwr.engine._textHtmlHandler=null;dwr.engine._headers=null;dwr.engine._parameters=null;dwr.engine._postSeperator="\n";dwr.engine._defaultInterceptor=function(data){return data;}
dwr.engine._urlRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._contentRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._replyRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._nextBatchId=0;dwr.engine._propnames=["rpcType","httpMethod","async","timeout","errorHandler","warningHandler","textHtmlHandler"];dwr.engine._partialResponseNo=0;dwr.engine._partialResponseYes=1;dwr.engine._partialResponseFlush=2;dwr.engine._execute=function(path,scriptName,methodName,vararg_params){var singleShot=false;if(dwr.engine._batch==null){dwr.engine.beginBatch();singleShot=true;}
var batch=dwr.engine._batch;var args=[];for(var i=0;i<arguments.length-3;i++){args[i]=arguments[i+3];}
if(batch.path==null){batch.path=path;}
else{if(batch.path!=path){dwr.engine._handleError(batch,{name:"dwr.engine.multipleServlets",message:"Can't batch requests to multiple DWR Servlets."});return;}}
var callData;var lastArg=args[args.length-1];if(typeof lastArg=="function"||lastArg==null)callData={callback:args.pop()};else callData=args.pop();dwr.engine._mergeBatch(batch,callData);batch.handlers[batch.map.callCount]={exceptionHandler:callData.exceptionHandler,callback:callData.callback};var prefix="c"+batch.map.callCount+"-";batch.map[prefix+"scriptName"]=scriptName;batch.map[prefix+"methodName"]=methodName;batch.map[prefix+"id"]=batch.map.callCount;for(i=0;i<args.length;i++){dwr.engine._serializeAll(batch,[],args[i],prefix+"param"+i);}
batch.map.callCount++;if(singleShot)dwr.engine.endBatch();};dwr.engine._poll=function(overridePath){if(!dwr.engine._activeReverseAjax)return;var batch=dwr.engine._createBatch();batch.map.id=0;batch.map.callCount=1;batch.isPoll=true;if(navigator.userAgent.indexOf("Gecko/")!=-1){batch.rpcType=dwr.engine._pollType;batch.map.partialResponse=dwr.engine._partialResponseYes;}
else if(document.all){batch.rpcType=dwr.engine.IFrame;batch.map.partialResponse=dwr.engine._partialResponseFlush;}
else{batch.rpcType=dwr.engine._pollType;batch.map.partialResponse=dwr.engine._partialResponseNo;}
batch.httpMethod="POST";batch.async=true;batch.timeout=0;batch.path=(overridePath)?overridePath:dwr.engine._defaultPath;batch.preHooks=[];batch.postHooks=[];batch.errorHandler=dwr.engine._pollErrorHandler;batch.warningHandler=dwr.engine._pollErrorHandler;batch.handlers[0]={callback:function(pause){dwr.engine._pollRetries=0;setTimeout("dwr.engine._poll()",pause);}};dwr.engine._sendData(batch);if(batch.rpcType==dwr.engine.XMLHttpRequest){dwr.engine._checkCometPoll();}};dwr.engine._pollErrorHandler=function(msg,ex){dwr.engine._pollRetries++;dwr.engine._debug("Reverse Ajax poll failed (pollRetries="+dwr.engine._pollRetries+"): "+ex.name+" : "+ex.message);if(dwr.engine._pollRetries<dwr.engine._maxPollRetries){setTimeout("dwr.engine._poll()",10000);}
else{dwr.engine._debug("Giving up.");}};dwr.engine._createBatch=function(){var batch={map:{callCount:0,page:window.location.pathname+window.location.search,httpSessionId:dwr.engine._getJSessionId(),scriptSessionId:dwr.engine._getScriptSessionId()},charsProcessed:0,paramCount:0,headers:[],parameters:[],isPoll:false,headers:{},handlers:{},preHooks:[],postHooks:[],rpcType:dwr.engine._rpcType,httpMethod:dwr.engine._httpMethod,async:dwr.engine._async,timeout:dwr.engine._timeout,errorHandler:dwr.engine._errorHandler,warningHandler:dwr.engine._warningHandler,textHtmlHandler:dwr.engine._textHtmlHandler};if(dwr.engine._preHook)batch.preHooks.push(dwr.engine._preHook);if(dwr.engine._postHook)batch.postHooks.push(dwr.engine._postHook);var propname,data;if(dwr.engine._headers){for(propname in dwr.engine._headers){data=dwr.engine._headers[propname];if(typeof data!="function")batch.headers[propname]=data;}}
if(dwr.engine._parameters){for(propname in dwr.engine._parameters){data=dwr.engine._parameters[propname];if(typeof data!="function")batch.parameters[propname]=data;}}
return batch;}
dwr.engine._mergeBatch=function(batch,overrides){var propname,data;for(var i=0;i<dwr.engine._propnames.length;i++){propname=dwr.engine._propnames[i];if(overrides[propname]!=null)batch[propname]=overrides[propname];}
if(overrides.preHook!=null)batch.preHooks.unshift(overrides.preHook);if(overrides.postHook!=null)batch.postHooks.push(overrides.postHook);if(overrides.headers){for(propname in overrides.headers){data=overrides.headers[propname];if(typeof data!="function")batch.headers[propname]=data;}}
if(overrides.parameters){for(propname in overrides.parameters){data=overrides.parameters[propname];if(typeof data!="function")batch.map["p-"+propname]=""+data;}}};dwr.engine._getJSessionId=function(){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=cookies[i];while(cookie.charAt(0)==' ')cookie=cookie.substring(1,cookie.length);if(cookie.indexOf(dwr.engine._sessionCookieName+"=")==0){return cookie.substring(11,cookie.length);}}
return"";}
dwr.engine._checkCometPoll=function(){for(var i=0;i<dwr.engine._outstandingIFrames.length;i++){var text="";var iframe=dwr.engine._outstandingIFrames[i];try{text=dwr.engine._getTextFromCometIFrame(iframe);}
catch(ex){dwr.engine._handleWarning(iframe.batch,ex);}
if(text!="")dwr.engine._processCometResponse(text,iframe.batch);}
if(dwr.engine._pollReq){var req=dwr.engine._pollReq;var text=req.responseText;dwr.engine._processCometResponse(text,req.batch);}
if(dwr.engine._outstandingIFrames.length>0||dwr.engine._pollReq){setTimeout("dwr.engine._checkCometPoll()",dwr.engine._pollCometInterval);}};dwr.engine._getTextFromCometIFrame=function(frameEle){var body=frameEle.contentWindow.document.body;if(body==null)return"";var text=body.innerHTML;if(text.indexOf("<PRE>")==0||text.indexOf("<pre>")==0){text=text.substring(5,text.length-7);}
return text;};dwr.engine._processCometResponse=function(response,batch){if(batch.charsProcessed==response.length)return;if(response.length==0){batch.charsProcessed=0;return;}
var firstStartTag=response.indexOf("//#DWR-START#",batch.charsProcessed);if(firstStartTag==-1){batch.charsProcessed=response.length;return;}
var lastEndTag=response.lastIndexOf("//#DWR-END#");if(lastEndTag==-1){return;}
if(response.charCodeAt(lastEndTag+11)==13&&response.charCodeAt(lastEndTag+12)==10){batch.charsProcessed=lastEndTag+13;}
else{batch.charsProcessed=lastEndTag+11;}
var exec=response.substring(firstStartTag+13,lastEndTag);dwr.engine._receivedBatch=batch;dwr.engine._eval(exec);dwr.engine._receivedBatch=null;};dwr.engine._sendData=function(batch){batch.map.batchId=dwr.engine._nextBatchId++;dwr.engine._batches[batch.map.batchId]=batch;dwr.engine._batchesLength++;batch.completed=false;for(var i=0;i<batch.preHooks.length;i++){batch.preHooks[i]();}
batch.preHooks=null;if(batch.timeout&&batch.timeout!=0){batch.interval=setInterval(function(){dwr.engine._abortRequest(batch);},batch.timeout);}
if(batch.rpcType==dwr.engine.XMLHttpRequest){if(window.XMLHttpRequest){batch.req=new XMLHttpRequest();}
else if(window.ActiveXObject&&!(navigator.userAgent.indexOf("Mac")>=0&&navigator.userAgent.indexOf("MSIE")>=0)){batch.req=dwr.engine._newActiveXObject(dwr.engine._XMLHTTP);}}
var prop,request;if(batch.req){if(batch.async){batch.req.onreadystatechange=function(){dwr.engine._stateChange(batch);};}
if(batch.isPoll){dwr.engine._pollReq=batch.req;batch.req.batch=batch;}
var indexSafari=navigator.userAgent.indexOf("Safari/");if(indexSafari>=0){var version=navigator.userAgent.substring(indexSafari+7);if(parseInt(version,10)<400){if(dwr.engine._allowGetForSafariButMakeForgeryEasier=="true")batch.httpMethod="GET";else dwr.engine._handleWarning(batch,{name:"dwr.engine.oldSafari",message:"Safari GET support disabled. See getahead.org/dwr/server/servlet and allowGetForSafariButMakeForgeryEasier."});}}
batch.mode=batch.isPoll?dwr.engine._ModePlainPoll:dwr.engine._ModePlainCall;request=dwr.engine._constructRequest(batch);try{batch.req.open(batch.httpMethod,request.url,batch.async);try{for(prop in batch.headers){var value=batch.headers[prop];if(typeof value=="string")batch.req.setRequestHeader(prop,value);}
if(!batch.headers["Content-Type"])batch.req.setRequestHeader("Content-Type","text/plain");}
catch(ex){dwr.engine._handleWarning(batch,ex);}
batch.req.send(request.body);if(!batch.async)dwr.engine._stateChange(batch);}
catch(ex){dwr.engine._handleError(batch,ex);}}
else if(batch.rpcType!=dwr.engine.ScriptTag){var idname=batch.isPoll?"dwr-if-poll-"+batch.map.batchId:"dwr-if-"+batch.map["c0-id"];batch.div=document.createElement("div");batch.div.innerHTML="<iframe src='javascript:void(0)' frameborder='0' style='width:0px;height:0px;border:0;' id='"+idname+"' name='"+idname+"'></iframe>";document.body.appendChild(batch.div);batch.iframe=document.getElementById(idname);batch.iframe.batch=batch;batch.mode=batch.isPoll?dwr.engine._ModeHtmlPoll:dwr.engine._ModeHtmlCall;if(batch.isPoll)dwr.engine._outstandingIFrames.push(batch.iframe);request=dwr.engine._constructRequest(batch);if(batch.httpMethod=="GET"){batch.iframe.setAttribute("src",request.url);}
else{batch.form=document.createElement("form");batch.form.setAttribute("id","dwr-form");batch.form.setAttribute("action",request.url);batch.form.setAttribute("target",idname);batch.form.target=idname;batch.form.setAttribute("method",batch.httpMethod);for(prop in batch.map){var value=batch.map[prop];if(typeof value!="function"){var formInput=document.createElement("input");formInput.setAttribute("type","hidden");formInput.setAttribute("name",prop);formInput.setAttribute("value",value);batch.form.appendChild(formInput);}}
document.body.appendChild(batch.form);batch.form.submit();}}
else{batch.httpMethod="GET";batch.mode=batch.isPoll?dwr.engine._ModePlainPoll:dwr.engine._ModePlainCall;request=dwr.engine._constructRequest(batch);batch.script=document.createElement("script");batch.script.id="dwr-st-"+batch.map["c0-id"];batch.script.src=request.url;document.body.appendChild(batch.script);}};dwr.engine._ModePlainCall="/call/plaincall/";dwr.engine._ModeHtmlCall="/call/htmlcall/";dwr.engine._ModePlainPoll="/call/plainpoll/";dwr.engine._ModeHtmlPoll="/call/htmlpoll/";dwr.engine._constructRequest=function(batch){var request={url:batch.path+batch.mode,body:null};if(batch.isPoll==true){request.url+="ReverseAjax.dwr";}
else if(batch.map.callCount==1){request.url+=batch.map["c0-scriptName"]+"."+batch.map["c0-methodName"]+".dwr";}
else{request.url+="Multiple."+batch.map.callCount+".dwr";}
var sessionMatch=location.href.match(/jsessionid=([^?]+)/);if(sessionMatch!=null){request.url+=";jsessionid="+sessionMatch[1];}
var prop;if(batch.httpMethod=="GET"){batch.map.callCount=""+batch.map.callCount;request.url+="?";for(prop in batch.map){if(typeof batch.map[prop]!="function"){request.url+=encodeURIComponent(prop)+"="+encodeURIComponent(batch.map[prop])+"&";}}
request.url=request.url.substring(0,request.url.length-1);}
else{request.body="";for(prop in batch.map){if(typeof batch.map[prop]!="function"){request.body+=prop+"="+batch.map[prop]+dwr.engine._postSeperator;}}
request.body=dwr.engine._contentRewriteHandler(request.body);}
request.url=dwr.engine._urlRewriteHandler(request.url);return request;};dwr.engine._stateChange=function(batch){var toEval;if(batch.completed){dwr.engine._debug("Error: _stateChange() with batch.completed");return;}
var req=batch.req;try{if(req.readyState!=4)return;}
catch(ex){dwr.engine._handleWarning(batch,ex);dwr.engine._clearUp(batch);return;}
try{var reply=req.responseText;reply=dwr.engine._replyRewriteHandler(reply);var status=req.status;if(reply==null||reply==""){dwr.engine._handleWarning(batch,{name:"dwr.engine.missingData",message:"No data received from server"});}
else if(status!=200){dwr.engine._handleError(batch,{name:"dwr.engine.http."+status,message:req.statusText});}
else{var contentType=req.getResponseHeader("Content-Type");if(!contentType.match(/^text\/plain/)&&!contentType.match(/^text\/javascript/)){if(contentType.match(/^text\/html/)&&typeof batch.textHtmlHandler=="function"){batch.textHtmlHandler();}
else{dwr.engine._handleWarning(batch,{name:"dwr.engine.invalidMimeType",message:"Invalid content type: '"+contentType+"'"});}}
else{if(batch.isPoll&&batch.map.partialResponse==dwr.engine._partialResponseYes){dwr.engine._processCometResponse(reply,batch);}
else{if(reply.search("//#DWR")==-1){dwr.engine._handleWarning(batch,{name:"dwr.engine.invalidReply",message:"Invalid reply from server"});}
else{toEval=reply;}}}}}
catch(ex){dwr.engine._handleWarning(batch,ex);}
dwr.engine._callPostHooks(batch);dwr.engine._receivedBatch=batch;if(toEval!=null)toEval=toEval.replace(dwr.engine._scriptTagProtection,"");dwr.engine._eval(toEval);dwr.engine._receivedBatch=null;dwr.engine._clearUp(batch);};dwr.engine._remoteHandleCallback=function(batchId,callId,reply){var batch=dwr.engine._batches[batchId];if(batch==null){dwr.engine._debug("Warning: batch == null in remoteHandleCallback for batchId="+batchId,true);return;}
try{var handlers=batch.handlers[callId];if(!handlers){dwr.engine._debug("Warning: Missing handlers. callId="+callId,true);}
else if(typeof handlers.callback=="function")handlers.callback(reply);}
catch(ex){dwr.engine._handleError(batch,ex);}};dwr.engine._remoteHandleException=function(batchId,callId,ex){var batch=dwr.engine._batches[batchId];if(batch==null){dwr.engine._debug("Warning: null batch in remoteHandleException",true);return;}
var handlers=batch.handlers[callId];if(handlers==null){dwr.engine._debug("Warning: null handlers in remoteHandleException",true);return;}
if(ex.message==undefined)ex.message="";if(typeof handlers.exceptionHandler=="function")handlers.exceptionHandler(ex.message,ex);else if(typeof batch.errorHandler=="function")batch.errorHandler(ex.message,ex);};dwr.engine._remoteHandleBatchException=function(ex,batchId){var searchBatch=(dwr.engine._receivedBatch==null&&batchId!=null);if(searchBatch){dwr.engine._receivedBatch=dwr.engine._batches[batchId];}
if(ex.message==undefined)ex.message="";dwr.engine._handleError(dwr.engine._receivedBatch,ex);if(searchBatch){dwr.engine._receivedBatch=null;dwr.engine._clearUp(dwr.engine._batches[batchId]);}};dwr.engine._remotePollCometDisabled=function(ex,batchId){dwr.engine.setActiveReverseAjax(false);var searchBatch=(dwr.engine._receivedBatch==null&&batchId!=null);if(searchBatch){dwr.engine._receivedBatch=dwr.engine._batches[batchId];}
if(ex.message==undefined)ex.message="";dwr.engine._handleError(dwr.engine._receivedBatch,ex);if(searchBatch){dwr.engine._receivedBatch=null;dwr.engine._clearUp(dwr.engine._batches[batchId]);}};dwr.engine._remoteBeginIFrameResponse=function(iframe,batchId){if(iframe!=null)dwr.engine._receivedBatch=iframe.batch;dwr.engine._callPostHooks(dwr.engine._receivedBatch);};dwr.engine._remoteEndIFrameResponse=function(batchId){dwr.engine._clearUp(dwr.engine._receivedBatch);dwr.engine._receivedBatch=null;};dwr.engine._eval=function(script){if(script==null)return null;if(script==""){dwr.engine._debug("Warning: blank script",true);return null;}
return eval(script);};dwr.engine._abortRequest=function(batch){if(batch&&!batch.completed){clearInterval(batch.interval);dwr.engine._clearUp(batch);if(batch.req)batch.req.abort();dwr.engine._handleError(batch,{name:"dwr.engine.timeout",message:"Timeout"});}};dwr.engine._callPostHooks=function(batch){if(batch.postHooks){for(var i=0;i<batch.postHooks.length;i++){batch.postHooks[i]();}
batch.postHooks=null;}}
dwr.engine._clearUp=function(batch){if(!batch){dwr.engine._debug("Warning: null batch in dwr.engine._clearUp()",true);return;}
if(batch.completed=="true"){dwr.engine._debug("Warning: Double complete",true);return;}
if(batch.div)batch.div.parentNode.removeChild(batch.div);if(batch.iframe){for(var i=0;i<dwr.engine._outstandingIFrames.length;i++){if(dwr.engine._outstandingIFrames[i]==batch.iframe){dwr.engine._outstandingIFrames.splice(i,1);}}
batch.iframe.parentNode.removeChild(batch.iframe);}
if(batch.form)batch.form.parentNode.removeChild(batch.form);if(batch.req){if(batch.req==dwr.engine._pollReq)dwr.engine._pollReq=null;delete batch.req;}
if(batch.map&&batch.map.batchId){delete dwr.engine._batches[batch.map.batchId];dwr.engine._batchesLength--;}
batch.completed=true;if(dwr.engine._batchQueue.length!=0){var sendbatch=dwr.engine._batchQueue.shift();dwr.engine._sendData(sendbatch);}};dwr.engine._handleError=function(batch,ex){if(typeof ex=="string")ex={name:"unknown",message:ex};if(ex.message==null)ex.message="";if(ex.name==null)ex.name="unknown";if(batch&&typeof batch.errorHandler=="function")batch.errorHandler(ex.message,ex);else if(dwr.engine._errorHandler)dwr.engine._errorHandler(ex.message,ex);dwr.engine._clearUp(batch);};dwr.engine._handleWarning=function(batch,ex){if(typeof ex=="string")ex={name:"unknown",message:ex};if(ex.message==null)ex.message="";if(ex.name==null)ex.name="unknown";if(batch&&typeof batch.warningHandler=="function")batch.warningHandler(ex.message,ex);else if(dwr.engine._warningHandler)dwr.engine._warningHandler(ex.message,ex);dwr.engine._clearUp(batch);};dwr.engine._serializeAll=function(batch,referto,data,name){if(data==null){batch.map[name]="null:null";return;}
switch(typeof data){case"boolean":batch.map[name]="boolean:"+data;break;case"number":batch.map[name]="number:"+data;break;case"string":batch.map[name]="string:"+encodeURIComponent(data);break;case"object":if(data instanceof String)batch.map[name]="String:"+encodeURIComponent(data);else if(data instanceof Boolean)batch.map[name]="Boolean:"+data;else if(data instanceof Number)batch.map[name]="Number:"+data;else if(data instanceof Date)batch.map[name]="Date:"+data.getTime();else if(data&&data.join)batch.map[name]=dwr.engine._serializeArray(batch,referto,data,name);else batch.map[name]=dwr.engine._serializeObject(batch,referto,data,name);break;case"function":break;default:dwr.engine._handleWarning(null,{name:"dwr.engine.unexpectedType",message:"Unexpected type: "+typeof data+", attempting default converter."});batch.map[name]="default:"+data;break;}};dwr.engine._lookup=function(referto,data,name){var lookup;for(var i=0;i<referto.length;i++){if(referto[i].data==data){lookup=referto[i];break;}}
if(lookup)return"reference:"+lookup.name;referto.push({data:data,name:name});return null;};dwr.engine._serializeObject=function(batch,referto,data,name){var ref=dwr.engine._lookup(referto,data,name);if(ref)return ref;if(data.nodeName&&data.nodeType){return dwr.engine._serializeXml(batch,referto,data,name);}
var reply="Object_"+dwr.engine._getObjectClassName(data)+":{";var element;for(element in data){if(typeof data[element]!="function"){batch.paramCount++;var childName="c"+dwr.engine._batch.map.callCount+"-e"+batch.paramCount;dwr.engine._serializeAll(batch,referto,data[element],childName);reply+=encodeURIComponent(element)+":reference:"+childName+", ";}}
if(reply.substring(reply.length-2)==", "){reply=reply.substring(0,reply.length-2);}
reply+="}";return reply;};dwr.engine._errorClasses={"Error":Error,"EvalError":EvalError,"RangeError":RangeError,"ReferenceError":ReferenceError,"SyntaxError":SyntaxError,"TypeError":TypeError,"URIError":URIError};dwr.engine._getObjectClassName=function(obj){if(obj&&obj.constructor&&obj.constructor.toString)
{var str=obj.constructor.toString();var regexpmatch=str.match(/function\s+(\w+)/);if(regexpmatch&&regexpmatch.length==2){return regexpmatch[1];}}
if(obj&&obj.constructor){for(var errorname in dwr.engine._errorClasses){if(obj.constructor==dwr.engine._errorClasses[errorname])return errorname;}}
if(obj){var str=Object.prototype.toString.call(obj);var regexpmatch=str.match(/\[object\s+(\w+)/);if(regexpmatch&&regexpmatch.length==2){return regexpmatch[1];}}
return"Object";};dwr.engine._serializeXml=function(batch,referto,data,name){var ref=dwr.engine._lookup(referto,data,name);if(ref)return ref;var output;if(window.XMLSerializer)output=new XMLSerializer().serializeToString(data);else if(data.toXml)output=data.toXml;else output=data.innerHTML;return"XML:"+encodeURIComponent(output);};dwr.engine._serializeArray=function(batch,referto,data,name){var ref=dwr.engine._lookup(referto,data,name);if(ref)return ref;var reply="Array:[";for(var i=0;i<data.length;i++){if(i!=0)reply+=",";batch.paramCount++;var childName="c"+dwr.engine._batch.map.callCount+"-e"+batch.paramCount;dwr.engine._serializeAll(batch,referto,data[i],childName);reply+="reference:";reply+=childName;}
reply+="]";return reply;};dwr.engine._unserializeDocument=function(xml){var dom;if(window.DOMParser){var parser=new DOMParser();dom=parser.parseFromString(xml,"text/xml");if(!dom.documentElement||dom.documentElement.tagName=="parsererror"){var message=dom.documentElement.firstChild.data;message+="\n"+dom.documentElement.firstChild.nextSibling.firstChild.data;throw message;}
return dom;}
else if(window.ActiveXObject){dom=dwr.engine._newActiveXObject(dwr.engine._DOMDocument);dom.loadXML(xml);return dom;}
else{var div=document.createElement("div");div.innerHTML=xml;return div;}};dwr.engine._newActiveXObject=function(axarray){var returnValue;for(var i=0;i<axarray.length;i++){try{returnValue=new ActiveXObject(axarray[i]);break;}
catch(ex){}}
return returnValue;};dwr.engine._debug=function(message,stacktrace){var written=false;try{if(window.console){if(stacktrace&&window.console.trace)window.console.trace();window.console.log(message);written=true;}
else if(window.opera&&window.opera.postError){window.opera.postError(message);written=true;}}
catch(ex){}
if(!written){var debug=document.getElementById("dwr-debug");if(debug){var contents=message+"<br/>"+debug.innerHTML;if(contents.length>2048)contents=contents.substring(0,2048);debug.innerHTML=contents;}}};var KEY=Class.create();Object.extend(KEY,{BACKSPACE:8,TAB:9,RETURN:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,INSERT:45,SHIFT:16,CTRL:17,ALT:18});var timeoutInt=10;var upDownTimeOut=10000;var queryURL="/ac.do?query=";var indexAttr="aa_index";var highlightStyle="aa_highlight";var keyWordStyle="keyWord_highlight";var wordStyle="word_color";var onSelAttr="onSelect";var CtrlZNum=10;var paras;var func=null;var defaultCityText="输入城市名";var AutoComplete=Class.create();AutoComplete.prototype={initialize:function(destID,frmId,showDiv,type,typeDivName,func,params){this.txtBox=$(destID);this.txtBox.onkeyup=this.onkeyup.bindAsEventListener(this);this.txtBox.onkeydown=this.onkeydown.bindAsEventListener(this);this.txtBox.onblur=this.onblur.bindAsEventListener(this);this.txtBox.onfocus=this.onfocus.bindAsEventListener(this);Event.observe(document,"click",this.hide2.bindAsEventListener(this));this.type=type;this.typeDivName=typeDivName;this.func=func;this.paras=params;this.iframe=document.createElement("iframe");this.iframe.style.position="absolute";this.iframe.style.margin="1px 0 0 0";this.iframe.style.padding="0";this.iframe.style.height="40";this.iframe.id=frmId;Element.hide(this.iframe);document.body.appendChild(this.iframe);this.toShowDiv=document.createElement("div");this.toShowDiv.style.position="absolute";this.toShowDiv.id=showDiv;Element.hide(this.toShowDiv);document.body.appendChild(this.toShowDiv);this.bufferDiv=document.createElement("div");this.visible=false;this.lastQueryStr="";this.initView=0;this.oldInputValue="";this.oldInputValueForCtrlZ=new Array(CtrlZNum);this.oldInputValueForCtrlZnum=0;this.hasPressCtrlZFlag=false;this.selFlag=false;this.firstShowFlag=true;this.isOnsubmitFlag=false;this.pressCtrlCFlag=false;this.hasPressCtrlFlag=false;this.keyReturnDownFlag=false;window.onresize=this.winReSize.bind(this);this.txtBox.onsubmit=this.submitFunction.bind(this);this.children=new Array();this.cleanup();},doRequestAndSel:function(){this.doRequest();if(this.txtBox.createTextRange){}else{if(this.txtBox.setSelectionRange){}}
return true;},hide2:function(){this.hide();},submitFunction:function(){this.hide();this.isOnsubmitFlag=true;},winReSize:function(){if(this.visible){this.show();}
if(this.func!=null){this.func(this.paras);}},onkeyup:function(key){switch(key.keyCode){case KEY.PAGE_UP:case KEY.PAGE_DOWN:case KEY.END:case KEY.HOME:case KEY.INSERT:case KEY.CTRL:case KEY.ALT:case KEY.LEFT:return false;case KEY.SHIFT:break;case KEY.BACKSPACE:this.firstShowFlag=true;break;case KEY.TAB:this.hide();return true;case KEY.RIGHT:if(!this.selFlag){if(this.currentNodeIndex==-1){return false;}else{break;}}else{this.selFlag=false;}
break;case KEY.UP:return false;case KEY.DOWN:if(!this.visible){if(this.toShowDiv.childNodes.length>0){if(this.txtBox.value==this.lastQueryStr){this.show();return false;}else{break;}}
break;}else{return false;}
case KEY.ESC:this.hide();return false;case 32:if(this.hasPressCtrlFlag){this.hasPressCtrlFlag=false;return true;}
break;case KEY.RETURN:if(this.lastQueryStr!=this.txtBox.value&&this.currentNodeIndex==-1){this.keyReturnDownFlag=false;break;}else{if(this.visible&&this.currentNodeIndex>-1){var stat=this.children[this.currentNodeIndex].getAttribute(onSelAttr);try{eval(stat);this.oldInputValue=this.txtBox.value;}
catch(e){}
this.keyReturnDownFlag=false;this.hide();return false;}else{if(this.currentNodeIndex==-1){if(!this.visible){if(!this.isOnsubmitFlag){this.show();}else{this.isOnsubmitFlag=false;}}
this.keyReturnDownFlag=false;return true;}else{this.keyReturnDownFlag=false;return true;}}}
default:}
if(this.timeoutId!=0){clearTimeout(this.timeoutId);}
this.timeoutId=setTimeout(this.doRequest.bind(this),timeoutInt);},onkeydown:function(key){if(key.ctrlKey){this.hasPressCtrlFlag=true;}else{this.hasPressCtrlFlag=false;}
if(key.ctrlKey&&(key.keyCode==67||key.keyCode==99)){this.pressCtrlCFlag=true;return true;}else{if(key.ctrlKey&&(key.keyCode==90||key.keyCode==122)){if(this.oldInputValueForCtrlZnum>0){this.txtBox.value=this.oldInputValueForCtrlZ[--this.oldInputValueForCtrlZnum];this.hasPressCtrlZFlag=true;}
return false;}else{if(key.ctrlKey&&(key.keyCode==16)){return true;}else{if(key.ctrlKey&&key.keyCode==32){return true;}}}}
switch(key.keyCode){case KEY.RIGHT:return true;case KEY.TAB:return true;case KEY.UP:if(this.visible){this.up();}
return false;case KEY.DOWN:if(this.visible){this.down();}
return false;case KEY.RETURN:if(this.visible&&this.currentNodeIndex>-1){this.keyReturnDownFlag=true;return false;}
return true;case KEY.ESC:return false;default:}},isValidNode:function(node){return(node.nodeType==1)&&(node.getAttribute(onSelAttr));},select:function(){var stat=this.currentNode().getAttribute(onSelAttr);try{eval(stat);if(this.oldInputValue!=this.txtBox.value){if(this.oldInputValueForCtrlZnum<CtrlZNum){this.oldInputValueForCtrlZ[this.oldInputValueForCtrlZnum]=this.oldInputValue;this.oldInputValueForCtrlZnum++;}else{for(var i=0;i<CtrlZNum-1;++i){this.oldInputValueForCtrlZ[i]=this.oldInputValueForCtrlZ[i+1];}
this.oldInputValueForCtrlZ[9]=this.oldInputValue;}}
this.oldInputValue=this.txtBox.value;}
catch(e){}
this.hide();},doRequest:function(){this.firstShowFlag=true;if(this.oldInputValue!=this.txtBox.value&&!this.hasPressCtrlZFlag){if(this.oldInputValueForCtrlZnum<CtrlZNum){this.oldInputValueForCtrlZ[this.oldInputValueForCtrlZnum]=this.oldInputValue;this.oldInputValueForCtrlZnum++;}else{for(var i=0;i<=CtrlZNum-1;++i){this.oldInputValueForCtrlZ[i]=this.oldInputValueForCtrlZ[i+1];}
this.oldInputValueForCtrlZ[9]=this.oldInputValue;}}
this.hasPressCtrlZFlag=false;this.oldInputValue=this.txtBox.value;this.queryStr=this.txtBox.value;if(this.lastQueryStr==this.queryStr){if(this.toShowDiv.childNodes.length!=0){if(!this.visible&&this.queryStr!=""){if(!this.pressCtrlCFlag){this.show();this.initView=0;}else{this.pressCtrlCFlag=false;}}else{this.highlightOff();}
return;}}
if(!this.visible){this.cleanup();}
if(this.queryStr==""){this.lastQueryStr="";this.hide();return;}
this.lastQueryStr=this.queryStr;var ajaxParam={method:"get",onSuccess:this.onComplete.bindAsEventListener(this),onFailure:this.onFailure.bindAsEventListener(this)};var tempURL=queryURL;var URL=encodeURI(tempURL+this.queryStr+"&type="+this.type);this.bufferDiv.innerHTML="";this.currentRequest=new Ajax.Updater(this.bufferDiv,URL,ajaxParam);this.initView=0;},onFailure:function(){},cleanup:function(){if(this.keyReturnDownFlag){return;}
this.size=0;this.currentNodeIndex=-1;this.lastNodeIndex=-1;this.toShowDiv.innerHTML="";this.bufferDiv.innerHTML="";},onComplete:function(){setTimeout(this.updateContent.bind(this,arguments[0]),5);},updateContent:function(request){this.bufferDiv.innerHTML=request.responseText;var item;var _149=false;if(this.bufferDiv.innerHTML==""){if(this.toShowDiv.innerHTML!=""&&(this.toShowDiv.getElementsByTagName("div")[0]).getAttribute("id")==this.txtBox.value){return;}else{this.hide();this.cleanup();return;}}
var divs=this.bufferDiv.getElementsByTagName("div");if(divs==null||divs.length<=0){this.hide();return;}
if((this.bufferDiv.getElementsByTagName("div")[0]).getAttribute("id")!=this.txtBox.value){if(this.toShowDiv.innerHTML!=""&&(this.toShowDiv.getElementsByTagName("div")[0]).getAttribute("id")==this.txtBox.value){return;}else{this.hide();return;}}
var _14a=(((this.bufferDiv.getElementsByTagName("table"))[1]).getElementsByTagName("tr"));_149=true;if(_149){this.toShowDiv.innerHTML=this.bufferDiv.innerHTML;_14a=(((this.toShowDiv.getElementsByTagName("table"))[1]).getElementsByTagName("tr"));this.size=0;this.currentNodeIndex=-1;this.children.clear();for(var i=0;i<_14a.length;i++){item=_14a[i];item.setAttribute(indexAttr,this.size);Event.observe(item,"mouseover",this.onmouseover.bindAsEventListener(this));Event.observe(item,"mouseout",this.onmouseout.bindAsEventListener(this));Event.observe(item,"click",this.select.bindAsEventListener(this));this.children.push(item);this.size++;}
if(this.toShowDiv.getElementsByTagName("table").length>=3){var c2=(((this.toShowDiv.getElementsByTagName("table"))[2]).getElementsByTagName("A"));for(var i=0;i<c2.length;i++){item=c2[i];Event.observe(item,"click",this.onclick2.bindAsEventListener(this));Event.observe(item,"mouseover",this.onmouseover2.bindAsEventListener(this));Event.observe(item,"mouseout",this.onmouseout2.bindAsEventListener(this));}}
this.firstShowFlag=true;this.show();if(this.children.length>=1)this.currentNodeIndex=0;this.highlight(false);}else{this.hide();this.cleanup();}},setInputField:function(_14d){this.txtBox.value=_14d;},updateInputField:function(){var _14e=this.txtBox.value;if(_14e.toUpperCase().indexOf(this.oldInputValue.toUpperCase())==0){if(this.txtBox.createTextRange){var u=this.txtBox.createTextRange();u.moveStart("character",this.oldInputValue.length);u.select();this.selFlag=true;}else{if(this.txtBox.setSelectionRange){this.txtBox.setSelectionRange(this.oldInputValue.length,_14e.length);this.selFlag=true;}}}},show:function(){if(this.toShowDiv.childNodes.length<1){return;}
if((this.toShowDiv.getElementsByTagName("div")[0]).getAttribute("id")!=this.txtBox.value){return;}
var _150=Position.cumulativeOffset(this.txtBox);this.toShowDiv.style.top=_150[1]+this.txtBox.offsetHeight-1+"px";this.toShowDiv.style.left=_150[0]+"px";var _151=(navigator&&navigator.userAgent.toLowerCase().indexOf("msie")==-1);this.toShowDiv.style.width=_151?this.txtBox.offsetWidth-3+"px":this.txtBox.offsetWidth+"px";this.iframe.style.width=this.toShowDiv.style.width;this.iframe.style.top=this.toShowDiv.style.top;this.iframe.style.left=this.toShowDiv.style.left;Element.show(this.iframe);Element.show(this.toShowDiv);this.iframe.style.height=_151?Element.getHeight(this.toShowDiv)-3+"px":Element.getHeight(this.toShowDiv)+"px";this.visible=true;if(this.firstShowFlag){this.currentNodeIndex=-1;this.firstShowFlag=false;}},onblur:function(){if(this.visible==true){if(this.currentNodeIndex==-1)
this.currentNodeIndex=0;this.highlight();this.txtBox.style.color="#000000";this.hide();}
else{if(this.txtBox.value==""){this.txtBox.value=defaultCityText;this.txtBox.style.color="#555555";}}},hide:function(){if(this.keyReturnDownFlag){return;}
this.visible=false;this.selFlag=false;this.highlightOff();Element.hide(this.toShowDiv);Element.hide(this.iframe);this.currentNodeIndex=-1;this.firstShowFlag=true;},onmousemove:function(arg0){this.initView=1;this.onmouseover(arg0);},onmouseover:function(arg0){this.highlightOffAll();this.txtBox.onblur=null;var item=Event.element(arg0);if(this.initView==0){this.initView=1;return;}
while(item.parentNode&&(!item.tagName||(item.getAttribute(indexAttr)==null))){item=item.parentNode;}
var _155=(item.tagName)?item.getAttribute(indexAttr):-1;if(_155==-1||_155==this.currentNodeIndex){return;}
this.highlightOff();this.currentNodeIndex=_155;this.highlight();},onmouseout:function(){this.currentNodeIndex=-1;this.txtBox.value=this.oldInputValue;this.txtBox.onblur=this.onblur.bindAsEventListener(this);this.initView=1;},onmouseover2:function(arg0){this.txtBox.onblur=null;this.intView=1;},onmouseout2:function(){this.initView=1;this.txtBox.onblur=this.onblur.bindAsEventListener(this);},onclick2:function(){up();this.initView=1;return true;},onfocus:function(){this.txtBox.select();},getNode:function(i){if(this.children){return this.children[i];}else{return undefined;}},currentNode:function(){if(this.children){return this.children[this.currentNodeIndex];}else{return undefined;}},highlight:function(){var updateInput=true;if(arguments.length>=1)
updateInput=false;if(this.currentNode()){var t_c=this.currentNode().getElementsByTagName("td");for(var i=0;i<t_c.length;++i){Element.addClassName(t_c[i],highlightStyle);}
var t_c_sp=this.currentNode().getElementsByTagName("span");for(var i=0;i<t_c_sp.length;++i){if(t_c_sp[i].id){Element.removeClassName(t_c_sp[i],keyWordStyle);}}
var stat=this.currentNode().getAttribute(onSelAttr);try{if(updateInput!=false){eval(stat);this.selFlag=false;this.updateInputField();}}
catch(e){}}
this.txtBox.style.color="#000000";},highlightOff:function(){if(this.keyReturnDownFlag){return;}
if(this.currentNode()){var t_c=this.currentNode().getElementsByTagName("td");var t_c_sp=this.currentNode().getElementsByTagName("span");for(var i=0;i<t_c.length;++i){Element.removeClassName(t_c[i],highlightStyle);}
for(var i=0;i<t_c_sp.length;++i){if(t_c_sp[i].id){Element.addClassName(t_c_sp[i],keyWordStyle);}}
this.currentNodeIndex=-1;}},highlightOffAll:function(){if(this.keyReturnDownFlag){return;}
this.children.each(function(item){var t_c=item.getElementsByTagName("td");var t_c_sp=item.getElementsByTagName("span");for(var i=0;i<t_c.length;++i){Element.removeClassName(t_c[i],highlightStyle);}
for(var i=0;i<t_c_sp.length;++i){if(t_c_sp[i].id){Element.addClassName(t_c_sp[i],keyWordStyle);}}});},up:function(){var _15d=this.currentNodeIndex;if(this.currentNodeIndex>0){this.highlightOff();this.currentNodeIndex=_15d-1;this.highlight();}else{if(this.currentNodeIndex==0){this.highlightOff();this.currentNodeIndex=--_15d;this.txtBox.value=this.oldInputValue;}else{this.currentNodeIndex=this.size-1;this.highlight();}}},down:function(){var _15e=this.currentNodeIndex;if(this.currentNodeIndex==-1){this.currentNodeIndex=++_15e;this.highlight();}else{if(this.currentNodeIndex<this.size-1){this.highlightOff();this.currentNodeIndex=++_15e;this.highlight();}else{this.highlightOff();this.currentNodeIndex=-1;this.txtBox.value=this.oldInputValue;}}}};var callBackUrl;var d=0;
function showCalendar(evt,sImg,bOpenBound,sFld1,sFld2,sCallback,url,showEndFlag)
{if($("hotCityDiv"))$("hotCityDiv").style.display="none";if($("hotCityIframe"))
$("hotCityIframe").style.display="none";if($("CalFrame").style.display=="block"){hideCalendar();return;}
var reShowCalender=false;if(!($("onewayTrue")&&$("onewayTrue").checked==true)&&sImg=="StartDate"){reShowCalender=true;}else{reShowCalender=false;}
if(showEndFlag==true){if($(sFld1)&&$(sFld2))
$(sFld1).value=Date.getOtherDay($(sFld2).value,1);}
if(isIE&&sCallback==true){}else{evt.cancelBubble=true;}
var fld1,fld2;var cf=document.getElementById("CalFrame");var wcf=window.frames.CalFrame;var oImg=document.getElementById(sImg);if(!oImg){return;}
if(!sFld1){alert("输入控件未指定！");return;}
fld1=document.getElementById(sFld1);if(!fld1){alert("输入控件不存在！");return;}
if(fld1.tagName!="INPUT"||fld1.type!="text"){alert("输入控件类型错误！");return;}
if(sFld2)
{fld2=document.getElementById(sFld2);if(!fld2){alert("参考控件不存在！");return;}
if(fld2.tagName!="INPUT"||fld2.type!="text"){alert("参考控件类型错误！");return;}}
if(!wcf.bCalLoaded){alert("日历未成功装载！请刷新页面！");return;}
var eT=0,eL=0,p=oImg;var sT=document.body.scrollTop,sL=document.body.scrollLeft;var eH=oImg.clientHeight,eW=oImg.clientWidth;if($("StartInput"))
var StartInput=$("StartInput").value;if($("EndInput"))
var EndInput=$("EndInput").value;while(p&&p.tagName!="BODY"){eT+=p.offsetTop;eL+=p.offsetLeft;p=p.offsetParent;}
cf.style.top=eT+eH+2+"px";if(sImg=="StartDate")
cf.style.left=(evt.clientX-cf.width+5)+"px";else
cf.style.left=((document.body.clientWidth-(eL-sL)>=cf.width)?eL:eL+eW-cf.width)+"px";cf.style.display="block";wcf.openbound=bOpenBound;wcf.fld1=fld1;wcf.fld2=fld2;wcf.boxCheck=sFld1;wcf.callback=sCallback;wcf.initCalendar(reShowCalender,sImg,StartInput,EndInput,sCallback);callBackUrl=url;}
function calcallback(str){window.location=callBackUrl+str;}
function hideCalendar()
{var cf=$("CalFrame");if(cf!=null)
cf.style.display="none";}
with(document){onclick=hideCalendar;}
if(TourBao==undefined){var TourBao={};}
TourBao.Utils={_DOMDocument:["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"],hideFocus:function(tName){var aTag=document.getElementsByTagName(tName);for(i=0;i<aTag.length;i++)
aTag[i].onfocus=function(){this.blur();};},unserializeDocument:function(xml){var dom;if(window.DOMParser){var parser=new DOMParser();dom=parser.parseFromString(xml,"text/xml");if(!dom.documentElement||dom.documentElement.tagName=="parsererror"){var message=dom.documentElement.firstChild.data;message+="\n"+dom.documentElement.firstChild.nextSibling.firstChild.data;throw message;}
return dom;}
else if(window.ActiveXObject){dom=dwr.engine._newActiveXObject(TourBao.Utils._DOMDocument);dom.loadXML(xml);return dom;}
else{var div=document.createElement("div");div.innerHTML=xml;return div;}},changeTab:function(idPrefix,selectLiIndex,size,selectClassName,notSelectClassName,showHideDivPrefix){if(selectLiIndex>=size)return;var liElement=$(idPrefix+selectLiIndex);Element.removeClassName(liElement,notSelectClassName);Element.addClassName(liElement,selectClassName);for(i=0;i<size;i++){if(i!=selectLiIndex){var liElementNotSelect=$(idPrefix+i);Element.removeClassName(liElementNotSelect,selectClassName);Element.addClassName(liElementNotSelect,notSelectClassName);}}
if(showHideDivPrefix){var divElement=$(showHideDivPrefix+selectLiIndex);if(!divElement)return;for(i=0;i<size;i++){if(i!=selectLiIndex){var divElementNotSelect=$(showHideDivPrefix+i);divElementNotSelect.style.display="none";}}
Element.show(divElement);}},changeTabOfClassArray:function(idPrefix,selectLiIndex,size,selectClassArray,notSelectClassArray,showHideDivPrefix){if(selectLiIndex>=size)return;var liElement=$(idPrefix+selectLiIndex);Element.removeClassName(liElement,notSelectClassArray[selectLiIndex]);Element.addClassName(liElement,selectClassArray[selectLiIndex]);for(i=0;i<size;i++){if(i!=selectLiIndex){var liElementNotSelect=$(idPrefix+i);Element.removeClassName(liElementNotSelect,selectClassArray[i]);Element.addClassName(liElementNotSelect,notSelectClassArray[i]);}}
if(showHideDivPrefix&&$(showHideDivPrefix+selectLiIndex)){var divElement=$(showHideDivPrefix+selectLiIndex);Element.show(divElement);for(i=0;i<size;i++){if(i!=selectLiIndex){var divElementNotSelect=$(showHideDivPrefix+i);Element.hide(divElementNotSelect);}}}},addBookmark:function(title,url){if(window.sidebar){window.sidebar.addPanel(title,url,"");}else if(document.all){window.external.AddFavorite(url,title);}else if(window.opera&&window.print){return true;}},isEmpty:function(str){if(str==null)return true;if(typeof str=="string"&&str.strip().length<=0)return true;else return false;},copyToClipBorad:function(text){if(window.clipboardData){text+=location.href;window.clipboardData.clearData();window.clipboardData.setData("Text",text);}
else{text=text+escape(location.href);var flashcopier='flashcopier';if(!$(flashcopier)){var divholder=document.createElement('div');divholder.id=flashcopier;document.body.appendChild(divholder);}
$("flashcopier").innerHTML='';var divinfo='<embed src="/clipboard.swf" flashVars="content='+text+'" width="1" height="1" type="application/x-shockwave-flash"></embed>';$("flashcopier").innerHTML=divinfo;}
alert("网址复制成功!\n 你可以利用快捷方式Ctrl+V复制到QQ或者MSN里");},setSelectDefaultValue:function(ele,defaultValue){if(typeof ele=="string")
ele=$(ele);if(ele==null)return;var flag=false;for(var i=0;i<ele.options.length;i++){option=ele.options[i];if(option.value==defaultValue){flag=true;option.selected=true;break;}}
if(!flag)ele.options[0].selected=true;},getValueOfCheckGroup:function(name){var arrs=document.getElementsByName(name);if(arrs==null)return null;for(var i=0;i<arrs.length;i++){var item=arrs[i];if(item.checked==true)
return item.value;}
return null;},goURL:function(url){location.href=url;},recHotelDirect:function(url,day){if(typeof(TourBao.InitInfo.deptDate)=='undefined')url+="?startDate="+day;else
url+="?startDate="+TourBao.InitInfo.deptDate;TourBao.Utils.newWindow(url);},recHotelDirectMore:function(url)
{if(typeof(TourBao.InitInfo.deptDate)!='undefined')
url+="&startDate="+TourBao.InitInfo.deptDate;url=encodeURI(url);TourBao.Utils.newWindow(url);},loggerNewWindow:function(type,site,param1,param2,time,message,url){var logger=new Logger(type,site,param1,param2,time,message);logger.doLogger();if(!url)
url=message;if(url)
TourBao.Utils.newEncodeWindow(url);},newEncodeWindow:function(url){url=encodeURI(url);TourBao.Utils.newWindow(url);},newWindow:function(url){window.open(url);},formSubmit:function(theForm){for(var i=0;i<3;i++){if(arguments[i*2+1]!=null){if(!checkInputAndFocus(arguments[i*2+1])){if(arguments[(i+1)*2]!=null){alert("请填写:"+arguments[(i+1)*2]);return;}else{alert("要查询的信息没有填写完整");return;}}}else{break;}}
theForm.submit();},formSubmit_notAllNull:function(theForm)
{if(arguments[4]!=null){if(!checkInputAndFocus(arguments[1])&&!checkInputAndFocus(arguments[3])){alert(arguments[2]+"和"+arguments[4]+"不能全为空!");return;}}
theForm.submit();},checkInputAndFocus:function(id){var item=$(id);if(item.value.strip().length==0){item.focus();return false;}
return true;},findBeginNum:function(date,dateStr){for(var i=0;i<dateStr.size();i++){if(date.substr(5,5)==dateStr[i].substring(0,5))
{return i;}}},addSelectOptions:function(array,selectId,defaultValue){var ele=$(selectId);var length=ele.options.length;array=$A(array);for(var i=0;i<array.length;i++){if(array[i].value==null)
ele.options[i]=new Option(array[i].name,array[i].name);else{ele.options[i]=new Option(array[i].name,array[i].value);}
if(defaultValue!=null&&defaultValue.trim()!=""&&defaultValue==ele.options[i].value)
ele.options[i].selected=true;}
if(defaultValue==null||defaultValue.trim()==""){ele.options[0].selected=true;}
for(j=length;j>i;j--){ele.remove(j-1);}},setErrorMsg:function(msg){if(msg==null||msg.strip().length<=0)
return;alert(msg);},getDiscount:function(discPrice,origPrice){if(origPrice<=0)return"公务舱";dight=Math.floor((discPrice/origPrice)*100)/10;if(dight>10)discountStr="公务舱";else if(dight==10)discountStr="全价";else discountStr=dight+"折";return discountStr;},viewTab:function(tab){var o=$(tab);if(o.style.display=="none"){o.style.display="block";}else{o.style.display="none";}},viewAllTab:function(){for(i=0;i<arguments.length;i++){viewTab(arguments[i]);}},interceptStr:function(str,staStr){if(str.indexOf(staStr)>0)return str.substring(0,str.indexOf(staStr));return str;},cutStr:function(str,num){if(str.length>num)return str.substr(0,num);return str;},isPointInRange:function(strLat,strLon,strArray){var lat=parseFloat(strLat);var lon=parseFloat(strLon);var maxLat=parseFloat(strArray[0]);var maxLon=parseFloat(strArray[1]);var minLat=parseFloat(strArray[2]);var minLon=parseFloat(strArray[3]);if(lat<=maxLat&&lat>=minLat&&lon<=maxLon&&lon>=minLon){return true;}
return false;},showTip:function(evt,text,width){var left=Event.pointerX(evt)+10-width;var top=Event.pointerY(evt)+10;$("tooltip").innerHTML=text;$("innerTip").style.left=left+"px";$("innerTip").style.top=top+"px";$("innerTip").style.zIndex=9999;$("innerTip").style.width=width+"px";$("tooltip").style.display="block";},hideTip:function(evt){$("tooltip").style.display="none";},showHotelExtTip:function(){$("tooltip").style.display="block";}};TourBao.CookieUtil={getCookie:function(name){name=escape(name);var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i<clen){var j=i+alen;if(document.cookie.substring(i,j)==arg){return unescape(TourBao.CookieUtil.getCookieVal(j));}
i=document.cookie.indexOf(" ",i)+1;if(i==0)break;}
return"";},getCookieVal:function(offset){var endstr=document.cookie.indexOf(";",offset);if(endstr==-1){endstr=document.cookie.length;}
return unescape(document.cookie.substring(offset,endstr));},setCookie:function(name,value,expires,path,domain,secure){name=escape(name);value=escape(value);if(expires==null){var the_date=new Date("December 31, 2020");expires=the_date.toGMTString();}
path="/";document.cookie=name+"="+value+
((expires)?"; expires="+expires:"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"");},deleteCookie:function(name,path,domain){if(getCookie(name)){document.cookie=name+"="+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";}}}
TourBao.HistoryUtil={addSearchHistory:function(stype,value){var sv=TourBao.CookieUtil.getCookie(TourBao.ConfigConstant._sh_prefix+stype);var historyLength=TourBao.ConfigConstant.historyLength;if(sv==null||sv==''){sv=value;}else{var svs=sv.split(';');for(i=0;i<svs.length;i++){var orgValue=svs[i].split('$$');var valueCh=value.split('$$');if(stype==TourBao.CookieConstant.flight){if(orgValue[1]==valueCh[1]&&orgValue[2]==valueCh[2]&&orgValue[5]==valueCh[5])
svs.splice(i,1);}else if(stype==TourBao.CookieConstant.hotel){if(orgValue[2]==valueCh[2])
svs.splice(i,1);}else if(stype==TourBao.CookieConstant.scene){if(orgValue[1]==valueCh[1])
svs.splice(i,1);}else if(stype==TourBao.CookieConstant.threec){historyLength=TourBao.ConfigConstant.historyLengthThreec;if(orgValue[0]==valueCh[0]&&orgValue[1]==valueCh[1]&&orgValue[2]==valueCh[2])svs.splice(i,1);}}
if(svs.length>=historyLength){svs.splice(0,1);}
sv="";for(i=0;i<svs.length;i++){sv=sv+svs[i]+';';}
sv=sv+value;}
TourBao.CookieUtil.setCookie(TourBao.ConfigConstant._sh_prefix+stype,sv);},getSearchHistory:function(stype){var sv=TourBao.CookieUtil.getCookie(TourBao.ConfigConstant._sh_prefix+stype);if(sv==null||sv==''){return null;}else{return sv.split(';');}},showListSearchHistory:function(type){var cookieArray=TourBao.HistoryUtil.getSearchHistory(type);if(type==TourBao.CookieConstant.flight){if(cookieArray!=null&&cookieArray.length>0){var content="";for(i=0;i<cookieArray.length;i++){var historyValue=cookieArray[i].split("$$");var showValue=historyValue[0]+"  "+historyValue[1]+"-"+historyValue[2];content+="<li><a id='flightHistory"+i+"' href='"+FLIGHT_URL_PREFIX+TourBao.HistoryUtil.getUrlFromCookie(historyValue,TourBao.CookieConstant.flight)+"' target='_blank'>";if(historyValue[5]=="true")
showValue+=" 单程";else
showValue+=" 往返";showValue=showValue.length<=21?showValue:(showValue.substring(0,20)+"..");content+=(showValue+"</a></li>");}
if(content=="")
content="没有历史记录";else content="<ul>"+content+"</ul>"
$("flight_history").style.display="block";$("flight_history").innerHTML=content;for(i=0;i<cookieArray.length;i++){var historyValue=cookieArray[i].split("$$");var text="<div id='innerTip' style='height:auto;background-color:#ffffe1;padding: 10px 10px 10px 10px;position: absolute;border: 1px solid #313131;'>";if(historyValue[5]=="false")
text+=historyValue[1]+"-"+historyValue[2]+"<br>"+" 去程出发日期："+historyValue[0]+"<br>"+" 返程出发日期："+historyValue[6];else
text+=historyValue[1]+"-"+historyValue[2]+"<br> "+" 出发日期："+historyValue[0];text+="</div>";$('flightHistory'+i).onmouseover=TourBao.Utils.showTip.bindAsEventListener(this,text,160);$('flightHistory'+i).onmouseout=TourBao.Utils.hideTip.bindAsEventListener(this);}}}if(type==TourBao.CookieConstant.hotel){if(cookieArray!=null&&cookieArray.length>0){var content="";for(i=0;i<cookieArray.length;i++){var historyValue=cookieArray[i].split("$$");var showValue=historyValue[1].length<13?historyValue[1]:(historyValue[1].substring(0,12)+"..");content+="<li><a id='hotel_history"+i+"' href='"+TourBao.HistoryUtil.getUrlFromCookie(historyValue,TourBao.CookieConstant.hotel)+"' target='_blank'>"+showValue+"</a></li>"}
if(content=="")
content="没有历史记录";else content="<ul>"+content+"</ul>"
$("hotel_history").style.display="block";$("hotel_history").innerHTML=content;for(i=0;i<cookieArray.length;i++){var historyValue=cookieArray[i].split("$$");var text="<div id='innerTip' style='height:auto;background-color:#ffffe1;padding: 10px 10px 10px 10px;position: absolute;border: 1px solid #313131;'>";text+=historyValue[1];if(historyValue[0]!=null)text+="<br> "+"入住日期："+historyValue[0];if(historyValue[3]!=null)text+="<br> "+"搜索日期："+historyValue[3];text+="</div>"
$('hotel_history'+i).onmouseover=TourBao.Utils.showTip.bindAsEventListener(this,text,150);$('hotel_history'+i).onmouseout=TourBao.Utils.hideTip.bindAsEventListener(this);}}}if(type==TourBao.CookieConstant.scene){if(cookieArray!=null&&cookieArray.length>0){var content="";for(i=0;i<cookieArray.length;i++){var historyValue=cookieArray[i].split("$$");var showValue=historyValue[0].length<13?historyValue[0]:(historyValue[0].substring(0,12)+"..");content+="<li><a href='"+TourBao.HistoryUtil.getUrlFromCookie(historyValue,TourBao.CookieConstant.scene)+"' target='_blank'>"+showValue+"</a></li>"}
if(content=="")
content="没有历史记录";else content="<ul>"+content+"</ul>"
$("scene_history").style.display="block";$("scene_history").innerHTML=content;}}if(type==TourBao.CookieConstant.threec){if(cookieArray!=null&&cookieArray.length>0){var content="";for(i=0;i<cookieArray.length;i++){var historyValue=cookieArray[i].split("$$");var showValue="";if(historyValue[2])
showValue+='<tr><td width="83"><img class="images" height="54" width="75" src="'+historyValue[2]+'"/></td></tr>';if(historyValue[1]&&historyValue[3])
showValue+='<tr><td class="style5"><a href="'+historyValue[3]+'"  target="_blank">'+historyValue[1]+'￥</a></td></tr>';if(historyValue[2]||historyValue[1])
showValue='<td><table><tbody>'+showValue+'</tbody></table></td>';if((i%2==0)&&(historyValue[2]||historyValue[1]))content+="<tr>";content+=showValue;if((i%2==1)&&(historyValue[2]||historyValue[1]))content+="</tr>";if((i+1)==cookieArray.length&&(i%2==0)&&(historyValue[2]||historyValue[1]))content+="</tr>";}
if(content=="")
content="没有历史记录";else{content='<table width="201" border="0" align="center" cellpadding="5" cellspacing="5">'+content+'</table>';}
$("historyTable").innerHTML=content;}}},getUrlFromCookie:function(historyValue,type){if(type==TourBao.CookieConstant.flight){var StartDate=historyValue[0];var StartInput=historyValue[1];var EndInput=historyValue[2];var isInternation=historyValue[4];var isOneWay=historyValue[5];var returnDate=historyValue[6];var url="/"+StartInput+"-"+EndInput+".html?StartDate="+StartDate+"&isInternation="+isInternation+"&isOneWay="+isOneWay+"&returnDate="+returnDate;return url;}else if(type==TourBao.CookieConstant.hotel){var url="/"+historyValue[2]+".html";return url;}else if(type==TourBao.CookieConstant.scene){var url="/a_"+historyValue[1]+".html";return url;}else if(type==TourBao.CookieConstant.trip){var id=cookieValue.substring(cookieValue.indexOf("--")+2);var url="/d_"+id+".html";return url;}},showIndexSearchHistory:function(type){var cookieArray=TourBao.HistoryUtil.getSearchHistory(type);if(type==TourBao.CookieConstant.flight){if(cookieArray!=null&&cookieArray.length>0){var content="<span>历史记录:</span>  ";for(i=0;i<cookieArray.length;i++){var historyValue=cookieArray[i].split("$$");content+="<a href='"+TourBao.HistoryUtil.getUrlFromCookie(historyValue,TourBao.CookieConstant.flight)+"' target='_blank'>"+historyValue[0]+"  "+historyValue[1]+"-"+historyValue[2]+"</a>  "}
if($("flight_hot_search")!=null){$("flight_hot_search").style.display="none";$("flight_history").style.display="block";$("flight_history").innerHTML=content;}}}else if(type==TourBao.CookieConstant.hotel){if(cookieArray!=null&&cookieArray.length>0){var content="<span>历史记录:</span>  ";for(i=0;i<cookieArray.length;i++){var historyValue=cookieArray[i].split("$$");var showValue=historyValue[1].length<13?historyValue[1]:(historyValue[1].substring(0,12)+"..");content+="<a href='"+TourBao.HistoryUtil.getUrlFromCookie(historyValue,TourBao.CookieConstant.hotel)+"' target='_blank'>"+showValue+"</a>  "}
$("hotel_history").style.display="block";$("hotel_history").innerHTML=content;}}},showSearchHistory:function(type){var cookieArray=getSearchHistory(type);if(cookieArray!=null&&cookieArray.length>0){var cookieTable=document.createElement("ul");for(i=0;i<cookieArray.length;i++){var li=document.createElement("li");var a=document.createElement("a");if(type==cookieConstant.flight){var historyValue=cookieArray[i];}else if(type==TourBao.CookieConstant.hotel){var hotelId=cookieArray[i].substring(cookieArray[i].indexOf("--")+2);if(isNaN(parseInt(hotelId))){continue;}
var historyValue=cookieArray[i].substring(0,cookieArray[i].indexOf("--"));}
else if(type==TourBao.CookieConstant.scene||type==TourBao.CookieConstant.trip){var historyValue=cookieArray[i].substring(0,cookieArray[i].indexOf("--"));}
if(historyValue.length>=10)
historyValue=historyValue.substring(0,10)+"..";a.target="_blank";a.innerHTML=historyValue;a.href=getUrlFromCookie(cookieArray[i],type);li.appendChild(a);cookieTable.appendChild(li);}
$("hotel_history").appendChild(cookieTable);}}};TourBao.TooltipInput=Class.create();TourBao.TooltipInput.prototype={initialize:function(inputId,initValue,tipValue){var inputEle=$(inputId);inputEle.onclick=function(e){var value=this.value;value=value.replace(' ','').replace('　','');if(value==tipValue){this.value='';}};inputEle.onblur=function(e){this.value.replace(' ','').replace('　','');if(this.value==''){this.value=tipValue;this.style.color="#555555";}};if(initValue!=null&&initValue!=""){if(inputEle.value=="")
inputEle.value=decodeURI(initValue);}else{inputEle.value=tipValue;}}};function checkMail(s){var pattern=/\w+@\w+\.[a-z]+/;if(pattern.test(s)){return true;}
else{return false;}}
var Logger=Class.create();Logger.prototype={initialize:function(type,siteId,param1,param2,time,message){this.type=type;this.message=message;this.siteId=siteId;this.param1=param1;this.param2=param2;this.time=time;},doLogger:function(){var requestURL="/util.do?";switch(this.type){case"ud_flight":requestURL+="&loggerType="+this.type+"&siteId="+this.siteId+"&param1="+this.param1+"&param2="+this.param2+"&time="+this.time+"&message="+this.message;break;case"ud_hotel":requestURL+="&loggerType="+this.type+"&siteId="+this.siteId+"&param1="+this.param1+"&param2="+this.param2+"&time="+this.time+"&message="+this.message;break;case"ad_flight":requestURL+="&loggerType="+this.type+"&siteId="+this.siteId+"&message="+this.message;break;case"ad_hotel":requestURL+="&loggerType="+this.type+"&siteId="+this.siteId+"&message="+this.message;break;default:requestURL+="&loggerType="+this.type+"&siteId="+this.siteId+"&message="+this.message;}
requestURL=encodeURI(requestURL);new Ajax.Request(requestURL,{method:"get"});}};var offsetfromcursorX=12
var offsetfromcursorY=10
var offsetdivfrompointerX=10
var offsetdivfrompointerY=14
var ie=document.all
var ns6=document.getElementById&&!document.all
var enabletip=false
var tipobj="";var pointerobj="";if(ie||ns6){if(ie){tipobj=document.all["dhtmltooltip"];pointerobj=document.all["dhtmlpointer"];}
else if(ns6){tipobj=$("dhtmltooltip");pointerobj=$("dhtmlpointer");}}
function ietruebody(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}
function ddrivetip(thetext,thewidth,second,thecolor){if(ns6||ie){if(typeof thewidth!="undefined"){tipobj.style.width=thewidth+"px";}
if(typeof thecolor!="undefined"&&thecolor!="")tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
if(!second)second=2
return false}}
function positiontip(e){if(enabletip){var nondefaultpos=false
var curX=(ns6)?e.pageX:event.clientX+ietruebody().scrollLeft;var curY=(ns6)?e.pageY:event.clientY+ietruebody().scrollTop;var winwidth=ie&&!window.opera?ietruebody().clientWidth:window.innerWidth-20
var winheight=ie&&!window.opera?ietruebody().clientHeight:window.innerHeight-20
var rightedge=ie&&!window.opera?winwidth-event.clientX-offsetfromcursorX:winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera?winheight-event.clientY-offsetfromcursorY:winheight-e.clientY-offsetfromcursorY
var leftedge=(offsetfromcursorX<0)?offsetfromcursorX*(-1):-1000
if(rightedge<tipobj.offsetWidth){tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true}
else if(curX<leftedge)
tipobj.style.left="5px"
else{tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"}
if(bottomedge<tipobj.offsetHeight){tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true}
else{tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"}
tipobj.style.visibility="visible"
if(!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"}}
function hideddrivetip(){if(ns6||ie){enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''}}
document.onmousemove=positiontip
Date.parseDate=function(date,today){if(typeof date=='number'){var ms_perday=1000*60*60*24;today=today||new Date();date=new Date(today.getTime()+date*ms_perday);}
else if(typeof date=='string'){var d=date.trim();d=d.replace(/-/g,"/");d=d.replace(/(\d+)\.(\d+)/,"$2.$1").replace(/\./g,"/")
d=new Date(d);if(isNaN(d.getTime()))
date=new Date(Date.parse(d));else
date=d;}
else
date=date;if(isNaN(date.getTime())||date.constructor!=Date)
return false;return date;}
function parseStrFromUpdateTime(time){baseTime=new Date();var _updateTime;var interval=baseTime-time;if(interval<=0)
_updateTime="1分钟以前";else if(interval<=1000)
_updateTime=interval+"毫秒以前";else{interval=Math.floor(interval/1000);if(interval<60)
_updateTime=interval+"秒以前";else if(interval<3600)
_updateTime=Math.ceil(interval/60)+"分钟以前";else if(interval<=36000&&interval>=3600)
_updateTime=Math.ceil(interval/3600)+"小时以前";else _updateTime="10小时以前";}
return"更新: "+_updateTime;}
function parseStrFromTime(time,serverTime){var baseTime=serverTime;var _updateTime="";if(time){var interval=baseTime-time;if(interval<=0)
_updateTime="更新: 1分钟以前";else if(interval<=1000)
_updateTime="更新: "+interval+"毫秒以前";else{interval=Math.floor((baseTime-time)/1000);if(interval<60)
_updateTime="更新: "+interval+"秒以前";else if(interval<3600)
_updateTime="更新: "+Math.floor(interval/60)+"分钟以前";else if(interval<18000&&interval>=3600)
_updateTime="更新: "+Math.floor(interval/3600)+"小时以前";else
_updateTime="更新: 5小时以前";}}
return _updateTime;}
function parseStrFromFlyTime(startTime,endTime){var sHour=startTime.slice(0,2);var sMinute=startTime.slice(3,5);startTime=(parseInt(sHour,10)*60+parseInt(sMinute,10))*60*1000;var eHour=endTime.slice(0,2);var eMinute=endTime.slice(3,5);endTime=(parseInt(eHour,10)*60+parseInt(eMinute,10))*60*1000;var flyTime;if(endTime<=startTime)
{flyTime=Math.floor((endTime+86400000-startTime)/1000);return Math.floor((flyTime/3600))+"小时"+(flyTime/60)%60+"分钟";}
else{flyTime=Math.floor((endTime-startTime)/1000);if(flyTime<3600)return Math.floor(flyTime/60)+"分钟";if((flyTime/60)%60==0){return Math.floor(flyTime/3600)+"小时整"}
if((flyTime/60)%60<10)
return Math.floor(flyTime/3600)+"小时0"+(flyTime/60)%60+"分钟";return Math.floor(flyTime/3600)+"小时"+(flyTime/60)%60+"分钟";}}
function fillZero(num,width){width=width||2;num=''+num;for(var i=num.length;i<width;i++)
num='0'+num;return num}
Date.getStr=function(date,format){if(!format)
format='%Y-%0M-%0D';date=Date.parseDate(date);if(format===true)
format='%Y-%M-%D';format=format.replace(/%Y/g,date.getFullYear());format=format.replace(/%M/g,date.getMonth()+1);format=format.replace(/%D/g,date.getDate());format=format.replace(/%0M/g,fillZero(date.getMonth()+1));format=format.replace(/%0D/g,fillZero(date.getDate()));return format;}
getStrFromDate=Date.dateToIsoDate=Date.getStrFromDate=Date.getStr;Date.isLeapYear=function(year){return(((year%4==0)&&(year%100!=0))||(year%400==0));}
Date.parseTimeValue=function(val){var midPos=val.indexOf(":");var hour=val.substr(0,midPos);var min=parseInt(val.substr(midPos+1),10)/60;if(isNaN(hour))hour=0;if(isNaN(min))min=0;return parseFloat(hour)+min;}
Date.isValidTime=function(hour,minute,second){if((hour<0)||(hour>24))return false;if((minute<0)||(minute>59))return false;if((second<0)||(second>59))return false;return true;}
Date.timeToIsoTime=function(someTime){someTime=someTime.trim();if(someTime.length<5)return false;if(someTime.length>8){someTime=someTime.substr(0,8);}
if(someTime.indexOf(':')>=0){var chunks=someTime.split(':');if(chunks.length!=3)return false;var hour=parseInt(chunks[0],10);var minute=parseInt(chunks[1],10);var second=parseInt(chunks[2],10);}else{return false;}
if(!Date.isValidTime(hour,minute,second))return false;if(hour<10){hour='0'+hour;}
if(minute<10){minute='0'+minute;}
if(second<10){second='0'+second;}
var ret='';ret+=hour+':';ret+=minute+':';ret+=second;return ret;}
Date.parseTimeToNL=function(time){var utStr="";if(time<1000)utStr=time+languageVars._MILLISECOND;else if(time<60000)utStr=parseInt(time/1000)+languageVars._SECOND;else if(time<3600000)utStr=parseInt(time/60000)+languageVars._MINUTE;else if(time<(24*3600000))utStr=parseInt(time/3600000)+languageVars._HOUR;else if(time<(365*24*3600000))utStr=parseInt(time/(24*3600000))+languageVars._DAY;else utStr=parseInt(time/(365*24*3600000))+languageVars._YEAR;return utStr;}
Date.getDays=function(year,month){if(year.constructor==Date){var month=year.getMonth();year=year.getFullYear();}
switch(month){case 2:if(Date.isLeapYear(year))return 29;return 28;break;case 1:case 3:case 5:case 7:case 8:case 10:case 12:return 31;break;default:return 30;}}
Date.getSevenDays=function(systemTime,date){var oneDay=24*60*60*1000;var dateSplit=date.split("-");var dateFormat=new Date(dateSplit[1]+"/"+dateSplit[2]+"/"+dateSplit[0]);var systemDay=new Date((systemTime.getMonth()+1)+"/"+systemTime.getDate()+"/"+systemTime.getFullYear());var days=new Date(systemDay.valueOf()+Math.floor((dateFormat.valueOf()-systemDay.valueOf())/(oneDay*7))*oneDay*7);var arr=new Array();for(var i=0;i<7;i++){mon=days.getMonth()<9?"0"+(days.getMonth()+1):days.getMonth()+1;d=days.getDate()<10?"0"+days.getDate():days.getDate();arr[i]=days.getFullYear()+"-"+mon+"-"+d;days=new Date(days.valueOf()+oneDay);}
return arr;}
Date.isDateEqual=function(date1,date2){var dateSplit1=date1.split("-");var dateFormat1=new Date(dateSplit1[1]+"/"+dateSplit1[2]+"/"+dateSplit1[0]);var dateSplit2=date2.split("-");var dateFormat2=new Date(dateSplit2[1]+"/"+dateSplit2[2]+"/"+dateSplit2[0]);return dateFormat1==dateFormat2;}
Date.getOtherDay=function(date,dateNum){var oneDay=24*60*60*1000;var dateSplit=date.split("-");var dateFormat=new Date(dateSplit[1]+"/"+dateSplit[2]+"/"+dateSplit[0]);var today=new Date();var valueOfDay=dateFormat.valueOf()+dateNum*oneDay;var otherDay=valueOfDay>today.valueOf()?new Date(valueOfDay):today;mon=otherDay.getMonth()<9?"0"+(otherDay.getMonth()+1):otherDay.getMonth()+1;d=otherDay.getDate()<10?"0"+otherDay.getDate():otherDay.getDate();return otherDay.getFullYear()+"-"+mon+"-"+d;}
Date.turnString2Date=function(dateString){var dateSplit=dateString.split("-");return new Date(dateSplit[1]+"/"+dateSplit[2]+"/"+dateSplit[0]);}
var jsWindowManager=new TourBao.JSWindowManager();if(TourBao==undefined){var TourBao={};}
var FSObject=Class.create();FSObject.prototype={initialize:function(){this.StartInput='';this.EndInput='';this.StartDate='';this.isInternation=false;this.isOneway=false;this.returnDate='';this.priceLow='';this.priceHigh='';this.departTimeLow='';this.departTimeHigh='';}}
TourBao.Flight=Class.create();TourBao.Flight.prototype={initialize:function(isIndexPage,isOem,from,oemType){this._fsObject=new FSObject();this.type="flight";this.isInternation=false;this.isIndexPage=isIndexPage;if("true"==isOem){this.isOem=true;this.from=from;this.oemType=oemType;}
else this.isOem=false;this.flightIndexInit();},onewayTypeSelect:function(){type=TourBao.Utils.getValueOfCheckGroup("onewayType");if(type=="true"){$("returnDate").disabled=true;Element.hide("returnDate_img")}else{$("returnDate").disabled=false;$("returnDate").value=Date.getOtherDay($("StartDate").value,5);$("returnDate_img").style.display="";}},flightIndexInit:function(){var acfd=new AutoComplete("StartInput","aciframe1","acDiv1","flight","jipiaoType");var acfa=new AutoComplete("EndInput","aciframe2","acDiv2","flight","jipiaoType");if(this.isIndexPage!=1){Event.observe($("onewayFalse"),"click",this.onewayTypeSelect.bind(this));Event.observe($("onewayTrue"),"click",this.onewayTypeSelect.bind(this));this.onewayTypeSelect();}
if($("trandMapDepartCity_img"))
Event.observe($("trandMapDepartCity_img"),'click',this.cityImg.bindAsEventListener(this,'trandMapDepartCity'));if($("trandMapArriveCity_img"))
Event.observe($("trandMapArriveCity_img"),'click',this.cityImg.bindAsEventListener(this,'trandMapArriveCity'));if($("showTrandMap"))
Event.observe($("showTrandMap"),"click",this.showTrandMap.bind(this));Event.observe($("StartInput_img"),'click',this.cityImg.bindAsEventListener(this,'StartInput'));Event.observe($("EndInput_img"),'click',this.cityImg.bindAsEventListener(this,'EndInput'));Event.observe($("flightSearch"),"click",this.doFlightSearch.bind(this));if(this.isOem==null||!this.isOem)
TourBao.HistoryUtil.showIndexSearchHistory(TourBao.CookieConstant.flight);var rq=$("a_returnQuery");if(rq){Event.observe(rq,"click",this.doReturnFlight.bind(this));}},cityImg:function(event,divid){hotCityImg(event,divid,divid,this.type);},jipiaoTypeSelect:function(type){if("foreignFlight"==type){$("onewayTrue").disabled=false;$("onewayFalse").disabled=false;$("onewayFalse").checked=true;$("onewayTrue").checked=false;if($("a_returnQuery"))
$("a_returnQuery").style.display="none";if(this.isIndexPage==2){$("returnDate").value=Date.getOtherDay($("StartDate").value,5);$("StartInput").value="北京";$("EndInput").value="旧金山";}
this.showCityCookieValue(true);}
else{$("onewayTrue").disabled=false;$("onewayFalse").disabled=false;$("onewayFalse").checked=false;$("onewayTrue").checked=true;$("onewayTrue").disabled=false;$("onewayFalse").disabled=false;if($("a_returnQuery"))
$("a_returnQuery").style.display="";this.showCityCookieValue(false);}
this.onewayTypeSelect();},jipiaoTypeLinkSelect:function(flag){if(flag){this.type="flight"
this.isInternation=false;}
else{this.type="foreignFlight";this.isInternation=true;}
this.jipiaoTypeSelect();},specialDepartCity:function(){var urlStr=location.href;var urlStatic=FLIGHT_URL_PREFIX+"/From_";var urlSuffix=".html";if(urlStr.include("From")){if(urlStr.include("isFromMail"))
return;var strDept=urlStr.substring(urlStatic.length);strDept=strDept.substring(0,strDept.length-urlSuffix.length);$("StartInput").value=strDept;}},flightTypeSelect:function(flag){if(flag){$("onewayTrue").disabled=false;$("onewayFalse").disabled=false;$("onewayFalse").checked=false;$("onewayTrue").checked=true;$("onewayTrue").disabled=true;$("onewayFalse").disabled=true;$("returnDate").disabled=true;Element.hide("returnDate_img");}else{}},showCityCookieValue:function(isInternation){if(!isInternation){var cookieValue=TourBao.CookieUtil.getCookie(TourBao.ConfigConstant._sh_prefix+TourBao.CookieConstant.domesticFlight);if(cookieValue==null||cookieValue=='')
return;else{if(this.isIndexPage==3){}else if(this.isIndexPage==2){}
var value=cookieValue.split("$$");var deptCity=value[0];var arriCity=value[1];var isOneWay=value[2];var returnData=value[3];$("StartInput").value=deptCity;$("EndInput").value=arriCity;if(isOneWay=='false'){$("onewayFalse").checked=true;$("returnDate").disabled=false;$("returnDate").value=returnData;$("returnDate_img").style.display="";}
else{$("onewayTrue").checked=true;$("returnDate").disabled=true;Element.hide("returnDate_img");}}}
else{var cookieValue=TourBao.CookieUtil.getCookie(TourBao.ConfigConstant._sh_prefix+TourBao.CookieConstant.foreignFlight);if(cookieValue==null||cookieValue=='')
return;else{var value=cookieValue.split("$$");var deptCity=value[0];var arriCity=value[1];var isOneWay=value[2];$("StartInput").value=deptCity;$("EndInput").value=arriCity;if(isOneWay=='false'){$("onewayFalse").checked=true;$("returnDate").disabled=false;$("returnDate_img").style.display="";}
else{$("onewayTrue").checked=true;$("returnDate").disabled=true;Element.hide("returnDate_img");}}}},showDepartCityCookieValue:function(){var StartInput=TourBao.CookieUtil.getCookie(TourBao.ConfigConstant._sh_prefix+TourBao.CookieConstant.flightDepartCity);if(StartInput==$("EndInput").value){$("StartInput").value="";$("StartInput").focus();}},showArriveCityCookieValue:function(){var EndInput=TourBao.CookieUtil.getCookie(TourBao.ConfigConstant._sh_prefix+TourBao.CookieConstant.flightArriveCity);if(EndInput==$("StartInput").value){$("EndInput").value="";$("EndInput").focus();}},doReturnFlight:function(){var EndInput=$("StartInput").value;var StartInput=$("EndInput").value;$("StartInput").value=StartInput;$("EndInput").value=EndInput;this.doFlightSearch();},doFlightSearch:function(){this._fsObject.StartInput=$F('StartInput');this._fsObject.EndInput=$F('EndInput');this._fsObject.StartDate=$F('StartDate');if(this.isIndexPage==1){this._fsObject.returnDate=$F('returnDate');if(TourBao.Utils.isEmpty(this._fsObject.returnDate)){this._fsObject.isOneway=true;}else{this._fsObject.isOneway=false;}}
else{if("true"==TourBao.Utils.getValueOfCheckGroup("onewayType"))
this._fsObject.isOneway=true;else{this._fsObject.isOneway=false;this._fsObject.returnDate=$F('returnDate');}}
if(this.checkSearchField()){this.queryFlight();}},queryFlight:function(){var url="/util.do?method=checkCity&flightDepartCity="+this._fsObject.StartInput+"&flightArriveCity="+this._fsObject.EndInput;url=encodeURI(url);var ajax=new Ajax.Request(url,{onComplete:function(originalRequest){if(originalRequest.responseText=="departFail"){alert("错误的出发城市,请重新输入");$('StartInput').select();}
else if(originalRequest.responseText=="arriveFail"){alert("错误的到达城市,请重新输入");$('EndInput').select();}
else if(originalRequest.responseText=="sameFail"){alert("出发城市和目的城市不能相同,请重新输入");$('EndInput').select();}
else if(originalRequest.responseText=="internationDeCityFail"){alert("出发城市不支持国际航线");$('StartInput').select();}
else if(originalRequest.responseText=="internationArCityFail"){alert("到达城市不支持国际航线");$('EndInput').select();}
else if(originalRequest.responseText=="isDomestic"){var gotoUrl=FLIGHT_URL_PREFIX+"/"+this._fsObject.StartInput+"-"+this._fsObject.EndInput+".html?StartDate="+this._fsObject.StartDate;if(!this._fsObject.isOneway)
gotoUrl+="&isOneWay=false&returnDate="+this._fsObject.returnDate;if(this.isOem)
gotoUrl+="&searchType=oem&from="+this.from;gotoUrl=encodeURI(gotoUrl);if(this.oemType&&this.oemType.indexOf("Form")>=0)
TourBao.Utils.newWindow(gotoUrl);else location.href=gotoUrl;}
else if(originalRequest.responseText=="isInternation"){var gotoUrl=FLIGHT_URL_PREFIX+"/"+this._fsObject.StartInput+"-"+this._fsObject.EndInput+".html?isInternation=true&StartDate="+this._fsObject.StartDate;if(!this._fsObject.isOneway)
gotoUrl+="&isOneWay=false&returnDate="+this._fsObject.returnDate;if(this.isOem)
gotoUrl+="&searchType=oem&from="+this.from;gotoUrl=encodeURI(gotoUrl);if(this.oemType&&this.oemType.indexOf("Form")>=0)
TourBao.Utils.newWindow(gotoUrl);else location.href=gotoUrl;}}.bind(this)});},checkSearchField:function(){var errMsg='';var ok=true;if(!TourBao.Utils.checkInputAndFocus('StartInput')){errMsg='请输入出发城市';ok=false;$('StartInput').select();}else if(!TourBao.Utils.checkInputAndFocus('EndInput')){errMsg='请输入到达城市';ok=false;$('EndInput').select();}else if(!TourBao.Utils.checkInputAndFocus('StartDate')){errMsg='请输入出发日期';ok=false;$('StartDate').select();}else if($('StartInput')==$('EndInput')){errMsg='出发城市和目的城市不能相同';ok=false;$('StartDate').select();}
else if(this._fsObject.isInternation){var departTime=$F('StartDate');var returnTime=$F('returnDate');if(departTime>=returnTime&&!this._fsObject.isOneway){errMsg='往返国际航班去程出发日期不能晚于返程日期';ok=false;$('returnDate').focus();}}
if(!ok){TourBao.Utils.setErrorMsg(errMsg);}
return ok;},afterShopping:function(){this.toggleFaderPane(false);jsWindowManager.hiddenWindow("beforeShopping");},toggleFaderPane:function(show){show=show?true:false;this.showFader=show;var faderPane=$('faderPane');if(faderPane==null)return;var height=document.body.clientHeight;faderPane.style.display=(show)?'block':'none';faderPane.style.height=height+"px";},trendMapCitySelect:function(){var curCity="杭州";var arriCity="北京";if(TourBao.Utils.isEmpty(curCity))
curCity="杭州";if(!hotCity.include(curCity))curCity="杭州";if(curCity=="北京")arriCity="杭州";if(this.trendMapCityWindow==null){var hotelNoticeHtml='<div class="win_box"><div class="box_title"><div class="b_title">切换城市查看趋势图</div>'
+'<div class="win_close" id="hotel_search_close">关闭 <img src="'+STYLE_PREFIX+'/images/button/b_close.gif" align="absmiddle" style="padding-bottom:3px;" /></div>'
+'</div><div class="box_content"><div class="box_input"><span class="font_b lt">出发城市</span><span class="font_b rt" style="margin-right:80px;">目的城市</span><br />'
+'<input id="city" type="text" name="city" value="'+curCity+'" /><img src="'+STYLE_PREFIX+'/images/table.gif" class="box_city" onclick="hotCityImg(event,\'city\',\'city\',\'hotel\')" /> <input id="city1" type="text" name="city1" value="'+arriCity+'" /><img src="'+STYLE_PREFIX+'/images/table.gif" style="left:264px;position:absolute;top:29px;" onclick="hotCityImg(event,\'city1\',\'city1\',\'hotel\')" /> <br />'
+'</div><div class="box_btn"> <a style="cursor:pointer;"><input type="button" id="hotel_search" onclick="showTrendMap()" value="查看趋势图" style="height:20px;" />'
+'</a>'
+'</div><p>提供2882条国内航线，1223条国际航线的搜索比价</p></div><div class="box_bottom"></div></div>';var theWindows=jsWindowManager.createWindow("beforeShopping",{className:'g_win_4',width:328,height:200,hideFlash:false,title:'比价啦',onTop:false,notKeepPos:true,hiddenOnClose:false,hasBottomBar:false,hasSystemBar:false});theWindows.panel.innerHTML=hotelNoticeHtml;this.trendMapCityWindow=theWindows;Event.observe($('hotel_search_close'),"click",this.afterShopping.bind(this));}
this.toggleFaderPane(true);jsWindowManager.showWindow("beforeShopping");},showTrandMap:function(){this.trendMapCitySelect();}}
function indexInit(initCurCity){var flight=new TourBao.Flight(2);flight.showCityCookieValue(false);var curCity=initCurCity;var arriCity="北京";if(TourBao.Utils.isEmpty(curCity))
curCity="杭州";if(!hotCity.include(curCity))curCity="杭州";if(curCity=="北京")arriCity="杭州";createFlightTrendSWF("flightTrendSWF",['/chart.swf?c1='+curCity+'&c2='+arriCity+'&host='+FLIGHT_DIRECT_URL_PREFIX+'&version='+TOURBAO_VERSION,'flightTrendSWFem','407px','330px'],{quality:'high',c1:curCity,c2:arriCity,wmode:'transparent'});}
function isNeedDrawTrendMap(deptCity,arriCity){var flag=false;if(hotCity.include(deptCity)&&hotCity.include(arriCity))
flag=true;return flag;}
function createFlightTrendSWF(el,b,params,vars){var str='<div><a name="trendMap"></a><div class="padding0">';str+=swf(b,params,vars);str+="</div>";$(el).style.display="block";$(el).innerHTML=str;}
function showTrendMap(){var curCity=$("city").value;var arriCity=$("city1").value;var ele=false;ele=$("flightTrendSWFem");ele.refreshChart(curCity,arriCity);jsWindowManager.hiddenWindow("beforeShopping");}
function showBackSpringFlight(index,city,firstIndex){if(city==currentBackSpringCity)
return;changeSpringTab("springBack_city_",index,9,"special_fisrt_cur","special_last_oth",firstIndex,"special_fisrt_oth");if($("springBack_"+city)){$("springBack_"+currentBackSpringCity).style.display="none";$("springBack_"+city).style.display="block";currentBackSpringCity=city;return;}else{$("springBack_"+currentBackSpringCity).style.display="none";Element.show($("waitBackState"));var videoFirstClick=true;if(videoFirstClick){var url="method=springBackFlightSearch"+"&rangeCity="+city;var courseDiv=document.createElement("div");courseDiv.id="springBack_"+city;$("springBack_flight").appendChild(courseDiv);oAjax=new Ajax.Request('/special.do',{method:'get',parameters:"type=springBackFlightSearch"+"&rangeCity="+city,onSuccess:function(req){courseDiv.innerHTML=req.responseText;Element.hide($("waitBackState"));},onError:function(req){Element.show($("errorBackState"));Element.hide($("waitBackState"));}});videoFirstClick=false;currentBackSpringCity=city;}}}
function showSpringFlight(index,city,firstIndex){if(city==currentSpringCity)
return;changeSpringTab("spring_city_",index,9,"special_fisrt_cur","special_last_oth",firstIndex,"special_fisrt_oth");if($("spring_"+city)){$("spring_"+currentSpringCity).style.display="none";$("spring_"+city).style.display="block";currentSpringCity=city;return;}
else{$("spring_"+currentSpringCity).style.display="none";Element.show($("waitState"));var videoFirstClick=true;if(videoFirstClick){var url="method=springFlightSearch"+"&rangeCity="+city;var courseDiv=document.createElement("div");courseDiv.id="spring_"+city;$("spring_flight").appendChild(courseDiv);oAjax=new Ajax.Request('/special.do',{method:'get',parameters:"type=springFlightSearch"+"&rangeCity="+city,onSuccess:function(req){courseDiv.innerHTML=req.responseText;Element.hide($("waitState"));},onError:function(req){Element.show($("errorState"));Element.hide($("waitState"));}});videoFirstClick=false;currentSpringCity=city;}}}
function changeSpringTab(idPrefix,selectLiIndex,size,selectClassName,notSelectClassName,firstTab,firstClassName){if(selectLiIndex>=size)return;var liElement=$(idPrefix+selectLiIndex);Element.removeClassName(liElement,notSelectClassName);Element.addClassName(liElement,selectClassName);for(i=0;i<size;i++){if(i!=selectLiIndex){var liElementNotSelect=$(idPrefix+i);Element.removeClassName(liElementNotSelect,selectClassName);if(firstTab==i)
Element.addClassName(liElementNotSelect,firstClassName);else
Element.addClassName(liElementNotSelect,notSelectClassName);}}}
var _hotelHasAdvanceSearch=false;var starTypeLow=[{"name":'不限',"value":'0'},{"name":'二星',"value":'4'},{"name":'三星',"value":'6'},{"name":'四星',"value":'8'},{"name":'五星',"value":'10'}];var starTypeHigh=[{"name":'不限',"value":'11'},{"name":'二星',"value":'4'},{"name":'三星',"value":'6'},{"name":'四星',"value":'8'},{"name":'五星',"value":'10'}];var roomPriceLow=[{"name":'0'},{"name":'100'},{"name":'200'},{"name":'300'},{"name":'400'},{"name":'500'},{"name":'600'},{"name":'700'},{"name":'800'},{"name":'900'},{"name":'1000'},{"name":'1200'},{"name":'1500'},{"name":'1800'},{"name":'2000'}];var roomPriceHigh=[{"name":'不限',"value":'100000'},{"name":'100'},{"name":'200'},{"name":'300'},{"name":'400'},{"name":'500'},{"name":'600'},{"name":'700'},{"name":'800'},{"name":'900'},{"name":'1000'},{"name":'1200'},{"name":'1500'},{"name":'1800'},{"name":'2000'}];function indexHotelInit(defaultStarTypeLow,defaultStarTypeHigh,defaultRoomPriceLow,defaultRoomPriceHigh){new AutoComplete("city","aciframe3","acDiv3","hotel");TourBao.HistoryUtil.showIndexSearchHistory(TourBao.CookieConstant.hotel);}
var HSObject=Class.create();HSObject.prototype={initialize:function(){this.city='';this.startDate='';this.hotelName='';this.starTypeLow='';this.starTypeHigh='';this.roomPriceLow='';this.roomPriceHigh='';}}
var _hsObject=new HSObject();function doHotelSearch(flag){if(checkSearchField()){queryHotel(flag);}}
function queryHotel(flag){_hsObject.city=$F('city');_hsObject.startDate=$F('startDate');if($('hotelName'))
_hsObject.hotelName=$F('hotelName');if(TourBao.Utils.isEmpty(_hsObject.hotelName))
_hsObject.hotelName="";if(!checkSearchField())
return;searchUrl=HOTEL_URL_PREFIX+"/"+_hsObject.city+".html?startDate="+_hsObject.startDate+"&hotelName="+_hsObject.hotelName;if($("price_select")){var price=$("price_select").value;if(price==1){searchUrl+="&roomPriceHigh=200";}else if(price==2){searchUrl+="&roomPriceLow=200&roomPriceHigh=500";}else if(price==3){searchUrl+="&roomPriceLow=500";}}
var url="/util.do?method=checkHotelCity&hotelCity="+_hsObject.city;url=encodeURI(url);var ajax=new Ajax.Request(url,{onComplete:function(originalRequest){if(originalRequest.responseText=="cityFail"){alert("错误的城市,请重新输入");$('city').select();}
else if(originalRequest.responseText=="success"){if(flag)
TourBao.Utils.newEncodeWindow(searchUrl);else
location.href=encodeURI(searchUrl);}}});}
function checkSearchField(){var errMsg='';var ok=true;if(!checkInputAndFocus('city')){errMsg='请输入酒店所在城市';ok=false;}else if(!checkInputAndFocus('startDate')){errMsg='请输入入住日期';ok=false;}
if(!ok){setErrorMsg(errMsg);}
return ok;}
function showSpecialHotel(cityName){var length=$("hotHotel").childNodes.length;if($("hotHotel").childNodes[length-1].id!="三亚"){var lastNode=$("hotHotel").childNodes[length-1];$("hotHotel").removeChild(lastNode);}
if($("hotHotel_"+cityName)){changeHotHotelDiv(cityName);changeHotelTab(cityName)
return;}else{changeHotelTab(cityName);Element.show($("waitHotelState"));Element.hide($("hotHotelList"));var courseDiv=document.createElement("div");courseDiv.id="hotHotel_"+cityName;$("hotHotelList").appendChild(courseDiv);var ajaxUrl="/special.do?ajaxType=hotel"+"&specialCity="+cityName;hideHeaderCity();ajaxUrl=encodeURI(ajaxUrl);new Ajax.Request(ajaxUrl,{onComplete:function(req){var result=req.responseText;$("hotHotel_"+cityName).innerHTML=result;Element.hide($("waitHotelState"));Element.show($("hotHotelList"));}});changeHotHotelDiv(cityName);}}
function changeHotHotelDiv(cityName){var length=$("hotHotelList").childNodes.length;if(isIE){for(var i=0;i<length;i++){if($("hotHotelList").childNodes[i].id=="hotHotel_"+cityName)
Element.show($("hotHotelList").childNodes[i]);else
Element.hide($("hotHotelList").childNodes[i]);}}else{for(var i=1;i<length;i++){if($("hotHotelList").childNodes[i].id=="hotHotel_"+cityName)
Element.show($("hotHotelList").childNodes[i]);else
Element.hide($("hotHotelList").childNodes[i]);}}}
function changeHotelTab(city){var length=$("hotHotel").childNodes.length;if(isIE){for(var i=0;i<length;i++){if($("hotHotel").childNodes[i].id==city)
$("hotHotel").childNodes[i].className="special_fisrt_cur"
else
$("hotHotel").childNodes[i].className="";}}else{for(var i=1;i<length;i++){if($("hotHotel").childNodes[i].id==city)
$("hotHotel").childNodes[i].className="special_fisrt_cur"
else
$("hotHotel").childNodes[i].className="";i++;}}}
var S_URL_PREFIX;var HOST_URL_PREFIX;var STYLE_PREFIX;var ListenTextBox=Class.create();ListenTextBox.prototype={initialize:function(node,onchange){this.oldValue="";this.txtBox=node;this.listenKey=function(){var v=this.txtBox.value;if(v!=this.oldValue){onchange();}
this.oldValue=v;}.bind(this);if(isIE)
this.txtBox.onkeydown=this.listenKey.bindAsEventListener(this);else
this.txtBox.onkeypress=this.listenKey.bindAsEventListener(this);setInterval(this.listenKey,1000);}};function turnBackground(element,css){if(!element)return;if(!css)css="background";if(Element.hasClassName(element,css)){Element.removeClassName(element,css);}else
Element.addClassName(element,css);}
function formSubmit(theForm)
{if(!theForm)return;for(var i=0;i<3;i++){if(arguments[i*2+1]!=null){if(!checkInputAndFocus(arguments[i*2+1])){if(arguments[(i+1)*2]!=null){alert("请填写:"+arguments[(i+1)*2]);return;}else{alert("要查询的信息没有填写完整");return;}}}else{break;}}
theForm.submit();}
function formSubmit_notAllNull(theForm)
{if(!theForm)return;if(arguments[4]!=null){if(!checkInputAndFocus(arguments[1])&&!checkInputAndFocus(arguments[3])){alert(arguments[2]+"和"+arguments[4]+"不能全为空!");return;}}
theForm.submit();}
function doClear(id)
{$(id).value="";}
function checkInputAndFocus(id){var item=$(id);if(item.value.strip().length==0){item.focus();return false;}
return true;}
function searchTabClick(current_index,size,tabprefix,tdprefix,name,value){for(var i=0;i<size;i++){var cur_tab=document.getElementById(tabprefix+i);if(i==current_index)
cur_tab.style.display="block";else
cur_tab.style.display="none";}
for(var i=0;i<size;i++){var cur_td=document.getElementById(tdprefix+i);if(i==current_index)
cur_td.className="dipan";else
cur_td.className="dipan2";}
if(name&&value)
Cookie.set(name,value,10);}
function cityTabClick(current_index,size,tabprefix,tdprefix){for(var i=0;i<size;i++){var cur_tab=document.getElementById(tabprefix+i);if(i==current_index)
cur_tab.style.display="block";else
cur_tab.style.display="none";}
for(var i=0;i<size;i++){var cur_td=document.getElementById(tdprefix+i);if(i==current_index)
cur_td.className="dipan3";else
cur_td.className="dipan4";}}
function rightTabClick(current_index,size,tabprefix,tdprefix){for(var i=0;i<size;i++){var cur_tab=document.getElementById(tabprefix+i);if(i==current_index)
cur_tab.style.display="block";else
cur_tab.style.display="none";}}
function aboutMeClick(current_index,size,tabprefix,tdprefix){for(var i=0;i<size;i++){var cur_tab=document.getElementById(tabprefix+i);if(i==current_index)
cur_tab.style.display="block";else
cur_tab.style.display="none";}
for(var i=0;i<size;i++){var cur_td=document.getElementById(tdprefix+i);if(i==current_index)
cur_td.style.color="#FF6600";else
cur_td.style.color="#000000";}}
function doSubmit(id){document.getElementById(id).submit();}
function doScroll(objid,direct){var obj=$(objid);if(obj.stopscroll==true)return;if(direct==1){if(obj.nowscroll<obj.contWidth){obj.scrollLeft=obj.nowscroll++;}else{obj.scrollLeft=0;obj.nowscroll=0;}}
if(direct==2){if(obj.nowscroll<obj.contWidth){obj.scrollRight=obj.nowscroll++;}else{obj.scrollRight=0;obj.nowscroll=0;}}
if(direct==3){if(obj.nowscroll<obj.contHeight){obj.scrollTop=obj.nowscroll++;}else{obj.scrollTop=0;obj.nowscroll=0;}}
if(direct==4){if(obj.nowscroll<obj.contHeight){obj.scrollBottom=obj.nowscroll++;}else{obj.scrollBottom=0;obj.nowscroll=0;}}}
function direct(url,id,parName){location.href=url+"&"+parName+"="+$(id).value;}
function ShowRecommandInfo(id,type,url){var url="/recommandation.do?type="+type+"&"+url;url=encodeURI(url);$(id).innerHTML="正在加载......";var ajax=new Ajax.Updater(id,url,{onSuccess:function(){$(id).innerHTML=arguments[0].responseText;}});}
function showSpecialInfo(orgUrl,prefixUrl,id,type,city){var url=orgUrl+"?prefixUrl="+prefixUrl+"&type="+type+"&city="+city;url=encodeURI(url);var ajax=new Ajax.Updater(id,url,{onSuccess:function(){$(id).innerHTML=arguments[0].responseText;}});}
function flightGoUrl(sityType){}
var Cookie={set:function(name,value,expirationInDays,path,domain){var cookie=escape(name)+"="+escape(value);if(expirationInDays){var date=new Date();date.setDate(date.getDate()+expirationInDays);cookie+="; expires="+date.toGMTString();}
if(path){cookie+=";path="+path;}
if(domain){cookie+=";domain="+domain;}
document.cookie=cookie;if(value&&(expirationInDays==undefined||expirationInDays>0)&&!this.get(name)){return false;}},clear:function(name,path){this.set(name,"",-1,path);},get:function(name){var pattern="(^|;)\\s*"+escape(name)+"=([^;]+)";var m=document.cookie.match(pattern);if(m&&m[2]){return unescape(m[2]);}else{return null;}}}
function viewTab(tab){var o=$(tab);if(o.style.display=="none"){o.style.display="block";}else{o.style.display="none";}}
function clearText(evt){evt.value="";}
var bigImgs=STYLE_PREFIX+"/images/ad/bijiala/0.jpg|"+STYLE_PREFIX+"/images/ad/bijiala/1.jpg|"+STYLE_PREFIX+"/images/ad/bijiala/2.jpg|"+STYLE_PREFIX+"/images/ad/bijiala/3.jpg|"+STYLE_PREFIX+"/images/ad/bijiala/4.jpg";var smallImgs=STYLE_PREFIX+"/images/ad/bijiala/0_s.jpg|"+STYLE_PREFIX+"/images/ad/bijiala/1_s.jpg|"+STYLE_PREFIX+"/images/ad/bijiala/2_s.jpg|"+STYLE_PREFIX+"/images/ad/bijiala/3_s.jpg|"+STYLE_PREFIX+"/images/ad/bijiala/4_s.jpg";function showIndexImagePlayer(){var el="adImagesDiv";if($(el)==null)
return;var b=['/ImagePlayer.swf?bigImgs='+bigImgs+'&smallImgs='+smallImgs+'&version='+TOURBAO_VERSION,'adImagesPlayer','274px','327px'];var params={quality:'high',bigImgs:bigImgs,smallImgs:smallImgs,wmode:'transparent'};var str=swf(b,params);$(el).style.display="block";$(el).innerHTML=str;}
var roundTripDefaultDateValue="不填即为单程";var alertAddressDefaultValue="请输入邮件地址";var alertPasswordDefaultValue="请输入密码";var alertPriceDefaultValue="请输入价格";var quickAlertMailDefaultValue="您的email地址";var quickAlertPriceDefaultValue="您的最低价格";var cityDefaultValue="城市名";