﻿
function cls(){ 
with(event.srcElement) 
if(value==defaultValue) value="" 
} 
function res(){ 
with(event.srcElement) 
if(value=="") value=defaultValue 
} 
function move(x, y) {
if (document.all) {
object1.style.pixelLeft += x;
object1.style.pixelTop  += y;}
else
if (document.layers) {
document.object1.left += x;
document.object1.top  += y;
}};

function position() {
document.object1.left += -200;
document.object1.top  += 0;
document.object1.visibility = "show"
};

function makeStatic() {
if (document.all) {object1.style.pixelTop=document.body.scrollTop+100}
else {eval('document.object1.top=eval(window.pageYOffset+20)');}
setTimeout("makeStatic()",0);}

var debug = false ; 
function switchTab (e, tab) 
{ StopEvent(e) ; 
var tabName = getTabGroupName (tab.id) ; 
if (tabName == '') 
{ alert ("No tabName for tab [" + tab.id + "]") ; 
return ; 
} 
var index = 1 ; 
while (true) 
{ var tabTitle = eval ("document.getElementById ('" + tabName + '_' + index + "')") ; 
if (tabTitle == undefined) 
break ; 
deactiveTabTitle (tabTitle , tabName) ; 
var tabContent = eval ("document.getElementById ('" + tabName + '_' + index + '_content' + "')") ; 
if (tabContent != undefined) 
tabContent.style.display = "NONE" ; 
index ++ ; 
} 
if (debug) 
alert ("Find " + (index - 1) + " tab title(s) for TabName [" + tabName + "]") ; 
activeTabTitle (tab , tabName) ; 
var tabContent = eval ("document.getElementById ('" + tab.id + '_content' + "')") ; 
if (tabContent != undefined) 
tabContent.style.display = "BLOCK" ; 
} 

function cancelTab () 
{ 
} 

function getTabGroupName (tabId) 
{ 
if (tabId == '' || tabId == undefined) 
{ 
alert ("tabId is NULL! [" + tabId + "]") ; 
return ; 
} 
var i = tabId.lastIndexOf ('_') ; 
if (i <= 1) 
return '' ; 
return tabId.substr (0 , i) ; 
} 

function deactiveTabTitle (tab , tabName) 
{ 
tab.className = tabName + "_off" ; 
} 

function activeTabTitle (tab , tabName) 
{ 
tab.className = tabName + "_on" ; 
} 

function StopEvent(pE) 
{ 
if (!pE) 
if (window.event) 
pE = window.event; 
else 
return; 
if (pE.cancelBubble != null) 
pE.cancelBubble = true; 
if (pE.stopPropagation) 
pE.stopPropagation(); 
if (pE.preventDefault) 
pE.preventDefault(); 
if (window.event) 
pE.returnValue = false; 
if (pE.cancel != null) 
pE.cancel = true; 
} 
// -->	
// JavaScript Document
var n=0;
var showNum = document.getElementById("num");
function Mea(value){
	n=value;
	setBgColor(value);
	plays(value);
	//cons(value);
	}
function setBgColor(value){
	for(var i=0;i<4;i++) {
		if(value==i){
		
			showNum.getElementsByTagName("td")[i].className='bigon';
			} 
		else{	
			showNum.getElementsByTagName("td")[i].className='bigoff';
			}  
	 }		
} 
		
	function plays(value){
		try
		{
			with (fc)
			{
				filters[0].Apply();
				for(i=0;i<4;i++)i==value?children[i].style.display="block":children[i].style.display="none"; 
				filters[0].play(); 
			}
		}
		catch(e)
		{
			var divlist = document.getElementById("fc").getElementsByTagName("div");
			for(i=0;i<4;i++)
			{
				i==value?divlist[i].style.display="block":divlist[i].style.display="none";
			}
		}
 
	
}
/*
function cons(value){
	try
	{
		with (con)
		{
				for(i=0;i<4;i++)i==value?children[i].style.display="block":children[i].style.display="none"; 		
		}
	}
	catch(e)
	{
		var divlist = document.getElementById("con").getElementsByTagName("div");
		for(i=0;i<4;i++)
		{
			i==value?divlist[i].style.display="block":divlist[i].style.display="none";
		}		
	}
}
*/
 
