var time = 500;
var h = 0;
function addCount(){
	if(time>0)
	{
		time--;
		h = h+5;
	}
	else
	{
		return;
	}
	if(h>397)  //高度
	{
		return;
	}
	document.getElementById("ads").style.display = "";
	document.getElementById("ads").style.height = h+"px";
	setTimeout("addCount()",30); 
}
window.onload = function showAds()
{
	addCount();
	setTimeout("noneAds()",10000); //停留时间自己适当调整
}

var T = 260;
var N = 825; //高度
function noneAds(){
	if(T>0)
	{
		T--;
		N = N-5;
	}
	else
	{
		return;
	}
	if(N<0)
	{
		document.getElementById("ads").style.display = "none";
		return;
	}
	
	document.getElementById("ads").style.height = N+"px";
	setTimeout("noneAds()",30); 
}
document.write ('<div id="ads" style="margin:auto; display:none; width:990px; top:0px; height:0px;text-align:center;z-index:0;"><a href="http://www.csauto.cn/sjhd/20110524/3489124719.html" target="_blank"><img src="./images/chery.jpg"></a></div>');

var downMsg=function(msgid,contentid,config){
	this.msg = $i(msgid);
	this.content = $i(contentid);
	this.config = config ? config : {start_delay:3000, speed: 5, movepx:2,cookie:'downMsgcookie',expiresDay:0};
	this.offsetHeight;
	this.emsg_objTimer;
	this.ie6Add =0;
	var _this = this;
	
	this.init = function(){
		var ifcookie=_jsc.cookies.getCookie(this.config.cookie);
		if(ifcookie == "show")
			return;
		window.setTimeout(_this.start,parseInt(_this.config.start_delay,10));
	}
	
	this.start = function(){
		_this.msg.style.display="block";
		_this.content.style.display="block";
		_this.offsetHeight = _this.content.offsetHeight;
		_this.content.style.height ="0px";
		_this.emsg_objTimer = setInterval(_this.moveUpDiv,parseInt(_this.config.speed,10));
	}
	
	this.moveUpDiv = function(){
	  if(_this.offsetHeight> parseInt(_this.content.style.height,10)){
	  	_this.content.style.height =  parseInt(_this.content.style.height,10)+parseInt(_this.config.movepx,10)+"px";
	  }
	  else{
	  	window.clearInterval(_this.emsg_objTimer);
	  	_jsc.cookies.setCookie(_this.config.cookie,"show",_this.config.expiresDay);
	  	// ie6???????fixed??
	  	var isMSIE = !!(/*@cc_on!@*/0);
		if(isMSIE &&!(window.XMLHttpRequest))
		{ 
	  	_this.content.style.height = parseInt(_this.content.style.height,10) +2+"px";
	  	_this.autoMoveIe6();
	  	}
	  }
	}
	this.autoMoveIe6 = function(){

		if(_this.ie6Add ==0){
			_this.content.style.height =  parseInt(_this.content.style.height,10) + 1 +"px";
			_this.msg.style.bottom="-2px";
			_this.ie6Add =1;
		}
		else{
			_this.content.style.height =  parseInt(_this.content.style.height,10) - 1 +"px";
			_this.msg.style.bottom="-1px";
			_this.ie6Add =0;
		}
		setTimeout(_this.autoMoveIe6,100)
	}
}

function closeDiv()
{
	document.getElementById('downmsg_emessage').style.display='none';
	document.getElementById('downmsg_emessage').innerHTML = "";
}

function showHideDiv()
{
	var ct = document.getElementById('donwmsg_content');
	var btn = document.getElementById('msg_hidden_btn');
	if(ct.style.display!="none"){
	  ct.style.display = "none"
	  btn.className="msg-hidden-btn-2";
	}else{
	  ct.style.display="block";
	  btn.className="msg-hidden-btn-1";
	}

}
var bdy = (document.documentElement && document.documentElement.clientWidth)?document.documentElement:document.body;
var float_top = 50; // 流媒体上边距 根据需要修改
var float_left = -1; // 流媒体左边距 根据需要修改 -1 = 默认居中
var float_width = 800; // 流媒体宽度 根据需要修改 
function myLeftLoad()
{
	document.getElementById('cl_stylebig').style.top = bdy.scrollTop + float_top + 0;
	document.getElementById('cl_stylebig').style.left = float_left>=0?float_left:(bdy.offsetWidth - float_width)/2;
	setTimeout("myLeftLoad();",80)
}
function openWin(){
	myLeftLoad();
	document.getElementById('cl_stylebig').style.visibility='visible';
}
function closecl()
{
	document.getElementById('cl_stylebig').style.visibility='hidden';
}
document.write ('<div id="cl_stylebig" style="position: absolute;border:solid 5px #4097CC; left:0px; top: 0;z-index: 25; visibility:hidden" align="right">');
document.write ('<div>');
document.write ('<a href="http://www.csauto.cn/4s/wenbang/" target="_blank"><img src="./images/toyota.jpg" border=0></a>');
document.write ('</div>');
document.write ('<div style="text-align:right;background:#0087C9;line-height:20px;">');
document.write ("<a href='#' onclick='javascript:closecl();return false;' style='font-weight:bold;'>关 闭</a>");
document.write ('</div></div>');
setTimeout("openWin();",25000);
setTimeout("closecl();",40000);

//adside.JS - 左右侧边栏的广告
function ad_show(width) { //显示广告函数
	ad_width = (width-990)/2;
	left_div=(ad_width-160)/2; //得到左边栏的left位置
	right_div=ad_width+978+left_div; //得到右边栏的left位置

	left_str="<div id='adleft' style='position:absolute;top:10px;left:" + left_div + "px;z-index:2007;padding:4px;'><a href='http://csjixie01.w9.bitidc.net/cheshi/' target='_blank'><img src='./images/2010px.jpg'></a></div>";

	document.write(left_str);
	//document.write(right_str);
}

function updown(){ //随滚动条滚动函数
	document.getElementById("adleft").style.top = bdy.scrollTop;
	//document.getElementById("adright").style.top=(document.documentElement.scrollTop+10)+"px";;
}
/**
var wd=screen.width;
if(wd>800) { //若分辨率宽度大于800个像素则执行上面两个函数
	ad_show(wd);
	window.onscroll=updown;
}
**/

