// JavaScript Document
var xml = null;
var b;
var OrderStr;
var HotelIdStrA_all;

	var dstrx;	//输出查询日期串
	var dstrx1;	//输出查询日期串1
	var dstrx2;	//输出查询日期串2
	var tstrx; //输出查询时间串
	var tstrx1;	//输出查询时间串1
	var tstrx2; //输出查询时间串2
	var rstrx;	//输出查询房间串
	var dstr; //格式化后的日期串
	
function ShowRoom(str){
	
/*	 for(var m=0;m<parseInt(document.getElementById('hid_count').value);m++){
		if(i==m){
			 var obj = document.getElementById('showroom_'+i+'');
			 if(obj.style.display == "none"){
				 obj.style.display = "block";
				 document.getElementById('font_'+i).innerHTML  = '隐藏房型'; 
			 }else{
				obj.style.display = "none";
				document.getElementById('font_'+i).innerHTML  = '全部房型';
			 }
		} else{  
				var obj = document.getElementById('showroom_'+m+'');
				obj.style.display = "none";
				document.getElementById('font_'+m).innerHTML  = '全部房型';
			 }
	  }*/
	//b = i;
	//alert(str);
	OrderStr =  str;
	var OrderStrA=OrderStr.split("$");
	var HotelIdStr=OrderStrA[0];
	var HotelIdStrA=HotelIdStr.split(",");
	HotelIdStrA_all=HotelIdStrA;
	var HotelIdStrA_Lenght=HotelIdStrA.length;
	//alert("数组长度"+HotelIdStrA_Lenght);
	for(var m=0;m<HotelIdStrA_Lenght;m++){
		document.getElementById(HotelIdStrA[m]).innerHTML = '<div style="text-align:center"><img src="/Themes/images/icon/ajax-loader.gif" />&nbsp;&nbsp;正在处理中...</div>';
		}

	
	
	if(window.XMLHttpRequest)
		xml = new XMLHttpRequest();
	else if(window.ActiveXObject)
		xml = new ActiveXObject("Microsoft.XMLHTTP");
		xml.onreadystatechange = GetHotelRoom;
	try{
		//xml.open("GET","/Hotel/GetHotelRoom.asp?str="+encodeURI(str)+"&nocache="+Math.random(),true);
		xml.open("GET","/Hotel/GetHotelRoom8899.asp?str="+OrderStr+"&nocache="+Math.random(),true);
		xml.send(null);	
	}
	catch(e){}
}