function clearAuto(){clearInterval(autoStart)}
function setAuto(){autoStart=setInterval("auto(n)", 5000)}
function auto(){
	n++;
	if(n>3)n=0;
	Mea(n);
} 
function sub(){
	n--;
	if(n<0)n=3;
	Mea(n);
} 
setAuto(); 


	function setCarBg(bgid,sBox,bgsrc){
		var pArr=['p0','p1','p2'];
		var sArr=['hotcar.jpg','small.jpg','bus.jpg'];
		var zArr=['s_00','s_01','s_02'];
		
		for(var i=0;i < pArr.length;i++){
			//alert(pArr[i]);
			$(pArr[i]).style.display='none';
			$(zArr[i]).src="images/"+sArr[i];
		}
		$(sBox).style.display='block';
		$(bgid).src="images/"+bgsrc;
	}
	
	
	function showPic(pid,path){
		var p = document.getElementById("p"+pid);
		var s = document.getElementById("s"+pid);
		if(path==0){
			p.style.display="none";	
			s.style.display="none";	
		}
		else {
			var h = document.documentElement.clientHeight;
			var ch = event.y;
			if(ch+250>h){
				s.style.top = "auto";	
				p.style.marginTop = -(ch+255-h)+"px";
			}
			//alert(h+" ---  "+ch);
			s.style.display="block";
			p.style.display="block";	
		}
	}

var $d = document;

function $i(s){return $d.getElementById(s);}

var _jsc = {};

_jsc.client = (function(){	
	var t = {};
	var b = navigator.userAgent.toLowerCase();
	t.isOpera = (b.indexOf('opera') > -1);
	t.isIE = (!t.isOpera && b.indexOf('msie') > -1);
	t.isFF = (!t.isOpera &&!t.isIE&&b.indexOf('firefox') > -1);
	return t;
})();

_jsc.util = (function(){
	var t = {};
	t.addEvent = function(o,c,h){
		if(_jsc.client.isIE){
			o.attachEvent('on'+c,h);
		}else{
			o.addEventListener(c,h,false);
		}
		return true;
	};
	return t;
})();

_jsc.evt = (function(){
	var t = {};
	t.gTar = function(oe){
		if(_jsc.client.isIE){
			return oe.srcElement;
		}else{
			return oe.target;
		}
	};
	return t;
})();

function tabswitch(c, config){
	this.config = config ? config : {start_delay:300, delay:1500};
	this.container = $i(c);
	this.pause = false;
	this.nexttb = 1;
	this.tabs = this.container.getElementsByTagName('dt');
	var _this = this;
	if(this.tabs.length<1)this.tabs = this.container.getElementsByTagName('li');
	for(var i = 0; i < this.tabs.length; i++){
		var _ec = this.tabs[i].getElementsByTagName('span');
		if(_ec.length<1)_ec = this.tabs[i].getElementsByTagName('a');
		if(_ec.length<1){
			_ec = this.tabs[i]
		}else{
			_ec = _ec[0];
		}
		_ec.onmouseover = function(e) {
			_this.pause = true;
			var ev = !e ? window.event : e;
			_this.start(ev, false, null);
		};
		
		_ec.onmouseout = function() {
			_this.pause = false;
		};
		
		try{
			$i(this.tabs[i].id + '_body_1').onmouseover = function(){
				_this.pause = true;
			};
			
			$i(this.tabs[i].id + '_body_1').onmouseout = function(){
				_this.pause = false;
			};
		}catch(e){}
	}

	if ($i(c + '_sts')) {
		var _sts = $i(c + '_sts');
		var _step = _sts.getElementsByTagName('li');
		if(_step.length<1)_step = _sts.getElementsByTagName('div');
		_step[0].onclick = function() {
			if (_this.tabs[_this.tabs.length-1].className.indexOf('current') > -1) {
				_this.nexttb = _this.tabs.length + 1;
			};
			_this.nexttb = _this.nexttb - 2 < 1 ? _this.tabs.length : _this.nexttb - 2;
			//alert(_this.nexttb);
			_this.start(null, null, _this.nexttb);
		};
		
		_step[1].onclick = function() {
			_this.nexttb = _this.nexttb < 1 ? 1 : _this.nexttb;
			_this.start(null, null, _this.nexttb);
		};
	};
	
	this.start = function(e, r, n){
		if(_this.pause && !e)return;
		if(r){
			curr_tab = $i(_this.container.id + '_' + rand(4));
		}else{
			if(n){
				//alert(_this.container.id + '_' + _this.nexttb);
				curr_tab = $i(_this.container.id + '_' + _this.nexttb);
			}else{
				curr_tab = _jsc.evt.gTar(e);
				if(curr_tab.id=="")curr_tab = curr_tab.parentNode;
			}
		}
		
		var tb = curr_tab.id.split("_");
		for(var i = 0; i < _this.tabs.length; i++){
			if(_this.tabs[i]==curr_tab){
				_this.tabs[i].className="hot Selected current";
				try{
					//alert(_this.tabs[i].id);
					$i(_this.tabs[i].id + '_body_1').style.display = "block";
				}catch(e){}
			}else{
				_this.tabs[i].className="";
				try{
					$i(_this.tabs[i].id + '_body_1').style.display = "none";
				}catch(e){}
			}
		}
		_this.nexttb = parseInt(tb[tb.length-1]) >= _this.tabs.length ? 1 : parseInt(tb[tb.length-1]) + 1;
	};
}

