var Browser = new Object();
Browser.isMozilla = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined') && (typeof HTMLDocument!='undefined');
Browser.isIE = window.ActiveXObject ? true : false;
Browser.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox")!=-1);
Browser.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
if (Browser.isFirefox) { // entend Event Mod for FireFox
	extendEventObject();
}
function extendEventObject() {
	Event.prototype.__defineGetter__("srcElement", function () {
		var node = this.target;
		while (node.nodeType != 1) node = node.parentNode;
		return node;
	});

	Event.prototype.__defineGetter__("fromElement", function () {
		var node;
		if (this.type == "mouseover")
			node = this.relatedTarget;
		else if (this.type == "mouseout")
			node = this.target;
		if (!node) return;
		while (node.nodeType != 1) node = node.parentNode;
		return node;
	});

	Event.prototype.__defineGetter__("toElement", function () {
		var node;
		if (this.type == "mouseout")
			node = this.relatedTarget;
		else if (this.type == "mouseover")
			node = this.target;
		if (!node) return;
		while (node.nodeType != 1) node = node.parentNode;
		return node;
	});
}
function IsChild(cNode,pNode){
	while(cNode!=null){
		cNode=cNode.parentNode;
		if(cNode==pNode) return true; 
	}
	return false;
}


var ajccache=new Object();
var waitInterval;
var tempref;
var MouseDelayTime=150;//鼠标感应延迟300毫秒
function getTBprefixName(str,sta){
	if(str.indexOf("active")!=-1 || str.indexOf("normal")!=-1) str=str.substr(6);
		else if(str.indexOf("over")!=-1) str=str.substr(4);
			else str="";
	return sta+str;
}

function startajaxtabs(){
	for(var i=0;i<arguments.length;i++)
	{
		var ulobj=document.getElementById(arguments[i]);
			ulist=ulobj.getElementsByTagName("li");			
			for(var j=0;j<ulist.length;j++)
			{
				var thelist=ulist[j];
				if(thelist.parentNode.parentNode!=ulobj) continue;//只有第一层li有效 fixed 2006.9.29
				var ulistlink=thelist.getElementsByTagName("a")[0];
				var ulistlinkurl=ulistlink.getAttribute("urn");
				var ulistlinktarget=ulistlink.getAttribute("rel");
				thelist.setActive=function(bactive){
					if(bactive){
						this.status="active";
						this.className=getTBprefixName(this.className,"active");
					}else{
						this.status="normal";
						this.className=getTBprefixName(this.className,"normal");
					}
				}
				thelist.LoadTab=function(){
					this.setActive(true);
					this.parentNode.parentNode.activetab.setActive(false);
					this.parentNode.parentNode.activetab=this;					
					var ulistlink=this.getElementsByTagName("a")[0];
					loadAJAXTab(ulistlink.getAttribute("urn"),ulistlink.getAttribute("rel"));
				}
				thelist.onmouseover=function(aEvent){
					var myEvent = window.event ? window.event : aEvent;
					var fm=myEvent.fromElement;
					if(IsChild(fm,this) || fm==this) return;//过滤子元素event
					if(this.status=="active") return;
					tempref=this;
					clearTimeout(waitInterval);
					waitInterval=window.setTimeout("tempref.LoadTab();",MouseDelayTime);
				}

				thelist.onmouseout=function(aEvent){
					var myEvent = window.event ? window.event : aEvent;
					var em=myEvent.toElement;
					if(IsChild(em,this) || em==this) return; //过滤子元素event
					if(this.status=="active") return;
					clearTimeout(waitInterval);
				}

				if(ulistlinkurl.indexOf("#default")!=-1){
					thelist.setActive(true);
					ulobj.activetab=thelist;
					ajccache[ulistlinkurl]=getElement(ulistlinktarget).innerHTML;
				}else{
					thelist.setActive(false);
				}

			}
		if(ulobj.activetab==null) ulobj.activetab=ulist[0];
	}
}



