// JavaScript Document
function nav(thisObj,Num){
if(thisObj.className == "act")return;
var tabObj = thisObj.parentNode.id;
var tabList = document.getElementById(tabObj).getElementsByTagName("div");
for(i=0; i <tabList.length; i++)
  {
	if (i == Num)
	{
	 thisObj.className = "act"; 
	}else{
	 tabList[i].className = ""; 
	}
  } 
  }
//Ajax start
 var req; //定义变量，用来创建xmlhttprequest对象
 var divName;

 function creatReq(div,pid,rows) // 创建xmlhttprequest,ajax开始
 {
	 divName = div;
	 
	 var url = "citySceneryAjax.asp?pid="+pid+"&rows="+rows+""; //要请求的服务端地址
	
	 //document.write(url);
	 if(window.XMLHttpRequest) //非IE浏览器及IE7(7.0及以上版本)，用xmlhttprequest对象创建
	  {
		 req=new XMLHttpRequest();
	 }
	 else if(window.ActiveXObject) //IE(6.0及以下版本)浏览器用activexobject对象创建,如果用户浏览器禁用了ActiveX,可能会失败.
	  {
		 req=new ActiveXObject("Microsoft.XMLHttp");
	 }
	 
	 if(req) //成功创建xmlhttprequest
	  {
		 req.open("GET",url,true); //与服务端建立连接(请求方式post或get，地址,true表示异步)
		 req.onreadystatechange = callback; //指定回调函数
		 req.send(url); //发送请求
	 }
 }
		 
 function callback() //回调函数，对服务端的响应处理，监视response状态
          {
             if(req.readyState==4) //请求状态为4表示成功
              {
                 if(req.status==200) //http状态200表示OK
                  {
                     Dispaly(); //所有状态成功，执行此函数，显示数据
                 }
                 else //http返回状态失败
                  {
                     Dispaly();
                 }
             }
             else //请求状态还没有成功，页面等待 
              {
                
             }
         }
		
 function Dispaly() //接受服务端返回的数据，对其进行显示
          {
             document.getElementById (""+divName+"").innerHTML =req.responseText;
         }
//Ajax end

function searchBarOnclick(thisDiv,thisValue){
				var obj=null;
				var temp=document.getElementById(thisDiv).getElementsByTagName("a");
				obj=temp[0];
				if(thisValue!="")
				{
					for(var i=0;i<temp.length;i++)
					{
					
						if(temp[i].innerHTML.indexOf(thisValue)!= -1)
						{
						
							temp[i].className="current";
						}
						else
						{
							temp[i].className="";
							}
							
					}
				}
					
}

function searchBarOnclickOther(thisDiv,thisValue){
				var obj=null;
				var temp=document.getElementById(thisDiv).getElementsByTagName("a");
				obj=temp[0];
				if(thisValue!="")
				{
					for(var i=0;i<temp.length;i++)
					{
					
						if(temp[i].innerHTML==thisValue)
						{
						
							temp[i].className="current";
						}
						else
						{
							temp[i].className="";
							}
							
					}
				}
					
}

function qiehuan()
{

	var temp1 = document.getElementById("weather_qie").getElementsByTagName("div");
	for(var i = 0; i<temp1.length;i++)
	{
		  
		    temp1[i].onclick = (function(num)
		    {
			     return function()
			    {
			  	    var temp3 = document.getElementById("weather_qie").getElementsByTagName("div");
				    var temp4=  document.getElementById("datecon").getElementsByTagName("ul"); 
				    for(var j = 0 ; j < temp3.length; j ++)
				    {
					    if(num == j)
					    {
						    temp3[j].style.backgroundColor = "#FFF";		
						    temp3[j].style.borderBottomColor = "#FFF";
						    temp4[j].style.display = "block";
					    }
					    else
					    {
						    temp3[j].style.backgroundColor = "#ebeff8";		
						    temp3[j].style.borderBottomColor = "#BACCDA";
						    temp4[j].style.display = "none";	
					    }	
				    }
			    };
		    })(i);
	}	
}

function iFrameHeight() { 
var ifm= document.getElementById("iframepage"); 
var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument; 
if(ifm != null && subWeb != null) { 
ifm.height = subWeb.body.scrollHeight; 
} 
} 

function flashJs(files,links)
{
	 var swf_width=630;var swf_height=167;var text_height=0;
//                var files = "http://upload.17u.cn/hotel/old/2011/4/22/201104221722013.jpg|http://upload.17u.cn/hotel/old/2011/4/29/201104291654342.jpg|http://upload.17u.cn/hotel/old/2011/5/9/201105090818054.jpg|http://upload.17u.cn/hotel/old/2011/3/3/201103031340365.jpg|http://upload.17u.cn/hotel/old/2011/4/28/201104281115471.jpg|http://upload.17u.cn/hotel/old/2011/5/12/201105121406341.jpg|http://upload.17u.cn/hotel/old/2011/5/9/201105090815596.jpg|http://upload.17u.cn/hotel/old/2011/4/6/201104061006083.jpg"; // 图片
//                var links = "http://www.17u.cn/subject/wap/|http://www.17u.cn/scenery/BookSceneryTicket_5798.html|http://www.17u.cn/zhuanti/shwzoo/|http://www.17u.cn/subject/motaihuodong?utm_source=CN_index_B_4%26utm_medium=zhannei%26utm_content=motaihuodong%26utm_campaign=subject|http://www.17u.cn/dujia/tours/14595/|http://www.17u.cn/scenery/BookSceneryTicket_772.html|http://www.17u.cn/scenery/BookSceneryTicket_17480.html|http://www.17u.com/special/yanke/"; // 链接
				var files =""+files+"";
				var links =""+links+"";
                var texts = "";
                var ifocusStr = '';
                ifocusStr += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">';
                ifocusStr += '<param name="movie" value="images/viewer.swf"><param name="quality" value="high">';
                ifocusStr += '<param name="menu" value="false"><param name=wmode value="opaque">';
                ifocusStr += '<param name="FlashVars" value="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'">';
                ifocusStr += '<embed src="images/viewer.swf" wmode="opaque" FlashVars="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'& menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
                ifocusStr += '</object>';
                document.getElementById("ifocus").innerHTML=ifocusStr;
                var timeend = new Date(); 
}