if (typeof ITSOGO == "undefined" || !ITSOGO) {
	var ITSOGO = {};
}

ITSOGO.namespace = function() {
	var b=arguments,g=null,e,c,f;
	for(e=0;e<b.length;e=e+1)
	{
		f=b[e].split(".");
		g=ITSOGO;
		for(c=(f[0]=="ITSOGO")?1:0;c<f.length;c=c+1)
		{
			g[f[c]]=g[f[c]]||{};
			g=g[f[c]]
		}
	}
	return g
};

(function() {
	ITSOGO.namespace("util","widget","visitor","event");
})();

ITSOGO.visitor.StatusView=function(){
	if (typeof userid == "undefined" || !userid) {	
		document.write('<a href="#" target="_self">登录</a> | <a href="#">注册</a>&nbsp;');	
	}else{
		document.write('<span><a href="http://my.zol.com.cn/'+userid+'/"><b style="font-family:Arial">'+userid+'</b></a>&nbsp;| <span id="msg_n"><a href="http://my.zol.com.cn/'+userid+'/message/">短消息</a></span> | <a href="http://blog.zol.com.cn/'+userid+'/">我的博客</a>&nbsp;| <a href="http://bbs.zol.com.cn/new/login.php?type=quit&?backUrl='+backUrl+'" target="_self">退出</a>&nbsp;');
	}
}

//ITSOGO.load = function(file) {
//	var scriptElement = document.createElement("script");
//	scriptElement.src = file;
//	document.getElementsByTagName("head")[0].appendChild(scriptElement);
//};

ITSOGO.util.cookie = {
	get : function(n){
		var v = '',
		c = ' ' + document.cookie + ';',
		s = c.indexOf((' ' + n + '='));
		if (s >= 0) {
			s += n.length + 2;
			v = unescape(c.substring(s, c.indexOf(';', s)));
		}
		return v;
	},
	set : function(n,v){
		var a=arguments,al=a.length;
		var k=new Date();
		k=k.valueOf();
		document.cookie = n + "=" + v +
		((al>2&&a[2]!="") ? ";expires=" + (typeof(a[2])=="object" ? a[2].toGMTString() : (new Date(k+a[2] * 1000)).toGMTString()) : "") + ";path=" + ((al>3&&a[3]!="") ? a[3] : "/") +
		";domain="  + ((al>4&&a[4]!="") ? a[4] : "itsogo.net");
	},
	checksub : function(sCookie,s){
		var aParts = sCookie.split('&'),nParts = aParts.length,aKeyVal;
		if (nParts==1) {
			return sCookie.indexOf(s);
			} else {
			for(var i=0; i<nParts; i++){
				aKeyVal = aParts[i].split('=');
				if(aKeyVal[0]==s){
					return i;
				}
			}
		}
		return -1;
	},
	getsub : function(n,s){
		var sCookie = this.get(n);
		var nExists = this.checksub(sCookie,s);
		if (nExists>-1) {
			return sCookie.split('&')[nExists].split('=')[1];
			} else if (sCookie.indexOf(s)>0) {
			return sCookie.split('=')[1];
		}
		return '';
	},
	setsub : function(n,s,v){
		var sCookie = this.get(n),a=arguments,al=a.length;
		var aParts = sCookie.split('&');
		var nExists = this.checksub(sCookie,s);
		if (sCookie=='') {
			sNewVal=(s+'='+v).toString();
			} else {
			if(nExists==-1){nExists=aParts.length;}
			aParts[nExists]=s+'='+v;
			sNewVal = aParts.join('&');
		}
		return this.set(n,sNewVal,(a[3]||''),(a[4]||'/'),(a[5]||''));
	}
};

ITSOGO.W=window;
ITSOGO.D=document;
ITSOGO.URL=ITSOGO.D.location.href;
ITSOGO.go=function(a)
{
	ITSOGO.D.location.href=a
};

