function favorite(url,title) { 
window.external.AddFavorite(url,title);
}

function getValue() {
varCall = document.getElementById("scroll_top").innerHTML;
document.getElementById('getvar').innerHTML = varCall;
}

/*--------------------------------
      ¸®½ÎÀÌÁî ·¹ÀÌ¾î
---------------------------------*/ 
function resize_div( $id, $prop, $pixel ){
	var obj = document.getElementById( $id );
	obj.style[$prop] = $pixel + "px";
}

/*--------------------------------
      ¸ÞÀÎÀÌº¥Æ® ¹®±¸º¯°æ
---------------------------------*/ 

 function eventChange() 
 { 
  var obj=document.getElementById('eventData');
  var temp_value = obj.innerHTML; 
  var regexp = /event_txt1/gi;
  temp_value = temp_value.replace(regexp,"(ÁÖ¹®ÆøÁÖ)");
  var regexp = /event_txt2/gi;
  temp_value = temp_value.replace(regexp,"Handmade Mini Skirt");
  var regexp = /event_txt3/gi;
  temp_value = temp_value.replace(regexp,"ÀÎ±â»óÇ°");
  obj.innerHTML=temp_value;
 } 

/*--------------------------------
      ÇÃ·¡½Ã ¸µÅ© ½ÃÀÛ
---------------------------------*/ 
//
//Æ®·£µå¸®ºä ½ÃÀÛ
//
function link_trend1(){
  location.href='/front/php/product.php?product_no=4499'; //1¹øÀÌ¹ÌÁö
}
function link_trend2(){
  location.href='/front/php/product.php?product_no=4508'; //2¹øÀÌ¹ÌÁö
}
function link_trend3(){
  location.href='/front/php/product.php?product_no=4525'; //3¹øÀÌ¹ÌÁö
}
//Æ®·£µå¸®ºä ³¡
//
//ÄÚµð¾ÆÀÌÅÛ ½ÃÀÛ
//
function link_cody1(){
  location.href='/front/php/category.php?cate_no=41'; //1¹øÀÌ¹ÌÁö
}
function link_cody2(){
  location.href='/front/php/category.php?cate_no=57'; //2¹øÀÌ¹ÌÁö
}
function link_cody3(){
  location.href='/front/php/category.php?cate_no=28'; //3¹øÀÌ¹ÌÁö
}
function link_cody4(){
  location.href='/front/php/category.php?cate_no=46'; //4¹øÀÌ¹ÌÁö
}
function link_cody5(){
  location.href='/front/php/category.php?cate_no=54'; //5¹øÀÌ¹ÌÁö
}
//ÄÚµð¾ÆÀÌÅÛ ³¡
/*--------------------------------
      ÇÃ·¡½Ã ¸µÅ© ³¡
---------------------------------*/ 


function roll(div_id, banner_height, banner_delay, banner_speed, this_height)
{
    var div_tag = document.getElementById(div_id);
    var table_tag, i;

    this_height ++;
    if(this_height < banner_height) {
        div_tag.style.top = -this_height;
        setTimeout("roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", " + this_height + ");", banner_speed);
    } else {

        table_tag = div_tag.getElementsByTagName("TABLE");
        div_tag.appendChild(table_tag[0]);
        div_tag.style.top = 0;
        setTimeout("roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", 0);", banner_delay);
    }

    return true;
}



/*--------------------------------
      ÇÃ·¡½Ã ÄÚµå ½ÃÀÛ
---------------------------------*/ 

