//¸ÞÀÎ ÆË¾÷
function all_banner_clear()
{
	var banner_id = "";
	for( var i=1; i<= banner_count; i++){
		banner_id = 'all_banner_'+ i;
		document.all[banner_id].style.visibility='hidden';
	}
	clearTimeout(timeout_id);
}
function all_banner_change(){
	
	var next_banner = cur_banner+1;
	var banner_id = "";
	if( next_banner > banner_count ){
		next_banner = 1;
	}
	banner_id = 'all_banner_'+ cur_banner;
	document.all[banner_id].style.visibility='hidden';
	banner_id = 'all_banner_'+ next_banner;
	document.all[banner_id].style.visibility='visible';
	
	cur_banner = next_banner;
	timeout_id = window.setTimeout("all_banner_change()",4000);
}
function all_banner_open()
{
		if (screen.width==800) {
			var w_left = 0;
			var w_top = 125
		} else {
			var w_left = (screen.width)?(screen.width-1000)/2:100; //leftÀ§Ä¡¼³Á¤
			var w_top = 125
		}
		var banner_id = "";
		for(var i = 1; i<= banner_count; i++ ){
			banner_id = 'all_banner_' + i;
			if (i==2){
				w_left = w_left + 400;
			}else if(i==3){
				w_left = (screen.width)?(screen.width-1000)/2:100;
				w_top = 300;
			}else if(i==4){
				w_left = w_left + 400;
				w_top = 300;
			}
			document.all[banner_id].style.left=w_left;
			document.all[banner_id].style.top=w_top;

			if (getCookie("all_banner_img"+i) == null) {
				document.all[banner_id].style.visibility='visible';

		//		timeout_id = window.setTimeout("all_banner_change()",4000);
			} else {
				document.all[banner_id].style.visibility='hidden';
			}
		
		}

}
//////////////////////////////////////////////////////////////

function all_banner_cookie(cook_num)
{	
	cookieid = 'all_banner_img' + cook_num;
	cookiecheck = 'cookie_check' + cook_num;
	banner_id = 'all_banner_'+ cook_num;
		
	if (document.all['cookie_check'+cook_num].checked == true) {
		setCookie(cookieid, "true", cook_num);
	}
	document.all[banner_id].style.visibility = "hidden";
	clearTimeout(timeout_id);
	
}


function getCookie(Name)
{ 
	var search = Name + "=" 
	if (document.cookie.length > 0) { 
		offset = document.cookie.indexOf(search) 
		if (offset != -1) { 
			offset += search.length 
			end = document.cookie.indexOf(";", offset) 
			if (end == -1) 
			end = document.cookie.length 
			return unescape(document.cookie.substring(offset, end)) 
		} 
	} 
} 

function setCookie(name, value, expiredays)
{
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