ITSOGO.$=function(e)
{
	if(!e)
	{
		return false
	}
	if(typeof(e)=="object")
	{
		return e
	}
	var c=ITSOGO.browser.IE;
	if(c&&c<8)
	{
		elems=document.all[e];
		if(elems)
		{
			for(var b=0,a=elems.length;b<a;b++)
			{
				var d=elems[b];
				if(d.id==e)
				{
					return d
				}
			}
		}
		else
		{
			return false
		}
	}
	return !!e&&document.getElementById(e)||false
};
ITSOGO.find=function(b,a)
{
	if(!b||typeof(b)!="string")
	{
		return false
	}
	var a=ITSOGO.$(a);
	a=a||ITSOGO.D;
	if(typeof(a)!="object")
	{
		return false
	}
	return a.getElementsByTagName(b)
};
ITSOGO.browser=function()
{
	var c={IE:0,OPERA:0,GECKO:0,WEBKIT:0,MOBILE:null};
	var b=navigator.userAgent,a;
	if((/KHTML/).test(b))
	{
		c.WEBKIT=1
	}
	a=b.match(/AppleWebKit\/([^\s]*)/);
	if(a&&a[1])
	{
		c.WEBKIT=parseFloat(a[1]);
		if(/ Mobile\//.test(b))
		{
			c.MOBILE="Apple"
		}
		else
		{
			a=b.match(/NokiaN[^\/]*/);
			if(a)
			{
				c.MOBILE=a[0]
			}
		}
	}
	if(!c.WEBKIT)
	{
		a=b.match(/Opera[\s\/]([^\s]*)/);
		if(a&&a[1])
		{
			c.OPERA=parseFloat(a[1]);
			a=b.match(/Opera Mini[^;]*/);
			if(a)
			{
				c.MOBILE=a[0]
			}
		}
		else
		{
			a=b.match(/MSIE\s([^;]*)/);
			if(a&&a[1])
			{
				c.IE=parseFloat(a[1])
			}
			else
			{
				a=b.match(/Gecko\/([^\s]*)/);
				if(a)
				{
					c.GECKO=1;
					a=b.match(/rv:([^\s\)]*)/);
					if(a&&a[1])
					{
						c.GECKO=parseFloat(a[1])
					}
				}
			}
		}
	}
	return c
}();

ITSOGO.env={
	trim:function(a)
	{
		return a.replace(/(^\s*)|(\s*$)/g,"")
	},
	isUndefined:function(a)
	{
		return typeof(a)==="undefined"
	},
	isnull:function(a)
	{
		return a===null
	},
	isset:function(a)
	{
		return a==undefined
	},
	getRewriteJsUrl:function(a)
	{
		if(!a)
		{
			return false
		}
		a=a.replace(/index\.php\?c=Ajax\&a=([\w_]+)\&(.+)/g,"ajax_$1_$2.html");
		a=a.replace(/&/g,"^");
		return a
	}
};

ITSOGO.load=function(file,filetype,callback)
{
	var self=this;
	this.loaded=false;
	this.callback=callback;
	filetype=filetype||"js";
	var onload=function(file)
	{
		typeof(callback)=="function"&&callback(file)
	};
	var checkLoaded=function()
	{
		switch(filetype)
		{
			case"js":
				tagName="script";
				linkAttrName="src";
				break;
			case"css":
				tagName="link";
				linkAttrName="href";
				break;
			default:
				return false;
				break
		}
		var loadElems=document.getElementsByTagName(tagName);
		if(loadElems)
		{
			for(var i=0,len=loadElems.length;i<len;i++)
			{
				if(loadElems[i][linkAttrName].indexOf(file)!=-1)
				{
					self.loaded=true;
					return true
				}
			}
		}
	};
	if(checkLoaded())
	{
		onload(file);
		return
	}
	if(filetype=="js")
	{
		var elem=document.createElement("script");
		with(elem)
		{
			type="text/javascript";
			src=file
		}
	}
	else
	{
		if(filetype=="css")
		{
			var elem=document.createElement("link");
			with(elem)
			{
				type="text/css";
				rel="stylesheet";
				href=file
			}
		}
	}
	elem&&document.getElementsByTagName("head")[0].appendChild(elem);
	elem.onload=elem.onreadystatechange=function()
	{
		if(this.readyState&&this.readyState=="loading")
		{
			return
		}
		else
		{
			onload(file)
		}
	};
	return elem
};