function flashWrite(url,w,h,id,bg,vars,win){

	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);

}

 function product(url,w,h,id,bg,win){

	var obj, objs;
	var leng = dateNum;
	var regexp0 = /[<][^>]*[^>][>]/gi;
	var regexp1 = /¿ø /g;
	var regexp2 = /\s\s|\n/g;
	var regexp3 = /%/g;
	var regexp4 = /¿ø/g;
	var regexp5 = /Á¦Á¶»ç/g;
	for(var i=1; i<parseInt(leng); i++)
         {
		obj = "date_" + i;
		objs = document.getElementById(obj);
		temp_value = objs.innerHTML;
		temp_value = temp_value.replace(regexp0,"");
		temp_value = temp_value.replace(regexp1," won&memo= ");
		temp_value = temp_value.replace(regexp2,"");
		temp_value = temp_value.replace(regexp3,"%25°¡ Àû¸³µË´Ï´Ù.&");
		temp_value = temp_value.replace(regexp4,"¿øÀÌ Àû¸³µË´Ï´Ù.&");
		temp_value = temp_value.replace(regexp5,"");
		document.getElementById(obj).innerHTML = temp_value;  
		vars = temp_value;
	}

var flashStra=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='FlashVars' value='" +vars+ "' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' FlashVars='" +vars+ "' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStra);
}
/*--------------------------------
      ÇÃ·¡½Ã ÄÚµå ³¡
---------------------------------*/ 














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 );
}
/*--------------------------------
       Ä«¿îÆ® Áõ°¡
---------------------------------*/ 

dateNum = 1;
mNum = 1;


/*--------------------------------
       ½ºÅ©·Ñ ·¹ÀÌ¾î
---------------------------------*/ 
//<![CDATA[
// TOP ¹öÆ° ½½¶óÀÌµå
//Å¬¸¯ÇÏ¸é Å¾À¸·Î ÀÌµ¿
function go_top() {
	x = document.body.scrollLeft;
	y = document.body.scrollTop;
	step = 2;

	while ((x != 0) || (y != 0)) {
	        scroll (x, y);
	        step += (step * step / 300);
	        x -= step;
	        y -= step;
	        if (x < 0) x = 0;
	        if (y < 0) y = 0;
	}
	scroll (0, 0);
}

// TOP ¹öÆ° ½½¶óÀÌµå
function Floating(FloatingObj,MarginX,MarginY,Percentage,setTime) {
	this.FloatingObj = FloatingObj;
	this.MarginX = (MarginX) ? MarginX : 0;
	this.MarginY = (MarginY) ? MarginY : 0;
	this.Percentage = (Percentage) ? Percentage : 20;
	this.setTime = (setTime) ? setTime : 10;
	this.FloatingObj.style.position = "absolute";
	this.Body = null;
	this.setTimeOut = null;
	this.Run();
}
// ¿ìÃø ½ºÅ©·Ñ ·¹ÀÌ¾î
Floating.prototype.Run = function () {
	if ((document.documentElement.scrollLeft + document.documentElement.scrollTop) > (document.body.scrollLeft + document.body.scrollTop)) {
		this.Body = document.documentElement.document.getElementById("wrapper");
	} else {
		this.Body = document.body.document.getElementById("wrapper");
	}

	var This = this;
	var FloatingObjLeft = (this.FloatingObj.style.right) ? parseInt(this.FloatingObj.style.right,10) : this.FloatingObj.offsetLeft;
	var FloatingObjTop = (this.FloatingObj.style.top) ? parseInt(this.FloatingObj.style.top,10) : this.FloatingObj.offsetTop;
	var DocLeft = this.Body.scrollLeft + this.MarginX;
	var DocTop = this.Body.scrollTop + this.MarginY;

	var MoveX = Math.abs(FloatingObjLeft - DocLeft);
	MoveX = Math.ceil(MoveX / this.Percentage);
	var MoveY = Math.abs(FloatingObjTop - DocTop);
	MoveY = Math.ceil(MoveY / this.Percentage);

	if (FloatingObjLeft < DocLeft) {
		this.FloatingObj.style.right = FloatingObjLeft + MoveX + "px";
	} else {
		this.FloatingObj.style.right = FloatingObjLeft - MoveX + "px";
	}

	if (FloatingObjTop < DocTop) {
		this.FloatingObj.style.top = FloatingObjTop + MoveY + "px";
	} else {
		this.FloatingObj.style.top = FloatingObjTop - MoveY + "px";
	}

	window.clearTimeout(this.setTimeOut);
	this.setTimeOut = window.setTimeout(function () { This.Run(); },this.setTime);
}

