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 );
}

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 );
}

// IE flash
function flashMovie(fid,src,wid,hei,fvs,wmd) { 
  this.fPrint = ''; 
  this.Id = document.getElementById(fid); 
  this.Src = src; 
  this.Width = wid; 
  this.Height = hei; 
  this.FlashVars = (fvs != undefined)? fvs :''; 
  this.Wmod = (wmd != undefined)? wmd :''; 
  if(isObject(Id)) { 
    fPrint = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"'; 
    fPrint += ' width="'+Width+'"'; 
    fPrint += ' height="'+Height+'">'; 
	fPrint += '<param name="allowscriptaccess" value="always" />';
    fPrint += '<param name="movie" value="'+Src+'">'; 
    fPrint += '<param name="quality" value="high">'; 
    fPrint += (FlashVars != null) ? '<param name="FlashVars" value="'+FlashVars+'">' : ''; 
    fPrint += (Wmod != null) ? '<param name="wmode" value="'+Wmod+'">' : ''; 
    fPrint += '<embed'; 
    fPrint += fPrint + ' src="'+Src+'"'; 
    fPrint += (FlashVars != null) ? ' FlashVars="'+FlashVars+'"' : ''; 
    fPrint += (Wmod != null) ? ' wmode="'+Wmod+'"' : ''; 
    fPrint += ' quality="high"'; 
	fPrint += ' allowscriptaccess="always"'; 
    fPrint += ' pluginspage="http://www.macromedia.com/go/getflashplayer"'; 
    fPrint += ' type="application/x-shockwave-flash"'; 
    fPrint += ' width="'+Width+'"'; 
    fPrint += ' height="'+Height+'"'; 
    fPrint += '></embed>'; 
    fPrint += '</object>'; 
    Id.innerHTML = fPrint; 
  } 
} 
function isObject(a) { 
    return (a && typeof a == 'object'); 
}

//flash menu link
var flashLink=new Array();
flashLink[00]="/"; //·Î°í
flashLink[01]="/front/php/login/login_f.php"; //·Î±×ÀÎ
flashLink[02]="/front/php/c/member_regist_f.php"; //È¸¿ø°¡ÀÔ
flashLink[03]="/front/php/basket.php"; //Àå¹Ù±¸´Ï
flashLink[04]="/front/php/faq.php"; //°¡ÀÌµå
flashLink[05]="/front/php/myshop/myshop.php"; //¸¶ÀÌÆäÀÌÁö
flashLink[19]="/front/php/myshop/myshop_orders.php"; //ÁÖ¹®Á¶È¸

flashLink[06]="/front/php/login/login_a.php?mode=logout"; //·Î±×¾Æ¿ô
flashLink[07]="/front/php/c/member_regist_f.php"; //Á¤º¸¼öÁ¤

flashLink[08]="/front/php/category.php?cate_no=25"; //Æ¼
flashLink[09]="/front/php/category.php?cate_no=27"; //¹ÙÁö
flashLink[10]="/front/php/category.php?cate_no=24"; //¿ÜÅõ
flashLink[11]="/front/php/category.php?cate_no=26"; //µå·¹½º
flashLink[12]="/front/php/category.php?cate_no=29"; //¾Ç¼¼¼­¸®
flashLink[13]="/front/php/category.php?cate_no=28"; //½Å¹ß
flashLink[14]="/front/php/faq.php"; //ÀÌ¿ë¾È³»
flashLink[15]="/front/php/category.php?cate_no=30"; //ÇÚµå¸ÞÀÌµå
flashLink[16]="http://service.epost.go.kr/iservice/trace/Trace.jsp"; //¹è¼ÛÁ¶È¸
flashLink[17]="javascript:addBookmark();"; //¹è¼ÛÁ¶È¸
flashLink[18]="/";//¾×ÀÚ ¸µÅ©

function goFlash(n){
	//alert(n);
    
	if (n==16) window.open(flashLink[n]);
	else location.href=flashLink[n];
}

