var protoDomain = (("https:" == document.location.protocol) ? "https://2009.bomul.com" : "http://2009.bomul.com");
/*
gnbMenu
gnbMenu([swf°æ·Î], [swf³ÐÀÌ], [swf³ôÀÌ], [ÆÄ¶ó¹ÌÅÍ]);
ÆÄ¶ó¹ÌÅÍ¿¡´Â theCode1 °ú theCode2 ¸¦ ÀÔ·ÂÇÑ´Ù.
theCode1 Àº ´ë¸Þ´ºÀÇ ¼ø¼­
theCode2 ´Â ¼Ò¸Þ´ºÀÇ ¼ø¼­

¿¹¸¦ µé¾î ´Ù¿î·Îµå >> ¸ÖÆ¼¹Ìµð¾î ÆäÀÌÁöÀÏ °æ¿ì
gnbMenu('http://coding.bomul.com/images/common/gnb.swf', '960', '75', 'theCode1=1&theCode2=2');
*/
function gnbMenu(swf, width, height, flashvars)
{

    var strFlashTag = new String();
	strFlashTag += '<iframe name="flashPop" src="" width="0" height="0" frameborder="0" scrolling="no"></iframe>';
	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 += '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="wmode" value="transparent"/>';
        strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed src="' + swf + '" ';
        strFlashTag += 'quality="high" ';
        strFlashTag += 'width="' + width + '" ';
        strFlashTag += 'height="' + height + '" ';
		if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
        strFlashTag += 'wmode="transparent" ';
        strFlashTag += 'allowScriptAccess="sameDomain" ';
        strFlashTag += 'type="application/x-shockwave-flash" ';
        strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        strFlashTag += '</embed>';
    }
 document.write(strFlashTag);
}

function flash(swf, width, height, flashvars)
{

    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 += '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="wmode" value="transparent"/>';
        strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed src="' + swf + '" ';
        strFlashTag += 'quality="high" ';
        strFlashTag += 'width="' + width + '" ';
        strFlashTag += 'height="' + height + '" ';
		if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
        strFlashTag += 'wmode="transparent" ';
        strFlashTag += 'allowScriptAccess="sameDomain" ';
        strFlashTag += 'type="application/x-shockwave-flash" ';
        strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        strFlashTag += '</embed>';
    }
 document.write(strFlashTag);
}