ITSOGO.event.add=function (elm, evType, fn){    
	if (elm.attachEvent)
	{
		elm['e'+evType+fn] = fn;   
		elm[evType+fn] = function(){elm['e'+evType+fn](window.event);}   
		elm.attachEvent("on"+evType,elm[evType+fn] );   
	}
	else if(elm.addEventListener)
	{
		elm.addEventListener(evType,fn,false);  
	}
};
ITSOGO.event.remove=function (elm, evType, fn){    
	if (elm.detachEvent)
	{
		elm.detachEvent('on'+evType, elm[evType+fn] );   
		elm[evType+fn] = null;   
	}
	else if(elm.removeEventListener)
	{
		elm.removeEventListener(evType,fn,false);
	}
};

ITSOGO.onReady=function(b)
{
	if(typeof(b)!="function")
	{
		return false
	}
	this.domReady=false;
	if(typeof(a)=="undefined")
	{
		var a=[]
	}
	a.push(b);
	var c=function()
	{
		for(i in a)
		{
			a[i]()
		}
	};
	this.ready=function()
	{
		if(this.domReady)
		{
			c()
		}
		if(ITSOGO.browser.IE)
		{
			var f=window.setInterval(
				function()
				{
					try
					{
						document.body.doScroll("left");
						c();
						window.clearInterval(f);
						this.domReady=true
					}
					catch(g)
					{
					}
				},5)
		}
		else
		{
			try
			{
				document.removeEventListener("DOMContentLoaded",c)
			}
			catch(d)
			{
			}
			document.addEventListener("DOMContentLoaded",c,false);
			this.domReady=true
		}
	};
	this.ready()
};

ITSOGO.util.addFavorite=function(u,t)
{
	var a=document.URL;
	var c=document.title;
	if(u!=null && t==null)
	{
		a=u;
	}
	else if(u!=null && t!=null)
	{
		a=u;
		c=t;
	}
	if(document.all)
	{
		try {
		window.external.addFavorite(a, c);
		}
		catch (e1) {
			try {
				window.external.addToFavoritesBar(a, c);
			}
			catch (e2) {
				alert('加入收藏失败，请您手工加入。')
			}
		}
	}
	else if(window.sidebar)
	{
		window.sidebar.addPanel(c,a,"")
	} 
	else 
	{
		alert('加入收藏失败，请您手工加入。')
	}
	return false;
};

ITSOGO.util.setHomePage=function(sURL)
{
    if (document.all) {
        document.body.style.behavior = 'url(#default#homepage)';
        document.body.setHomePage(sURL);
    }
    else if (window.sidebar) {
        if (window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            }
            catch (e) {
                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入\"about:config\"并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
            }
        }
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
        prefs.setCharPref('browser.startup.homepage', sURL);
    }
	return false;
};

ITSOGO.util.copy=function(c,f)
{
	if(window.clipboardData)
	{
		if(window.clipboardData.setData("Text",c))
		{
			typeof(f)=="function"&&f()
		}
	}
	else
	{
		var b="flashcopier";
		var d="/_clipboard.swf";
		if(!ITSOGO.$(b))
		{
			var e=document.createElement("div");
			e.id=b;
			e.style.display="none";
			document.body.appendChild(e)
		}
		ITSOGO.$(b).innerHTML="";
		c=c.replace(/\"/g,"'");
		var a='<embed src="'+d+'" FlashVars="clipboard='+c+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
		ITSOGO.$(b).innerHTML=a;
		typeof(f)=="function"&&f()
	}
};

ITSOGO.util.getPosition=function(d)
{
	if(!d)
	{
		return false
	}
	var a=d.offsetLeft;
	var e=d.offsetTop;
	var b=d.offsetWidth;
	var c=d.offsetHeight;
	while(d=d.offsetParent)
	{
		a+=d.offsetLeft;
		e+=d.offsetTop
	}
	return{x:a,y:e,w:b,h:c}
};

ITSOGO.util.getBodySize=function()
{
	var g=document.documentElement,b=document.body;
	var f=g&&g.scrollWidth||b&&b.scrollWidth||0;
	var d=g&&g.scrollHeight||b&&b.scrollHeight||0;
	var c=g&&g.clientWidth||b&&b.clientWidth||0;
	var e=g&&g.clientHeight||b&&b.clientHeight||0;
	var a=g&&g.scrollLeft||b&&b.scrollLeft||0;
	var j=g&&g.scrollTop||b&&b.scrollTop||0;
	return{aw:f,ah:d,w:c,h:e,x:a,y:j}
};

ITSOGO.util.toggle=function(f,b,e)
{
	var d=ITSOGO.$(f);
	b=b||{};
	var a=b.show||"";
	var c=b.hidden||"none";
	if(d.style.display==a)
	{
		d.style.display=c
	}
	else
	{
		d.style.display=a
	}
	typeof(e)=="function"&&e(d.style.display)
};

ITSOGO.util.Browser= (function(){
	var ua = navigator.userAgent;
	var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]';
	return {
	  IE:             !!window.attachEvent && !isOpera,
	  Opera:          isOpera,
	  WebKit:         ua.indexOf('AppleWebKit/') > -1,
	  Gecko:          ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1,
	  MobileSafari:   /Apple.*Mobile.*Safari/.test(ua),
	  Firefox :       ua.toLowerCase().indexOf("firefox")!= -1
	}
  })();