function GetHotelRoom(){
	//var showroom = document.getElementById('showroom_'+b);
	//document.getElementById("aaabbbccc").innerHTML=xml.responseText;
	//alert(xml.responseText);
		
	 if(xml.readyState == 4){
		if(xml.status == 200){
			//var html = '<table width="90%" align="center" border="0" cellpadding="0" cellspacing="1"  class="hidTab">';
			//	html += '<tr>';
			
		var html = '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="NewHotelTabList">';
			html += '<tr class="NewHotelTabTr">';			

			html += '<th width=20% height="25" style="text-align:left; padding-left:10px">房型</th>';
			html += '<th width=20%>早餐</th>';
			html += '<th width=10%>宽带</th>';
			//html += '<th width=12%>门市价</th>';
			html += '<th width=15%>日均价</th>';
			html += '<th width=15% '+isHotelBack_display+'>奖金</th>';
			//html += '<th>床型</th>';
			
			
			//html += '<th>备注</th>';
			//html += '<th width=12%>支付方式</th>';
			html += '<th width=20%>&nbsp;</th>';	
			
			html += '</tr>';


			
				
		var response=xml.responseText;		
		//alert(response);
		//window.clipboardData.setData("text",response);


//IE
if (window.ActiveXObject){ 
            var xmldoc = new ActiveXObject("Microsoft.XMLDOM"); 
			xmldoc.async = "false";
		    xmldoc.loadXML(response);
} 
//Firefox
else if (document.implementation && document.implementation.createDocument){//Mozilla, Firefox, Opera, etc.
			var oParser = new DOMParser();
			var xmldoc = oParser.parseFromString(response,"text/xml");
}

			
			var lprice,hprice
			var temHotelID="",HotelID_="";
			var html8="";
			var room_Number,room_Number_;
			var node = xmldoc.getElementsByTagName('RoomType');			
			//var StrValue = document.OrderRoomform.StrValue.value;
			var SUVS = document.OrderRoomform.Sys_UserID.value;
			SUVS = SUVS.split('|');
			var room_Num = node.length;
			
			//alert(node.length);
			
			for(var j=0;j<node.length;j++){				
				var nodev = node[j];
				var OrderRoomIsNo = 0;
				 //<RoomType HotelID="SOHOTO10163" VendorCode="SOHOTO" RoomTypeCode="INCE001" RoomTypeName="豪华套房" RatePlanCode="BK001" RoomTypeDesc="所在楼层:7、9层;房型面积:70平方米;床型:大床;床面积:大床2.1米;宽带免费;内窗;房间无电脑;可加床;有明清风格和现代风格；" BedType="大床" IsInternet="" Payment="T" checkinDate="2011-5-5" Status="0" AmountPrice="1288" DisplayPrice="2188" CommissionType="PCT" YPercent="0.10" YgAmount="0" Meal="0" /> 
				    var HotelID = nodev.getAttribute( "HotelID");
				    var VendorCode = nodev.getAttribute("VendorCode");					
					if(VendorCode==SUVS[0])
					OrderRoomIsNo = 1;					
					var RoomName = nodev.getAttribute( "RoomTypeName"); 
					var RoomCode = nodev.getAttribute( "RoomTypeCode"); 
					var RatePlanCode = nodev.getAttribute( "RatePlanCode"); 
					
					var PaymentType=nodev.getAttribute( "Payment"); 
					var DisplayPrice = nodev.getAttribute( "DisplayPrice"); 
					if(isNaN(DisplayPrice))
					DisplayPrice = "×";
					var RateAmount = nodev.getAttribute( "AmountPrice"); 
					if(isNaN(RateAmount))
					RateAmount = "×";
					var BedType= nodev.getAttribute( "BedType"); 
					var RoomDesc = nodev.getAttribute( "RoomTypeDesc"); 
					var RoomStatus=nodev.getAttribute( "Status");
					var AddValues=nodev.getAttribute( "AddValues");
					var GaranteeRule=nodev.getAttribute( "GaranteeRule");
					var OrderType = nodev.getAttribute( "OrderType"); 
					
					/*if (nodev.getElementsByTagName("BedType")[0].firstChild!=null)
					{var BedType = nodev.getElementsByTagName("BedType")[0].firstChild.data;}
					var RoomDesc = "" ;
					if (nodev.getElementsByTagName("RoomTypeDesc")[0].firstChild!=null)
					{RoomDesc = nodev.getElementsByTagName("RoomTypeDesc")[0].firstChild.data;}*/
					//var RoomDesc = nodev.getElementsByTagName("RoomTypeDesc")[0].firstChild.data;
					var MealPlan = nodev.getAttribute( "Meal");
					var IsInternet = nodev.getAttribute( "IsInternet");
					var RatePlanName = "";
					RatePlanName = nodev.getAttribute( "RatePlanName");	
					RatePlanName = RatePlanName.replace(/(-)/ig,"");					
					RatePlanName = RatePlanName.replace("航旅通","");					
					RatePlanName = RatePlanName.replace("所有渠道","");
					RatePlanName = RatePlanName.replace("现付","");
					RatePlanName = RatePlanName.replace("代付","");
					RatePlanName = RatePlanName.replace("默认","");					
					RatePlanName = RatePlanName.replace("航信价格","");	
					RatePlanName = RatePlanName.replace("底价预付","");	
					
					
					if(RatePlanName!="")
					RatePlanName = "("+RatePlanName+")";
					
					if(IsInternet =="")
					IsInternet = "无";
					else
						{
						if (IsInternet =="Y")
							IsInternet = "有";
						else if (IsInternet =="YY")
							IsInternet = "有(收费)";
						else if (IsInternet =="YN")
							IsInternet = "有(免费)";
						else if (IsInternet =="N")	
							IsInternet = "无";
						else
							IsInternet = IsInternet;
						}
					//if(j==0){lprice=RateAmount;}
					//if(j==node.length-1){hprice=RateAmount;}

					if(OrderRoomIsNo && !SUVS[1].length && OrderStr.split("$")[3]!="HKG" && OrderStr.split("$")[3]!="MFM")
					{
					var tmp = '<span hint="仅会员可见,请先登录！">***</span>';
					RateAmount = '<span hint="仅会员可见,请先登录！">***</span>';
					var Back = '<span hint="仅会员可见,请先登录！">***</span>';
					}
					else
					{
					if(DisplayPrice!='0.0')
					var tmp = "<del>"+DisplayPrice+"</del>";	
					else
					var tmp = '';
					if(DisplayPrice == "×")
					var tmp = DisplayPrice;
					if(RateAmount == "×"){
						RateAmount=0;
						var Back = 0;}
					else{
					var Back = RateAmount ;
					var Back = RateAmount * eval(SUVS[2]);
					//返回大于等于其数字参数的最小整数
					//Back = Math.ceil(Back / 100);
					//四舍五入
					Back = Math.round(Back / 100);	
					if(PaymentType!="T") //现付的才返佣
					Back = Back;					
					}
					}
					

					
					if(temHotelID!=HotelID)
					room_Number = 0;
					else
					room_Number += 1;
					
					
					var tmp2 = OrderStr.split('$');
					//var tmp3="55";
					//'SHA^上海^SOHOTO11104^021-62261133^上海 普陀区 万航渡后路59号^INCE005^2011-05-06^2011-05-08^0^T^BK001'
					//var tmp3 = tmp2[3] + "^" + tmp2[4] + "^" + HotelID + "^^^" + RoomCode + "^" + tmp2[1] + "^" + tmp2[2] + "^0^" + PaymentType + "^" + RatePlanCode;
					
					if(RoomDesc!=''){
					var tmp1 = '<a href="javascript:Summary22(\''+HotelID+'_'+RoomCode+'_'+RatePlanCode+'_'+PaymentType+'\');"  class="blue">房型描述</a>';
					//var tmp1 = '<a href="javascript:Summary22(\''+HotelID+'_'+RoomCode+'_'+RatePlanCode+'_'+PaymentType+'\');"  class="blue">房型描述</a> '+HotelID+'_'+room_Number;
					}else{
						var tmp1 = '<u>房型描述</u>';
					}
					
					var _mapstr="";

					if(isNaN(MealPlan)){
						_mapstr =MealPlan ;
					}else
					{
						_mapstr = GetMeal(MealPlan);
					}

					var html5="";
					var srtle_d;
					if(room_Number>=2)
					srtle_d = " style=\"display:none;\"";
					else
					srtle_d = "";
					html5 += '<tr onMouseOver="this.className=\'NewHotelTabTrOver\'" onMouseOut="this.className=\'\'" id="tr_'+HotelID+'_'+room_Number+'" '+srtle_d+'>';
					html5 += '<td height="25"  style="cursor:pointer;text-decoration:underline;text-align:left; padding-left:10px;"  onclick="Summary22(\''+HotelID+'_'+RoomCode+'_'+RatePlanCode+'_'+PaymentType+'_'+room_Number+'\');">'+RoomName+RatePlanName+'</td>';
					
					 
					
					if(isNaN(MealPlan)){
						MealPlan = MealPlan.replace(".","");	
						html5 += '<td  class="2row1"  >'+MealPlan+'</td>';
					}else
					{
						MealPlan = MealPlan.replace(".","");	
						html5 += '<td class="2row1"  >'+GetMeal(MealPlan)+'</td>';
					}
					html5 += '<td  class="2row3">'+IsInternet+'</td>';
					//html5 += '<td>'+tmp+'</td>';
					//if(RateAmount)

					html5 += '<td style="text-align:center;color:#f60; font-family:Arial; cursor:pointer; font-size:18px; font-style:normal; font-weight:normal; "><span style="font-size:14px; font-style:normal;color:#f60;">¥</span>'+RateAmount+'</td>';
					html5 += '<td style="'+isHotelBack_display22+'color:#f60; font-family:Arial; cursor:pointer;font-size:14px; font-style:normal;font-weight:bold;" onMouseOver="tips2(this,\'v1\',\''+PaymentType+'\',\''+Back+'\',\''+AddValues+'\',\''+GaranteeRule+'\')"><span style="font-size:12px; font-style:normal;color:#f60; font-weight:normal;">¥</span>'+Back+'</td>';
					//html5 += '<td>'+BedType+'&nbsp;</td>';

					
					//html5 += '<td>'+GetPaymentType(PaymentType)+'</td>';
													
					//html5 += '<td>'+tmp1+'</td>';
					var GRImg 
					if(PaymentType=="S"||PaymentType=="Y")
					{
						GRImg= '<img src="/Themes/images/btn/ico_vouch2.gif" width="29" height="14" title="该酒店需要预付" />&nbsp;';
					}
					else
					{
						GRImg = '&nbsp;';
					}
					//alert(JsGetTimeFromStr(GaranteeRule,1));
					
					if(GaranteeRule.indexOf('担保')!=-1)
					{
						//取出日期串,dstrx1,dstrx2
						//JsGetDateFromStr(GaranteeRule);
						
						//取出时间串,tstrx1,tstrx2
						JsGetTimeFromStr(GaranteeRule);
						
						//取出房间数rstrx
						JsGetRoomFromStr(GaranteeRule); 
						if (tstrx=="0" && rstrx=="0")
						{
					
					 		GRImg = '<img src="/Themes/images/btn/ico_vouch1.gif" onMouseOver="tips2(this,\'v2\',\''+PaymentType+'\',\''+Back+'\',\''+AddValues+'\',\''+GaranteeRule+'\')" width="29" height="14"  />&nbsp;';
						}
						else
						 GRImg = '&nbsp;';
						
					}
					else
					 GRImg = '&nbsp;';
					
					if(RateAmount == "×" || (OrderRoomIsNo && !SUVS[1].length && OrderStr.split("$")[3]!="HKG" && OrderStr.split("$")[3]!="MFM"))
					html5 += '<td><img src="/Themes/images/btn/btnhotel_no.gif" width="43" height="19" /></td>';
					else if(RoomStatus==1)
					html5 += '<td><img src="/Themes/images/btn/btnhotel_no.gif" width="43" height="19" /></td>';
					else
					//html5 += '<td><img src="/Themes/images/btn/btnhotel.gif" width="43" height="19" style="cursor:pointer;" onclick="OrderRoom(\''+tmp3+'\',\''+RoomName+RatePlanName+'\',\''+OrderRoomIsNo+'\');" /></td>';
					html5 += '<td>'+GRImg+'<img src="/Themes/images/btn/btnhotel.gif" width="43" height="19" style="cursor:pointer;" onclick="dobook(\''+HotelID+'\',\''+RoomCode+'\',\''+RatePlanCode+'\')" /></td>';					
					
					html5 += '</tr>';
					
					html5 += '<tr id="'+ HotelID+'_'+RoomCode+'_'+RatePlanCode+'_'+PaymentType+'_'+room_Number+'" style="display:none;">';
					html5 += '<td colspan="8" align="left" height="25" style="padding-left:10px;text-align:left;" class="font_RoomDesc">房型描述：'+RoomDesc+'</td>';
					html5 += '</tr>';
					
					//alert(html + RoomCode +  RoomName + DisplayPrice + RateAmount + BedType + RoomDesc + MealPlan);*/
				if (temHotelID=="")
				{
					temHotelID=HotelID;
					html8=html+html5;
					if(j==node.length-1)//只有一条记录时,不加这个显示不出来
					document.getElementById(temHotelID).innerHTML = html8;
				}
				else if(temHotelID==HotelID)
				{
					html8+=html5;
					room_Number_ = room_Number;
					HotelID_ = HotelID;
					if(j==node.length-1)
					{
					  html8 += '</table>';
					  //alert(j + "\n" + temHotelID + "\n" + HotelID + "\n" + html8);
					  //alert(room_Number_);
					  if(room_Number_>=2)
					  {					
					  html8 += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
					  html8 += '<tr valign="bottom">';
					  html8 += '<td height="22" class="NewHotelTabMore"><a style="cursor:pointer" onClick="javascript:ShowMin22('+room_Number_+',\''+HotelID_+'\');"><span id="span_'+HotelID_+'">显示所有房型</span>('+(room_Number_+1)+')</a> ▼ </td>';
					  html8 += '</tr>';
					  html8 += '</table>';
					  }				
					  document.getElementById(temHotelID).innerHTML = html8;
					}
				}
				//else
				else if((temHotelID!=HotelID && HotelID!="") || j==node.length-1)
				{
				html8 += '</table>';
				//alert(room_Number_);
				if(room_Number_>=2)
				{					
				html8 += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
                html8 += '<tr valign="bottom">';
                html8 += '<td height="22" class="NewHotelTabMore"><a style="cursor:pointer" onClick="javascript:ShowMin22('+room_Number_+',\''+HotelID_+'\');"><span id="span_'+HotelID_+'">显示所有房型</span>('+(room_Number_+1)+')</a> ▼ </td>';
                html8 += '</tr>';
                html8 += '</table>';
				}				
				document.getElementById(temHotelID).innerHTML = html8;
				
				if(temHotelID!=HotelID && HotelID!="" && j==node.length-1)
				{
					html8=html+html5;
					html8 += '</table>';
					document.getElementById(HotelID).innerHTML = html8;
				    //alert(j + "\n" + temHotelID + "\n" + HotelID + "\n" + html8);
				}
				
				html8="";
				html8=html+html5;
				temHotelID=HotelID;		
				room_Number_ = 0;
				HotelID_="";
				}
				
				//alert(j);

			}
			
			
			
			var HotelIdStrA_Lenght=HotelIdStrA_all.length;
			for(var m=0;m<HotelIdStrA_Lenght;m++){
				var temStr=document.getElementById(HotelIdStrA_all[m]).innerHTML;
				if( temStr.indexOf("ajax-loader.gif") > 0)
				{
					//document.getElementById(HotelIdStrA_all[m]).innerHTML ="";
					document.getElementById(HotelIdStrA_all[m]).innerHTML = SetHotelInfo();
					
				}				
			}

			
			//document.getElementById('desp_count').value = node.length;
			//alert(html)
			//alert(lprice+' '+hprice)
			//document.getElementById('showroom_'+b).innerHTML = html;
			
			//alert(11+tmp[2])
			
			
/*			if(window.XMLHttpRequest)
				xml = new XMLHttpRequest();
			else if(window.ActiveXObject)
				xml = new ActiveXObject("Microsoft.XMLHTTP");
				xml.onreadystatechange = GetPriceShow;
			try{
				xml.open("GET","/hotel/GetHotelPrice.asp?lprice="+encodeURI(lprice)+"&hprice="+hprice+"&hotelid="+tmp2[0]+"&nocache="+Math.random(),true);
				xml.send(null);	
			}
			catch(e){}*/




		}
	}
}





