//document.body.style.overflow='hidden';

var cate_00000000_code = new Array(); // ÁÂÃø ¸Þ´ºÀÇ Ä«Å×°í¸® ¸ñ·Ï
var board_list_code = new Array(); // ÁÂÃø ¸Þ´ºÀÇ °Ô½ÃÆÇ ¸ñ·Ï
var move_script_str  // °áÁ¦¼±ÅÃ ÆäÀÌÁö¿¡¼­ ¹è¼Û·á Á¾·ù

// Àå¹Ù±¸´Ï, °áÁ¦¼±ÅÃÆäÀÌÁö, ÁÖ¹®¼­ È®ÀÎ¿¡¼­ »ç¿ë
var add_price_arr = new Array(); // ±Ý¾× Ãß°¡ ¿É¼ÇÀ» À§ÇØ »ý¼º
var option_arr = new Array(); // ´ÙÁß ÀÏ¹Ý ¼±ÅÃ ¿É¼ÇÀ» À§ÇØ »ý¼º
var option_img_arr = new Array(); // ´ÙÁß ÀÌ¹ÌÁö ¼±ÅÃ ¿É¼ÇÀ» À§ÇØ »ý¼º
var option_user_arr = new Array(); // Á÷Á¢ ÀÔ·ÂÇü ¿É¼ÇÀ» À§ÇØ »ý¼º
var coupon_price_arr = new Array(); // Ãß°¡ ÇÒÀÎ ÇýÅÃÀ» ¼±ÅÃ½Ã¿¡ »ç¿ë

// ÃÖ±Ù °Ô½Ã¹° º¯¼ö
var script_new_list = new Array();

function getFlash(src, width, height)
{
	if(!src || !width || !height)
	{
		return null;
	}
	var classid  = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000";
	var codebase = "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0";
	var wmode    = "transparent";
	var quality  = "high";
	var plugin   = "http://www.macromedia.com/go/getflashplayer";
	var type     = "application/x-shockwave-flash";
	var allowScriptAccess     = "always";
	var html = "<object classid='" + classid + "' "
			 + "codebase='" + codebase + "' "
			 + "width='" + width + "' height='" + height + "'>"
			 + "<param name='wmode' value='" + wmode + "'>"
			 + "<param name='movie' value='" + src + "'>"
			 + "<param name='quality' value='" + quality + "'>"
			 + "<param name='allowScriptAccess' value='" + quality + "'>"
			 + "<embed src='" + src + "' "
			 + "quality='" + quality + "' pluginspage='" + plugin + "' type='" + type + "' "
			 + "width='" + width + "' height='" + height + "'></embed></object>";
	getObject(html);
}

function flash(swf, width, height, bgcolor, id, flashvars, xml_path){
    var strFlashTag = new String();
    if(!id){
		var tmp_num = Math.random()*10000;
		tmp_num = Math.round(tmp_num);
		id = "flash_name"+tmp_num;
	}

    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
        strFlashTag += 'id="' + id + '" width="' + width + '" height="' + height + '">';
        strFlashTag += '<param name="movie" value="' + swf + '"/>';
        
        if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
        strFlashTag += '<param name="quality" value="high"/>';
		if(bgcolor != null) {strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>'};
        strFlashTag += '<param name="menu" value="false"/>';
        strFlashTag += '<param name="salign" value="LT"/>';
        // strFlashTag += '<param name="scale" value="noscale"/>';
        strFlashTag += '<param name="wmode" value="transparent"/>';
        strFlashTag += '<param name="allowScriptAccess" value="always"/>';
		if(xml_path != null) {strFlashTag += '<param name="xml_path" value="'+xml_path+'"/>'};
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed src="' + swf + '" ';
        strFlashTag += 'quality="high" ';
        if(bgcolor != null) {strFlashTag += 'bgcolor="' + bgcolor + '" '};
        strFlashTag += 'width="' + width + '" ';
        strFlashTag += 'height="' + height + '" ';
		if(xml_path != null) {strFlashTag += 'xml_path="' + xml_path + '" '};
        strFlashTag += 'menu="false" ';
        // strFlashTag += 'scale="noscale" ';
        strFlashTag += 'id="' + id + '" ';
        strFlashTag += 'salign="LT" ';
        strFlashTag += 'wmode="transparent" ';
        strFlashTag += 'allowScriptAccess="always" ';
        if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
        strFlashTag += 'type="application/x-shockwave-flash" ';
        strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        strFlashTag += '</embed>';
    }

 document.write(strFlashTag);
}