function init_imh () {
	var _lis = document.getElementsByTagName('li');
	for (var i=0;i<_lis.length;i++) {
		if (_lis[i].getAttribute('jpe') == 'linkto:a') {
			_lis[i].onclick = function(e) {
				var ev = !e ? window.event : e;
				var _target = _jsc.evt.gTar(ev);
				while (_target.tagName.toLowerCase() != 'li') {
					_target = _target.parentNode;
				}
				location.href = _target.getElementsByTagName('a')[0].getAttribute('href');
				return false;
			};
		}
	}
}

var banners, new_trans, super_rec, crazy_buy, star,bargain_scroll,buy_ok_div;
_jsc.util.addEvent(window, 'load', function() {
		if ($i('banners')) {	
			banners = new tabswitch('banners', {});
			setInterval("banners.start(null, null, 1);", 5000);
		}
		
});


	function closeFrom(){
		var wp = window.parent;
		//wp.document.getElementById()
		wp.$("regBox").remove();
		wp.$("bgBox").remove();
		//wp.document.body.removeChild(wp.document.getElementById("imgBox"));
		//wp.document.body.removeChild(wp.document.getElementById("bgBox"));
	}
		function backhome() {
		
		window.parent.location.href='main.asp';
		closeFrom()
	}
	
	function backUser() {
			
		window.top.document.location.href='membercenter.asp';
		closeFrom();	
		///alert('dddd');		
	}
	
	function closeFrom(){
		var wp = window.parent;
		//wp.document.getElementById()
		wp.$("regBox").remove();
		wp.$("bgBox").remove();
		//wp.document.body.removeChild(wp.document.getElementById("imgBox"));
		//wp.document.body.removeChild(wp.document.getElementById("bgBox"));
	}   
   function copyUrl2() 
{ 
var Url2=document.getElementById("tgurl");//对象是QQ 
Url2.select(); //选择对象 
document.execCommand("Copy"); //执行浏览器复制命令 
alert("复制成功,直接粘贴过去给您的朋友吧."); 
} 


   function showpic(dpicpath)
   {
    
		document.images("dpic").src=dpicpath;
   }
   
     function hidepic()
   {
    
		document.images("dpic").src="pic/about1111.jpg";
   }
<!--//--><![CDATA[//><!--