/*function GetPriceShow(){
	 if(xml.readyState == 4){
		if(xml.status == 200){
			var response=xml.responseText;
			if(response!='error') {
				document.getElementById('price_'+b+'').innerHTML = response;
			}
		}
	 }
}*/



function GetMeal(f){
	f = eval(f) * 1;
	if(f==-1){
		return '不限';
	}else if(f==0){
		return '无早';
	}else if(f==1){
		return '单早';	
	}else if(f==2){
		return '双早';
	}else if(f==3){
		return '不限';
	}
	else{
		return ' ';
	}
}

function GetPaymentType(f){
	if(f=='T'){
		return '现 付';
	}else if(f=='S'){
		return '预 付';	
	}else if(f=='Y'){
		return '预 付';
	}
}



function SetHotelInfo(){
var sum = Math.floor(Math.random()*10+1) % 5;
var html = "";

    html = '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="NewHotelTabList">';
	html += '<tr class="NewHotelTabTr">';
	html += '<th width=20% height="25" style="text-align:left; padding-left:10px">房型</th>';
	html += '<th width=20%>早餐</th>';
	html += '<th width=10%>宽带</th>';
	//html += '<th width=12%>门市价</th>';
	html += '<th width=15%>日均价</th>';
	html += '<th width=15% '+isHotelBack_display+'>奖金</th>';
	//html += '<th>床型</th>';
	
	
	//html += '<th>备注</th>';
	//html += '<th width=12%>支付方式</th>';
	html += '<th width=20%>&nbsp;</th>';	
	
	html += '</tr>';





//	for(var i=0;i<=sum;i++)
//	{			
//    var RoomName = "标准间,标准大床房,标准双床房,高级大床房,高级双人房".split(",")[i];
//    var BedType = "大床,大床,双床,大床,双床".split(",")[i];	
//	html += '<tr onMouseOver="this.className=\'NewHotelTabTrOver\'" onMouseOut="this.className=\'\'" >';
//	html += '<td height="25" >'+RoomName+'</td>';
//	html += '<td>前台面付</td>';
//	html += '<td><del>'+(200+i*10+10)+'</del></td>';
//	html += '<td>'+(200+i*5)+'</td>';
//	html += '<td>'+BedType+'</td>';
//	html += '<td>无早</td>';
//	html += '<td>无</td>';
//	//html += '<td>房型描述</td>';
//	html += '<td><img src="/Themes/images/btn/btnhotel_no.gif" width="43" height="19" /></td>';
//	html += '</tr>';					
//	}


	html += '<tr onMouseOver="this.className=\'NewHotelTabTrOver\'" onMouseOut="this.className=\'\'" >';
	html += '<td height="25" colspan="6" align="center" > 暂 无 可 售 房 型</td>';
	html += '</tr>';					


	
	
	html += '</table>';		
	
	
	return html;

}


