// 이벤트 배너 이전 다음 정지 , 자동스크롤링 기능
function bannerEvntZone(){

	for(i=1;i<=bannerEvntItemCount;i++){

		if(bannerZoneTmpVal!=1) {
			bannerZoneVal = bannerZoneTmpVal;
			bannerZoneTmpVal = 1;
		}
		if(bannerZoneVal > bannerEvntItemCount)	bannerZoneVal = 1;
		id1 = "evntBanr_"+i
		if(bannerZoneVal==i){
			document.getElementById(id1).style.display	= "";
		}else{
			document.getElementById(id1).style.display	= "none";
		}
	}

	if ( bannerZoneVal == 0 ) {
		document.getElementById("evntBanr_1").style.display	= "";
		bannerZoneVal = bannerZoneVal + 1;
	}
	bannerZoneOrgVal = bannerZoneVal;
	bannerZoneVal = bannerZoneVal + 1;
	
	autocontrolvarEvnt = setTimeout("bannerEvntZone()",5000);
}


function bannerEvntZoneStop(chk){
	if(chk == 0){
		clearTimeout(autocontrolvarEvnt);
	}else if(chk == 1){
		clearTimeout(autocontrolvarEvnt);
		bannerZoneVal = bannerZoneOrgVal +1;
		bannerEvntZone();
	}else if(chk == 2){
		clearTimeout(autocontrolvarEvnt);
		if ( bannerZoneOrgVal == 1 ) {
			bannerZoneVal = bannerEvntItemCount;
		} else {
			bannerZoneVal = bannerZoneOrgVal -1;
		}
		bannerEvntZone2();
	}
}

function bannerEvntZone2(){

	for( i=bannerEvntItemCount; i>=1;i--){

		if(bannerZoneTmpVal!=1) {
			bannerZoneVal = bannerZoneTmpVal;
			bannerZoneTmpVal = 1;
		}
		if(bannerZoneVal == bannerEvntItemCount+1)	bannerZoneVal = 1;
		if(bannerZoneVal <= 0) bannerZoneVal = 1;
		id1 = "evntBanr_"+i;
		if(bannerZoneVal==i){
			document.getElementById(id1).style.display	= "";
		} else {
			document.getElementById(id1).style.display	= "none";
		}
	}
	//alert(bannerZoneVal);
	bannerZoneOrgVal = bannerZoneVal;
	if ( bannerZoneVal == 1 ) {
		bannerZoneVal = bannerEvntItemCount;
	} else {
		bannerZoneVal = bannerZoneVal - 1;
	}
	
	autocontrolvarEvnt = setTimeout("bannerEvntZone2()",5000);
	
}

// 캠페인 배너 이전 다음 정지 , 자동스크롤링 기능
function bannerCpusZone(){
	
	for(i=1;i<=bannerCpusItemCount;i++){

		if(bannerZoneTmpVal2!=1) {
			bannerZoneVal2 = bannerZoneTmpVal2;
			bannerZoneTmpVal2 = 1;
		}
		if(bannerZoneVal2 > bannerCpusItemCount)	bannerZoneVal2 = 1;
		id1 = "cpusBanr_"+i
		if(bannerZoneVal2==i){
			document.getElementById(id1).style.display	= "";
		}else{
			document.getElementById(id1).style.display	= "none";
		}
	}

	if ( bannerZoneVal2 == 0 ) {
		document.getElementById("cpusBanr_1").style.display	= "";
		bannerZoneVal2 = bannerZoneVal2 + 1;
	}
	bannerZoneOrgVal2 = bannerZoneVal2;
	bannerZoneVal2 = bannerZoneVal2 + 1;
	
	autocontrolvarCpus = setTimeout("bannerCpusZone()",5000);
}