sfHover = function() {
	var sfEls = document.getElementById("dxhorinav") ? document.getElementById("dxhorinav").getElementsByTagName("LI") : document.getElementById("dxvertnav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if ((/msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent)) && (window.addEventListener)) window.addEventListener("load", sfHover, false);
else if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!]]>
/*按比例生成缩略图*/
function $(){
	var elem = null;
	if(typeof arguments[0] !="string"){
		if(!arguments[0]){return null;}
		elem = arguments[0];
		if(!elem["version"]){
			$._Method.Element.apply(elem);
			if($._appendMethod){
				$._appendMethod.apply(elem);
			}
		}
		return elem;
	}
	var argID = arguments[0].trim();

	if(argID.indexOf(" ")==-1 && argID.indexOf(",")==-1 && argID.indexOf(".")==-1 && argID.indexOf("[")==-1 && argID.indexOf(">")==-1){
		elem = document.getElementById(argID.replace("#","")); 
		if(!elem){return null;}
		if(!elem["version"]){
			$._Method.Element.apply(elem);
			if($._appendMethod){
				$._appendMethod.apply(elem);
			}
		}
		return elem;
	}
	//CSS Selector
	var path = argID.replace(/(^,*)|(,*$)/g,"").split(",");
	var allelem = [];
	for(var a=0,b; b=path[a]; a++){
		var p = b=path[a].trim().replace(/ +/g," ").split(" ");
		for (var i=0,q; q=p[i]; i++){
			if (q.indexOf("#")==0){ //id
				elem = $(q.substring(1)); 
				continue;
			}
			var attsel = [];
			var elem_temp=[];
			if (q.indexOf(".")!=-1){ // (tag+)className
				var tags = q.replace(/\[.*?\]/gi,function($1){attsel.push($1.replace(/\[|\]/g,""));return "";});
				var tag = tags.split(".")[0];
				var cn = tags.split(".")[1];
				if (elem == null){
					elem_temp = $._find(tag,cn,arguments[1] || document);
				}else{
					if (elem instanceof Array){
						var arr = [];
						elem.each(function(obj){$._find(tag,cn,obj).each(function(){arr.push(arguments[0])});});						
						elem_temp = arr;
					}else{
						elem_temp = $._find(tag,cn,elem);
					}
				}
				elem = $._attributeSelector(attsel,elem_temp);
				continue;
			}else{//tag
				var tag = q.replace(/\[.*?\]/gi,function($1){attsel.push($1.replace(/\[|\]/g,""));return "";});
				if(elem == null){
					elem_temp = $A((arguments[1] || document).getElementsByTagName(tag)).each(function(obj){$(obj)});
				}else{
					if (elem instanceof Array){
						var arr = [];
						elem.each(function(obj){$A(obj.getElementsByTagName(tag)).each(function(obj){arr.push($(obj))})});
						elem_temp = arr;
					}else{
						elem_temp = $A(elem.getElementsByTagName(tag)).each(function(obj){$(obj)});
					}
				}
				elem = $._attributeSelector(attsel,elem_temp);
			}
		}
		if(elem.constructor==Array){
			elem.each(function(obj){allelem.push(obj)});
		}else{
			allelem.push(elem);
		}
		elem = null;
	}
	return allelem;
};
$.Version = "0.2.1.1";
$._find = function(tag,cn,par){
	var arr = par.getElementsByTagName(tag||"*");
	var elem = [];
	for(var i=0,j; j=arr[i]; i++){
		if(j.className.hasSubString(cn," ")){elem.push($(j));}
	}
	return elem;
}
$._attributeSelector = function(attsel,elem_temp){
	for (var j=0; j<attsel.length; j++){
		var elemArr = [];
		var k=attsel[j].split(/=|!=/g);
		if(k.length==1){
			elem_temp.each(function(n){
				if(n.getAttribute(k[0].trim())){
					elemArr.push(n);
				}
			});
		}else if(k.length>1){
			elem_temp.each(function(n){
				if(attsel[j].indexOf("!=")!=-1){
					if(n.getAttribute(k[0].trim())!=k[1].trim()){
						elemArr.push(n);
					}
				}else{
					if(n.getAttribute(k[0].trim())==k[1].trim()){
						elemArr.push(n);
					}
				}
			});						
		}						
		elem_temp.length = 0;
		elem_temp = elemArr;
	}
	return elem_temp; 
}
function NameSpace(){};
function StringBuffer(){this.data = []};
$._Method = {
	Element	: function(){
		this.version = $.Version;
		this.hide = function(){this.style.display="none"; return this};
		this.show = function(){this.style.display=""; return this};
		this.getStyle = function(s){
			var value = this.style[s=="float"?($.Browse.isIE()?"styleFloat":"cssFloat"):s.camelize()];
			if (!value){
				if (this.currentStyle){
					value = this.currentStyle[s.camelize()];
				}else if (document.defaultView && document.defaultView.getComputedStyle){
					var css = document.defaultView.getComputedStyle(this, null);
					value = css ? css.getPropertyValue(s) : null;
				}
			}
			return value;
		};
		this.setStyle = function(s){
			var sList = s.split(";");
			for (var i=0,j; j=sList[i]; i++){
				var k = j.split(/:(?!\/\/)/g);
				var key = k[0].trim();
				key=key=="float"?($.Browse.isIE()?"styleFloat":"cssFloat"):key.camelize();
				this.style[key] = k[1].trim();
			}
			return this;
		};
		this.toggle = function(){this.getStyle("display")=="none"?this.show():this.hide(); return this};
		this.hasClassName = function(c){return this.className.hasSubString(c," ");};
		this.addClassName = function(c){if(!this.hasClassName(c)){this.className+=" "+c};return this};
		this.removeClassName = function(c){if(this.hasClassName(c)){this.className = (" "+this.className+" ").replace(" "+c+" "," ").trim(); return this}};
		this.toggleClassName = function(c){if(this.hasClassName(c)){this.removeClassName(c);}else{this.addClassName(c);};return this;}
		this.getElementsByClassName = function(c){return this.getElementsByAttribute("className",c)};
		this.getElementsByAttribute = function(n,v){ //name,value;
			var elems = this.getElementsByTagName("*");
			var elemList = [];
			for (var i=0,j; j=elems[i]; i++){
				var att = j[n] || j.getAttribute(n);
				if (att==v){
					elemList.push(j);
				}
			}
			return elemList;
		};
		this.subTag = function(){return $A(this.getElementsByTagName(arguments[0])).each(function(n){$(n);});}
		this.parentIndex = function(p){
			if (this==p){return 0}			
			for (var i=1,n=this; n=n.parentNode; i++){
				if(n==p){return i;}
				if(n==document.documentElement) return -1;
			}
		}
		this.remove = function(){
			return this.parentNode.removeChild(this);
		}
		this.nextElement = function(){
			var n = this;
			for (var i=0,n; n = n.nextSibling; i++){
				if(n.nodeType==1) return $(n);
			}
			return null;
		};
		this.previousElement = function(){
			var n = this;
			for (var i=0,n; n = n.previousSibling; i++){
				if(n.nodeType==1) return $(n);
			}
			return null;
		};
		this.subElem = this.$ = function(css){
			return $(css,this);
		};
		this.findParent = function(p){
			for(var i=0,n=this; n=n.parentNode; i++){
				if(n==document.documentElement) break;
				var t = 0;
				for(var key in p){
					var m = n[key] || n.getAttribute(key);
					if(m!=p[key]){t++;break;}
				}
				if(t==0) return n;
			}
			return null;
		};
	},
	Array :	function(){
		this.indexOf = function(){
			for (i=0; i<this.length; i++){
				if (this[i]==arguments[0])
					return i;
			}
			return -1;
 	    };
		this.each = function(fn){
			for (var i=0,len=this.length; i<len; i++){
				fn(this[i],i);
			}
			return this;
		};
	},
	String : function(){
		this.trim = function(){
			var _re,_argument = arguments[0] || " ";
			typeof(_argument)=="string"?(_argument == " "?_re = /(^\s*)|(\s*$)/g : _re = new RegExp("(^"+_argument+"*)|("+_argument+"*$)","g")) : _re = _argument;
			return this.replace(_re,"");
		};
		this.stripTags = function(){
			return this.replace(/<\/?[^>]+>/gi, '');
		};
		this.cint = function(){
		    return this.replace(/\D/g,"")*1;
		};
		this.camelize = function(){
			return this.replace(/(-\S)/g,function($1){return $1.toUpperCase().substring(1,2)})
		};
		this.hasSubString = function(s,f){
			if(!f) f="";
			return (f+this+f).indexOf(f+s+f)==-1?false:true;
	    };
		this.hasSubStrInArr = function(){
			for(var i=0; i<arguments[0].length; i++){
				if(this.hasSubString(arguments[0][i])){return true;}
			}
			return false;
		};
		this.toXMLString = function(){
			var arr = this.split("&");
			var str = new StringBuffer();
			for (var i=0,len=arr.length; i<len; i++){
				var item = arr[i].split("=");
				str.append("<"+item[0]+"><![CDATA["+item[1]+"]]></"+item[0]+">");
			}
			var rootStr = arguments[0]?arguments[0]:"root";
			return "<"+rootStr+">"+str.toString()+"</"+rootStr+">";
		};
		this.format = function(){
			var p = arguments;
			return this.replace(/(\{\d+\})/g,function(){
				return p[arguments[0].replace(/\D/g,"")];
			});		
		};
		this.uniq = function(){			
			var arr = this.split("");
			var obj = {};
			for(var i=0,j; j=arr[i]; i++){
				obj[j] = i;
			}
			var s = [];
			for(var key in obj){
				s[obj[key]]=key;
			}
			return s.join("");
		};
	},
	StringBuffer : function(){
		this.append = function(){this.data.push(arguments[0]);return this};
		this.toString = function(){return this.data.join(arguments[0]||"")};
		this.length = function(){return this.data.length};
		this.clear = function(){this.data.length=0; return this;}
	},
	NameSpace : function(){
		this.copyChild = function(ns){
			for (var key in ns){
				this[key] = ns[key];
			}
			return this;
		};
	}
};