function JsGetDateFromStr(Str){
	var s1;
	var s2;
	
	var regstr = /\d{2,4}[.|-]\d{2}[.|-]\d{2}/g;	//ok ,日期字串 12.01.10/12-01-10/2012-01-10/2012.01.10

	//1.RegExp的exec()方法，有一个字符串参数，返回一个数组，数组的第一个条目是第一个匹配；其他的是反向引用。所以第一个返回的结果是第一个匹配的值es（不区分大小写）。
	s1 = regstr.exec(Str);
	s2 = regstr.exec(Str);
	//alert("RegExp的exec()方法,第一次exec:"+s1); 
	//alert("RegExp的exec()方法,第二次exec:"+s2); 
	//2.String对象有一个match()方法，它返回一个包含在字符串中所有匹配的数据。这个方法调用string对象，同时传给它一个RegExp对象。所以第二个弹出语句返回的是所有符合正则表达式的数组。
	//tempstr = Str.match(regstr);
	
	if (Str.match(regstr))
	{
		//alert("String对象match()方法，match ok！");
		//alert("第一次exec:"+s1);
		//alert("第二次exec:"+s2);
		
		dstrx = "1";
		dstrx1 = s1;
		dstrx2 = s2;
	}
	else
	{
		dstrx = "0";
	}
	
}


