window.defaultStatus = "»ïÈ£³ó¿ø - http://www.figfarm.net";

/*	¸µÅ© °É¸° °÷ ºí·¯ È¿°ú ÁÖ±â	*/
function blur(){ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=blur; 



function MM_showHideLayers() { //v6.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_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_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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

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_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);



function swapImgRestore() { //v3.0 
	var i,x,a =document.sr;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; 
} 


/*      ÀÔ·Â°ª Ã¼Å©(¼ýÀÚ¸¸)     */
function IsNumber() {
        if ((event.keyCode<48)||(event.keyCode>57)) {
                event.returnValue=false;
        }
}

/*	¸ÞÀÎ ·Î±×ÀÎ Æû. ¹Ùµð ·Î±×ÀÎ Æû ÀÔ·Â Ã¼Å© ÇÔ¼ö	*/
function LoginCheck(form) {
        if (!CheckField(form.id,"¾ÆÀÌµð¸¦"))		return false;
        if (!CheckField(form.passwd,"ÆÐ½º¿öµå¸¦"))	return false;

		return true;
}
function LoginCheck1(form) {

        if (!CheckField(form.guest_name,"ÁÖ¹®ÀÚ ÀÌ¸§À»"))		return false;
        if (!CheckField(form.guest_jumin,"ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦"))	return false;
		if (form.guest_jumin.value.length < 7)
		{
			alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸® 7ÀÚ¸®¸ðµÎ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			return false;
		}

		return true;
}

/*	Á¦Ç° °Ë»ö	*/
function Search() {
        if (!CheckField(document.SearchForm.key,"°Ë»ö¾î¸¦"))	return false;
}

/*	¾ÆÀÌµð/ÆÐ½º¿öµå ºÐ½Ç Ã¢	*/
function IDPW_Find() {
	var window_left	= (screen.width-640)/2;
        var window_top	= (screen.height-480)/2;
	ref	= "IDPW_Find.html";
        window.open(ref,"FindWin",'width=310,height=200,status=no, scrollbars=no, top=' + window_top + ',left=' + window_left + '');
}

/*      ÀÔ·Â Ã¼Å© ¿¡·¯ alert ÇÔ¼ö       */
function CheckField(form,name) {
        if (!form.value) {
                alert (name + ' ÀÔ·ÂÇØ ÁÖ¼¼¿ä');
                form.focus();
                return false;
        }
        return true;
}

/*	ÄÞ¸¶¸¦ Ãß°¡ÇÑ´Ù	*/
function NumberFormat(numstr) {
	var numstr = String(numstr);
  	var re0 = /(\d+)(\d{3})($|\..*)/;
  	if (re0.test(numstr))
    		return numstr.replace(
      		re0,
      	function(str,p1,p2,p3) { return NumberFormat(p1) + "," + p2 + p3; }
    	);
  	else
    	return numstr;
}


/*      »õÃ¢ ¿ÀÇÂ : ÆÄÀÏ¸í, À©µµ¿ìÃ¢ ¸í, ³ÐÀÌ, ³ôÀÌ     */
function WinOpen(file, name, width, height) {
        window.open(file, name, "width="+width+", height="+height+", status=no, scrollbars=yes, top=10, left=10");
}
/*      »õÃ¢ ¿ÀÇÂ ½ºÅ©·Ñ ¾øÀ½ : ÆÄÀÏ¸í, À©µµ¿ìÃ¢ ¸í, ³ÐÀÌ, ³ôÀÌ     */
function WinOpen_noscroll(file, name, width, height) {
        window.open(file, name, "width="+width+", height="+height+", status=no, scrollbars=no, top=0, left=0");
}
/*      »õÃ¢ ¿ÀÇÂ ½ºÅ©·Ñ ¾øÀ½ ¿·À¸·Î : ÆÄÀÏ¸í, À©µµ¿ìÃ¢ ¸í, ³ÐÀÌ, ³ôÀÌ     */
function WinOpen_noscroll_1(file, name, width, height) {
        window.open(file, name, "width="+width+", height="+height+", status=no, scrollbars=no, top=0, left=455");
}
function WinOpen_scroll(file, name, width, height) {
        window.open(file, name, "width="+width+", height="+height+", status=no, scrollbars=yes, top=250, left=280");
}

function WinOpen_noscroll(file, name, width, height) {
        window.open(file, name, "width="+width+", height="+height+", status=no, scrollbars=no, top=250, left=280");
}


/*	¸ÞÀÏ¹ß¼Û Æû	*/
function Mail() {
	window.open("/shop/mall/mailto.html","MailWin","width=550, height=375, status=no, scrollbars=no, top=10, left=10");
}

/*      Ã¼Å©¹Ú½º ÀÏ°ý ¼±ÅÃÇÏ±â          */
function CheckAll(form) {
	var chk_obj     = document.getElementsByName('uid[]');
         
	for (var i=0; i<chk_obj.length; i++) {
		if (chk_obj[i].checked == true) {
			chk_obj[i].checked      = false;
		} else {
			chk_obj[i].checked      = true;
		}
	}
}


function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
	{
		
	  toolbar_str = toolbar ? 'yes' : 'no';
	  menubar_str = menubar ? 'yes' : 'no';
	  statusbar_str = statusbar ? 'yes' : 'no';
	  scrollbar_str = scrollbar ? 'yes' : 'no';
	  resizable_str = resizable ? 'yes' : 'no';
	  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}
	
	
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 EnNext() {
	if (event.keyCode==13) {
		event.keyCode=9;
	}
}


/*
function GoBbs(){
	var bbs = main.wherebbs.value;
	if(bbs == "community01"){
	location.href="http://www.hongsigam.co.kr/LBoard/Control.php?board=community01&mn=community&pg=01";
	} if(bbs == "community02"){
	location.href="http://www.hongsigam.co.kr/LBoard/Control.php?board=community02&mn=community&pg=02";
	} else {
	location.href="http://www.hongsigam.co.kr/LBoard/Control.php?board=customer04&mn=customer&pg=04";
	}
}

*/

function openflash(width,height,src){ 
    return "<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+"><param name=movie value="+src+"><param name=quality value=high ><embed src="+src+" quality=high  pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width="+width+" height="+height+"></embed></object>"; 
} 

function writeflash(src){ 
    document.write(src); 
} 

function JS_viewObj(objhtml) { 

	//var objhtml = objhtml.replace("<PARAM NAME=wmode VALUE=transparent>", "");
    document.write(objhtml); 

}

//¼¾ÅÍ¿¡ Ã¢ ¶Ù¿ì±â

function popupEventCenter(theURL,winName,features) {
// window move to screen center
  var leftPosition = screen.width - getValue(features, "width");
  var topPosition = screen.height - getValue(features, "height");

  leftPosition = (leftPosition < 0) ? 0 : leftPosition/2;
  topPosition  = (topPosition < 0)  ? 0 : topPosition /2;
  features += ',top=' + topPosition + ',left=' + leftPosition;
  var popwin = window.open(theURL,winName,features);
}
function getValue(string, key) {
  var startIdx = string.indexOf(key);
  var endIdx   = string.indexOf(",", startIdx);
  if (endIdx == -1) {
    endIdx = string.length;
  }
  return string.substring(startIdx+key.length+1 , endIdx);
}