$._Method.Array.apply(Array.prototype);
$._Method.String.apply(String.prototype);
$._Method.StringBuffer.apply(StringBuffer.prototype);
$._Method.NameSpace.apply(NameSpace.prototype);

$.Browse = {
	isIE : function(){return navigator.userAgent.hasSubString("MSIE");},
	isFF : function(){return navigator.userAgent.hasSubString("Firefox");},
	isOpera : function(){return navigator.userAgent.hasSubString("Opera")},
	isSafari : function(){return navigator.userAgent.hasSubString("Safari");},
	isGecko : function(){return navigator.userAgent.hasSubString("Gecko");},
	IEVer : function(){return $.Browse.isIE() ? parseInt(navigator.userAgent.split(";")[1].trim().split(" ")[1]) : 0;}
}

$(document);

var Ajax={
	xmlhttp:function (){
		try{
			return new ActiveXObject('Msxml2.XMLHTTP');
		}catch(e){
			try{
				return new ActiveXObject('Microsoft.XMLHTTP');
			}catch(e){
				return new XMLHttpRequest();
			}
		}
	}
};
Ajax.Request=function (){
	if(arguments.length<2)return ;
	var para = {asynchronous:true,method:"GET",parameters:""};
	for (var key in arguments[1]){
		para[key] = arguments[1][key];
	}
	var _x=Ajax.xmlhttp();
	var _url=arguments[0];
	if(para["parameters"].length>0) para["parameters"]+='&_=';
	if(para["method"].toUpperCase()=="GET") _url+=(_url.match(/\?/)?'&':'?')+para["parameters"];
	_x.open(para["method"].toUpperCase(),_url,para["asynchronous"]);
	_x.onreadystatechange=function (){
		if(_x.readyState==4){
			if(_x.status==200)
				para["onComplete"]?para["onComplete"](_x):"";
			else{
				para["onError"]?para["onError"](_x):"";
			}
		}
	};
	if(para["method"].toUpperCase()=="POST")_x.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

	for (var ReqHeader in para["setRequestHeader"]){
		_x.setRequestHeader(ReqHeader,para["setRequestHeader"][ReqHeader]);
	}
	_x.send(para["method"].toUpperCase()=="POST"?(para["postBody"]?para["postBody"]:para["parameters"]):null);
	return _x;
};
$.Ajax = {
	Request : function(url,_method,para,complete,error){return Ajax.Request(url,{method:_method||"get",parameters:para||"",onComplete:complete,onError:error});},
	get	: function(url,complete,error){ return $.Ajax.Request(url+(url.indexOf("?")==-1?"?":"&")+Math.random(),"get","",complete,error); },
	post : function(url,para,complete,error){ return $.Ajax.Request(url,"post",para,complete,error);},
	update : function(url,id){ return $.Ajax.Request(url,(arguments[2]?"post":"get"),(arguments[2]?arguments[2]:Math.random()),function(x){if("INPUT,SELECT,BUTTON,TEXTAREA".hasSubString($(id).tagName,",")){$(id).value=x.responseText;}else{$(id).innerHTML=x.responseText;}});}
};
$.Cookies = {
    get : function(n){
	    var dc = "; "+document.cookie+"; ";
	    var coo = dc.indexOf("; "+n+"=");
	    if (coo!=-1){
		    var s = dc.substring(coo+n.length+3,dc.length);
		    return unescape(s.substring(0, s.indexOf("; ")));
	    }else{
		    return null;
	    }
    },
    set : function(name,value,expires,path,domain,secure){
        var expDays = expires*24*60*60*1000;
        var expDate = new Date();
        expDate.setTime(expDate.getTime()+expDays);
        var expString = expires ? "; expires="+expDate.toGMTString() : "";
        var pathString = "; path="+(path||"/");
		var domain = domain ? "; domain="+domain : "";
        document.cookie = name + "=" + escape(value) + expString + domain + pathString + (secure?"; secure":"");
    },
    del : function(n){
	    var exp = new Date();
	    exp.setTime(exp.getTime() - 1);
	    var cval=this.get(n);
	    if(cval!=null) document.cookie= n + "="+cval+";expires="+exp.toGMTString();
    }
}
$.Form = function(n){
	var f = typeof n =="string" ? document.forms[n] : n;
	$.Form._Method.apply(f);
	return f;
}
$.Form._Method = function(){
	this.serialize = function(obj){
			var arr = this.elements;
			var elem = {};
			for(var i=0,j; j=arr[i]; i++){
				if(j.disabled || !j.name){continue;}
				if(j.type && j.type.toLowerCase().hasSubStrInArr(["radio","checkbox"]) && !j.checked){continue;}
				var na = j.name.toLowerCase();
				if(typeof elem[na] == "undefined"){
					elem[na] = [];
				}
				elem[na].push($E(j.value));
			}
			return $.Form.serialize(obj,elem);
		};
}