function JsGetTimeFromStr(Str){
	var s1;
	var s2;
	
	var regstr = /\d{1,2}:\d{2}/g;	//ok ,时间字串 6:00/18:00

	//1.RegExp的exec()方法，有一个字符串参数，返回一个数组，数组的第一个条目是第一个匹配；其他的是反向引用。所以第一个返回的结果是第一个匹配的值es（不区分大小写）。
	s1 = regstr.exec(Str);
	s2 = regstr.exec(Str);
	//alert("RegExp的exec()方法,第一次exec:"+s1); 
	//alert("RegExp的exec()方法,第二次exec:"+s2); 
	//2.String对象有一个match()方法，它返回一个包含在字符串中所有匹配的数据。这个方法调用string对象，同时传给它一个RegExp对象。所以第二个弹出语句返回的是所有符合正则表达式的数组。
	//tempstr = Str.match(regstr);
	
	if (Str.match(regstr))
	{
		//alert("String对象match()方法，match ok！");
		//alert("第一次exec:"+s1);
		//alert("第二次exec:"+s2);
		tstrx = "1";
		tstrx1 = s1;
		tstrx2 = s2;
	}
	else
	{
		tstrx = "0";
	}
	
}


function JsGetRoomFromStr(Str){
	var s1;
	
	var regstr = /\d{1}间/g;	//match方法ok;test方法false ,房间数字串 5间

	//1.RegExp的exec()方法，有一个字符串参数，返回一个数组，数组的第一个条目是第一个匹配；其他的是反向引用。所以第一个返回的结果是第一个匹配的值es（不区分大小写）。
	s1 = regstr.exec(Str);
	//alert("RegExp的exec()方法,第一次exec:"+s1); 
	//alert("RegExp的exec()方法,第二次exec:"+s2); 
	//2.String对象有一个match()方法，它返回一个包含在字符串中所有匹配的数据。这个方法调用string对象，同时传给它一个RegExp对象。所以第二个弹出语句返回的是所有符合正则表达式的数组。
	
	if (Str.match(regstr))
	{
		//alert("String对象match()方法，match ok！");
		rstrx = s1;
	}
	else
	{
		rstrx = "0";
	}
	
}



function JsFormatDateStr(Str){
	

	//alert(Str.length);
	if (Str.length==10)
	{
		dstr = Str.substr(0,4) + "-" + Str.substr(5,2) + "-" + Str.substr(8,2);
		//alert(dstr);
	}
	if (Str.length==8)
	{
		dstr = "20" + Str.substr(0,2) + "-" + Str.substr(3,2) + "-" + Str.substr(6,2);
		//alert(dstr);
	}
	else
	{
		dstr = "0";
		//alert(dstr);
	}
	
}
