String.prototype.trim = function(){return this.replace(/(^\s*)|(\s*$)/g, "");};function addCommas(v){	var s=v.toString().split("."),r=new   RegExp("(\\d{"+(3-s[0].length%3)%3+"}),","g");	s[0]=s[0].match(/\d{1,3}/g).toString().replace(r,",$1");   	return   s.join(".");   }_PColl=new Object();_PColl.ChineseNamePattern="^[\u4e00-\u9fa5]{2,20}$";_PColl.ChinesePattern="^[\u4e00-\u9fa5]+$";_PColl.rareChineseName1="^[\u4e00-\u9fa5]+[A-z]{2,}$";_PColl.rareChineseName2="^[A-z]{2,}[\u4e00-\u9fa5]+$";_PColl.rareChineseName3="^[A-z]{3,}$";_PColl.EnglishName="^[a-z,A-Z ]{2,}\/[a-z,A-Z ]{2,}$";function ValidValue(pstr,str){	var patrn=new RegExp(pstr);	return patrn.test(str);}var c_validator={isEmpty:function(v){return v.length==0?false:true;},isIllegalChar:function(v){re=new RegExp("[\"\'\<\>\@\#\$\%\^\*\+\=]");if(re.test(v)){return true;}else{return false;}},isEmail:function(v){RegTest=new RegExp("^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[0-9a-zA-Z_]+))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2,4})$");return RegTest.test(mail);},isValidZipCode:function(v){	var reg = new RegExp('^[0-9]{6}$');	if (v.search(reg) == -1)return false;return true;},	isValidEmail:function(s){var reg1 = new RegExp('^[a-zA-Z0-9][a-zA-Z0-9@._-]{3,}[a-zA-Z]$');var reg2 = new RegExp('[@.]{2}');if (s.search(reg1) == -1|| s.indexOf('@') == -1|| s.lastIndexOf('.') < s.lastIndexOf('@')|| s.lastIndexOf('@') != s.indexOf('@')|| s.search(reg2) != -1)return false;return true;},isValidMobile:function(v){RegTest = new RegExp("^18[0-9]|^13[0-9]|^15[0-9][0-9]{8}$");if (v.length != 11 && v.length != 12 ){return false;}if (v.length == 12){if (v.substr(0,1) == 0){v = v.substr(1,11);			}else{return false;}}return RegTest.test(v);},isValidChinaIDCard:function(sNo){sNo = sNo.toString();if (sNo.length==18){var a,b,c;if (!c_validator.isInteger(sNo.substr(0,17))){return false;}a=parseInt(sNo.substr(0,1))*7+parseInt(sNo.substr(1,1))*9+parseInt(sNo.substr(2,1))*10;a=a+parseInt(sNo.substr(3,1))*5+parseInt(sNo.substr(4,1))*8+parseInt(sNo.substr(5,1))*4;a=a+parseInt(sNo.substr(6,1))*2+parseInt(sNo.substr(7,1))*1+parseInt(sNo.substr(8,1))*6;a=a+parseInt(sNo.substr(9,1))*3+parseInt(sNo.substr(10,1))*7+parseInt(sNo.substr(11,1))*9;a=a+parseInt(sNo.substr(12,1))*10+parseInt(sNo.substr(13,1))*5+parseInt(sNo.substr(14,1))*8;a=a+parseInt(sNo.substr(15,1))*4+parseInt(sNo.substr(16,1))*2;b=a%11;if (b==2){c=sNo.substr(17,1).toUpperCase();}else{c=parseInt(sNo.substr(17,1));}switch(b){case 0: if ( c!=1 ) {return false;}break;case 1: if ( c!=0 ) {return false;}break;case 2: if ( c!="X") {return false;}break;case 3: if ( c!=9 ) {return false;}break;case 4: if ( c!=8 ) {return false;}break;case 5: if ( c!=7 ) {return false;}break;case 6: if ( c!=6 ) {return false;}break;case 7: if ( c!=5 ) {return false;}break;case 8: if ( c!=4 ) {return false;}break;case 9: if ( c!=3 ) {return false;}break;case 10: if ( c!=2 ){return false};}}		else{if(sNo.length==15){if (isValidDate(sNo.substr(6,2),sNo.substr(8,2),sNo.substr(10,2))) {return true;}else{return false;}}else{return false;}}switch(sNo.length){case 15: if (isValidDate(sNo.substr(6,2),sNo.substr(8,2),sNo.substr(10,2))) {return true;}case 18: if (isValidDate(sNo.substr(6,4),sNo.substr(10,2),sNo.substr(12,2))) {return true;}}return false;},isInteger:function(v){var re = /^[0-9]+.?[0-9]*$/;return re.test(v);},isValidSpeciallyChar:function(string){	var v=string;if(ValidValue(_PColl.ChinesePattern,v)){if(!ValidValue(_PColl.ChineseNamePattern,v)){return false;}}else if(ValidValue(_PColl.rareChineseName1,v)){return true;}else if(ValidValue(_PColl.rareChineseName2,v)){return true;}else if(ValidValue(_PColl.rareChineseName3,v)){return false;}else if(ValidValue(_PColl.EnglishName,v)){return true;}else{return false;};return true;},isValidDateByYMD:function(iY, iM, iD){var undefined;if ( iY != undefined && !isNaN(iY) && iY >=0 && iY<=9999 &&iM != undefined && !isNaN(iM) && iM >=1   && iM<=12 &&iD != undefined && !isNaN(iD) && iD >=1   && iD<=31  ){if (iY<50)iY = 2000+iY; 	else if (iY<100) iY=1900+iY;if (iM == 2  && (isLeapYear(iY)  && iD > 29 || !isLeapYear(iY) && iD>28) ||	iD == 31 && (iM<7 && iM%2==0 || iM>7 && iM%2==1) )											return false;else{return true ;}}else{return false;}},isValidDate:function(d){var str=d;d = d.replace(/\s+/g,""); if(str.search(/^\d{4}-\d{1,2}-\d{1,2}$/) == 0){var y = parseInt(str.split("-")[0]); var m = parseInt(str.split("-")[1]); var d = parseInt(str.split("-")[2]); switch(m){ case 1: case 3: case 5: case 7: case 8: case 10: case 12: if(d>31){ return false; }else{ return true; } break; case 2: if((y%4==0 && d>29) || ((y%4!=0 && d>28))){ return false; }else{ return true; } break; case 4: case 6: case 9: case 11: if(d>30){ return false; }else{ return true; } break; default: return false; } }else{ return false; } },isNumber:function(str){ if(""==str){ return false; } var reg = /\D/; return str.match(reg)==null; }};function $validator(t, vv){var v = vv.trim();switch(t){case "Cchar":{return c_validator.isValidSpeciallyChar(v);break;}case "passengerno":{return c_validator.isValidChinaIDCard(v);break;}case "empty":{return c_validator.isEmpty(v);break;}case "Cmobile":{return c_validator.isValidMobile(v);break;}case "Ctel":{return c_validator.isInteger(v);break;}case "email":{return c_validator.isValidEmail(v);break;}case "receiver":{return c_validator.isValidSpeciallyChar(v);break;}case "prov":{return c_validator.isEmpty(v);break;}case "city":{return c_validator.isEmpty(v);break;}case "address":{return c_validator.isEmpty(v);break;}case "ticketaddr":{return c_validator.isEmpty(v);break;}case "sendday":{return c_validator.isValidDate(v);break;}case "userid":{return c_validator.isEmpty(v)?!c_validator.isIllegalChar(v):false;break;}case "pwd":{return c_validator.isEmpty(v);break;}case "cpwd":{return c_validator.isEmpty(v);break;}case "zipcode":{return c_validator.isValidZipCode(v);break;}case "number":{return c_validator.isNumber(v);break;}}}function $st(o) {return($(o).style); }function $Tag(){ var elements = new Array(); for (var i = 0; i < arguments.length; i++) {var element = arguments[i];if (typeof element == 'string')element = document.getElementsByTagName(element);if (arguments.length == 1)return element;elements.push(element);}return elements;}function GetobjVertex(sobj, t, sH, sW){sH=parseInt(sH);sW=parseInt(sW);var eT=0,eL=0,p=sobj;var sT=document.body.scrollTop;var sL=document.body.scrollLeft;var eH=sobj.height;var eW=sobj.width;while(p&&p.tagName!="BODY"){eT+=p.offsetTop;eL+=p.offsetLeft;p=p.offsetParent;};if(t=="Top"){return (document.body.clientHeight-eT-sT-eH>=sH?eT+eH:eT-sH)+sobj.offsetHeight;}else if(t=="Left"){return (document.body.clientWidth-eL-sL>=sW?eL:eL+eW-sW)+2;}}function Marquee(){ this.ID=document.getElementById(arguments[0]); this.Direction=arguments[1]; this.Step=arguments[2]; this.Width=arguments[3]; this.Height=arguments[4];this.Timer=arguments[5];this.WaitTime=arguments[6];this.StopTime=arguments[7];if(arguments[8]){this.ScrollStep=arguments[8];}else{this.ScrollStep=this.Direction>1?this.Width:this.Height;}this.CTL=this.StartID=this.Stop=this.MouseOver=0;this.ID.style.overflowX=this.ID.style.overflowY="hidden";this.ID.noWrap=true;this.ID.style.width=this.Width;this.ID.style.height=this.Height;this.ClientScroll=this.Direction>1?this.ID.scrollWidth:this.ID.scrollHeight;this.ID.innerHTML+=this.ID.innerHTML;this.Start(this,this.Timer,this.WaitTime,this.StopTime);}Marquee.prototype.Start=function(msobj,timer,waittime,stoptime){msobj.StartID=function(){msobj.Scroll();};msobj.Continue=function(){if(msobj.MouseOver==1){setTimeout(msobj.Continue,waittime);}else{clearInterval(msobj.TimerID); msobj.CTL=msobj.Stop=0; msobj.TimerID=setInterval(msobj.StartID,timer);}};msobj.Pause=function(){msobj.Stop=1; clearInterval(msobj.TimerID); setTimeout(msobj.Continue,waittime);};msobj.Begin=function(){    msobj.TimerID=setInterval(msobj.StartID,timer);msobj.ID.onmouseover=function(){msobj.MouseOver=1; clearInterval(msobj.TimerID);};msobj.ID.onmouseout=function(){msobj.MouseOver=0; if(msobj.Stop==0){clearInterval(msobj.TimerID); msobj.TimerID=setInterval(msobj.StartID,timer);}}};setTimeout(msobj.Begin,stoptime);};Marquee.prototype.Scroll=function(){switch(this.Direction){case 0:this.CTL+=this.Step; if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollTop+=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}else{if(this.ID.scrollTop>=this.ClientScroll) this.ID.scrollTop-=this.ClientScroll; this.ID.scrollTop+=this.Step;}break;case 1:this.CTL+=this.Step;if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollTop-=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}else{if(this.ID.scrollTop<=0) this.ID.scrollTop+=this.ClientScroll; this.ID.scrollTop-=this.Step;}break;case 2:this.CTL+=this.Step;if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollLeft+=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}else{if(this.ID.scrollLeft>=this.ClientScroll) this.ID.scrollLeft-=this.ClientScroll; this.ID.scrollLeft+=this.Step;}break;case 3:this.CTL+=this.Step;if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollLeft-=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}else{if(this.ID.scrollLeft<=0) this.ID.scrollLeft+=this.ClientScroll; this.ID.scrollLeft-=this.Step;}break;}};function DateDiff(sDate1, sDate2){ var aDate, oDate1, oDate2, iDays; aDate = sDate1.split("-"); oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]);aDate = sDate2.split("-");oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]);iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 /24);return iDays;}function getL(id){ var e=id;var l=e.offsetLeft; while(e=e.offsetParent){ l+=e.offsetLeft; } return l;} function getT(id){ var e=id;var t=e.offsetTop; while(e=e.offsetParent){ t+=e.offsetTop; } return t;} 
function setCookie(name, value, expires, path, domain){	var str = name + "=" + value + ";";	if (expires) str += "expires=" + expires + ";";	str += "path=" + (path ? path : "/") + ";";	if (domain) str += "domain=" + domain + ";";	document.cookie = str;}function getCookie(name){	var str = document.cookie;	var cookies = str.split("; ");	for (var i=0; i<cookies.length; i++)	{		if(cookies[i].split('=')[0]==name)		{			return cookies[i].split('=')[1];		}	}	return "";}