$.Form.serialize = function(obj){
	var elem = arguments[1] || {};
	for(var key in obj){
		var na = key.toLowerCase();
		if(typeof elem[na] == "undefined"){
			elem[na] = [];
		}
		elem[na].push($E(obj[key]));
	}
	var para = new StringBuffer();
	for(var name in elem){
		for(var i=0; i<elem[name].length; i++){
			para.append(name+"="+elem[name][i]);
		}
	}
	return para.toString("&");
}

$.Request = function(paras){
	var url = location.search;
	if(!url.hasSubString("?")){return "";}else{url=url.substring(1);}
	var obj = {};
	url.split("&").each(function(p){
		var k = p.split("=");
		var n = k[0].toLowerCase();		
		obj[n] = k[1] || "";
	});
	return obj[paras.toLowerCase()];
}
$.Redirect = function(url,paraStr){
	if(!paraStr){
		location.href=url;
		return;
	}
	var obj = {};
	if(url.indexOf("?")!=-1){
		var s = url.substring(url.indexOf("?")+1).split("&");
		for(var i=0; i<s.length; i++){
			var j=s[i].split("=");
			obj[j[0]]=j[1]||"";
		}		
	}
	var t = paraStr.split("&");
	for(var i=0; i<t.length; i++){
		var j = t[i].split("=");
		obj[j[0]] = j[1] || "";
	}			
	location.href=url.substring(0,url.indexOf("?"))+"?"+$.Form.serialize(obj);
}
$.Import = function(url){
	var myAjax = new Ajax.Request(
		url,
		{
			asynchronous:false,
			onComplete:function(x){
				var js = document.createElement("script");
				js.type = "text/javascript";
				js.defer = "defer";
				js.text = x.responseText;
				document.getElementsByTagName("head")[0].appendChild(js);			
			},
			onError:function(x){
				alert("loading script file occur an error:"+x.statusText);
			}
		}
	);
}
function $A(list){
	var arr = [];
	for (var i=0,len=list.length; i<len; i++){
		arr[i] = list[i];
	}
	return arr;
}
function $D(str){return decodeURIComponent(str);}
function $E(str){return encodeURIComponent(str);}
function $V(id){return $(id)?($($(id)).tagName.hasSubStrInArr(["INPUT","TEXTAREA","SELECT","BUTTON"])?$(id).value : $(id).innerHTML):"";}