ITSOGO.util.IsChild=function(cNode,pNode){
	while(cNode!=null){
		cNode=cNode.parentNode;
		if(cNode==pNode) return true;
	}
	return false;
};
ITSOGO.util.extendEventObject=function() {
	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;
	});
};

ITSOGO.util.XMLDOM={
	Xdom:null,
	created:false,
	loaded:false,
	create:function(xml){
		this.created=false;
		this.loaded=false;
		if(!document.all) 
			XMLDocument.prototype.__defineGetter__("xml",function(){return new XMLSerializer().serializeToString(this)}) 
		if (window.ActiveXObject) 
		{ 
			var arrSignatures = new Array("MSXML2.DOMDocument5.0", "MSXML2.DOMDocument4.0", "MSXML2.DOMDocument3.0", "MSXML2.DOMDocument", "Microsoft.XMLDOM"); 
			for (var i= 0; i < arrSignatures.length; i++) 
			{ 
				try 
				{ 
					var oXmlDom = new ActiveXObject(arrSignatures[i]); 
					oXmlDom.loadXML(xml);
					return oXmlDom; 
				} catch(e) { 
					//ignore 
				} 
			} 
			return false;
		} 
		else if (document.implementation && document.implementation.createDocument) 
		{ 
			var oXmlDom = document.implementation.createDocument("", "", null); 
			oXmlDom.loadXML(xml);
			return oXmlDom; 
		}
		else if(typeof DOMParser != "undefined")
		{
			return new DOMParser().parseFromString(xml, "text/xml");
		}
		else 
		{ 
			return false; 
		} 
		return false; 
	},
	loadxml:function(xml)
	{
		this.Xdom=this.create(xml);
		if(!this.Xdom)
		{
			this.loaded=false;
			return false;
		}
		else
		{
			this.created=true;
			this.loaded=true;
		}
	},
	value:function(Xpath,defaultValue)
	{
		if(!this.Xdom)
		{
			return (defaultValue==null)?"":defaultValue;
		}
		var node=this.Xdom.documentElement.selectSingleNode(Xpath);
		if(node)
		{
			return node.text;
		}
		else
		{
			return (defaultValue==null)?"":defaultValue;
		}
	},
	nodes:function(Xpath)
	{
		if(!this.Xdom)
		{
			return new Array();
		}
		var nodelist=this.Xdom.documentElement.selectNodes(Xpath);
		return nodelist;
	}
};

