//天气div切换
function w_e(obj,vv) {
lay = document.getElementById(obj);
if (vv==1) lay.style.display='block';
else lay.style.display='none';
}
//通用div切换
function cdiv(divid,divname,divcount){
	for(i=1;i<=divcount;i++) {
		document.getElementById(divname+'_'+i).style.display='none';
		document.getElementById(divname+i).className='h2';
	}
	document.getElementById(divname+'_'+divid).style.display='block';
	document.getElementById(divname+divid).className='h1';
}
//图片滚动切换
function lrarr(arr){
	var pc1 = document.getElementById('pc1');
	var pc2 = document.getElementById('pc2');
	var pc3 = document.getElementById('pc3');
if(arr == 'rr'){
	if(pc1.className == 'pcc'){
		pc1.className = 'pcc hidden';
		pc2.className = 'pcc';
		pc3.className = 'pcc hidden';	
	}else if(pc2.className == 'pcc'){
		pc1.className = 'pcc hidden';
		pc2.className = 'pcc hidden';
		pc3.className = 'pcc';	
	}
}
if(arr == 'll'){
	if(pc3.className == 'pcc'){
		pc1.className = 'pcc hidden';
		pc2.className = 'pcc';
		pc3.className = 'pcc hidden';	
	}else if(pc2.className == 'pcc'){
		pc1.className = 'pcc';
		pc2.className = 'pcc hidden';
		pc3.className = 'pcc hidden';	
	}
}
}

//文字自动循环滚动
//scrollBodyId:	String 内部滚动div的id
//scrollBoxId:	String 外面限制div的id
//lineHeight:	Int 每行的高度
//stopTime:		Int 间隔停止的时间（毫秒）
//speed:		Int 滚动速度（毫秒，越小越快）
var ScrollObj = function(scrollBodyId,scrollBoxId,lineHeight,stopTime,speed) {
	this.obj = document.getElementById(scrollBodyId);
	this.box = document.getElementById(scrollBoxId);
	
	this.style = this.obj.style;
	this.defaultHeight = this.obj.offsetHeight;
	
	this.obj.innerHTML += this.obj.innerHTML;
	this.obj.style.position = "relative";
	this.box.style.overflow = "hidden";
	
	this.scrollUp = doScrollUp;

	this.stopScroll = false;
	
	this.curLineHeight = 0;
	this.lineHeight = lineHeight;
	this.curStopTime = 0;
	this.stopTime = stopTime;
	this.speed = speed;

	this.style.top = lineHeight;

	this.object = scrollBodyId + "Object";
	eval(this.object + "=this");
	setInterval(this.object+".scrollUp()",speed);
	this.obj.onmouseover=new Function(this.object+".stopScroll=true");
	this.obj.onmouseout=new Function(this.object+".stopScroll=false");
}
function doScrollUp(){
	if( this.stopScroll == true )
		return;
  	this.curLineHeight += 1;
  	if( this.curLineHeight >= this.lineHeight ){
  		this.curStopTime += 1;
  		if( this.curStopTime >= this.stopTime ){
  			this.curLineHeight = 0;
  			this.curStopTime = 0;
  		}
  	}
	else{  	
	  	this.style.top = parseInt(this.style.top) - 1;
	  	if( -parseInt(this.style.top) >= this.defaultHeight ){
	    	this.style.top = 0;
	  	}
  	}
}
