function nTabs(thisObj,Num){
if(thisObj.className == "active")return;
var tabObj = thisObj.parentNode.id;
var tabList = document.getElementById(tabObj).getElementsByTagName("li");
for(i=0; i <tabList.length; i++)
{
  if (i == Num)
  {
   thisObj.className = "active"; 
      document.getElementById(tabObj+"_Content"+i).style.display = "block";
  }else{
   tabList[i].className = "normal";
   document.getElementById(tabObj+"_Content"+i).style.display = "none";
  }
} 
}
//首页三天特价
	function changeCity(v){
		var citys = new Array('XIY','PEK','SZX');
		for(var i = 0;i<citys.length;i++){
		var styles = document.getElementsByName("dl_"+citys[i]);
			if(citys[i] == v){			
						var styles = document.getElementsByName("dl_"+citys[i]);
						for(var x =0;x<styles.length;x++){
							styles[x].style.display ="block";
						}
			}else{			
						var styles = document.getElementsByName("dl_"+citys[i]);	
						for(var x =0;x<styles.length;x++){
							styles[x].style.display ="none";
						}
			}
		}
	}
//首页特价酒店
		function change(v,id){
		var citys = new Array('XIY','PEK','SHA','WUH','SZX','TAO');

		for(var i = 0;i<citys.length;i++){
		var styles = document.getElementsByName("hotel_"+citys[i]);
			if(citys[i] == v){			
						var styles = document.getElementsByName("hotel_"+citys[i]);
						for(var x =0;x<styles.length;x++){
							styles[x].style.display ="block";
						}
			}else{			
						var styles = document.getElementsByName("hotel_"+citys[i]);	
						for(var x =0;x<styles.length;x++){
							styles[x].style.display ="none";
						}
			}
		}
		
		for(var j =0 ;j< 6;j++){
			if(id == ("b"+j)){
				document.getElementById("b"+j).className = "active" ;
			}else{
				document.getElementById("b"+j).className  = "normal";
			}
		}	
	}
	
	//横向滚动广告
function hbhmao_scroll(divId, width) {
			this.divId = divId;
			this.width = width;
			this.amount = 20;
			this.delay =1;
			this.direction = "left";

			this.max = 0;
			this.si = null;
		}
		hbhmao_scroll.prototype = {
			run: function() {
				var _this = this;
				var div = _this.$(_this.divId);
				div.style.width = _this.width + "px";
				div.style.overflow = "hidden";
				var table = '<table width="' + _this.width + '" border="0" cellspacing="0" cellpadding="0"><tr><td style="white-space:nowrap;">' + div.innerHTML + '</td></tr></table>';
				var htm = '<table width="' + _this.width + '" border="0" cellspacing="0" cellpadding="0"><tr><td>' + table + '</td><td>' + table + '</td></tr></table>';
				div.innerHTML = htm;
				var m = div.getElementsByTagName("table")[0].getElementsByTagName("td")[0].offsetWidth;
				if (m > _this.width) {
					_this.max = m;
				}
				else {
					div.scrollLeft = 999999;
					_this.max = div.scrollLeft;
				}
				_this.start(_this);
				div.onmouseout = function() {
					_this.start(_this);
				};
				div.onmouseover = function() {
					clearInterval(_this.si);
				};
			},
			start: function(_this) {
				_this.si = setInterval(function() {
					if (_this.direction == "left") {
						if (_this.$(_this.divId).scrollLeft < _this.max) {
							_this.$(_this.divId).scrollLeft += _this.delay;
						}
						else {
							_this.$(_this.divId).scrollLeft = 0;
						}
					}
					else if (_this.direction == "right") {
						if (_this.$(_this.divId).scrollLeft > 0) {
							_this.$(_this.divId).scrollLeft -= _this.delay;
						}
						else {
							_this.$(_this.divId).scrollLeft = _this.max;
						}
					}
				}, _this.amount);
			},
			$: function(id) {
				return "string" == typeof id ? document.getElementById(id) : id;
			}
		};