ITSOGO.util.AJAX=function()
{
	this.lang=
	{
		HTTP_BUILDING_LINK:"",
		HTTP_SENDING:"",
		HTTP_LOADING:"",
		HTTP_DATA_IN_PROCESSED:"",
		HTTP_LOAD_FAILED:""
	};
	this.statusId=null;
	this.targetUrl="ooo";
	this.postData="";
	this.recvType="HTML";
	this.isCache=true;
	this._poll={};
	this._rewrite=true;
	this.callback=null;
	var a=this;
	this._msxmlVersion=["MSXML2.XMLHTTP","MSXML.XMLHTTP","Microsoft.XMLHTTP"];
	this.createXMLHttpRequest=function()
	{
		var c=false;
		if(window.XMLHttpRequest)
		{
			c=new XMLHttpRequest()
		}
		else
		{
			if(window.ActiveXObject)
			{
				for(i in this._msxmlVersion)
				{
					try{
						c=new ActiveXObject(this._msxmlVersion[i]);
						if(c)
						{
						return c
						}
					}
					catch(d)
					{
					}
				}
			}
		}
		return c
	};

	var b=this.createXMLHttpRequest();
	this._processHandle=function()
	{
		if(a._poll[a.targetUrl]&&this.isCache)
		{
			return a._poll[a.targetUrl]
		}
		if(a.statusId)
		{
			a.statusId.style.display="block"
		}
		if(b.readyState==1&&a.statusId)
		{
			a.lang.HTTP_BUILDING_LINK&&(a.statusId.innerHTML=a.lang.HTTP_BUILDING_LINK)
		}
		else
		{
			if(b.readyState==2&&a.statusId)
			{
				a.lang.HTTP_SENDING&&(a.statusId.innerHTML=a.lang.HTTP_SENDING)
			}
			else
			{
				if(b.readyState==3&&a.statusId)
				{
					a.lang.HTTP_LOADING&&(a.statusId.innerHTML=a.lang.HTTP_LOADING)
				}
				else
				{
					if(b.readyState==4)
					{
						if(b.status==200)
						{
							if(a.statusId)
							{
								a.lang.HTTP_DATA_IN_PROCESSED&&(a.statusId.innerHTML=a.lang.HTTP_DATA_IN_PROCESSED)
							}
							if(a.recvType=="HTML")
							{
								var c=b.responseText
							}
							else
							{
								if(a.recvType=="XML")
								{
									var c=b.responseXML.lastChild.firstChild.nodeValue
								}
							}
							if(a.isCache)
							{
								a._poll[a.targetUrl]=c
							}
							a.callback(c,a)
						}
						else
						{
							if(a.statusId)
							{
							a.lang.HTTP_LOAD_FAILED&&(a.statusId.innerHTML=a.lang.HTTP_LOAD_FAILED)
							}
						}
					}
				}
			}
		}
	};

	this.get=function(d,c)
	{
		this.targetUrl=d;
		this.callback=c;
		if(!this.isCache)
		{
			this.targetUrl+=(this.targetUrl.indexOf("?")<0)?"&":"?";
			this.targetUrl+=(new Date()).getTime()
		}
		b.onreadystatechange=this._processHandle;
		if(window.XMLHttpRequest)
		{
			
			b.open("GET",this.targetUrl,true);
			b.send(null)
		}
		else
		{
			b.open("GET",this.targetUrl,true);
			b.send()
		}
	};

	this.post=function(e,c,d)
	{
		this.targetUrl=e;
		this.postData=c;
		this.callback=d;
		b.onreadystatechange=this._processHandle;
		b.open("POST",this.targetUrl,true);
		b.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=gbk");
		b.send(this.postData)
	}
};



ITSOGO.util.ajax = {
	xml:null,
	text:null,
	callback:function(){},
	getXmlhttp:function (){
		var http_request;
		if(window.XMLHttpRequest) {
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType) {
				http_request.overrideMimeType("text/xml");
			}
		}
		else if (window.ActiveXObject) {
			try {
				http_request = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					http_request = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
		}
		if (!http_request) {
			//window.alert("can't create XMLHttpRequest object.");
			return null;
		}
		return http_request;
	},
	//var ajax=new Ajax.Request(url,{method:"get",parameters:null,onComplete:Response});
	request:function(url,method,_callback,resType,cachebase)
	{
		this.callback=_callback;
		xhttp=this.getXmlhttp();
		xhttp.onreadystatechange=function(){
			if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
			{
				if(cachebase!=null)
				{
					try{
						cachebase[url]=(resType=="xml")?xhttp.responseXML.xml:xhttp.responseText;
					}
					catch(e)
					{
						cachebase=(resType=="xml")?xhttp.responseXML.xml:xhttp.responseText;
					}
				}
				ITSOGO.util.ajax.xml=xhttp.responseXML.xml;
				ITSOGO.util.ajax.text=xhttp.responseText;
				_callback();
			}
		}
		xhttp.open(method.toUpperCase(),url+(url.indexOf("?")>0?"&":"?")+"rand="+escape(Math.random()),true);
		xhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 
		xhttp.send(null);
	}
};

