function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
//¿ìÆí¹øÈ£°Ë»öÃ¢¿­±â
function openSearchPostWin(formName, objPost1, objPost2, objAddress1, objAddress2)
{
	window.open("/global/common/search_post.asp?formName=" + formName + "&objPost1=" + objPost1 + "&objPost2=" + objPost2 + "&objAddress1=" + objAddress1 + "&objAddress2=" + objAddress2, "BDZ_SEARCHPOST_WIN", "width=600, height=286");
}
//ºó¹®ÀÚ¿­Ã¼Å©
function isExist(checkValue)
{
	return /[^\s]/g.test(checkValue);
}
//¹ÙÀÌÆ®¼öÃ¼Å©
function GetByteLen(s)
{
	var l=0;
	for(var i=0;i<s.length; i++) 
		if(escape(s.charAt(i)).length>3) l+=2; else l++;
 	return l;
}
//·Î±×ÀÎ
function BDZLogin(loginKind)
{
	var formName;
	
	if(loginKind == "L")
		formName = document.LargeLoginForm;
	else
		formName = document.SmallLoginForm;
		
	if(!isExist(formName.UserID.value))
	{
		window.alert("¾ÆÀÌµð¸¦ ½áÁÖ½Ê½Ã¿À.");
		formName.UserID.focus();
		return;
	}
	if(!isExist(formName.UserPWD.value))
	{
		window.alert("ºñ¹Ð¹øÈ£¸¦ ½áÁÖ½Ê½Ã¿À.");
		formName.UserPWD.focus();
		return;
	}
		
	formName.action = "https://www.boarderszone.com/global/login/login.asp";
	//formName.action = "http://www.boarderszone.com/global/login/login.asp";
	formName.submit();
}
//¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏµµ·Ï
function checkNumberKey()
{
	if((event.keyCode<48)||(event.keyCode>57))
	{
		event.returnValue=false;
	}
}
//¼ýÀÚ¿¡ ÄÞ¸¶ Ãß°¡
function AddCommaNumber(val)
{
    var temp = String(val);
    var str="";
    for(i=0;i<temp.length;i++)
    {
        if(temp.charAt(i)!=",")
            str += temp.charAt(i);
    }
    var fareamt = "";
    var j=0;
    for(i=(str.length-1);i>=0;i--)
    {
        if(j%3==0&&i!=str.length-1)
        {
            fareamt = str.charAt(i)+","+fareamt;
        }
        else
        {
            fareamt = str.charAt(i)+fareamt;
        }
        j++;
    }
    
    return fareamt;
}
//È­ÀÏÀÇ È®ÀåÀÚÃßÃâ
function getFileExtension(fileName)
{
	return fileName.substr(fileName.lastIndexOf(".") + 1, 3).toLowerCase();
}
//ÀÌ¹ÌÁöÅ©°Ôº¸±â
function viewLargeImage(img_path, img_width, img_height, img_title)
{
	var isOver = false;
	
	if(img_width > screen.width - 100)
	{
		img_width = screen.width - 100;
		isOver = true;
	}
	if(img_height > screen.height - 100)
	{
		img_height = screen.height - 100;
		isOver = true;
	}
	
	var fileName = '/global/common/view_image.asp?img_path='+img_path+'&img_title='+img_title
	var window_property = 'width='+img_width+', height='+img_height+', left='+(screen.width-img_width)/2+', top='+(screen.height-img_height)/2
	
	if(!isOver)
	{
		window.open(fileName, 'img_window', window_property);
	}
	else
	{
		window.open(fileName, 'img_window', window_property+',scrollbars=1');
	}
}
//¶óµð¿À¹öÆ° Ã¼Å©°ª
function getRadioElementValue(elementName)
{
	var returnValue;

	returnValue = "";
		
	//window.alert(elementName.length);
		
	for(var i = 0; i < elementName.length; i++)
	{
		if(elementName[i].checked)
		{
			returnValue = elementName[i].value;
			break;
		}
	}
		
	return returnValue;
}
//ÇÃ·¡½¬ÆÄÀÏ·Îµå
function loadFlash(flash_path, width, height)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + width + '" height="' + height + '"> <param name="movie" value="' + flash_path + '" />      <param name="quality" value="high" />      <param name=wmode value=transparent><embed src="' + flash_path + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed></object>');
}
//»õÃ¢¶ç¿ì±â
function openWindowBDZ(URL, WindowWidth, WindowHeight, WindowName, isScrolling, isCenter)
{
	var WindowProperty;
	
	WindowProperty = "width=" + WindowWidth + ", height=" + WindowHeight + ", scrollbars=" + isScrolling;
	
	if(isCenter)	//°¡¿îµ¥ »õÃ¢¶ç¿ì±â¶ó¸é
		WindowProperty += ", left="+(screen.width-WindowWidth)/2+", top="+(screen.height-WindowHeight)/2
		
	window.open(URL, WindowName, WindowProperty);
}
//ÇÃ·¡½Ã½ºÅ©¸³Æ®
function writeFlash(flash_url, width, height, wmode)
{
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"" + width + "\" height=\"" + height + "\">");
	document.write("<param name=\"movie\" value=\"" + flash_url + "\">");
	document.write("<param name=\"quality\" value=\"high\">");
	document.write("<param name=\"wmode\" value=\"" + wmode + "\">");
	document.write("<embed src=\"" + flash_url + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + width + "\" height=\"" + height + "\">");
	document.write("</embed>");
	document.write("</object>");
}
//ÄíÅ°Á¸ÀçÈ®ÀÎ
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 setCookie(name, value, expiredays) 
{ 
    var todayDate = new Date(); 
    todayDate.setDate( todayDate.getDate() + expiredays ); 
    document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
//ÄíÅ° ÀúÀåÈÄ ·¹ÀÌ¾î´Ý±â
function closeLayerSetCookie(layerID, cookieName) 
{ 
	setCookie(cookieName, 'done' , 1);	//ÄíÅ°ÀúÀå  
	document.getElementById(layerID).style.display = "none";
}
//·¹ÀÌ¾î ´Ý±â
function closeLaerNotSetCookie(layerID) 
{ 
	document.getElementById(layerID).style.display = "none";
}