/*
Copyright(C) Ctrip.COM 2006.All Rights Reserved.
Not to be reused without permission.
Created by Ma ChangKun, UI group, IT department.
Last modified by Chu Chengdong, UI group, IT department. 2007/09/21
*/

var _=window,__=_.document,__h=__.documentElement;with(navigator){with(userAgent){var operator_={e_window_onload:false,e_IE:!!match(/MSIE/),e_IE6:!!appVersion.match(/MSIE 6\.0/),e_FF:!!match(/Mozilla/),e_Opera:!!match(/Opera/),e_Mac:!!match(/Mac/),e_busy:0,dealt:{},tab:{},selectall:{},checkform:{},address:{},jmpinfo:{},popwin:{}}}}if(operator_.e_IE6)__.createStyleSheet().addRule("body","behavior:url(/webresource/ui/csshover2.htc)");operator_.e_charset=((__.charset?__.charset:__.characterSet)||"gb2312").toLowerCase();operator_.e_charset=(operator_.e_charset.match(/^(gb2312|big5|utf-8)$/g)||"gb2312").toString();operator_.e_chs=!operator_.e_charset.match(/^utf-8$/g);operator_.e_iframe={address:"address_070713",calender:"calender_070713",jmpinfo:"jmpinfo_070713",checkinfo:operator_.e_chs?"checkinfo_070713":"engcheckinfo_070713",popwin:/^gb2312$/i.test(operator_.e_charset)?"popwin_070713":(/^big5$/i.test(operator_.e_charset)?"popwin_big5_070713":"popwin_utf-8_070713")};function $(a){return __.getElementById(a)}function $fixE(e){return e||_.event}function $fixElement(e){return e.target?(e.target.nodeType==3?e.target.parentNode:e.target):e.srcElement}function $fixWindow(a){var b=a.ownerDocument;return b.parentWindow||b.defaultView}Number.prototype.formatCur=function(){_v_num=this.toFixed(2);var a=/(\d)(\d{3}[,\.])/;while(a.test(_v_num))_v_num=_v_num.replace(a,"$1,$2");return _v_num.replace(/^(-?)\./,"$10.")};Array.prototype._push=function(c){if(c===null)return;$each.call(this,c,function(b){if(this.each(function(a){if(a==b)return false}))this.push(b)})};Array.prototype.each=function(a){for(var i=0;i<this.length;i++)if(a(this[i],i)===false)return 0;return 1};Array.from=function(a){if(a.length===undefined)return[a];var b=[];for(var i=0;i<a.length;i++)b.push(a[i]);return b};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,'')};String.prototype.isEmail=function(){var a=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;return a.test(this)};String.prototype.isDateTime=function(){var a,_v_arr;var a=top.operator_.e_chs?this:this.replace(/^(\d{1,2})-(\d{1,2})-(\d{4})$/,"$3-$1-$2");_v_arr=a.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);if(!_v_arr)return false;for(var i=1;i<4;i++)_v_arr[i]=parseInt(_v_arr[i],10);if(_v_arr[1]<1000||_v_arr[1]>9999||_v_arr[2]<1||_v_arr[2]>12||_v_arr[3]<1||_v_arr[3]>31)return false;var b=new Date(_v_arr[1],_v_arr[2]-1,_v_arr[3]);return b.getFullYear()==_v_arr[1]&&b.getMonth()==_v_arr[2]-1&&b.getDate()==_v_arr[3]};String.prototype.parseEngDate=function(){var b="January|1@February|2@March|3@April|4@May|5@June|6@July|7@August|8@September|9@October|10@November|11@December|12",_v_re=this.replace(/[ \-,\.\/]+/g,"-").replace(/(^|-)0+(?=\d+)/g,"$1").replace(/[a-z]{3,}/i,function(a){return(_t_re=b.match(new RegExp("(^|@)"+a+"[^\\|]*\\|(\\d+)","i")))?_t_re[2]:a}).replace(/^([^-]{1,2}-[^-]{1,2})-([^-]{4})$/,"$2-$1");return _v_re.isDateTime()?_v_re:null};String.prototype.parseStdDate=function(){var a=this.parseEngDate();if(!a)return null;var b=a.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);return"Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec".split("|")[parseInt(b[2])-1]+"-"+b[3]+"-"+b[1]};String.prototype.parseDate=function(){var a,_v_today=(new Date()).dateValue(),_v_str=top.operator_.e_chs?this:this.replace(/^(\d{1,2})-(\d{1,2})-(\d{4})$/,"$3-$1-$2");a=_v_str.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);if(!a)return _v_today;for(var i=1;i<4;i++)a[i]=parseInt(a[i],10);if(a[1]<1000||a[1]>9999)a[1]=_v_today.getFullYear();if(a[2]<1||a[2]>12)a[2]=_v_today.getMonth()+1;if(a[3]<1||a[3]>31||(new Date(a[1],a[2]-1,1)).getMonth()!=(new Date(a[1],a[2]-1,a[3])).getMonth())a[3]=_v_today.getDate();return new Date(a[1],a[2]-1,a[3])};Date.prototype.dateValue=function(){return new Date(this.getFullYear(),this.getMonth(),this.getDate())};Date.prototype.getChineseDay=function(){return $$ba.a.charAt(this.getDay())};function $each(a,b){var c;if(a!==null)if(a.length!==undefined)for(var i=0;i<a.length&&(c=b.call(this,a[i],i))!==false;i++);else b.call(this,a,0);return c===false?0:1}function $iterator(b,c){$each.call(this,b.childNodes,function(a){c.call(this,a);$iterator(a,c)})}function $loadjs(a,b){var c=__.createElement('script');with(c){src=a;type='text/javascript';charset=b||operator_.e_charset}__.getElementsByTagName('head')[0].appendChild(c)}$loadjs("http://webresource.english.ctrip.com/code/js/resource/string_"+top.operator_.e_charset+".js",top.operator_.e_charset);function $t(a){if(_!=top)top.$t(a)}if(!_.$r)$r=function(c,d){var e=[].slice.call(arguments,2);$each(d.split(/[^A-Za-z]/g),function(b){$each(e,function(a){if(c.attachEvent)c.attachEvent(b,a);else c.addEventListener(b.replace(/^on/i,""),a,false)})})};function $ur(c,d){var e=[].slice.call(arguments,2);$each(d.split(/[^A-Za-z]/g),function(b){$each(e,function(a){if(c.detachEvent)c.detachEvent(b,a);else c.removeEventListener(b.replace(/^on/i,""),a,false)})})}function $init(){}function $rinit(a){var b=$init;$init=function(){b();a()}}function $stopevent(e,a){e=e||$fixE(e);a=a||0;if(a>=0)e.preventDefault?e.stopPropagation():(e.cancelBubble=true);if(a!=0)e.preventDefault?e.preventDefault():(e.returnValue=false)}function $g(m,n){function _m_query(g,h){var k=[],_v_re=g.match(/^([\.\#]*)([a-zA-Z0-9\-_*]+)(.*)$/i);if(!_v_re)return[];if(_v_re[1]=="#"){var l=$(_v_re[2]);if(l)k.push(l)}else if(_v_re[1]==".")h.each(function(b){$each(b.getElementsByTagName("*"),function(a){if(a.className.match(new RegExp("\\b"+_v_re[2]+"\\b")))k.push(a)})});else for(var i=0;i<h.length;i++){var l=h[i].getElementsByTagName(_v_re[2]);if(l)for(var j=0;j<l.length;j++)k.push(l[j])}_v_re[3].replace(/\[([^!=]+)(=|!=)([^\]]*)\]/gi,function(a,b,c,d){var f=k.slice(0);k=[];f.each(function(a){b={_class:"className",_for:"htmlFor"}["_"+b]||b;var e=a[b]||a.getAttribute(b);if(c!="="^e==d)k.push(a)})});return k}var o=[n||__.body];m.replace(/(#|\*)/gi," $1").replace(/([^\^ ])\.(\w+)/gi,"$1[className=$2]").trim().split(/\s+/g).each(function(a){o=_m_query(a,o)});return o.length==0?null:o}function $parser(a){$each((a&&a.tagName?a:__.body).getElementsByTagName("*"),$deal_elements);$init()}function $parserByRegExp(c){(c&&c.tagName?c:__.body).innerHTML.replace(/id=["']?([^ '"\/<>]+_[^ '"\/<>]+_m)["' \/>]/gi,function(a,b){$deal_elements($(b))});$init()}function $deal_elements(d){if(!d||!d.id||!d.id.match(/_m$/i)||operator_.dealt[d.id]==d)return;operator_.dealt[d.id]=d;d.id.replace(/_([^_]+)(?=_)/g,function(a,b){var c,_v_f,_v_c;if(_["c_module_"+b])new _["c_module_"+b](d);else if(_["m_module_"+b])_["m_module_"+b].minit(d);else if(c=operator_.e_iframe[b]){if(_v_f=top.$("iframe_"+b))_v_f.list._push(d);else{_v_f=top.__.createElement("iframe");with(_v_f){with(style){display="none";position="absolute";padding=margin="0";overflow="hidden";background="transparent";zIndex="100"}src="/webresource/ui/"+c+".html";frameBorder="0";id="iframe_"+b;allowTransparency=!operator_.e_IE6}_v_f.list=[d];if(!(_v_c=top.$("iframes_container"))){_v_c=top.__.createElement("div");_v_c.id="iframes_container";with(top.__.body){try{appendChild(_v_c)}catch(e){insertBefore(_v_c,lastChild)}}}_v_c.appendChild(_v_f)}}})}function $get_position(a){var b,_v_pos=[0,0],_t_height,_v_flag,_v_border={"thin":2,"medium":4,"thick":6},_t_border;function _m_fix_border(){_t_border=[$get_style(a,"borderLeftStyle").match(/none|hidden/)?0:$get_style(a,"borderLeftWidth"),$get_style(a,"borderTopStyle").match(/none|hidden/)?0:$get_style(a,"borderTopWidth")];_v_pos[0]+=_v_border[_t_border[0]]||parseInt(_t_border[0])||0;_v_pos[1]+=_v_border[_t_border[1]]||parseInt(_t_border[1])||0}do{b=$fixWindow(a);if(a.tagName.match(/^(iframe|frameset)$/i))_m_fix_border();_v_flag=-1;do{_v_pos[0]+=a.offsetLeft-a.scrollLeft;_v_pos[1]+=a.offsetTop-a.scrollTop;switch($get_style(a,"position")){case"absolute":_m_fix_border();break;case"fixed":_v_flag=1;break}}while((a=a.offsetParent)&&a!=b.__h);if(operator_.e_Mac){_v_pos[0]+=__.body.leftMargin||0;_v_pos[1]+=__.body.topMargin||0}if(_v_flag==1||b!=top){_v_pos[0]+=b.__h.scrollLeft*_v_flag;_v_pos[1]+=b.__h.scrollTop*_v_flag}}while(a=b.frameElement);return _v_pos}function $set_position(g,h,i,j){function _m_query(e,f){function _m_cal(a,b,c,d){return c+{"l":0,"c":b.offsetWidth/2,"r":b.offsetWidth,"t":0,"m":b.offsetHeight/2,"b":b.offsetHeight}[a||"l"]*d}return _m_cal(i.match(e),g,_m_cal(j.match(e),h,k[f],1),-1)+"px"}var k=$get_position(h);i=i||"lt";j=j||"lb";g.style.left=_m_query(/[lcr]/i,0);g.style.top=_m_query(/[tmb]/i,1)}function $nsib(a){return a.nextSibling||a.parentNode.firstChild}function $psib(a){return a.previousSibling||a.parentNode.lastChild}function _$abs_(a,b){if(!a)return null;b=b||"n";_v_re=new RegExp(({_p_1:"n",_p_3:"t",_p_8:"c"}["_p_"+a.nodeType])||"o","i");return b.match(_v_re)?a:arguments.callee.caller(a,b)}function $nabs(a,b){var c=a.firstChild||a.nextSibling;if(c)return _$abs_(c,b);do{a=a.parentNode;if(a==__.body)return null;c=a.nextSibling}while(!c);return _$abs_(c,b)}function $pabs(a,b){if(a==__.body)return null;var c=a.previousSibling;if(c){while(c.lastChild)c=c.lastChild}else return _$abs_(a.parentNode,b);return _$abs_(c,b)}function $next_focus(b){if(!b.form)return;try{b.blur()}catch(e){};var c=b.form.elements,_v_flag;$each(c,function(a){if(_v_flag)try{a.focus();return false}catch(e){};if(a==b)_v_flag=true})}function $set_display(b){$get_position(b).each(function(a,i){top.__h[["scrollLeft","scrollTop"][i]]=a-80})}function $get_style(a,b){var c=a.currentStyle||$fixWindow(a).getComputedStyle(a,null);return b?c[b]:c}function $uid(){return"uid_"+(new Date()).getTime()+parseInt(Math.random()*100000,10)}function $fix_height(d,e){if(operator_.no_fix_height)return;function _m_query(a,b){if(!a||!b||!a.style||!b.style)return;a.style.height=b.style.height="";if(a.offsetHeight>b.offsetHeight){var c=a;a=b;b=c}with(a){with(style){height=b.offsetHeight-offsetHeight+clientHeight+"px";overflow="hidden"}}}if(arguments.length<2){var f="pubGlobal_",_t2=f+"main_";_m_query($(f+"column05"),$(f+"column04"));_m_query($(_t2+"sidebar"),$(_t2+"content"));_m_query($(_t2+"sidebar"),$(_t2+"content3"))}else _m_query($(d)||d,$(e)||e)}function $fix_elements(){$each(__.body.getElementsByTagName("label"),function(b){if(b.htmlFor)return;$each(b.getElementsByTagName("input"),function(a){if(a.type.match(/radio|checkbox/i)){b.htmlFor=a.id=a.id||$uid();return false}})});$each(__.body.getElementsByTagName("select"),function(a){$r(a,"onmousewheel",function(){return false})})}function $getquery(a){var b=(location.search||"").match(new RegExp("[\?&]"+a+"=([^&]+)","i"));return b?unescape(b[1]):null}function $getpara(a){var b=a.getAttribute("para")||"",_v_para=b.split(b.indexOf("")>-1?"":",");for(var i=1;i<=Math.max(arguments.length-1,_v_para.length);i++)_v_para[i-1]=_v_para[i-1]||arguments[i]||"";return _v_para}function c_module_notice(a){a.notice=$getpara(a,$$bn.a)[0];function _m_check(){if(a.unnotice)return;with(a){if(!value||value==notice){style.color="gray";value=notice}else style.color=""}}_m_check();$r(a,"onfocus",function(){with(a){style.color="";if(value==notice)value=""}});$r(a,"onblur",function(){setTimeout(_m_check,0)})}function c_module_tab(e){var f=$getpara(e,null,null,null);if(operator_.tab[f[0]])return operator_.tab[f[0]](e);if(!f[1]||!f[2])return;var g=$g(f[1]),_v_obj2=$g(f[2]),_v_c={"true":"_current","false":"_nocurrent"};if(!g||!_v_obj2||g.length!=_v_obj2.length)return;$each(g,function(c,d){$r(c,"onclick",function(){$each(g,function(a,b){a.className=a.className.replace(_v_c[d!=b],_v_c[d==b]);_v_obj2[b].style.display=(d==b)?"":"none"})})})}function c_module_display(d){var e=$getpara(d),_v_l=[],_v_flag=1;$each(e,function(a){a.replace(/@/g,function(){_v_flag=0;return""});_v_l._push($(a))});$r(d,"onclick",function(){$each(_v_l,function(b,i){var c=$get_style(b,"display")=="none";b.style.display=c?"":"none";c=c&&_v_flag;if(i==0)$iterator(d,function(a){with(a){if(nodeType==3){nodeValue=nodeValue.replace(c?$$bd.a:$$bd.b,c?$$bd.b:$$bd.a);nodeValue=nodeValue.replace(c?$$bd.c:$$bd.d,c?$$bd.d:$$bd.c)}}})});$fix_height()})}function c_module_selectall(c){var d=$getpara(c,""),_v_input=$g(d[0]);if(operator_.selectall[d[0]])return operator_.selectall[d[0]](c);if(!_v_input)return;$each(_v_input,function(b){if(b!=c)$r(b,"onclick",function(){c.checked=$each(_v_input,function(a){if(a!=c&&!a.checked)return false})})});$r(c,"onclick",function(){$each(_v_input,function(a){a.checked=c.checked})})}function c_module_checkform(c){var d=$getpara(c,"","",$$bc.a),_v_msg=$(c.id+"_msg"),_v_lastvalue="",_v_clock,_v_func=d[1].match(/^\w+/)||"";if(!_v_msg||!d[1])return;if(!operator_.checkform[_v_func])return;$r(c,"onfocus",function(){_v_clock=setInterval(function(){var a=c.value.trim();if(a==_v_lastvalue)return;else _v_lastvalue=a;if(!a)return _v_msg.innerHTML="";var b=operator_.checkform[_v_func](c,d),_v_msginfo=d[2];if(typeof b=='string'){_v_msginfo=b;b=false}_v_msg.innerHTML=b?"<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"pubGlobal_cuebox02\"><tr><td class=\"td01\"></td></tr></table>":("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"pubGlobal_cuebox01\"><tr><td class=\"td01\">"+_v_msginfo+"</td></tr></table>")},200)});$r(c,"onblur",function(){clearInterval(_v_clock)})}operator_.checkform.public_int=function(a,b){if(isNaN(a.value)||a.value!=Math.ceil(a.value))return false;var c=b[1].match(/\((\d*)-(\d*)\)/);if(c){if(c[1]&&!isNaN(c[1])&&parseInt(a.value)<parseFloat(c[1]))return false;if(c[2]&&!isNaN(c[2])&&parseInt(a.value)>parseFloat(c[2]))return false}return true};operator_.checkform.public_date=function(a,b){var c=a.value.replace(/[\\\/\. ]/gi,"-");return c.isDateTime()};operator_.checkform.public_mail=function(a,b){return a.value.isEmail()};function c_module_class(a){var b=$getpara(a,"","","");if(b[0]=="url"&&top.location.href.toLowerCase().indexOf(b[1].toLowerCase())!=-1)a.className=b[2]}function checkinfo(a,b,c){if(_!=top)top.checkinfo($(a)||a,b,c)}function $preload(){if(!$("priFoot_sign"))return;$clear_preload();$ur(top,"onload",$fix_elements,$parserByRegExp);$fix_elements();$parserByRegExp()}function $clear_preload(){clearInterval(operator_.e_preload)}operator_.e_preload=setInterval($preload,500);$r(_,"onload",function(){operator_.e_window_onload=true});var t_window=top.operator_.e_window_onload?_:top;$r(t_window,"onload",$clear_preload,$fix_elements,$fix_height,$parserByRegExp);