function bannerCpusZoneStop(chk){
	//alert(chk);
	if(chk == 0){
		clearTimeout(autocontrolvarCpus);
	}else if(chk == 1){
		clearTimeout(autocontrolvarCpus);
		bannerZoneVal2 = bannerZoneOrgVal2 +1;
		bannerCpusZone();
	}else if(chk == 2){
		clearTimeout(autocontrolvarCpus);
		if ( bannerZoneOrgVal2 == 1 ) {
			bannerZoneVal2 = bannerCpusItemCount;
		} else {
			bannerZoneVal2 = bannerZoneOrgVal2 -1;
		}
		bannerCpusZone2();
	}
}
// 캠페인 배너 스크롤링 ( 이전 )
function bannerCpusZone2(){

	for( i=bannerCpusItemCount; i>=1;i--){

		if(bannerZoneTmpVal2!=1) {
			bannerZoneVal2 = bannerZoneTmpVal2;
			bannerZoneTmpVal2 = 1;
		}
		if(bannerZoneVal2 == bannerCpusItemCount+1)	bannerZoneVal2 = 1;
		if(bannerZoneVal2 <= 0) bannerZoneVal2 = 1;
		id1 = "cpusBanr_"+i;
		if(bannerZoneVal2==i){
			document.getElementById(id1).style.display	= "";
		} else {
			document.getElementById(id1).style.display	= "none";
		}
	}
	bannerZoneOrgVal2 = bannerZoneVal2;
	if ( bannerZoneVal2 == 1 ) {
		bannerZoneVal2 = bannerCpusItemCount;
	} else {
		bannerZoneVal2 = bannerZoneVal2 - 1;
	}
	
	autocontrolvarCpus = setTimeout("bannerCpusZone2()",5000);
	
}

function bannerZoneMove(num){

	for(i=1;i<=bannerItemCount;i++){
		id1 = "evntBanr_"+i
		if(num==i){
			document.getElementById(id1).style.display	= "";
		}else{
			document.getElementById(id1).style.display	= "none";
		}
	}

	bannerZoneVal 		= num;
	bannerZoneTmpVal 	= num;
	bannerZoneStop(1);
}


function bannerZoneShow(type){
	if(type){
		document.getElementById("spot_1").style.display = "none";
		document.getElementById("spot_2").style.display = "";
	}else{
		document.getElementById("spot_1").style.display = "";
		document.getElementById("spot_2").style.display = "none";
	}
}

// 정보광장 이미지 스크롤링
// 이벤트 배너 이전 다음 정지 , 자동스크롤링 기능
function mainInfoImgZone(){
	for(i=1;i<=infoImgItemCount;i++){

		if(infoImgZoneTmpVal!=1) {
			infoImgZoneVal = infoImgZoneTmpVal;
			infoImgZoneTmpVal = 1;
		}
		if(infoImgZoneVal == infoImgItemCount+1)	infoImgZoneVal = 1;
		id1 = "infoImg_"+i;
		if(infoImgZoneVal==i){
			document.getElementById(id1).style.display	= "";
		}else{
			document.getElementById(id1).style.display	= "none";
		}
	}

	if ( infoImgZoneVal == 0 ) {
		document.getElementById("infoImg_1").style.display	= "";
		infoImgZoneVal = infoImgZoneVal + 1;
	}
	infoImgZoneOrgVal = infoImgZoneVal;
	infoImgZoneVal = infoImgZoneVal + 1;
	
	autocontrolvarInfoImg = setTimeout("mainInfoImgZone()",5000);
}