window.onerror = function(){return true;}

function DrawImage(ImgD,W,H){ 
  var flag=false; 
  var image=new Image(); 
  image.src=ImgD.src; 
  if(image.width>0 && image.height>0){ 
    flag=true; 
    if(image.width/image.height>= W/H){ 
      if(image.width>50){
        ImgD.width=W; 
        ImgD.height=(image.height*H)/image.width; 
      }
	  else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
      } 
      ImgD.alt= ""; 
    } 
    else{ 
      if(image.height>50){
        ImgD.height=H; 
        ImgD.width=(image.width*W)/image.height; 
      }
	  else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
      } 
      ImgD.alt=""; 
    } 
  }
}

function showBigImg(img){
	
	var box = document.createElement("div");
	box.className = "imgBox";
	box.id = "imgBox";
	box.style.top = (document.documentElement.scrollTop+170)+"px";
	
	var image = img.cloneNode();
	image.onclick = closeImg;
	box.appendChild(image);
	var bgBox = document.createElement("div");
	bgBox.className="bgBox";
	bgBox.id = "bgBox";
	bgBox.style.height = document.body.scrollHeight+"px";
	bgBox.onclick = function(){
		$("imgBox").remove();
		$("bgBox").remove();
	}
	var toolbar = document.createElement("div");
	toolbar.id ='fontBox';
	toolbar.innerHTML = "<span style='float:right'><a href='javascript:void(0)' id='fcar_id' onclick='previousImg(this)'>上一张</a>&nbsp;|&nbsp;<a href='javascript:void(0)' id='ecar_id' onclick='nextImg(this)'>下一张</a></span>点击图片关闭";
	box.appendChild(toolbar);
	document.body.appendChild(bgBox);
	document.body.appendChild(box);
	showBigImg.index = $("#demo1 img").indexOf(img);
	
}

showBigImg.handle = 0;
function closeImg(){
	document.body.removeChild(this.parentNode);
	document.body.removeChild(document.getElementById("bgBox"));
	showBigImg.index = 0;
}

function previousImg(a){
	if(showBigImg.index==0)  {
		$('fcar_id').style.display='none';
		return;
	}else{
		$('ecar_id').style.display='';	
	}
	var img = $("#demo1 img")[--showBigImg.index].cloneNode();
	img.onclick = closeImg;
	a.parentNode.parentNode.previousSibling.replaceNode( img );
}