function FlashObject(swf, width, height, bgcolor, id, flashvars,xml_path)
{
    var strFlashTag = new String();
    
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
        strFlashTag += 'id="' + id + '" width="' + width + '" height="' + height + '">';
        strFlashTag += '<param name="movie" value="' + swf + '"/>';
        
        if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
        strFlashTag += '<param name="quality" value="high"/>';
        strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
        strFlashTag += '<param name="menu" value="false"/>';
        strFlashTag += '<param name="salign" value="LT"/>';
        // strFlashTag += '<param name="scale" value="noscale"/>';
        // strFlashTag += '<param name="wmode" value="transparent"/>';
        strFlashTag += '<param name="allowScriptAccess" value="always"/>';
		if(xml_path != null) {strFlashTag += '<param name="xml_path" value="' + xml_path + '"/>'};
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed src="' + swf + '" ';
        strFlashTag += 'quality="high" ';
        strFlashTag += 'bgcolor="' + bgcolor + '" ';
        strFlashTag += 'width="' + width + '" ';
        strFlashTag += 'height="' + height + '" ';
		if(xml_path != null) {strFlashTag += 'xml_path="' + xml_path + '" '};
        strFlashTag += 'menu="false" ';
        // strFlashTag += 'scale="noscale" ';
        strFlashTag += 'id="' + id + '" ';
        strFlashTag += 'salign="LT" ';
       //  strFlashTag += 'wmode="transparent" ';
        strFlashTag += 'allowScriptAccess="always" ';
        if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
        strFlashTag += 'type="application/x-shockwave-flash" ';
        strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        strFlashTag += '</embed>';
    }

 document.write(strFlashTag);
}

function comma(str){	
	var tmp_i=0;
	var i=0;
	var tt_p='';
	str = str+'';

	for(i=(str.length)-1,tmp_i=0;i>=0;i--,tmp_i++){
		if(tmp_i % 3 == 0 && tmp_i > 0){
			tt_p = str.charAt(i) + "," + tt_p;			
		}else{
			tt_p = str.charAt(i) + tt_p;
		}			
	}

	tt_p = tt_p.replace("-,","-");
	return tt_p;
}



function ok_frame_chk(){
	if(ok_frame){
		document.all.ok_frame.style.height=100;
		document.all.ok_frame.style.width=600;
	}
}

function goods_img_detail(goods_idx){
	if(!goods_idx) goods_idx = '';
	var w = 900;
	var h = 760;
	var window_left = (screen.width-w)/2;
	var window_top = (screen.height-h)/2;	
	var add_data_win = window.open('../shop_goods/goods_img_detail.htm?goods_idx='+goods_idx,'add_data_win','top='+window_top+',left='+window_left+',width='+w+',height='+h+',toolbar=no,scrollbars=yes,resizable=yes,status=yes,menubar=no,location=no');
	add_data_win.focus();
}

function goods_cart_reg(goods_idx){
	ok_frame.location.href="../shop_goods/goods_exec.php?mode=cart_add_one&goods_idx="+goods_idx
}

function goods_direct_buy(goods_idx){
	ok_frame.location.href="../shop_goods/goods_exec.php?mode=direct_one&goods_idx="+goods_idx
}

function goods_direct_jjim(goods_idx){
	ok_frame.location.href="../shop_popup/wish_reg_exec.php?mode=main_one&goods_idx="+goods_idx
}


function num_chk(tar){
	var str = tar.value;
	for(i=0;i<str.length;i++){
		if ((tar.value.charAt(i) >= 0 && tar.value.charAt(i) <= 9) || tar.value.charAt(i) == '.' || tar.value.charAt(i) == '-'){
		}else{
			alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä");
			tar.focus();
			return false;
		}
	}
	return true;
}

