function open_window( filename, option, name )
{
	if( !name )
	{
		name = 'new'
	}


        win = window.open( filename, name, option );

        return win
}

function window_open( page, name, top, left, width, height )
{
	option = "'toolbar=no," +
		"location=no," +
		"directories=no," +
		"status=no," +
		"menubar=no," +
		"scrollbars=yes," +
		"resizable=yes," +
		"width=" + width + "," +
		"height=" + height + "," +
		"top=" + top + "," +
		"left=" + left + "'"

        window.open( page, name, option );
}

function open_poll_pop( mode, no )
{
	page = '/front/php/poll_r.php?mode=' + mode + '&no=' + no;
	window_open( page, 'poll', 100, 300, 466, 382 );
}

/*Left menu ¹ÝÅõ¸í ·¹ÀÌ¾î ±¸Çö*/
function Layer_overload(LayerName,Status) 
{
    if (navigator.appName == "Netscape")
    {
		LayerN = document.getElementById(LayerName).style;
		if (Status == 'show') LayerN.visibility = 'visible';
		if (Status == 'hide') LayerN.visibility = 'hidden';
    }	
    else
    {
		LayerN = document.all[LayerName].style;
		if (Status == 'show') LayerN.visibility = 'visible';
		if (Status == 'hide') LayerN.visibility = 'hidden';
    }
}

/*Left menu±¸Çö*/
var old='';

function menu(name)
{
	submenu=eval("submenu_"+name+".style");
	if(old!=submenu)
	{
		if(old!='')
		{
			old.display='none';
		}
		submenu.display='block';
		old=submenu;
	}
	else
	{
		submenu.display='none';
		old='';
	}
}


function Layer_rollover(img_name,img_url)
{
	var menu;	
	//tmp = new String( "document."+img_name );
	menu=eval("document."+img_name);		
	menu.src = img_url;
	return;
}

function image_zoom( product_no, main_cate_no, display_group )
{
	//href = '/front/php/image_zoom.php?img='+image+'&product_no='+document.frm.product_no.value;
	href = '/front/php/image_zoom.php?product_no='+product_no+'&main_cate_no='+main_cate_no+'&display_group='+display_group;
	option = 'toolbar=no,scrollbars=no,resizable=yes,width=800,height=640,left=0,top=0';
	win_name = 'image'

	window.open( href, win_name, option );
}

/*-----------------------------------------------------------*/
/*             Added by zoedream (Date.20081110)             */
/*-----------------------------------------------------------*/

/* Input Box Background Focus in/out */
function overInput(f) {  // ÇØ´ç ÆûÀÇ CSS¸¦ 'onInput'·Î º¯°æ
    f.className = "input_focus";
}

function outInput(f) {  // ÇØ´ç ÆûÀÇ CSS¸¦ 'offInput'·Î º¯°æ
    f.className = "input_search";
}

/* ¿òÁ÷ÀÌ´Â ¹è³Ê */
//var stmnLEFT = 0; // ½ºÅ©·Ñ¸Þ´ºÀÇ ÁÂÃø À§Ä¡
var stmnGAP1 = 217; // ÆäÀÌÁö À§ÂÊ ¿©¹é
var stmnGAP2 = 30; // ½ºÅ©·Ñ½Ã ºê¶ó¿ìÀú »ó´Ü°ú ¾à°£ ¶ç¿ò. ÇÊ¿ä¾øÀ¸¸é 0À¸·Î Á¶Á¤ÇÏ¼¼¿ä
var stmnBASE = 217; // ½ºÅ©·Ñ¸Þ´º ÃÊ±â ½ÃÀÛÀ§Ä¡
var stmnActivateSpeed = 150; // ¿òÁ÷ÀÓÀ» °¨ÁöÇÏ´Â ¼Óµµ (¼ýÀÚ°¡ Å¬¼ö·Ï ´À¸®´Ù)
var stmnScrollSpeed = 10; // ½ºÅ©·ÑµÇ´Â ¼Óµµ (Å¬¼ö·Ï ´À¸²)
var stmnTimer;

function RefreshStaticMenu()
{
  var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;
  stmnStartPoint = parseInt(STATICMENU.style.top, 10);
  stmnEndPoint = document.body.scrollTop + stmnGAP2;

  if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;
  stmnRefreshTimer = stmnActivateSpeed;

  if (stmnStartPoint != stmnEndPoint){
    stmnScrollAmount = Math.ceil(Math.abs(stmnEndPoint - stmnStartPoint) / 15);
    STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ((stmnEndPoint<stmnStartPoint) ? - stmnScrollAmount : stmnScrollAmount );
    stmnRefreshTimer = stmnScrollSpeed;
  }

  stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
}

function InitializeStaticMenu()
{
  //STATICMENU.style.left = stmnLEFT;
  STATICMENU.style.top = document.body.scrollTop + stmnBASE;
  RefreshStaticMenu();
}

/* rolling news(a_7 Æ÷ÇÔ) */
function hit_roll(div_id, banner_height, banner_delay, banner_speed, this_height, list_count) 
{
    var div_tag = document.getElementById(div_id);
    var table_tag, i, total_height;

    this_height++;
    total_height = banner_height * list_count;
    if(this_height < total_height) {
        if(this_height%banner_height == 0){
            div_tag.style.top = -this_height;
            setTimeout("hit_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", " + this_height + ", " + list_count + ");", banner_delay);
        } else{
            div_tag.style.top = -this_height;
            setTimeout("hit_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", " + this_height + ", " + list_count + ");", banner_speed);
        }
    } else {
        table_tag = div_tag.getElementsByTagName("table");
        div_tag.appendChild(table_tag[0]);
        div_tag.style.top = 0;
        setTimeout("hit_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", 0, " + list_count + ");", banner_delay);
    }

    return true;
}

/* about bgm player */

function music(n) { 
  var music = top.document.getElementById('music'); 
  if(n == "stop")  music.stop(); 
  if(n == "play")  music.play(); 
  if(n == "pause") { 
    if (music.playstate == 2) music.pause(); 
    else { 
      if (music.playstate == 1) 
        music.play(); 
    } 
  } 
  if(n == "pre") music.previous(); 
  if(n == "next") music.next(); 
}

function qty_change(n){
  var qty=document.frm.quantity.value;
  if(n==1){
    qty++;
  }else if(n==0){
    if(qty > 1) qty--;
  }
  document.frm.quantity.value=qty;
}

/* ÃÖ±Ùº»»óÇ° °ü·Ã ½ÃÀÛ */



// ÁöÁ¤ÇÑ ÇÈ¼¿¸¸Å­ ÀÌµ¿ (¾ç¼öÀÏ¶§ ¿ìÃø, À½¼öÀÏ¶§ ÁÂÃø) 
function movePixel(int) 
{ 
   var product = document.getElementById("product"); 
   if(parseInt(product.style.left) == 0){
     alert('ÃÖ±Ù º» Ã¹»óÇ°ÀÔ´Ï´Ù.');
     return;
   }
   product.scrollLeft += int; 
   return; 
} 

/* ÃÖ±Ùº»»óÇ° °ü·Ã Á¾·á */