var isIe=(document.all)?true:false;
var _pos_right = document.getElementById("pos_right");
var _pos_right1 = document.getElementById("pos_right1");
var _pos_right2 = document.getElementById("pos_right2");
function showBackground(obj,endInt,size)
{
	if(isIe)
	{
		obj.filters.alpha.opacity+=size;
		if(obj.filters.alpha.opacity<endInt)
		{
			setTimeout(function(){showBackground(obj,endInt,size)},1);
		}
	}else{
		var al=parseFloat(obj.style.opacity);
		al+=(size/100);
		obj.style.opacity=al; 
		if(al<(endInt/100))
		{
			setTimeout(function(){showBackground(obj,endInt,size)},1);
		}
	} 
}
//-489
//-432
//-320 
var _h = 350;
var _h1 = 250;
var _h2 = 220;
function setdivmagin(h,obj){
	h+=1;
	_h =  h + _h; 
	if(_h < 432){
		_pos_right.style.marginTop="-"+_h+"px"; 
		if(_h>370 && _h1==250){_h1=251;setdivmagin1(1);}
		setTimeout(function(){setdivmagin(h)},_time); 
	}else{ 
		_pos_right.style.marginTop="-432px";
	}
}
function setdivmagin1(h){ 
	h+=1;
	_h1 =  h + _h1; 
	if(_h1 < 320){
		_pos_right1.style.marginTop="-"+_h1+"px";
		if(_h1 > 290 && _h2==220){_h2=221;setdivmagin2(1);}
		setTimeout(function(){setdivmagin1(h)},_time); 
	}else{ 
		_pos_right1.style.marginTop="-320px";
	}
}
function setdivmagin2(h){
	h+=1;
	_h2 =  h + _h2; 
	if(_h2 < 280){
		_pos_right2.style.marginTop="-"+_h2+"px";
		setTimeout(function(){setdivmagin2(h)},_time); 
	}else{ 
		_pos_right2.style.marginTop="-280px";
	}
}

var _showhref=document.getElementById("showhref");
var _icount=1;
var _iicount=0;
var image_0=new Image()
var image_1=new Image()
image_0.src="ccig/img/fk02.png";
image_1.src="ccig/img/fk01.png";

var _defaultpng="ccig/img/home_1.jpg";

var _img=new Array();
_img=['home_1.jpg','home_2.jpg','home_3.jpg']
//home_1.jpg
function js(i){ 
	//alert(_iicount+'  '+_icount)
	if(_iicount < _icount-1){
		_iicount+=1;
	}else{
		_iicount=0
	}  
	_showhref.style.background= "url(ccig/img/"+_img[i]+")";
	_showhref.style.backgroundRepeat="no-repeat";
	_showhref.style.backgroundPosition="center center"; 
	 
	if(isIe){
		_showhref.style.filter="alpha(opacity=0)";
		_showhref.filters.alpha.opacity=0;
	}else{
		_showhref.style.opacity=0;
	}
	showBackground(_showhref,100,2); 
	
	for(var _i=0;_i<_icount;_i++){
		document.getElementById("v_cc"+_i).src=image_0.src;
	} 
	document.getElementById("v_cc"+i).src=image_1.src;
	
	if(i==0){
		setdivmagin(1,_pos_right);
	}
}
var _time=30;
if(isIe){
	_time =1; 
	_pos_right2.style.filter="alpha(opacity=0)";
	_pos_right2.filters.alpha.opacity=0;
	
}else{ 
	_pos_right2.style.opacity=0;
	
	_time =70;
}
setdivmagin(1,_pos_right);
 
showBackground(_pos_right2,100,1);
if(_icount>0){ 
	//js(_iicount);
	if(_icount>1){
		setInterval(function(){js(_iicount);},8000);
	}
}

var _dfont = document.getElementById("dfont");
		window.onload=function(){  
			for ( var i=1;i<=7;i++){
					document.getElementById("div"+i).onmouseover=function(){ 
					
					document.getElementById("mdiv2").style.display="none";
					document.getElementById("mdiv4").style.display="none";
					document.getElementById("mdiv5").style.display="none";
					document.getElementById("mdiv6").style.display="none";
				    _dfont.style.marginLeft="470px";
					for(var _i=1;_i<=7;_i++){
						document.getElementById("nav_div"+_i).style.display = "none"; 
					}
					
					document.getElementById("nav_"+this.id).style.display="block"; 
					
					if(this.name+""!="b"){ 
						var _tempdiv=document.getElementById("m"+this.id); 
						_tempdiv.style.display="block";   
						_dfont.style.marginLeft="280px";
					}
				}
			}
		}  
		
		var _m=0;
		var o;
		document.getElementById("hidden_nav").onmouseover = function(e){ 
			if (e)  {
				e.stopPropagation();  
			}
			else{ 
				window.event.cancelBubble = true; 
				o = window.event.srcElement;
			}
			if(o.className=="nav_center" || o.className=="ha"){  
				document.getElementById("mdiv2").style.display="none";
				document.getElementById("mdiv4").style.display="none";
				document.getElementById("mdiv5").style.display="none";
				document.getElementById("mdiv6").style.display="none";
				_dfont.style.marginLeft="470px";for(var _i=1;_i<=7;_i++){						document.getElementById("nav_div"+_i).style.display = "none"; 
}
	}  
		}; 