ITSOGO.util.ipwry={
	BridgeName:"citybridge",
	CurCity:0,
	UserCity:ITSOGO.util.cookie.get("UserCity"),
	IsLoadCity:false,
	callback:function(){},
	wry:function(_callback){
		if('undefined' == typeof(this.UserCity) || this.UserCity=="")
		{
			var url="";
			if('undefined'==typeof(classen))
			{
				url="http://www.itsogo.net/prodsells/prodsells/c_0_xml.data";
			}
			else
			{
				url="http://"+classen+".itsogo.net/prodsells/prodsells/c_0_xml.data";
			}
			var ajax=ITSOGO.util.ajax.request(url,"get",function(){
				ITSOGO.util.XMLDOM.loadxml(ITSOGO.util.ajax.xml);
				ITSOGO.util.ipwry.UserCity=ITSOGO.util.XMLDOM.value("//cache/UserCity","0");
				ITSOGO.util.cookie.set("UserCity",ITSOGO.util.ipwry.UserCity,600000);
				_callback();					
			},"xml");
		}
		this.IsLoadCity=true;
	},
	LoadCity:function(){
		if('undefined' == typeof(this.UserCity) || this.UserCity=="")
		{
			if(productid=="")productid="0";
			var url="http://"+classen+".itsogo.net/prodsells/prodsells/c_"+productid+"_xml.data";
			var ajax=ITSOGO.util.ajax.request(url,"get",function(){
				ITSOGO.util.XMLDOM.loadxml(ITSOGO.util.ajax.xml);
				ITSOGO.util.ipwry.UserCity=ITSOGO.util.XMLDOM.value("//cache/UserCity","0");
				var tot=ITSOGO.util.XMLDOM.value("//cache/TimeOut","1");
				if(tot=="0")ITSOGO.util.ProdSells.TimeOut=false;
				ITSOGO.util.cookie.set("UserCity",ITSOGO.util.ipwry.UserCity,600000);
				ITSOGO.util.ProdSells.init();
			
			},"xml");
//				var cb=document.getElementById(this.BridgeName);
//				if(!cb)
//				{
//					cb=document.createElement("xml");
//					cb.id=this.BridgeName;
//					document.body.appendChild(cb);
//				}
//				//保定222.223.35.39
//				//http://www.itsogo.net/prodsells/c_220353_xml.data
//				if(productid=="")productid="0";
//				cb.src="http://www.itsogo.net/prodsells/c_"+productid+"_xml.data";
//				cb.ondatasetcomplete=function()
//				{
//					var Node=citybridge.selectSingleNode("/cache/UserCity");
//					if(Node){
//						ITSOGO.util.ipwry.UserCity=Node.text;
//					}
//					else
//					{
//						ITSOGO.util.ipwry.UserCity=0;
//					}
//					var Node=citybridge.selectSingleNode("/cache/TimeOut");
//					if(Node){
//						if(Node.text=="0")ITSOGO.util.ProdSells.TimeOut=false;
//					}
//					ITSOGO.util.cookie.set("UserCity",ITSOGO.util.ipwry.UserCity,600000);
//					ITSOGO.util.ProdSells.init();
//				}
		}
		else
		{
			if(productid=="")productid="0";
			var url="http://"+classen+".itsogo.net/prodsells/prodsells/c_"+productid+"_xml.data";
			var ajax=ITSOGO.util.ajax.request(url,"get",function(){
				ITSOGO.util.XMLDOM.loadxml(ITSOGO.util.ajax.xml);
				var tot=ITSOGO.util.XMLDOM.value("//cache/TimeOut","1");
				if(tot=="0")ITSOGO.util.ProdSells.TimeOut=false;
				ITSOGO.util.ProdSells.init();
			},"xml");

//				var cb=document.getElementById(this.BridgeName);
//				if(!cb)
//				{
//					cb=document.createElement("xml");
//					cb.id=this.BridgeName;
//					document.body.appendChild(cb);
//				}
//				//保定222.223.35.39
//				cb.src="http://www.itsogo.net/prodsells/c_"+productid+"_xml.data";
//				cb.ondatasetcomplete=function()
//				{
//					var Node=citybridge.selectSingleNode("/cache/TimeOut");
//					if(Node){
//						if(Node.text=="0")ITSOGO.util.ProdSells.TimeOut=false;
//					}
//					ITSOGO.util.ProdSells.init();
//				}
		}
		this.IsLoadCity=true;
	}
};
ITSOGO.util.ProdSells={
	CurDaMode:"a",
	Default:"",
	BridgeName:"prodsells",
	Target:"dealers",
	TimeOut:true,
	init:function()
	{
		if(productid==0)return;
		var url="http://"+classen+".itsogo.net/prodsells/prodsells/"+(this.TimeOut?"":"d_")+productid+".data";
		var ajax=ITSOGO.util.ajax.request(url,"get",function(){
			ITSOGO.util.XMLDOM.loadxml(ITSOGO.util.ajax.xml);
			ITSOGO.util.ProdSells.Show(ITSOGO.util.ipwry.UserCity);
		},"xml");


//			var ps=document.getElementById(this.BridgeName);
//			if(!ps)
//			{
//				ps=document.createElement("xml");
//				ps.id=this.BridgeName;
//				document.body.appendChild(ps);
//			}
//			var url="http://www.itsogo.net/prodsells/"+(this.TimeOut?"":"d_")+productid+".data";
//			ps.src=url;
//			ps.ondatasetcomplete=function()
//			{
//				ITSOGO.util.ProdSells.Show(ITSOGO.util.ipwry.UserCity);
//			}
	},
	Get:function(c,t)
	{
		if(productid==0)return;
		return ITSOGO.util.XMLDOM.value("//cache/data[@city='"+c+"'][@type='"+t+"']",this.Default)
//			var ps=document.getElementById(this.BridgeName);
//			var Node=ps.selectSingleNode("/cache/data[@city='"+c+"'][@type='"+t+"']");
//			if(Node){
//				return Node.text;
//			}
//			else
//			{
//				return this.Default;
//			}
	},
	Show:function(c,t)
	{
		var a=arguments,al=a.length;
		if(al==0)
		{
			c=ITSOGO.util.ipwry.CurCity;
			t=this.CurDaMode;
		}
		else if(al==1)
		{
			ITSOGO.util.ipwry.CurCity=c;
			t=this.CurDaMode;
		}
		else if(al>2 && a[2]!="")
		{
			ITSOGO.util.ipwry.CurCity=c;
			this.CurDaMode=t;
			this.Target=a[2];
		}
		else if(al==2 && (c==null || 'undefined' == typeof(c)))
		{
			this.CurDaMode=t;
		}
		if(this.Default=="")
		{
			this.Default=document.getElementById(this.Target).innerHTML;
		}
		document.getElementById(this.Target).innerHTML=this.Get(c,t);
		document.getElementById("da_"+c).className="act";
	}

};