// 메인 > 강의실 이미지 스크롤링
function lectureZone(){
	
	for(i=1;i<=lectureItemCount;i++){

		if(lectureZoneTmpVal!=1) {
			lectureZoneVal = lectureZoneTmpVal;
			lectureZoneTmpVal = 1;
		}
		if(lectureZoneVal == lectureItemCount+1)	lectureZoneVal = 1;
		id1 = "lecture_"+i
		if(lectureZoneVal==i){
			document.getElementById(id1).style.display	= "";
		}else{
			document.getElementById(id1).style.display	= "none";
		}
	}

	if ( lectureZoneVal == 0 ) {
		document.getElementById("lecture_1").style.display	= "";
		lectureZoneVal = lectureZoneVal + 1;
	}
	lectureZoneOrgVal = lectureZoneVal;
	lectureZoneVal = lectureZoneVal + 1;
	
	autocontrolvarlecture = setTimeout("lectureZone()",5000);
}
// 메인 > 2060다이어리 이미지 스크롤링
function diaryZone(){

	for(i=1;i<=diaryItemCount;i++){

		if(diaryZoneTmpVal!=1) {
			diaryZoneVal = diaryZoneTmpVal;
			diaryZoneTmpVal = 1;
		}
		if(diaryZoneVal == diaryItemCount+1)	diaryZoneVal = 1;
		id1 = "diary_"+i
		if(diaryZoneVal==i){
			document.getElementById(id1).style.display	= "";
		}else{
			document.getElementById(id1).style.display	= "none";
		}
	}

	if ( diaryZoneVal == 0 ) {
		document.getElementById("diary_1").style.display	= "";
		diaryZoneVal = diaryZoneVal + 1;
	}
	diaryZoneOrgVal = diaryZoneVal;
	diaryZoneVal = diaryZoneVal + 1;
	
	autocontrolvardiary = setTimeout("diaryZone()",5000);
}

// 키위 < 메인 : 여성을 말하다. 이미지 스크롤링
function femlImgZone(){
	
	for(i=1;i<=thumItemCount;i++){

		if(thumZoneTmpVal!=1) {
			thumZoneVal = thumZoneTmpVal;
			thumZoneTmpVal = 1;
		}
		if(thumZoneVal == thumItemCount+1)	thumZoneVal = 1;
		id1 = "femlThum_"+i
		
		if(thumZoneVal==i){
			document.getElementById(id1).style.display	= "";
		}else{
			document.getElementById(id1).style.display	= "none";
		}
	}

	if ( thumZoneVal == 0 ) {
		document.getElementById("femlThum_1").style.display	= "";
		thumZoneVal = thumZoneVal + 1;
	}
	thumZoneOrgVal = thumZoneVal;
	thumZoneVal = thumZoneVal + 1;
	
	
	autocontrolvarInfoThum = setTimeout("femlImgZone()",5000);
}

// 정보광장  < 메인 : 파워칼럼. 이미지 스크롤링
function infoImgZone(){
	for(i=1;i<=thumItemCount;i++){

		if(thumZoneTmpVal!=1) {
			thumZoneVal = thumZoneTmpVal;
			thumZoneTmpVal = 1;
		}
		if(thumZoneVal == thumItemCount+1)	thumZoneVal = 1;
		id1 = "infoThum_"+i
		
		if(thumZoneVal==i){
			document.getElementById(id1).style.display	= "";
		}else{
			document.getElementById(id1).style.display	= "none";
		}

	}

	if ( thumZoneVal == 0 ) {
		document.getElementById("infoThum_1").style.display	= "";
		thumZoneVal = thumZoneVal + 1;
	}
	thumZoneOrgVal = thumZoneVal;
	thumZoneVal = thumZoneVal + 1;
	
	autocontrolvarInfoThum = setTimeout("infoImgZone()",5000);
}

// 강의실  < 메인 : 추천강좌
function lectureImgZone(){

	for(i=1;i<=lectureItemCount;i++){

		if(lectureZoneTmpVal!=1) {
			lectureZoneVal = lectureZoneTmpVal;
			lectureZoneTmpVal = 1;
		}
		
		if(lectureZoneVal == (parseInt(lectureItemCount)+1) )lectureZoneVal = 1;
		id1 = "first_"+i
		id2 = "second_"+i
		
		if(lectureZoneVal==i){
			document.getElementById(id1).style.display	= "";
			document.getElementById(id2).style.display	= "";
		}else{
			document.getElementById(id1).style.display	= "none";
			document.getElementById(id2).style.display	= "none";
		}

	}

	if ( lectureZoneVal == 0 ) {
		document.getElementById("first_1").style.display	= "";
		document.getElementById("second_1").style.display	= "";
		lectureZoneVal = lectureZoneVal + 1;
	}

	lectureZoneOrgVal = lectureZoneVal;
	lectureZoneVal = lectureZoneVal + 1;
	
	autocontrolvarInfoLecture = setTimeout("lectureImgZone()",5000);
}