function setCookie( name, value, expiredays )			// ÄíÅ° »ý¼ºÇÏ±â
{
    var todayDate = new Date();
    todayDate.setDate( todayDate.getDate() + expiredays );
    document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function getCookie( name )									// ÄíÅ° °¡Á®¿À±â
{
        var nameOfCookie = name + "=";
        var x = 0;
        while ( x <= document.cookie.length )
        {
                var y = (x+nameOfCookie.length);
                if ( document.cookie.substring( x, y ) == nameOfCookie ) {
                        if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                                endOfCookie = document.cookie.length;
                        return unescape( document.cookie.substring( y, endOfCookie ) );
                }
                x = document.cookie.indexOf( " ", x ) + 1;
                if ( x == 0 )
                        break;
        }
        return "";
}

function login_check(){											// ·Î±×ÀÎ Ã¼Å©
	if(getCookie("BOMULWEBID")) logCheck = 1;
	else logCheck = 0;
	return logCheck;
}
login_check();

// ·Î±×ÀÎ ¿©ºÎ¸¦ Ã¼Å©ÇÏ¿© ·Î±×ÀÎÀÌ ¾ÈµÇ¾î ÀÖÀ» °æ¿ì ¸®ÅÏurlÀ» °¡Áö°í ·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ÇÑ´Ù
function loginCheckReturn(){
	if(getCookie("BOMULWEBID")) return false;
	else document.location.href = '/member/login_form.html?return_url=' + encodeURIComponent(document.location);
}



function HTTP_VAR(){
	//ÇöÀç ÆäÀÌÁöÀÇ ¿ÏÀüÇÑ ÁÖ¼Ò¾ò±â
	// ¹®ÀÚ¿­·Î Ã³¸®ÇÏÁö ¾ÊÀ¸¸é splitÀ» ºÒ·¯ ¾µ ¼ö ¾ø´Ù.

	var fullUrl=new String(document.location);

	//? ´ÙÀ½¿¡ ¿À´Â º¯¼ö¿Í °ªÀ» Ã³¸®ÇÏ±â À§ÇÑ ¹è¿­º¯¼ö »ý¼º
	// ÇÔ¼ö ÀÚ½ÅÀÇ º¯¼ö¸¦ ½á¾ß Á¤Àûº¯¼öÈ­ ÇÒ ¼ö ÀÖ´Ù.
	HTTP_VAR.va=new Array();
	HTTP_VAR.val=new Array();

	//?°¡ URL¿¡ ÀÖÀ¸¸é Ã³¸® ¾øÀ¸¸é ÇÔ¼ö Á¾·á
	if(fullUrl.indexOf("?")>=0){

		// ?¸¦ ±âÁØÀ¸·Î ³ª´©±â
		var getvar=fullUrl.split("?");
		HTTP_VAR.self=getvar[0];

			// &°¡ ÀÖÀ¸¸é º¯¼öµé ºÐ¸®ÇÏ±â
			if(getvar[1].indexOf("&")>=0){
				var conj=getvar[1].split("&");
				var v=new Array();
				for (b in conj){
					v[b]=conj[b].split("=");

					// HTTP_VARº¯¼öÀÇ ¹è¿­ÀÇ ¼±ÅÃÀÇ ¿©Áö¸¦ ÁÖ±â À§ÇÏ¿©...
					HTTP_VAR.va[v[b][0]]=v[b][0];
					HTTP_VAR.val[v[b][1]]=v[b][1];
					HTTP_VAR.va[b]=v[b][0];
					HTTP_VAR.val[b]=v[b][1];
				}
			}else{
				//&¾øÀÌ º¯¼ö ÇÏ³ª¸¸ ¿ÔÀ»¶§
				var a=getvar[1].split("=");
				HTTP_VAR.va[0]=a[0];
				HTTP_VAR.val[0]=a[1];
				getvar=null;
				a=null;
			}
	}else{
		HTTP_VAR.self=document.location;
		return;
	}
}

// ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©
function checkRegiNum(str){
	str = str.replace("-");

	if(isNaN(str)){
		//alert("¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä!");
		return false;
	}

	if(str.length != 13){
		//alert("ÀÚ¸´¼ö°¡ Æ²¸³´Ï´Ù.");
		return false;
	}

	for(i=0,sum=0; i<12; i++) sum += (((i%8) + 2) * (str.charAt(i) - "0"));

	sum = 11 - (sum % 11);
	sum = sum % 10;

	if(sum == str.charAt(12)) return true;
    else if(sum != str.charAt(12)) return false;

}


// »ç¾÷ÀÚµî·Ï¹øÈ£ Ã¼Å©
function checkBizNum(str) {
	str = str.replace("-");

	if(isNaN(str)){
		//alert("¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä!");
		return false;
	}

	if(str.length != 10){
		//alert("ÀÚ¸´¼ö°¡ Æ²¸³´Ï´Ù.");
		return false;
	}

	sumMod= 0;
	sumMod+= parseInt(str.substring(0,1));
	sumMod+= parseInt(str.substring(1,2)) * 3 % 10;
	sumMod+= parseInt(str.substring(2,3)) * 7 % 10;
	sumMod+= parseInt(str.substring(3,4)) * 1 % 10;
	sumMod+= parseInt(str.substring(4,5)) * 3 % 10;
	sumMod+= parseInt(str.substring(5,6)) * 7 % 10;
	sumMod+= parseInt(str.substring(6,7)) * 1 % 10;
	sumMod+= parseInt(str.substring(7,8)) * 3 % 10;
	sumMod+= Math.floor(parseInt(str.substring(8,9)) * 5 / 10);
	sumMod+= parseInt(str.substring(8,9)) * 5 % 10;
	sumMod+= parseInt(str.substring(9,10));

	if(sumMod % 10 == 0) return true;
	else if(sumMod % 10 != 0) return false;

}

// ¹è³Ê Ä«¿îÆÃ
function bannerClick(sid, url, fid, target, cp, action){
//alert(win);
//alert(target);

	var bcFrame = document.getElementById("bannerCounter");
	bcFrame.src = protoDomain + "/_include/banner_count.html?sid="+sid+"&cp="+cp+"&action="+action;

	if(fid) url = protoDomain + "/view/"+fid;

	if(target == "Y"){
		window.open(url, "", "");
	}else{
		window.open(url, "_top", "");
/*
		if(win == "_parent"){
			parent.document.location.href = url;
		}else if(win == "_top"){
//			top.document.location.href = url;
			window.open(url, "_top", "");
		}else if(win == "_blank"){
			window.open(url, "", "")
		}else{
			document.location.href = url;
		}
*/
	}

}

/**
* iframe auto resizing (by Çàº¹ÇÑ°í´Ï)
* »ç¿ë¹ý : ¾ÆÀÌÇÁ·¹ÀÓ ¹Ù·Î¹Ø¿¡ ¾Æ·¡ ÄÚµå¸¦ ³Ö´Â´Ù.
*             <script>new resizeIF("¾ÆÀÌÇÁ·¹ÀÓ id°ª");</script>
*/
function resizeIF(Id)
{
        var obj = document.getElementById(Id);
        var Body;
        var H, Min;

        // ÃÖ¼Ò ³ôÀÌ ¼³Á¤ (³Ê¹« ÀÛ¾ÆÁö´Â °ÍÀ» ¹æÁö)
        Min = 100;

        // DOM °´Ã¼ ÇÒ´ç
        try
        {
                if (!document.all && obj.contentWindow.document.location.href == 'about:blank') {
                        setTimeout("resizeIF('"+Id+"')", 10);
                        return;
                }

                Body = obj.contentWindow.document.getElementsByTagName('BODY');
                Body = Body[0];

                if (this.Location != obj.contentWindow.document.location.href) {
                        H = Body.scrollHeight + 5;
                        obj.style.height = (H<Min?Min:H) + 'px';

                        this.Location = obj.contentWindow.document.location.href;
                }
        }
        catch(e)
        {
                setTimeout("resizeIF('"+Id+"')", 10);
                return;
        }

        setTimeout("resizeIF('"+Id+"')", 100);
}
resizeIF.prototype.Location = '';



/*
 * ÆË¾÷ ÀÚµ¿ ¸®»çÀÌÂ¡
 *  - À©µµ È¯°æ¿¡ µû¶ó »çÀÌÁî°¡ ´Ù¸¦ ¼ö ÀÖ½À´Ï´Ù.
 *  - ÆË¾÷ÆäÀÌÁöÀÇ ½ºÅ©¸³Æ® ÃÖÇÏ´Ü¿¡¼­ ½ÇÇàÇÏ½Ê½Ã¿À.
 *
 * (ex.) window.onload = function(){popupAutoResize();}
*/
function popupAutoResize() {
	window.resizeTo(100, 100);

    var thisX = parseInt(document.body.scrollWidth);
    var thisY = parseInt(document.body.scrollHeight);
    var maxThisX = screen.width - 50;
    var maxThisY = screen.height - 50;
    var marginY = 0;
    //alert(thisX + "===" + thisY);
    //alert("ÀÓ½Ã ºê¶ó¿ìÀú È®ÀÎ : " + navigator.userAgent);
    // ºê¶ó¿ìÀúº° ³ôÀÌ Á¶Àý. (Ç¥ÁØ Ã¢ ÇÏ¿¡¼­ Á¶ÀýÇØ ÁÖ½Ê½Ã¿À.)
    if (navigator.userAgent.indexOf("MSIE 6") > 0) marginY = 45;        // IE 6.x
    else if(navigator.userAgent.indexOf("MSIE 7") > 0) marginY = 75;    // IE 7.x
    else if(navigator.userAgent.indexOf("Firefox") > 0) marginY = 75;   // FF
    else if(navigator.userAgent.indexOf("Opera") > 0) marginY = 30;     // Opera
    else if(navigator.userAgent.indexOf("Netscape") > 0) marginY = -2;  // Netscape
	else marginY = 55;  // Etc

    if (thisX > maxThisX) {
        window.document.body.scroll = "yes";
        thisX = maxThisX;
    }
    if (thisY > maxThisY - marginY) {
        window.document.body.scroll = "yes";
        thisX += 19;
        thisY = maxThisY - marginY;
    }
    window.resizeTo(thisX+10, thisY+marginY);

    // ¼¾ÅÍ Á¤·Ä
    // var windowX = (screen.width - (thisX+10))/2;
    // var windowY = (screen.height - (thisY+marginY))/2 - 20;
    // window.moveTo(windowX,windowY);

}


// ÀÌ¹ÌÁö ¸®»çÀÌÁî
function image_auto_resize(this_s,width,height){
	var ta_image = new Image();
	ta_image.src = this_s.src;

	if(!width){
		this_s.removeAttribute('width');
		this_s.style.width='auto';
	}else if(width < ta_image.width){
		this_s.width = width;
	}else{
		this_s.width = ta_image.width;
	}

	if(!height){
		this_s.removeAttribute('height');
		this_s.style.height='auto';
	}else if(height < ta_image.height){
		this_s.height = height;
	}else{
		this_s.height = ta_image.height;
	}

}

function info_popup(url, svar){
		window.open(url, 'info', 'width=680, height=600, scrollbars='+svar);
	}

function zip_pop(form_name, zip1, zip2, addr){
	window.open('/member/find_zip.html?form_name='+form_name+'&zip1='+zip1+'&zip2='+zip2+'&addr='+addr, 'zipcode', 'width=650,, height=200');
}

function pop_header(title){
	var strPop = new String();
	strPop += '<table width="100%" height="35" border="0" cellspacing="0" cellpadding="0" background="/images/popup/head.gif">';
	strPop += '	<tbody>';
	strPop += '		<tr>';
	strPop += '			<td>';
	strPop += '				<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">';
	strPop += '					<tbody>';
	strPop += '					<tr>';
	strPop += '						<td align="left">&nbsp;&nbsp;<img src="/images/popup/logo.PNG" alt="º¸¹°´åÄÄ" align="absmiddle">&nbsp;&nbsp;<span style="font-size:12px; font-weight:bold;">' + title + '</span></td>';
	strPop += '						<td align="right"><a href="#none" onClick="self.close();"><img src="/images/popup/btn_close.PNG" alt="´Ý±â" align="absmiddle"></a>&nbsp;&nbsp;</td>';
	strPop += '					</tr>';
	strPop += '					</tbody>';
	strPop += '				</table>';
	strPop += '			</td>';
	strPop += '		</tr>';
	strPop += '	</tbody>';
	strPop += '</table>';
	document.write(strPop);
}

//ÅëÇÕ°Ë»ö
function searchKey(flag)
{
  var f = document.forms["searchForm"];
  var str = f.keyword_str.value;
  str = str.replace(/(^\s*)|(\s*$)/g,"");
  if (str.length == 0)
  {
    alert( "°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
    f.keyword_str.focus();
    if(!flag) return flag;
  }
  else
  {
    f.action="/pds/search.html";
   	f.submit();
  }
}

// ±¤°í ¾È³» ÆË¾÷Ã¢ ¿­±â
function adInfoOpen(){
		window.open('/center/adinfo_main.html', 'adinfo', 'width=900, height=700, top=0, left=0');
}


// ÇöÀç µµ¸ÞÀÎ
function Host(){
 var Dns;
 Dns=location.href;
 Dns=Dns.split("//");
 Dns="http://"+Dns[1].substr(0,Dns[1].indexOf("/"));
 return Dns;
}

// IE ¿¡¼­ ºí¸µÅ© ÅÂ±× »ç¿ëÇÏ±â
function doBlink() {
  var blink = document.all.tags("BLINK");
  for (var i=0; i < blink.length; i++) {
   blink[i].style.visibility = (blink[i].style.visibility =="visible") ? "hidden":"visible";
  }
}
function doBlinkFast() {
  var blink = document.all.tags("BLINKFAST");
  for (var i=0; i < blink.length; i++) {
   blink[i].style.visibility = (blink[i].style.visibility =="visible") ? "hidden":"visible";
  }
}
if (document.all) setInterval("doBlink()",500);
if (document.all) setInterval("doBlinkFast()",300);


// IE6¿¡¼­ png24 »ç¿ëÇÏ±â
function setPng24(obj) {
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bpng24\b/i,'');
	obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');";
	obj.src='';
	return '';
}