function loadAJAXTab(url,contentid){
	var ocontent=getElement(contentid);
	if(ajccache[url]==null) {
		var xhttp=getXmlhttp();		
			xhttp.onreadystatechange=function(){
				if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
				{					
					ocontent.innerHTML=xhttp.responseText;
					ajccache[url]=ocontent.innerHTML;
				}
			}
		xhttp.open("GET",url,true);
		xhttp.send(null);
	}else{
		ocontent.innerHTML=ajccache[url];
	}
}
window.onerror=function(){return true}


//搜索引擎
function soComm(obj){
obj.elements["word"].value=obj.elements["q"].value;
obj.elements["keyWord"].value=obj.elements["q"].value;
obj.action=obj.elements["url"].value;
}
function soCar(id){
obj=document.getElementById(id);
var url="http://page.so.163.com/Ztc.php";
obj.action=url;
obj.submit();
}
/*weather begin*/
function getElement(aID)
{
  return (document.getElementById) ? document.getElementById(aID): document.all[aID];
}
var weather_gx;
var w_timeID;
var w_move_step=4;//值越小越平滑，速度越慢
var w_move_speed=8; // 值越小越平滑，速度越慢

/*ad begin*/
lastScrollY=0;
function heartBeat(){
var diffY;
   
//alert(diffY);
percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.getElementById("lovexin12").style.top=parseInt(document.getElementById("lovexin12").style.top)+percent+"px";
document.getElementById("lovexin14").style.top=parseInt(document.getElementById("lovexin12").style.top)+percent+"px";
lastScrollY=lastScrollY+percent;
//alert(lastScrollY);
}
suspendcode12="<div id=\"lovexin12\" style='left:2px; position:absolute; top:83px;'><a href='http://zs.gxjc.cn/' target='_blank'><img src='imag_a/a1.gif' alt='南宁装饰公司大本营' width='100' height='94' border='0' /></a><br/><a href='http://www.gxdwzs.cn/' target='_blank'><img src='imag_a/diwang.gif' alt='地王装饰' width='100' height='94' border='0' /></a><div style='width:100px; background:#000; line-height:180%; text-align:center; padding-top:5px'><a href='http://www.nnyite.com' class='r7' target='_blank'>伊特装饰</a><br/><a href='http://www.nnzs100.com' class='r7' target='_blank'>星匠装饰</a><br/><a href='http://www.sunho2010.com' class='r7' target='_blank'>森昊装饰</a><br/><a href='http://www.gxghzs.com' class='r7' target='_blank'>赣辉装饰</a><br/><a href='http://www.gxdwzs.cn' class='r7' target='_blank'>地王装饰</a><br/><a href='http://www.gxhjzs.com' class='r7' target='_blank'>鸿居装饰</a><br/><a href='http://www.gxsqzs.com' class='r7' target='_blank'>苏秦装饰</a><br/><a href='http://zs.gxjc.cn/53' class='r7' target='_blank'>美格装饰</a><br/><a href='http://www.vhdzs.com' class='r7' target='_blank'>鸿雕装饰</a><br/><a href='http://www.nnzd.com' class='r7' target='_blank'>富顿装饰</a><br/><a href='http://www.mtxzs.com' class='r7' target='_blank'>满天星装饰</a><br/><a href='http://www.nnxiaoming.com' class='r7' target='_blank'>小名广告装饰</a><br/><a href='http://www.nnzysky.com' class='r7' target='_blank'>自由天空装饰</a></div><a href='http://www.gxjc.cn/xgt/' target='_blank'><img src='imag_a/a2.gif' alt='装修效果图' width='100' height='94' border='0' /></a><br/></div>"
suspendcode14="<div id=\"lovexin14\" style='right:2px; position:absolute; top:83px;'><a href='http://www.gxjc.cn/comjc/301/' target='_blank'><img src='imag_a/ub.gif' alt='创安U型玻璃' width='100' height='94' border='0' /></a><br/><a href='http://www.gxjc.cn/comjc/459' target='_blank'><img src='imag_a/buildnet.gif' alt='大宝漆' width='100' height='94' border='0' /></a></div>"
document.write(suspendcode12);
document.write(suspendcode14);
window.setInterval("heartBeat()",1);