ITSOGO.util.sjrecommend={
	Citys:Array({id:6,name:'石家庄'},{id:10,name:'保定'},{id:8,name:'邯郸'},{id:9,name:'邢台'},{id:7,name:'唐山'},{id:16,name:'衡水'},{id:15,name:'廊坊'},{id:14,name:'沧州'},{id:12,name:'承德'},{id:11,name:'张家口'},{id:13,name:'秦皇岛'}),
	Selector:"city",
	CurrentCity:6,
	GetPos:function(e){
		var t=e.offsetTop,l=e.offsetLeft,w=e.offsetWidth,h=e.offsetHeight;
		while(e=e.offsetParent) {t+=e.offsetTop;l+=e.offsetLeft;}
		return {top:t,left:l,width:w,height:h};
	},
	SetPos:function(target){
		var CitySelector=document.getElementById(this.Selector);
		var pos=this.GetPos(target);
		var crel=target.parentNode.getAttribute("rel");
		var selitems="";
		for(var i=0;i<this.Citys.length;i++)
		{
			var tmp=this.Citys[i];
			if(tmp.id!=crel)
			{
				selitems+="<li rel=\""+tmp.id+"\" class=\"click_trigger\" onclick=\"selectcity(this)\">"+tmp.name+"</li>";
			}
		}
		
		CitySelector.childNodes[1].innerHTML=selitems;
		CitySelector.style.left=pos.left+"px";
		CitySelector.style.top=(pos.top+27)+"px";
		CitySelector.style.display="";
		CitySelector.root=target;
		target.onmouseout=function(aEvent){
			var myEvent = window.event ? window.event : aEvent;
			var em=myEvent.toElement;
			var CitySelector=document.getElementById(ITSOGO.util.sjrecommend.Selector);
			if (em==CitySelector || ITSOGO.util.IsChild(em,this) || em==this || ITSOGO.util.IsChild(em,CitySelector))return;
			CitySelector.style.display="none";
		};
		CitySelector.onmouseout=function(aEvent){
			var myEvent = window.event ? window.event : aEvent;
			var em=myEvent.toElement;
			var CitySelector=document.getElementById(ITSOGO.util.sjrecommend.Selector);
			if (em==target || ITSOGO.util.IsChild(em,this) || em==this || ITSOGO.util.IsChild(em,target))return;
			CitySelector.style.display="none";
		};
	},
	SetCityText:function(seloritem){
		var CitySelector=document.getElementById(this.Selector);
		var spans=CitySelector.root.parentNode.getElementsByTagName("span");
		var li=CitySelector.root.parentNode;
		var ta=CitySelector.root.parentNode.getAttribute("ta");
		var newrel=seloritem.getAttribute("rel");
		var newtext=seloritem.innerHTML;
		spans[0].innerHTML=newtext;
		li.setAttribute("rel",newrel);
		CitySelector.style.display="none";
//			if(newrel=="6")
//			{
//				li.setAttribute("urn","#default_sjrecommend_"+ta);
//			}
//			else
//			{
			li.setAttribute("urn","cache/sjr/"+ta+"_"+newrel+".html");
//			}
		tempref=li;
		clearTimeout(waitInterval);
		waitInterval=window.setTimeout("tempref.LoadTab();",MouseDelayTime);
	}
};