function nextImg(a){
	if(showBigImg.index==($("#demo1 img").length-1)) { 
		$('ecar_id').style.display='none';
		return;		
	}else{
		$('fcar_id').style.display='';	
	}
	var img = $("#demo1 img")[++showBigImg.index].cloneNode();
	img.onclick = closeImg;
	a.parentNode.parentNode.previousSibling.replaceNode( img );
}
  	
	function showRegFrom(){
		var box = document.createElement("div");
		box.className = "regBox";
		box.id = "regBox";
		box.style.top = (document.documentElement.scrollTop+40)+"px";
		
		var bgBox = document.createElement("div");
		bgBox.className="bgBox";
		bgBox.id = "bgBox";  
		bgBox.style.height = document.body.scrollHeight+"px";
		
		box.innerHTML='<iframe name="frameBox" src="about:blank" height="343" width="657" scrolling="no" frameborder="0"></iframe>';
		//box.appendChild(toolbar);
		document.body.appendChild(bgBox);
		document.body.appendChild(box);
		window.frames["frameBox"].location.href = "Memberregister1.asp";
	
	} 	
		function showRegFrom2(){
		var box = document.createElement("div");
		box.className = "regBox";
		box.id = "regBox";
		box.style.top = (document.documentElement.scrollTop+40)+"px";
		
		var bgBox = document.createElement("div");
		bgBox.className="bgBox";
		bgBox.id = "bgBox";  
		bgBox.style.height = document.body.scrollHeight+"px";
		
		box.innerHTML='<iframe name="frameBox" src="about:blank" height="343" width="657" scrolling="no" frameborder="0"></iframe>';
		//box.appendChild(toolbar);
		document.body.appendChild(bgBox);
		document.body.appendChild(box);
		window.frames["frameBox"].location.href = "mai4che.asp";
	
	} 	
		function showRegFrom1(){
		var box = document.createElement("div");
		box.className = "regBox";
		box.id = "regBox";
		box.style.top = (document.documentElement.scrollTop+40)+"px";
		
		var bgBox = document.createElement("div");
		bgBox.className="bgBox";
		bgBox.id = "bgBox";  
		bgBox.style.height = document.body.scrollHeight+"px";
		
		box.innerHTML='<iframe name="frameBox" src="about:blank" height="343" width="657" scrolling="no" frameborder="0"></iframe>';
		//box.appendChild(toolbar);
		document.body.appendChild(bgBox);
		document.body.appendChild(box);
		window.frames["frameBox"].location.href = "mai3che.asp";
	
	} 	
	function scrollShow(obj, count, ht, delay)
	{
		 var end = (count * 2 - 1) * ht;
		 var offset = 0;
		 var stop = false;
		 obj.innerHTML += obj.innerHTML;
		 //obj.onmouseover = function(){stop = true};
		 //obj.onmouseout = function(){stop = false};
		 function scrollStart()
		 {
			  if(!stop)
			  {
				   if (offset >= end)
				   {
						obj.scrollTop = offset = (count - 1) * ht;
				   }
				   obj.scrollTop = offset;
				   offset ++;
			   }

			  if (offset % ht == 0)
			  {
			  		//alert(offset);
				   setTimeout(scrollStart, delay);  
				   return false;
			  }
			  setTimeout(scrollStart, 5);
		 }
		 setTimeout(scrollStart, delay);
	}	
	
	
 
    function switchTag(tag,content)
    {
    //	alert(tag);
    //	alert(content);
	    for(i=1; i <4; i++)
	    {
		    if ("tag"+i==tag)
		    {
			    document.getElementById(tag).className="sch_menu_on";
		    }else{
			    document.getElementById("tag"+i).className="sch_menu_off";
			    document.getElementById(tag).className="sch_menu_on";
		    }
		    if ("content"+i==content)
		    {
			    document.getElementById(content).className="";
		    }else{
			    document.getElementById("content"+i).className="hidecontent";
			    document.getElementById(content).className="";
		    }
	    }
    }
    function switchTags(tagg,contentt)
    {
    //	alert(tag);
    //	alert(content);
	    for(i=1; i <5; i++)
	    {
		    if ("tagg"+i==tagg)
		    {
			    document.getElementById(tagg).className="sch_menu_ons";
    			
		    }else{
			    document.getElementById("tagg"+i).className="sch_menu_offs";
			    document.getElementById(tagg).className="sch_menu_ons";
		    }
		    if ("contentt"+i==contentt)
		    {
			    document.getElementById(contentt).className="";
		    }else{
			    document.getElementById("contentt"+i).className="hidecontent";
			    document.getElementById(contentt).className="";
		    }
	    }
    }
  
		var bId2=10;//ǰ
		function clickTT2(obj,tId){
			if(obj.className=="commend_car_tags_normal"){
				obj.className="commend_car_tags_hover";
				document.getElementById("item"+bId2).className="commend_car_tags_normal";
				document.getElementById("hdd"+bId2).style.display="none";
				document.getElementById("hdd"+tId).style.display="block";
				bId2=tId;
			}
		}
	
			var bId=3;//ǰ
		function clickTT(obj,tId){
			if(obj.className=="commend_car_tags_normal"){
				obj.className="commend_car_tags_hover";
				document.getElementById("item"+bId).className="commend_car_tags_normal";
				document.getElementById("hd"+bId).style.display="none";
				document.getElementById("hd"+tId).style.display="block";
				bId=tId;
			}
		}
	 