//IE PNG use
function setPng24(obj) { 
    obj.width=obj.height=1; 
    obj.className=obj.className.replace(/\bpng24\b/i,''); 
    obj.style.filter = 
    "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
    obj.src='';  
    return ''; 
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//  ¢Æ   bookmarksite
//
//**************************************************************************************************************
//
//  Usage) Áñ°ÜÃ£±â
//         -  À§»ç¸ô °ü¸®ÀÚÀÇ ¼îÇÎ¸ô°ü¸® - ´ëÇ¥µµ¸ÞÀÎ ¼³Á¤ - ´ëÇ¥µµ¸ÞÀÎ, 
//            À§»ç¸ô °ü¸®ÀÚÀÇ ¼îÇÎ¸ô°ü¸® - Å¸ÀÌÆ²¸ÞÅ¸°Ë»ö - À¥ºê¶ó¿ìÀú Å¸ÀÌÆ²ÀÌ ³»¿ëÀ¸·Î µé¾î°¨
//
//  Example)
//      <img src="ÀÌ¹ÌÁö°æ·Î" alt="Áñ°ÜÃ£±â" onclick="addBookmark()">
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function addBookmark() {
	var url = 'http://ruuroom.com/';
	var title = ':: Åõ¾ß ±èÁöÇýÀÇ ·ç·ë ::';

    if (window.sidebar) {// firefox
        window.sidebar.addPanel(title, url, ""); 
    }

    else if(window.opera && window.print) {// opera
        var elem = document.createElement('a');
        elem.setAttribute('href',url);
        elem.setAttribute('title',title);
        elem.setAttribute('rel','sidebar');
        elem.click();
    }

    else if(window.external) {// IE
        window.external.AddFavorite(url, title);
    }
}


/////////////////////////////////////////////////////////////////////////////////////////
//
//	¢Æ R2Slider 1.0
//
//	- 2008-03-20 by zardsama
//
// **************************************************************************
//
// Usage)
//		var º¯¼ö¸í = new R2Slider("·¹ÀÌ¾î ID","º¯¼ö¸í", ¼Óµµ, »ó´Ü¸¶Áø);
//		º¯¼ö¸í.slide();
//
//		- ¼Óµµ, »ó´Ü¸¶ÁøÀº »ý·« °¡´É / ÃßÈÄ º¯°æ °¡´É
//		- 'º¯¼ö¸í.limitTop' È¤Àº 'º¯¼ö¸í.limitBottom' À¸·Î »ó/ÇÏ´Ü ÇÑ°è ÁöÁ¡ ¼³Á¤°¡´É
//
//
//	Example )
//		<div id="scroll" style="position:absolute; width: 100px; height: 400px;"></div>
//		<script type="text/javascript">
//			var test = new R2Slider ("scroll","test",null,null,null);
//			test.limitTop = 100;
//			test.slide();
//		</x-script>
//
/////////////////////////////////////////////////////////////////////////////////////////

R2Slider = function(id, slider, divPitch, marginTop, dElement) {
	if (isNaN(parseInt(marginTop))) marginTop = 0;	// »ó´Ü ¸¶Áø µðÆúÆ®
	if (isNaN(parseInt(divPitch))) divPitch = 15;	// ÀÌµ¿ °£°Ý µðÆúÆ®
	if (!dElement) dElement = document.documentElement; // DTD strict ÀÏ¶§ ( Transitional ÀÏ¶§´Â document.body )

	this.timer;	// Å¸ÀÌ¸Ó º¯¼ö
	this.slider = slider;	// °´Ã¼ º¯¼ö¸í
	this.obj = document.getElementById (id);	// ¿ÀºêÁ§Æ®
	this.marginTop = parseInt(marginTop);	// »ó´Ü ¸¶Áø
	this.divPitch = parseInt(divPitch);	// ÀÌµ¿ °£°Ý
	this.dElement = dElement; // DTD ¿¡ µû¸¥ µµÅ¥¸ÕÆ® ¿¤¸®¸ÕÆ®
	this.limitTop;	 // »ó´Ü ÇÑ°èÁ¡
	this.limitBottom;	 // ÇÏ´Ü ÇÑ°èÁ¡
}


R2Slider.prototype.moveIt = function(){
	var pitch = (parseInt(this.dElement.scrollTop)+ parseInt(this.marginTop)) - parseInt(this.obj.style.top);

	if (pitch == 0) return;
	else nextPos = parseInt(this.obj.style.top) + pitch / this.divPitch
	nextPos = (pitch > 0) ? Math.ceil(nextPos) : Math.floor(nextPos);

	var limitBottom = this.dElement.scrollHeight - parseInt(this.limitBottom)- parseInt(this.obj.offsetHeight);
	if ( this.limitTop && nextPos  < this.limitTop ) nextPos = this.limitTop;
	if ( this.limitBottom && nextPos  > limitBottom ) nextPos = limitBottom;
	if (nextPos < this.marginTop) nextPos = this.marginTop;
	if (isNaN(nextPos)) nextPos = 0;

	this.obj.style.top = nextPos+"px";
}


R2Slider.prototype.slide = function() {
	this.timer = setInterval(""+this.slider+".moveIt()", 10);
}

function changeImage2(img_url){
	document.big_img.src = img_url;
   	return;
}