function search_zip(){
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;

	var postcodefind = window.open('../shop_popup/zipcode.htm',"postcodefind",'resizable=yes,toolbar=no,width=430,height=500,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
	postcodefind.focus();
}

function memo_read(idx){
	if(!idx) idx = '';
	var w = 570;
	var h = 380;
	var window_left = (screen.width-w)/2;
	var window_top = (screen.height-h)/2;	
	var memo_read = window.open('../shop_mypage/s_paper_read.htm?idx='+idx,'memo_read','top='+window_top+',left='+window_left+',width='+w+',height='+h+',toolbar=no,scrollbars=yes,resizable=yes,status=yes,menubar=no,location=no');
	memo_read.focus();
}

function pwd_ch(){
	var w = 440;
	var h = 360;
	var window_left = (screen.width-w)/2;
	var window_top = (screen.height-h)/2;	
	var pwd_ch_win = window.open('../shop_mypage/pwd_ch_form.htm','pwd_ch_win','top='+window_top+',left='+window_left+',width='+w+',height='+h+',toolbar=no,scrollbars=no,resizable=no,status=yes,menubar=no,location=no');
	pwd_ch_win.focus();
}

// »óÇ° °Ë»ö
function top_goods_search_chk(){
	var form = document.top_goods_search_form;
	/*
	if(!form.search_keyword.value){
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.');
		form.search_keyword.focus();
		return;
	}
	*/
	form.method = 'get'
	form.target=''
	form.action = '../shop_goods/goods_search_list.htm';
	form.submit();
}

//ÀÌ¸ÞÀÏ ¹«´Ü ¼öÁý °ÅºÎ
function no_email(){
	var w = 438;
	var h = 360;
	var window_left = (screen.width-w)/2;
	var window_top = (screen.height-h)/2;	
	var no_email_win = window.open('../shop_popup/no_email.htm','no_email_win','top='+window_top+',left='+window_left+',width='+w+',height='+h+',toolbar=no,scrollbars=no,resizable=no,status=yes,menubar=no,location=no');
	no_email_win.focus();
}

// ÁÂÃø ·Î±×ÀÎ ¹Ú½º
function loginbox(form){
	if(!form.id.value){
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		form.id.focus();
		return false;
	}
	if(!form.pwd.value){
		alert("ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		form.pwd.focus();
		return false;
	}
	return true;
}

// SSL º¸¾È ·Î±×ÀÎ ¹Ú½º
function ssl_loginbox(form){
	if(!form.id.value){
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		form.id.focus();
		return false;
	}
	if(!form.pwd.value){
		alert("ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		form.pwd.focus();
		return false;
	}
	
	var ssl_chk = 0;

	
	if(form.ssl_yn.type == 'checkbox'){
		if(form.ssl_yn.checked == true && form.ssl_yn.value == 1){
			ssl_chk = 1;
		}
	}else if(form.ssl_yn.type == 'hidden'){
		if(form.ssl_yn.value == 1){
			ssl_chk = 1;
		}

	}else if(form.ssl_yn[0].type == 'radio'){
		if(form.ssl_yn[0].checked == true && form.ssl_yn[0].value == 1){		
			ssl_chk = 1;
		}else if(form.ssl_yn[1].checked == true && form.ssl_yn[1].value == 1){
			ssl_chk = 1;
		}
	}

	var action_url;
	if(ssl_chk==1){
		action_url = "https://"+ssl_host+"/mem_login_chk.php";
	}else{
		action_url = "/shop_login/login_ok.php";
	}

	form.action = action_url;
	form.this_domain.value = document.domain;
	form.target='ok_frame';

	return true;
}

// SSL º¸¾È »çÀÌÆ® ·Î±×ÀÎ ¹Ú½º
function ssl_shop_loginbox(form){
	if(!form.id.value){
		alert("»çÀÌÆ® ID¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		form.id.focus();
		return false;
	}
	if(!form.bu_id.value){
		alert("°ü¸®ÀÚ ID¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		form.bu_id.focus();
		return false;
	}
	if(!form.pwd.value){
		alert("ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		form.pwd.focus();
		return false;
	}
	
	var ssl_chk = 0;

	
	if(form.ssl_yn.type == 'checkbox'){
		if(form.ssl_yn.checked == true && form.ssl_yn.value == 1){
			ssl_chk = 1;
		}
	}else if(form.ssl_yn.type == 'hidden'){
		if(form.ssl_yn.value == 1){
			ssl_chk = 1;
		}
	}else if(form.ssl_yn[0].type == 'radio'){
		if(form.ssl_yn[0].checked == true && form.ssl_yn[0].value == 1){		
			ssl_chk = 1;
		}else if(form.ssl_yn[1].checked == true && form.ssl_yn[1].value == 1){
			ssl_chk = 1;
		}
	}

	var action_url;
	if(ssl_chk==1){
		action_url = "https://"+ssl_host+"/shop_login_chk.php";
	}else{
		action_url = "/admin/sub_login/login_ok.php";
	}

	form.action = action_url;
	form.this_domain.value = document.domain;
	form.target='ok_frame';

	return true;
}

//ºñ¹Ð¹øÈ£ Ã£±â
function pwd_search(){
	var w = 400;
	var h = 360;
	var window_left = (screen.width-w)/2;
	var window_top = (screen.height-h)/2;	
	var pwd_search_win = window.open('../shop_popup/pwd_search_form.htm','pwd_search_win','top='+window_top+',left='+window_left+',width='+w+',height='+h+',toolbar=no,scrollbars=no,resizable=no,status=yes,menubar=no,location=no');
	pwd_search_win.focus();
}

// ¹è°æÀ½¾Ç ¼³Á¤
var dragapproved=false
function drag_dropie() {		
	if (dragapproved==true){		
		var mov = tempx+event.clientX-iex			
		if (mov > 0  && mov < 48) { 
			//alert(mov + "½ÇÇà");
			document.all.showimage.style.pixelLeft=tempx+event.clientX-iex			
			var loudness =  mov - 50;
			if (loudness > 0 ) {
				top.bgm_frame.Player.Volume =  0 
			} else if (0 > loudness ) {
				top.bgm_frame.Player.Volume = loudness*55 
			}
			
		}
		return false
	}
}
function initializedragie() {
	iex=event.clientX
	iey=event.clientY
	tempx=showimage.style.pixelLeft
	tempy=showimage.style.pixelTop
	dragapproved=true 
	document.onmousemove=drag_dropie
	if (document.all) {
		document.onmouseup=new Function('dragapproved=false') 
	}
}

function bgm_time(){
	if(top.bgm_frame!=null){
		if (top.bgm_frame.load_ck!=null) {
			top.bgm_frame.load_ck.value="1";
			top.bgm_frame.load_ck2.value="0";
			top.bgm_frame.entryInfo();
		}
	}
}

function play() {
	if(top.bgm_frame.document.getElementById('Player_false').value == 1){
		if(top.bgm_frame.document.getElementById('Player2') != null){
			top.bgm_frame.document.getElementById('Player2').play();
			top.bgm_frame.load_ck.value="1";
			top.bgm_frame.load_ck2.value="0";
			if(top.frames[0].document.getElementById('song_nm')) top.frames[0].song_nm.innerHTML = "Àç»ý";
		}
		
	}else{
		top.bgm_frame.location.href="../shop_main/bgm_frame.htm?play_bt=1";
		if(top.frames[0].document.getElementById('song_nm')) top.frames[0].song_nm.innerHTML = "&nbsp;&nbsp;&nbsp;Buffering...";
		setTimeout("bgm_time()",1000);
	}
}

function stop() {
	if(top.bgm_frame.document.getElementById('Player_false').value == 1){
		if(top.bgm_frame.document.getElementById('Player2') != null){
			top.bgm_frame.document.getElementById('Player2').Stop();
			top.bgm_frame.load_ck.value="0";
			top.bgm_frame.load_ck2.value="0";
			if(top.frames[0].document.getElementById('song_nm')) top.frames[0].song_nm.innerHTML = "&nbsp;&nbsp;&nbsp;Á¤Áö";
		}
	}else{
		if(top.bgm_frame.document.getElementById('Player') != null){
			top.bgm_frame.document.getElementById('Player').Stop();
			top.bgm_frame.load_ck.value="0";
			top.bgm_frame.load_ck2.value="0";
			if(top.frames[0].document.getElementById('song_nm')) top.frames[0].song_nm.innerHTML = "&nbsp;&nbsp;&nbsp;Á¤Áö";
		}
	}
}

function bgm_list() {
	var bgm_list_win =  window.open('../shop_popup/bgm_list.htm','bgm_list_win','height=300,width=310,scrollbars=no,resizable=no');
	bgm_list_win.focus();
}

function sms_call(w,h){
	var window_left = (screen.width-w)/2;
	var window_top = (screen.height-h)/2;	
	var sms_call_win = window.open('../shop_contents/sms_call_form.htm','sms_call_win','top='+window_top+',left='+window_left+',width='+w+',height='+h+',toolbar=no,scrollbars=yes,resizable=yes,status=yes,menubar=no,location=no');
	sms_call_win.focus();
}

function popup_window(url,w,h,top,left){

	if(!w) w = 0;
	if(!h) h = 0;
	var window_left = ((screen.width-w)/2)-100;
	var window_top = ((screen.height-h)/2)-100;	

	if(left) window_left = left;
	if(top) window_top = top;

	if(window_left <=0 )window_left = 0;
	if(window_top <=0 )window_top = 0;

	var popup_window_win = window.open(url,'','top='+window_top+',left='+window_left+',width='+w+',height='+h+',toolbar=no,scrollbars=yes,resizable=yes,status=yes,menubar=no,location=no');
	popup_window_win.focus();
}

function img_view(url){	
	var img_view = window.open('/bbs_shop/inc/viewimage.htm?url='+url,'','top=0,left=0,width=100,height=100,scrollbars=yes,resizable=yes');
	img_view.focus();
}

function mgGetFileExt( szValue )
{
    var szExt = szValue.substr( szValue.length - 3, 3 ).toLowerCase();
	return szExt;
}

function Adminlogin_form_chk(){
form = document.Adminlogin_form;
	if(!form.id.value)
	{
		alert("»çÀÌÆ® ¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		form.id.focus();
		return false;
	}

	if(!form.bu_id.value)
	{
		alert("°ü¸®ÀÚ ¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		form.bu_id.focus();
		return false;
	}

	if(!form.pwd.value)
	{
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		form.pwd.focus();
		return false;
	}
}



function getCookieVal (offset) { 
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
} 

// ÄíÅ° °¡°Ü¿À±â
function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) { //while open 
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg) return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	} //while close return null;
	return '';
} 

// ÄíÅ° ÀúÀåÇÏ±â
function SetCookie (name, value) { 
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (2 < argc) ? argv[2] : null;
	var path = (3 < argc) ? argv[3] : null;
	var domain = (4 < argc) ? argv[4] : null;
	var secure = (5 < argc) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");
} 


// ¿À´Ã ÇÏ·ç ¾È¶ä ----> ½ÇÇà
function user_today_no(name,val){
	var ExpDate = new Date();
	ExpDate.setTime(ExpDate.getTime() + 1000*60*60*24); // 24½Ã°£µ¿¾È ÆË¾÷¾È¶ß°Ô...
	if(val==true){
		SetCookie(name, '1',ExpDate) ;
	}else{
		SetCookie(name, '0',ExpDate) ;
	}
}
// ·¹ÀÌ¾î ´Ý±â ÇÔ¼ö
function user_layer_close(sel_name){
	eval(sel_name+".style.display='none';")
	
}


function dis_on(tar){
	tar.disabled = true;
	tar.style.backgroundColor='dddddd';
}
function dis_off(tar){
	tar.disabled = false;
	tar.style.backgroundColor='ffffff';
}


// ±¸ÀÎ ±¸Á÷ ¸¶ÀÌÆäÀÌÁö
function mypage_job2(reg_type){
	ok_frame.location.href="/job2/mypage_chk.php?reg_type="+reg_type;
}

// ±¸ÀÎ ±¸Á÷ ±¤°í ½ÅÃ»
function biz_advertising(){
	ok_frame.location.href="/job2/biz_chk.php";
}


function shuffle(array) { 
    var len = array.length; 
    for(var i=len ; i>0 ; i--) { 
        array[len-1] = array.splice(Math.floor(Math.random() * i),1)[0]; 
    } 
	return array;
} 

function paper_form(susin_id,w,h){
	if(!w) w = 500;
	if(!h) h = 500;

	var window_left = (screen.width-w)/2;
	var window_top = (screen.height-h)/2;	
	var paper_form_win = window.open('/shop_mypage/s_paper_form.htm?susin_id='+susin_id,'paper_form_win','top='+window_top+',left='+window_left+',width='+w+',height='+h+',toolbar=no,scrollbars=yes,resizable=yes,status=yes,menubar=no,location=no');
	paper_form_win.focus();
}

function admin_login_form_chk(form){
	if(!form.id.value)
	{
		alert("»çÀÌÆ® ¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		form.id.focus();
		return false;
	}

	if(!form.bu_id.value)
	{
		alert("°ü¸®ÀÚ ¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		form.bu_id.focus();
		return false;
	}

	if(!form.pwd.value)
	{
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		form.pwd.focus();
		return false;
	}

	
	form.action='/admin/sub_login/login_ok.php';
	form.method='post';
	form.target='ok_frame';

	if(!document.all('back_login_form')){
		var str
		str = "<form name='back_login_form' action='' style='margin:0'>";
		str += "<input type='hidden' name='back_login' value=''>";
		str += "<input type='hidden' name='id' value=''>";
		str += "<input type='hidden' name='bu_id' value=''>";
		str += "<input type='hidden' name='pwd' value=''>";
		str += "<input type='hidden' name='referer' value=''>";
		str += "</form>";

		advertise_tmp.innerHTML = str;
	}

	return true;
}

function frame_resize(frame,chk,min_size){
	if(!min_size) min_size = 0;
	try{
		if(!chk)chk=0
		if(chk>0){
			var h = parent.document.frames(frame).document.body.scrollHeight;
			if(min_size > h) h = min_size;
			var obj = parent.document.getElementById(frame);
			obj.style.height = h;
		}
		if(chk==0){
			frame_resize(frame,(chk+1),min_size);
		}else if(chk<5){
			setTimeout("frame_resize('"+frame+"',"+(chk+1)+","+min_size+")",400);
		}
	}catch(e){
	}
}


function auto_admin_login(shop_id){
	var w = 950;
	var h = 700;
	var window_left = (screen.width-w)/2;
	var window_top = (screen.height-h)/2;	
	var auto_admin_login_win = window.open('/admin/sub_login/auto_login.php?id='+shop_id,'auto_admin_login_win','top='+window_top+',left='+window_left+',width='+w+',height='+h+',toolbar=no,scrollbars=yes,resizable=yes,status=yes,menubar=no,location=no');
	auto_admin_login_win.focus();
}


function admin_login_pop(){
	var w = (screen.width);
	var h = (screen.height);	
	var window_left = 0;
	var window_top = 0;	
	var admin_login_pop_win = window.open('/admin/sub_login/logout.php','admin_login_pop_win','top='+window_top+',left='+window_left+',width='+w+',height='+h+',toolbar=no,scrollbars=yes,resizable=yes,fullscreen=no,status=yes,menubar=no,location=no');
	admin_login_pop_win.focus();
}


function shop_link(shop_id,go_url){
	if(!go_url) go_url = '';
	if(go_url){
		//go_url = unescape(go_url);
		go_url = escape(go_url);
		//go_url = encodeURIComponent(go_url);
		
	}

	window.open("/shop_admin/shop_link.php?shop_id="+shop_id+"&go_url="+go_url);
}


function shop_coupon_view(coupon_idx){
	if(!coupon_idx) coupon_idx = '';
	var w = 600;
	var h = 600;
	var window_left = 50;
	var window_top = 50;	
	var coupon_view_win = window.open('/recom_site/coupon_view.htm?coupon_idx='+coupon_idx,'','top='+window_top+',left='+window_left+',width='+w+',height='+h+',toolbar=no,scrollbars=yes,resizable=yes,status=yes,menubar=no,location=no');
	coupon_view_win.focus();
}


function strpos(str, ch) {
   for (var i = 0; i < str.length; i++)
      if (str.substring(i, i+(ch.length)) == ch) return i;
   return -1;
}


function admin_seller_pop(){
	var w = 950;
	var h = 700;	
	var window_left = 0;
	var window_top = 0;	
	var admin_seller_pop_win = window.open('/admin_seller/','admin_seller_pop_win','top='+window_top+',left='+window_left+',width='+w+',height='+h+',toolbar=no,scrollbars=yes,resizable=yes,fullscreen=no,status=yes,menubar=no,location=no');
	admin_seller_pop_win.focus();
}

function mini_shop_go(seller_id,my_type){
	location.href="/openmarket/shop_main.htm?seller_mem_id="+seller_id+"&my_type="+my_type;
}

// ¼¿·ºÆ® ¹Ú½º ÀÚµ¿ ¼±ÅÃÇÏ°Ô ÇÏ±â
function auto_select(input_name,val){
	var obj = document.getElementById(input_name);

	if(!obj) return;

	// <option>ÀÌ ÇÑ°³¸¸ ´Þ¶û ÀÖ´Â °æ¿ì
	if(!obj.length) return;
	
	for(var i=0;i<obj.length;i++){
		if(obj[i].value == val){
			obj[i].selected = true;
			break;
		}
	}
}

function auto_select2(obj,val){
	// <option>ÀÌ ÇÑ°³¸¸ ´Þ¶û ÀÖ´Â °æ¿ì
	if(!obj.length) return;
	
	for(var i=0;i<obj.length;i++){
		if(obj[i].value == val){
			obj[i].selected = true;
			break;
		}
	}
}

function shop_view(shop_id){
	if(!shop_id){
		alert('ÁØºñÁß ÀÔ´Ï´Ù.');
	}else{
		window.open("/shop_admin/shop_link.php?shop_id="+shop_id);
	}
}

// ----------------- Å¸ÀÓ½ºÅÛÇÃ¸¦ ³¯Â¥ÇüÀ¸·Î º¯È¯ --------------------------- 
function timeToHuman( time_num ){

	time_num += (3600*9); // ÀÌ°Ô ÀÖ¾î¾ß ¸Â¾Æ ¶³¾îÁü ¤Ñ¤Ñ;

	var theDate = new Date(time_num * 1000);
	dateString = theDate.toGMTString();
	
	arrDateStr = dateString.split(" ");
	var tmp_m = getMonthNum(arrDateStr[2])*1;
	var tmp_d = arrDateStr[1]*1;
	var tmp_y  = arrDateStr[3];
	var tmp_h = arrDateStr[4].substr(0,2)*1;
	var tmp_i = arrDateStr[4].substr(3,2)*1;
	var tmp_s = arrDateStr[4].substr(6,2)*1;

	if(tmp_m<10)tmp_m = '0'+tmp_m;
	if(tmp_d<10)tmp_d = '0'+tmp_d;
	if(tmp_h<10)tmp_h = '0'+tmp_h;
	if(tmp_i<10)tmp_i = '0'+tmp_i;
	if(tmp_s<10)tmp_s = '0'+tmp_s;

	return tmp_y+"-"+tmp_m+"-"+tmp_d+" "+tmp_h+":"+tmp_i+":"+tmp_s;
}

function getMonthNum(abbMonth){
	var arrMon = new Array("Jan","Feb","Mar","Apr","May","Jun", "Jul","Aug","Sep","Oct","Nov","Dec");

	for(i=0; i<arrMon.length; i++){
		if(abbMonth == arrMon[i]){
			return i+1;
		}
	}
}




var httpReq_etc = null;
var httpReq_etc2 = null;

function getInstance_etc(){
	var httpReq_etc = null;

	try{
		httpReq_etc = new ActiveXObject("Msxml2.XMLHTTP");	
	} catch(Ex) {
		try{
			httpReq_etc = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (Ex2) {
			httpReq_etc = null;
		}
	}
	return httpReq_etc;	
}


var naver_map_key = '';
var naver_map_w = 300;
var naver_map_h = 300;
var naver_map_x = 0;
var naver_map_y = 0;

function naver_map(addr,w,h){

	document.write("<div id='mapContainer' style='width:300px;height:300px'></div>");
	
	httpReq_etc = getInstance_etc();

	//addr = escape(addr);
	
	var url = "/sys_load/naver_map_xy_load.php?addr="+addr;
	naver_map_w = w;
	naver_map_h = h;

	httpReq_etc.onreadystatechange = naver_map_result;	
	httpReq_etc.open("GET", url, true);
	httpReq_etc.send();	
}


function naver_map_result(){
	

	if (httpReq_etc.readyState==4) {
		
		var xy_arr = httpReq_etc.responseText.split(" ");
		naver_map_key = xy_arr[0];
		naver_map_x = xy_arr[1];
		naver_map_y = xy_arr[2];
		
		if(!naver_map_key || !naver_map_x || !naver_map_x){
			alert("³×ÀÌ¹ö Áöµµ °Ë»ö ½ÇÆÐ");
			//alert(httpReq_etc.responseText);
			return;
		}
		//alert(naver_map_x + ' // ' + naver_map_y);
		//return;
		naver_map_js.src = "http://map.naver.com/js/naverMap.naver?key="+naver_map_key;
		naver_map_output();
		
	}
}



function naver_map_output(chk_i){

	if(chk_i > 100) return; // ¹«ÇÑ ¹Ýº¹ ¹æÁö
	
	if(window.NMap) { 
		//alert('js load ¼º°ø');
	}else{
		//alert('js load ½ÇÆÐ');
		setTimeout("naver_map_output()",100);
		return;
	}	

	var opts = {width:naver_map_w, height:naver_map_h, mapMode:0};
	var mapObj = new NMap(document.getElementById("mapContainer"),opts);

	mapObj.setCenterAndZoom(new NPoint(naver_map_x,naver_map_y),3);

	var zoom = new NZoomControl();

	zoom.setAlign('right');
	zoom.setValign('top');
	mapObj.addControl(zoom);


	var mapBtns = new NMapBtns();
	mapBtns.setAlign('right');
	mapBtns.setValign('top');
	mapObj.addControl(mapBtns);

	var infowin = new NInfoWindow();
	mapObj.addOverlay(infowin);

	mapObj.addOverlay(createMarker(new NPoint(naver_map_x,naver_map_y), 1, ""));

	return;
}

function createMarker(pos, count, subject) {
	
	var iconUrl = '/img/pin1.png';
	var marker = new NMark(pos, new NIcon(iconUrl, new NSize(23, 30)));

	NEvent.addListener(marker, "mouseover", function(pos) {
			infowin.set(pos, '<div style="width:100px; height:50px; background-color:#ffffff; border:solid 1px #999999;">dddd</div>');
			infowin.showWindow();
			
	});

	NEvent.addListener(marker, "mouseout", function() {
			infowin.hideWindow();
	});

	return marker;
}


function checkSpace( str ){ // °ø¹éÀÌ ÀÖ´Ù¸é 1À» ¹ÝÈ¯ÇÑ´Ù.
     if(str.search(/\s/) != -1){
     	return 1;
     }else {
         return "";
     }
}


function email_chk( str ){

     if(str == ""){
     	alert("ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
     	return false;
     }
     var retVal = checkSpace( str );
     if( retVal != "") {
         alert("ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦ ºó°ø°£ ¾øÀÌ ³ÖÀ¸¼¼¿ä.");
         return false;
     }

     var isEmail = /[-!#$%&'*+\/^_~{}|0-9a-zA-Z]+(\.[-!#$%&'*+\/^_~{}|0-9a-zA-Z]+)*@[-!#$%&'*+\/^_~{}|0-9a-zA-Z]+(\.[-!#$%&'*+\/^_~{}|0-9a-zA-Z]+)*/;
     if( !isEmail.test(str) ) {
         alert("ÀÌ¸ÞÀÏ Çü½ÄÀÌ Àß¸ø µÇ¾ú½À´Ï´Ù.");
         return false;
     }
     if( str.length > 60 ) {
         alert("ÀÌ¸ÞÀÏ ÁÖ¼Ò´Â 60ÀÚ±îÁö À¯È¿ÇÕ´Ï´Ù.");
         return false;
     }
	/*
	 if( str.lastIndexOf("daum.net") >= 0 || str.lastIndexOf("hanmail.net") >= 0 ) {
 		 alert("´ÙÀ½ ¸ÞÀÏ °èÁ¤Àº »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
		 document.mem_reg_form.email.focus();  
		 return 0;
	 }
	*/

     return true;
}


function more_hms(chk_time){
	
	var end_time_h,end_time_m,end_time_s

	var ori_chk_time = chk_time;

	end_time_h = Math.floor(chk_time/3600)*1;

	chk_time -= (end_time_h*3600);
	end_time_m = Math.floor(chk_time/60)*1;

	chk_time -= (end_time_m*60);
	end_time_s = chk_time*1;

	if(end_time_h < 0 || end_time_m < 0 || end_time_s < 0) {
		end_time_h = 0;
		end_time_m = 0;
		end_time_s = 0;
	}

	if(end_time_h < 10 ) end_time_h = '0'+end_time_h;
	else if(end_time_h > 99 ) end_time_h =99;
	
	if(end_time_m < 10 ) end_time_m = '0'+end_time_m;
	if(end_time_s < 10 ) end_time_s = '0'+end_time_s;
	
	var more_time_str = end_time_h+":"+end_time_m+":"+end_time_s;
	
	if(ori_chk_time<=15){
		more_time_str = "<font color=red>"+more_time_str+"</font>";
	}
	return more_time_str;

}

function web_resize_iframe(f_name){
	if (parent && parent != this && parent.ok_resize_iframe != null){
		setTimeout('parent.ok_resize_iframe(\''+f_name+'\')',300);
		setTimeout('parent.ok_resize_iframe(\''+f_name+'\')',1000);
		setTimeout('parent.ok_resize_iframe(\''+f_name+'\')',2000);
	}
}

function ok_resize_iframe(f_name){
	
	try
	{
		var oBody   = document.frames(f_name).document.body;
		var oIFrame = document.getElementById(f_name);
		//var frmWidth  = oBody.scrollWidth;
		var frmHeight = oBody.scrollHeight;	

		oIFrame.style.height = frmHeight;
		//oIFrame.style.width = frmWidth;
		
	}
	catch (e)
	{
		window.status = "IFrame Resize Error";
	}
	
	
}


// GET º¯¼ö °¡Á®¿À±â...
function get_load(){
	var tmp=window.location;
	tmp=String(tmp).split('?');
	tmp=tmp[1].split('&');

	var GET_ARR = new Array();
	for(k in tmp) {
		tmp2=tmp[k].split('=');
		
		
		GET_ARR[tmp2[0]] = tmp2[1];

		//document.write(tmp2[0]+' '+tmp2[1]+'<br>');
	}
	
	return GET_ARR;

}