/*
 *  JavaScript & Function
 */
//---------------------------------------------------------
function PreViewImg(what) {
   pic = new Image();
   var url =what;
   pic.src=url;
   var PicWidth=eval(pic).width+10;
   var PicHeight=eval(pic).height+28;
   var sFeatures="dialogHeight:"+PicHeight+"px; dialogWidth:"+PicWidth+"px; center: yes; help: no; resizable: yes; status: no;";
   window.showModelessDialog( url,"img", sFeatures);
}
//---------------------------------------------------------
function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}
//---------------------------------------------------------
function na_preload_img()
{ 
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i]     = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}
//---------------------------------------------------------
function na_change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}
//---------------------------------------------------------
function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  var popleft = (screen.width - width) / 2;
  var poptop = (screen.height - height) / 2;
  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='+popleft+',top='+poptop+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}
//---------------------------------------------------------
function na_call(str)
{
  eval(str);
}
//---------------------------------------------------------
function photoview(photo_name) {
   	var PicWidth=400;
   	var PicHeight=300;
	var xwin=(screen.width-PicWidth)/2;
	var ywin=(screen.height-PicHeight)/2;
   	var sFeatures="height="+PicHeight+", width="+PicWidth+", left="+xwin+", top="+ywin;
   	
	ycphoto=window.open("","ycphoto",sFeatures); 
	ycphoto.document.write("<html><title>³²Ãµ¾È±³È¸</title>"); 
	ycphoto.document.write("<body bgcolor=white text=white background="+photo_name+" onclick=window.close() style='cursor:hand'>");
	ycphoto.document.write("</body></html><p>"); 
}
//---------------------------------------------------------
function photoview2(photo_name) {
  	var sFeatures="height="+10+", width="+10+", left="+0+", top="+0;
   	
	ycphoto=window.open("","ycphoto",sFeatures); 
	ycphoto.document.write("<html><title>³²Ãµ¾È±³È¸</title>"); 
	ycphoto.document.write("<body bgcolor=white leftmargin=0 topmargin=0");
	ycphoto.document.write("<a href='#none' onclick=window.close() style='cursor:hand'><img src="+photo_name+" border=0 name=ycphoto1 onload=resizeTo(ycphoto1.width,ycphoto1.height+25)></a>");
	ycphoto.document.write("<script>");
	ycphoto.document.write("resizeTo(ycphoto1.width,ycphoto1.height+25)");
	ycphoto.document.write("</script>");
	ycphoto.document.write("</body></html>");
}
//---------------------------------------------------------
function photoview3(photo_name) {
	pic = new Image();
   	pic.src=photo_name;
   	var PicWidth=eval(pic).width;
   	var PicHeight=eval(pic).height;
	var xwin=(screen.width-PicWidth) / 2;
	var ywin=(screen.height-PicHeight) / 2;
   	var sFeatures="height="+PicHeight+", width="+PicWidth+", left="+xwin+", top="+ywin;
   	
	ycphoto=window.open("","ycphoto",sFeatures); 
	ycphoto.document.write("<html><title>³²Ãµ¾È±³È¸</title>"); 
	ycphoto.document.write("<body bgcolor=white background="+photo_name+" onclick=window.close() style='cursor:hand'>");
	ycphoto.document.write("<script>");
	ycphoto.document.write("resizeTo(ycphoto1.width,ycphoto1.height+25)");
	ycphoto.document.write("</script>");
	ycphoto.document.write("</body></html><p>"); 
}
//---------------------------------------------------------
function photoview4(photo_name,ptitle) {
	pic = new Image();
   	pic.src=photo_name;
   	var PicWidth=eval(pic).width;
   	var PicHeight=eval(pic).height;
	var xwin=(screen.width-PicWidth) / 2;
	var ywin=(screen.height-PicHeight) / 2;
  	var sFeatures="height="+10+", width="+10+", left="+xwin+", top="+ywin;
   	
	ycphoto=window.open("","ycphoto",sFeatures); 
	ycphoto.document.write("<html><title>:: "+ptitle+" ::::::::::::::::::::</title>"); 
	ycphoto.document.write("<body bgcolor=white leftmargin=0 topmargin=0");
	ycphoto.document.write("<a href='#none' onclick=window.close() style='cursor:hand'><img src="+photo_name+" border=0 name=ycphoto1 onload=resizeTo(ycphoto1.width,ycphoto1.height+25)></a>");
	ycphoto.document.write("<script>");
	ycphoto.document.write("resizeTo(ycphoto1.width,ycphoto1.height+25)");
	ycphoto.document.write("</script>");
	ycphoto.document.write("</body></html>");
}
//---------------------------------------------------------
function photoview5(photo_name,ptitle) {
  	var sFeatures="height="+10+", width="+10+", left=0, top=0";
   	
	ycphoto=window.open("","ycphoto",sFeatures); 
	ycphoto.document.write("<html><title>:: "+ptitle+" ::::::::::::::::::::</title>"); 
	ycphoto.document.write("<body bgcolor=white leftmargin=0 topmargin=0");
	ycphoto.document.write("<a href='#none' onclick=window.close() style='cursor:hand'><img src="+photo_name+" border=0 name=ycphoto1 onload=resizeTo(ycphoto1.width+9,ycphoto1.height+28)></a>");
	ycphoto.document.write("<script>");
	ycphoto.document.write("resizeTo(ycphoto1.width+9,ycphoto1.height+28)");
	ycphoto.document.write("</script>");
	ycphoto.document.write("</body></html>");
}
//------------------- ¿ÜºÎÀÇ imgview.php ¿Í ¿¬µ¿ÇØ¼­ ÀÌ¹ÌÁö¸¦ º¸¿©ÁØ´Ù.-------------------- 2004.01.31 Ãß°¡½ºÅ©¸³Æ®
function imgview(imgname,title) {
	if(imgname=='')
		return;
	var x=screen.width/2-150/2; //Ã¢À» È­¸é Áß¾ÓÀ¸·Î À§Ä¡ 
	var y=(screen.height-30)/2-150/2;
	window.open('imgview.php?image='+imgname+'&title='+title,'','width=150,height=150,scrollbars=0,resizable=1,top='+y+',left='+x)
}
//---------------------------------------------------------
function pop_win(url,winname,xx,yy){
var xwin=(screen.width-xx)/2;
var ywin=(screen.height-yy)/2;
newwin=window.open(url,winname,'scrollbars=no,status=no,toolbar=no,menubar=no,resizable=no')
if (document.all){
newwin.resizeTo(xx,yy)
newwin.moveTo(xwin,ywin)
}
newwin.location=url;
}
//---------------------------------------------------------
function pop_win2(url,winname,xx,yy){
var xwin=0;
var ywin=0;
newwin=window.open(url,winname,'scrollbars=no,status=no,toolbar=no,menubar=no,resizable=no')
if (document.all){
newwin.resizeTo(xx,yy)
newwin.moveTo(xwin,ywin)
}
newwin.location=url;
}
//---------------------------------------------------------
function pop_win3(url, name, xx, yy)
{
  var popleft = (screen.width - xx) / 2;
  var poptop = (screen.height - yy) / 2;
  var toolbar_str = 'no';
  var menubar_str = 'no';
  var statusbar_str = 'no';
  var scrollbar_str = 'no';
  var resizable_str = 'no';
  window.open(url, name, 'left='+popleft+',top='+poptop+',width='+xx+',height='+yy+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}
//---------------------------------------------------------
function pop_win4(url, name, xx, yy)
{
  var popleft = 0;
  var poptop = 0;
  var toolbar_str = 'no';
  var menubar_str = 'no';
  var statusbar_str = 'no';
  var scrollbar_str = 'no';
  var resizable_str = 'no';
  window.open(url, name, 'left='+popleft+',top='+poptop+',width='+xx+',height='+yy+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}
//---------------------------------------------------------
function pop_win5(url, name, xx, yy)
{
  var popleft = (screen.width - xx) / 2;
  var poptop = (screen.height - yy) / 2;
  var toolbar_str = 'no';
  var menubar_str = 'no';
  var statusbar_str = 'no';
  var scrollbar_str = 'yes';
  var resizable_str = 'no';
  window.open(url, name, 'left='+popleft+',top='+poptop+',width='+xx+',height='+yy+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

//---------------------------------------------------------
function New_Winopen(xURL)
{
	if (xURL!="#"){window.open(xURL,'new');}
}
//---------------------------------------------------------
function New_Winopen2(xURL)
{
	if (xURL!="#")	{
		newwin=window.open("","new","scrollbars=yes,status=no,toolbar=no,menubar=no,resizable=no")
		if (document.all){
			newwin.moveTo(0,0)
			newwin.resizeTo(screen.width,screen.height)
		}
		newwin.location=xURL;
	}
}
//---------------------------------------------------------
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_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 autoblur() {
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
	}
//---------------------------------------------------------
function bustime_href(xURL)
{
	if (xURL!="#")	{
		busline.location=xURL;
	}
}
//---------------------------------------------------------
function New_href(xURL)
{
	if (xURL!="#")	{
		this.location=xURL;
	}
}
//---------------------------------------------------------
function mlogin()
{
	alert('Çã¿ëµÇÁö ¾ÊÀº IP·Î\n\nLOG-INÀ» ½ÃµµÇÏ¼Ì½À´Ï´Ù.\n');
}
function gonowpage(xpage)
{
	this.location.href = xpage;
}
//---------------------------------------------------------
//----	Ãß°¡µÈ ºÎºÐ / 2003.09.28
//---------------------------------------------------------
function CheckStr(strOriginal, strFind, strChange){
   var position, strOri_Length;
   position = strOriginal.indexOf(strFind);
   while (position != -1) {
      strOriginal = strOriginal.replace(strFind, strChange);
      position = strOriginal.indexOf(strFind);
   }
   strOri_Length = strOriginal.length;
   return strOri_Length;
}
//---------------------------------------------------------
function check_space(str) {
   if (str.search(/\S/)<0) {
      return false;
   }
   var temp=str.replace(' ','');
   if (temp.length == 0) {
      return false;
   }
   return true;
}
//---------------------------------------------------------
function dosearch() {
   var frm = document.form2 ;
   var keyfield = frm.keyfield.value ;
   var form_value = CheckStr(keyfield, " ", "");
   if (form_value == 0) {
       alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
       frm.keyfield.select() ;
       return false;
   }
   frm.submit();
   return true;
}
//---------------------------------------------------------
function dosearch2() {
   var frm = document.products ;
   var keyfield = frm.keyfield.value ;
   var form_value = CheckStr(keyfield, " ", "");
   if (form_value == 0) {
       alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
       frm.keyfield.select() ;
       return false;
   }
   frm.submit();
   return true;
}
//---------------------------------------------------------
function doGoodS() {
   var frm = document.search ;
   var searchWord = frm.searchWord.value ;
   var form_value = CheckStr(searchWord, " ", "");
   if (form_value == 0) {
       alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
       frm.searchWord.select() ;
       return false;
   }
   if (searchWord.length < 2 ) {
       alert("°Ë»ö¾î¸¦ 2ÀÚÀÌ»óÀ¸·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
       frm.searchWord.select() ;
       return false;
   }
   frm.submit();
   return true;
}
//---------------------------------------------------------
function enterChk(i) {
  if (event.keyCode == 13 && i == 1) {
     dosearch();
  }
}
//---------------------------------------------------------
function enterChk3(i) {
  if (event.keyCode == 13 && i == 1) {
     dosearch2();
  }
}
//---------------------------------------------------------
function godelete(httpd) {
   if(confirm("»èÁ¦ ÇÏ°Ú½À´Ï±î?")==true) {
      location.href = httpd;
   }
}
//---------------------------------------------------------
function gomodify(httpd) {
   if(confirm("¼öÁ¤ ÇÏ°Ú½À´Ï±î?")==true) {
      location.href = httpd;
   }
}
//---------------------------------------------------------
function docancel() {
   history.back();
}
//---------------------------------------------------------
function gourl(httpd) {
   location.href = httpd;
}
//---------------------------------------------------------
function enterChk2(i) {
  if (event.keyCode == 13 && i == 1) {
     idchk();
  }
}
//---------------------------------------------------------
function psearch() {
   var frm = document.form3 ;
   var searchWord = frm.searchWord.value ;
   var form_value = CheckStr(searchWord, " ", "");
   if (form_value == 0 || searchWord == "»óÇ°°Ë»ö") {
       alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
       frm.searchWord.select() ;
       return false;
   }
   if (searchWord.length < 2 || searchWord == "»óÇ°°Ë»ö") {
       alert("°Ë»ö¾î¸¦ 2ÀÚÀÌ»óÀ¸·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
       frm.searchWord.select() ;
       return false;
   }
   frm.submit();
   return true;
}
//---------------------------------------------------------
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.top.open(theURL,winName,features);
}
//---------------------------------------------------------
function change_img(id,src) 
{ 
eval(id+'.filters.blendTrans.stop();'); 
eval(id+'.filters.blendTrans.Apply();'); 
eval(id+'.src="'+src+'";'); 
eval(id+'.filters.blendTrans.Play();'); 
} 
//-----------------------------------------------------------------------------
// onfocus
//-----------------------------------------------------------------------------

function allblur() {
         for (i = 0; i < document.links.length; i++)
              document.links[i].onfocus = document.links[i].blur;
    }

function bluring(){ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
} 
document.onfocusin=bluring;


//-----------------------------------------------------------------------------
// gotop
//-----------------------------------------------------------------------------

function gotop() {
	window.scrollTo(0,0);
}

function gotop_Call() {
	document.body.ondblclick = Top;
}


var Xpos = 0;
var Ypos = 0;
var Ygravity = 0.85;
var scrollPos = 0;
var oldScrollPos = 0;


function FloatMenu(){
	docWidth = document.body.clientWidth; // Update document width
	docHeight = document.body.clientHeight; // Update document height
	oldScrollPos = scrollPos;
	scrollPos = document.body.scrollTop; // Update scrollbar position

	Xpos = 915;
	//Xpos = (docWidth - floater.offsetWidth) - 10; //¿À¸¥ÂÊ ¿©¹é ¹è³Ê°¡ ¿À¸¥ÂÊ¿¡ ºÙÀ»°æ¿ì
	//Xpos = (docWidth / 2) + 410; // Áß¾ÓÁ¤·ÄÀÏ°æ¿ì. " + 410 Àº Å×ÀÌºí Å©±â / 2 "
	Yboundary = ((scrollPos + docHeight) - floater.offsetHeight) - 30; //ÇÏ´Ü¿©¹é

	if(floater.offsetTop < Yboundary - 1){ // Object is behind boundary
		Ypos += 2;
	}

	if(floater.offsetTop > Yboundary + 1){ // Object is past boundary
		Ypos -= 1;
	}

	Ypos *= Ygravity; // Slow object down

	floater.style.pixelLeft = Xpos;
	floater.style.pixelTop += Ypos; // Make object bounce
}

 //¸Å°³º¯¼öÁß µÞÂÊ ¼ýÀÚ´Â ³»·Á¿À´Â ¼Óµµ


//»ó´Ü¸Þ´º ¸µÅ©
//»ó´Ü1 ÇØµéÀÎ¼Ò°³ ¸µÅ©
function sub1_01(){window.location.href="../haedrin/haedrin.php?id=01";}
function sub1_02(){window.location.href="../haedrin/haedrin.php?id=02";}
function sub1_03(){window.location.href="javascript:look();";}
function sub1_04(){window.location.href="../haedrin/haedrin.php?id=04";}
function sub1_05(){window.location.href="../haedrin/haedrin.php?id=05";}
function sub1_06(){window.location.href="../haedrin/haedrin.php?id=06";}
//»ó´Ü2 ´ÙÀÌ¾îÆ® ¸µÅ©
function sub2_01(){window.location.href="../diet/diet.php?id=01";}
function sub2_02(){window.location.href="../diet/diet.php?id=02";}
function sub2_03(){window.location.href="../diet/diet.php?id=03";}
function sub2_04(){window.location.href="../diet/diet.php?id=04";}
function sub2_05(){window.location.href="../diet/diet.php?id=05";}
function sub2_06(){window.location.href="../diet/diet.php?id=06";}
function sub2_07(){window.location.href="../diet/diet.php?id=07";}
function sub2_08(){window.location.href="../diet/diet.php?id=08";}
function sub2_09(){window.location.href="../diet/diet.php?id=09";}

//»ó´Ü3 ¿©µå¸§¸µÅ©
function sub3_01(){window.location.href="../skin/skin.php?id=01";}
function sub3_02(){window.location.href="../skin/skin.php?id=02";}
function sub3_03(){window.location.href="../skin/skin.php?id=03";}
function sub3_04(){window.location.href="../skin/skin.php?id=04";}
function sub3_05(){window.location.href="../skin/skin.php?id=05";}
function sub3_06(){window.location.href="../skin/skin.php?id=06";}
function sub3_07(){window.location.href="../skin/skin.php?id=07";}
function sub3_08(){window.location.href="../skin/skin.php?id=08";}
function sub3_09(){window.location.href="../skin/skin.php?id=09";}

//»ó´Ü4
function sub4(){window.location.href="#";}
function sub4_01(){window.location.href="#";}
function sub4_02(){window.location.href="#";}

//»ó´Ü5 °Ô½ÃÆÇ¸µÅ©
function sub5_01(){window.location.href="../community/community.php?id=01";}
function sub5_02(){window.location.href="../community/community.php?id=02";}
function sub5_03(){window.location.href="../community/community.php?id=03";}
function sub5_04(){window.location.href="../community/community.php?id=04";}
function sub5_05(){window.location.href="../community/community.php?id=05";}
function sub5_06(){window.location.href="../community/community.php?id=06";}
function sub5_07(){window.location.href="../community/community.php?id=07";}
function sub5_08(){window.location.href="../community/community.php?id=09";}
function sub5_09(){window.location.href="../community/community.php?id=08";}


//¸ÞÀÎ ÅÇ°Ô½ÃÆÇ½ºÅ©¸³Æ®