if(ITSOGO.util.Browser.Firefox)
{
	ITSOGO.util.extendEventObject();
}
function initcity()
{
	var citydiv=document.getElementById("city");

}
function showcitys(target)
{
	ITSOGO.util.sjrecommend.SetPos(target);
}
function selectcity(seloritem)
{
	//alert(target.innerHTML);
	ITSOGO.util.sjrecommend.SetCityText(seloritem);
}
function da_showmore(obj)
{
	var display=(document.getElementById("danavmore").style.display=="none")?"":"none";
	document.getElementById("danavmore").style.display=display;
	obj.innerHTML=(display=="none")?"显示其他地市":"隐藏其他地市";
	obj.className=(display=="none")?"more1":"more2";
}

function ShowProdSells(city_id)
{
	var oldcity=ITSOGO.util.ipwry.CurCity;
	if(oldcity!=city_id)
	{
		document.getElementById("da_"+oldcity).className="";
		ITSOGO.util.ipwry.CurCity=city_id;
		ITSOGO.util.ProdSells.Show();
	}
}
function da_sort(sortby)
{
	if(ITSOGO.util.ProdSells.CurDaMode==sortby)
	{
		document.getElementById("dasort_bycredit").className="";
		document.getElementById("dasort_byprice").className="";
		ITSOGO.util.ProdSells.CurDaMode="a";
		ITSOGO.util.ProdSells.Show();
		return;
	}
	switch(sortby)
	{
		case "b":
			document.getElementById("dasort_bycredit").className="";
			document.getElementById("dasort_byprice").className="act";
			ITSOGO.util.ProdSells.CurDaMode="b";
			ITSOGO.util.ProdSells.Show();
			break;
		case "c":
			document.getElementById("dasort_byprice").className="";
			document.getElementById("dasort_bycredit").className="act";
			ITSOGO.util.ProdSells.CurDaMode="c";
			ITSOGO.util.ProdSells.Show();
			break;
	}
}

function add_favorite(){
	var url=document.URL;
	var title=document.title;
	if (document.all) window.external.AddFavorite(url,title);
	else if (window.sidebar) window.sidebar.addPanel(title,url,"");
}
function ToMyFriends(){
	var url=document.URL;
	var title=document.title;
	clipboardData.setData('Text','IT搜购网 - '+title+'\n'+url);
	window.alert('本帖标题和地址已复制到剪贴板，您可按下 Ctrl+V 在任何软件如：QQ、MSN中进行粘贴发送给好友');
}