


/*--------------------------------------------------------------------------*/
/*  image on off
/*--------------------------------------------------------------------------*/
function imgOn(imgElement)
{
	if(imgElement.src.indexOf("_on.gif") == -1){
		imgElement.src = imgElement.src.replace("_off.gif", "_on.gif");
	}
}

function imgOut(imgElement)
{
	if(imgElement.src.indexOf("_off.gif") == -1){
		imgElement.src = imgElement.src.replace("_on.gif", "_off.gif");
	}
}

/*########popup zone########*/
inx = 2;
function startPopZone(){
	timer = setInterval("popZoneAct();",5000);	
}
function stopPopZone(){
	clearInterval(timer);	
}

function popZone(){
	var a = document.getElementById("zoneNum");
	var b = a.getElementsByTagName("div");	
	for(i = 1;i < b.length;i++){
		if(!b[i].className == "pop_zone") return false;
		if(b[i].className == "pop_zone"){
			b[i].style.display = "none";			
		}
	}
}
//addLoadEvent(popZone);

function popZoneAct(){
	
	var a = document.getElementById("popZone" + inx);
	var b = document.getElementById("zoneNum");
	var c = b.getElementsByTagName("div");
	
	var j = 0;
	for(i = 0;i < c.length;i++){
		if(!c[i].className == "pop_zone") return false;
		if(c[i].className == "pop_zone") {
			j++;
			c[i].style.display = "none";
		}
	}
	a.style.display = "block";
	
	inx++;
	if(inx > j){
		inx = 1;
	}
	a.onmouseover = function(){
		stopPopZone();
	}
	a.onfocus = function(){
		stopPopZone();
	}
	a.onmouseout = function(){
		startPopZone();
	}
	a.onblur = function() {
		startPopZone();
	}	
}
//addLoadEvent(startPopZone);

function popZoneNum(){
	var a = document.getElementById("zoneNum");
	var b = a.getElementsByTagName("div");
	for(i = 0; i < b.length; i++) {
		if(!b[i].className == "pop_zone") return false;
		if(b[i].className == "pop_zone") {
			c = b[i].getElementsByTagName("a");
			cnt = 0;
			for(j = 0; j < c.length; j++) {
				if(!c[j].className == "popNum") return false;
				if(c[j].className == "popNum"){
					cnt++;
					c[j].onclick = function() {
						chDiv(cnt);
					};
				}
			}
		}
	}
}
//addLoadEvent(popZoneNum);

function chDiv(num){
	//alert(num);
	var a = document.getElementById("zoneNum");
	var b = a.getElementsByTagName("div");
	
	for(i = 0;i < b.length;i++){
		if(!b[i].className == "pop_zone") return false;
		if(b[i].className == "pop_zone")
			b[i].style.display = "none";
	}
	document.getElementById("popZone" + num).style.display = "block";
	inx = num;
}
//]]>

function rolloverImgOver(getSrc,thisImg){var leng = getSrc.length, real =leng - 4;url = getSrc.substring(0,real);thisImg.src = url + "_over.gif";}
function rolloverImgOut(getSrc,thisImg){var leng = getSrc.length, real =leng - 4;url = getSrc.substring(0,real);thisImg.src = url + ".gif";}
function rolloverImg(){
	var a = document.getElementsByTagName("body");
	var b = a[0].getElementsByTagName("img");
	var inputBtn = a[0].getElementsByTagName("input");
	var c,d,e,f;
	for(i = 0;i < b.length;i++){
		if(!b[i].className == "rolloverimg") return false;
		if(b[i].className == "rolloverimg"){
			b[i].onmouseover = function(){c = this.src;rolloverImgOver(c,this);}
			b[i].onmouseout = function(){d = c;rolloverImgOut(d,this);}
		}
	}
	for(j = 0;j < inputBtn.length;j++){
		if(!inputBtn[j].className == "rolloverimg") return false;
		if(inputBtn[j].className == "rolloverimg"){
			inputBtn[j].onmouseover = function(){e = this.src;rolloverImgOver(e,this);}
			inputBtn[j].onmouseout = function(){f = e;rolloverImgOut(f,this);}
		}
	}
	/* navigation */
	var k = document.getElementById("ckmpNavigation");
	var l = k.getElementsByTagName("span");
	for(m = 0;m < l.length;m++){naviRollover(m,l[m]);}
}
//addLoadEvent(rolloverImg);

function naviRollover(num,target){
	var a = target.getElementsByTagName("img");
	for(i = 0;i < a.length;i++){
		if((main - 1) == num){
			rolloverImgOver(a[0].src,a[0]);
		}else{
			a[0].onmouseover = function(){c = this.src;rolloverImgOver(c,this);}
			a[0].onmouseout = function(){d = c;rolloverImgOut(d,this);}
		}
	}
}
