// JavaScript Document
var xml = null;
function ShowDP1(HotelID){

}



function ShowDP(HotelID){
	
	document.getElementById("TD3").innerHTML='<img src="/Themes/Images/Icon/ajax-loader.gif" alt="加载中"  style="padding:15px;" />';
	
	if(window.XMLHttpRequest)
		xml = new XMLHttpRequest();
	else if(window.ActiveXObject)
	   xml = new ActiveXObject("Microsoft.XMLHTTP");
	   xml.onreadystatechange = GetHotelRoom;
	   xml.open("POST","/Hotel/GetHotelInfoDinPing.asp",true);
	   xml.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	   xml.send("hid="+HotelID);
}



function GetHotelRoom(){
	//alert(xml.responseText);
	 if(xml.readyState == 4){
		if(xml.status == 200){
			
		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 html="";
			//var node = xmldoc.getElementsByTagName('RoomType');
			var node = xmldoc.getElementsByTagName('Comment');
			
			//alert(node.length);
			
			for(var j=0;j<node.length;j++){
				
				var nodev = node[j];
				
				 //<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" /> 
				 
				 //  <Comment id="120344" hotelid="4637" xinghao="标准间" username="1823934****" jiangjin="32" times="06 24 2011  9:26PM" haoping="1" formID="28959861" ispic="0" yinxiang="破旧$愤怒$"><![CDATA[环境还可以，服务员特别热情！但是离地铁有点远，不过打车还是挺方便的1]]></Comment>

				var jiangjin = nodev.getAttribute("jiangjin"); 
				var haoping = nodev.getAttribute("haoping"); 
				var username = nodev.getAttribute("username"); 
				var times = nodev.getAttribute("times"); 
				var xinghao = nodev.getAttribute("xinghao"); 
				var CDATA = nodev.getAttribute("CDATA"); 
				var yinxiang = nodev.getAttribute("yinxiang"); 
				
				html += "<div class=\"view_main1\">";
				html += "  <div class=\"comment\">";
				html += "          <dl>";
				//html += "            <dt>"+jiangjin+"<em>元</em></dt>";
				html += "            <dt><em>"+Gethaoping(haoping)+"</em></dt>";
				html += "            <dd><em><a>顶一下</a>(<label id=\"v_120344\">0</label>)</em><strong>"+username+" 于 "+SetY(times,1)+" 发表　</strong><!--strong><font color=\"#FF0000\">"+Gethaoping(haoping)+"</font></strong-->";
				html += "            <p style=\"color:#666;\">点评房型：<a class=\"Dlan\">"+xinghao+"</a>　点评日期："+SetY(times,0)+"</p>";
				html += "            <p>"+CDATA+"</p>";
				html += "            <p class=\"yinxiang\"><span class=\"yx_x\">客人印象</span>";
				var yx = yinxiang.split("$")
				for(var i=0;i<yx.length - 1;i++)
				html += "<span class=\"yx_"+i+"\">"+yx[i]+"</span>";
				html += "</p></dd>";
				html += "          </dl>";
				html += "   </div>";
				html += "</div>";	
				
				}
				
				
			document.getElementById("TD3").innerHTML= html ;

				


		}
	}
}




function Gethaoping(f){
	if(f==-1){
		return '差评';
	}else if(f==0){
		return '中评';
	}else if(f==1){
		return '好评';	
	}
	else{
		return '一般';
	}
}




function SetY(s,v){
var sa = ",Jan,Feb,Mar,Apr,May,June,July,Aug,Sept,Oct,Nov,Dec".split(",");
var d = s;
//alert(d);
var d2 = d.split(" ");
//var d1=(new Date(Date.parse(d.replace(/-/g,"/")))).toLocalDate();  
d = sa[eval(d2[0].replace("0",""))] + d.substring(2,(d+"|").indexOf("|"));
var d1 = new Date(Date.parse(d));
if(v==0)
{
var s = d1.getYear()+ "-";
s += (d1.getMonth()+ 1) + "-";
s += d1.getDate();
s += " " + d1.getHours() + ":";
s += d1.getMinutes();
}
else
{
var s = d1.getYear()+ "年";
s += (d1.getMonth()+ 1) + "月";
s += d1.getDate() + "日";
}
return s;
}
