function view_div(over_img,img_name,div_name){

	if(div_name.style.display=='block')
	{
		div_name.style.display='none';
		over_img.src="http://file.stylehomme.cafe24.com/Design/skin_3/"+img_name+".gif";
	}
	else
	{
		div_name.style.display='block';
		over_img.src="http://file.stylehomme.cafe24.com/Design/skin_3/"+img_name+"_on.gif";
	}
}

//카테고리에서 카테고리 영역 벗어나면 안보이게 함.
function categoryNoDisplay(over_img,img_name,div_name){
                div_name.style.display='none';
                over_img.src="http://file.stylehomme.cafe24.com/Design/skin_3/"+img_name+".gif";
}


function flashObject(file_name,id,flashVar,width,height){
  document.write('<object id="' + id + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '">');
  document.write('<param name="movie" value="' + file_name + '">');
  document.write('<param name=FlashVars value="' + flashVar + '">');
  document.write('<param name="quality" value="high">');
  document.write('<param name="bgcolor" value="#ffffff">');
  document.write('<param name="wmode" value="transparent">');
  document.write('<param name="allowScriptAccess" value="always">');
  document.write('<param name="base" value=".">');
  document.write('<embed src="' + file_name +'" name="' + id +'" FlashVars="' + flashVar +'" width="' + width + '" height="' + height + '" quality="high" bgcolor="#ffffff" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" allowScriptAccess="always" allowNetworking="all" base="."></embed>');
  document.write('</object>');
}









function setimg(){
var loc = location.href.split('?');
    if(loc[1].indexOf('cate_no=29')>=0||loc[1].indexOf('cate_no=30')>=0||loc[1].indexOf('cate_no=31')>=0||loc[1].indexOf('cate_no=32')>=0)
    {
      dir="c5";
     }
     else if(loc[1].indexOf('cate_no=33')>=0||loc[1].indexOf('cate_no=34')>=0||loc[1].indexOf('cate_no=35')>=0)
    {
      dir="c2";
     }
    else if(loc[1].indexOf('cate_no=37')>=0||loc[1].indexOf('cate_no=38')>=0||loc[1].indexOf('cate_no=39')>=0||loc[1].indexOf('cate_no=36')>=0)
    {
      dir="c3";
     }
    else if(loc[1].indexOf('cate_no=40')>=0||loc[1].indexOf('cate_no=41')>=0||loc[1].indexOf('cate_no=42')>=0)
    {
      dir="c4";
     }
    else if(loc[1].indexOf('cate_no=43')>=0||loc[1].indexOf('cate_no=44')>=0)
    {
      dir="c1";
     }
  
  allbg.background="http://file.stylehomme.cafe24.com/Design/skin_3/img/"+dir+"http://file.stylehomme.cafe24.com/Design/skin_3/bg.jpg";
  c1.src="http://file.stylehomme.cafe24.com/Design/skin_3/img/"+dir+"http://file.stylehomme.cafe24.com/Design/skin_3/images/c1.png";
  setPng24(c1);
 c2.src="http://file.stylehomme.cafe24.com/Design/skin_3/img/"+dir+"http://file.stylehomme.cafe24.com/Design/skin_3/images/c2.png";
   setPng24(c2);
  c3.src="http://file.stylehomme.cafe24.com/Design/skin_3/img/"+dir+"http://file.stylehomme.cafe24.com/Design/skin_3/images/c3.png";
  setPng24(c3);
  c4.src="http://file.stylehomme.cafe24.com/Design/skin_3/img/"+dir+"http://file.stylehomme.cafe24.com/Design/skin_3/images/c4.png";
  setPng24(c4);
  c5.src="http://file.stylehomme.cafe24.com/Design/skin_3/img/"+dir+"http://file.stylehomme.cafe24.com/Design/skin_3/images/c5.png";
  setPng24(c5);
  c6.src="http://file.stylehomme.cafe24.com/Design/skin_3/img/"+dir+"http://file.stylehomme.cafe24.com/Design/skin_3/images/c6.png";
  setPng24(c6);
  c7.src="http://file.stylehomme.cafe24.com/Design/skin_3/img/"+dir+"http://file.stylehomme.cafe24.com/Design/skin_3/images/c7.png";
  setPng24(c7);
  c8.src="http://file.stylehomme.cafe24.com/Design/skin_3/img/"+dir+"http://file.stylehomme.cafe24.com/Design/skin_3/images/c8.png";
  setPng24(c8);
  c9.src="http://file.stylehomme.cafe24.com/Design/skin_3/img/"+dir+"http://file.stylehomme.cafe24.com/Design/skin_3/images/c9.png";
  setPng24(c9);    
  cmbg.background="http://file.stylehomme.cafe24.com/Design/skin_3/img/"+dir+"http://file.stylehomme.cafe24.com/Design/skin_3/images/cmbg.jpg";

  
}

function setPng24(obj) {
        obj.width=obj.height=1;
        obj.className=obj.className.replace(/bpng24b/i,'');
        obj.style.filter =
        "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
       // obj.src='';
        return '';
    }


function bluring(){  
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG")  
document.body.focus();   
}
document.onfocusin=bluring;  

function imgon(img){
  var str=img.src;
//alert(img.src);
  var lnk = str.split("/");
  var num = lnk.length-1;
  img.src="http://file.stylehomme.cafe24.com/Design/skin_3/on/"+lnk[num];
}

function imgout(img){
  var str=img.src;
  var lnk = str.split("/");  
  var num = lnk.length-1;
  img.src="http://file.stylehomme.cafe24.com/Design/skin_3/"+lnk[num];
}

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 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);

}




var stmnGAP1 = 20; // 페이지 헤더부분의 여백 (이보다 위로는 올라가지 않음)
        var stmnGAP2 = 0; // 스크롤시 브라우저 상단과 약간 띄움. 필요없으면 0으로 세팅
        var stmnBASE = 20; // 스크롤메뉴 초기 시작위치 (아무렇게나 해도 상관은 없지만 stmnGAP1과 약간 차이를 주는게 보기 좋음)
        var stmnActivateSpeed = 100; // 움직임을 감지하는 속도 (숫자가 클수록 늦게 알아차림)
        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.top = document.body.scrollTop + stmnBASE; // 기본위치로 이동한다.
                        RefreshStaticMenu(); // 스크립트 가동
        }

function bookmarksite(title,url) { 
//title=document.title;
url=parent.location.href;
   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(document.all) // ie
   window.external.AddFavorite(url, title); 
}


function callExternalInterface() {
    thisMovie("music").myplay();
}

function callExternalInterface2() {
    thisMovie("music").mystop();
}

function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}




var globopObject;
var opIndex=0;
var cleared=true;
var direction=10;

function dynOpacity(opObject,stop) {
  if (stop) {
    clearInterval(window.tm);
    cleared=true;
    opIndex=10;
    return;
  }
  globopObject=opObject;
  if (opIndex>105) direction=-4;
  if (opIndex<100) direction=4;
  opIndex+=direction;
  globopObject.style.filter='alpha(opacity:' + opIndex + ')';
  if (cleared) {
    window.tm=setInterval("dynOpacity(globopObject,false);",1);
    cleared=false;
  }
}

function opacity(num) {
  if(num == 1) {
    dynOpacity(event.srcElement,false);
  }
  if(num == 2) {
    event.srcElement.style.filter="";
    dynOpacity(event.srcElement,true);
  }
}

function bookmarksite(title,url) { 
title=parent.document.title;
url=parent.location.href;
   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(document.all) // ie
   window.external.AddFavorite(url, title); 
}

function large(){
document.all('flashArea').style.height=530;
}
function small(){
document.all('flashArea').style.height=180;
}






    function shoutCut(){{
        var url = '/Front/?url=Shortcut';
        var winname = "shortcut_install" ;
        var option = "toolbar=no location=no scrollbars=no width=355 height=185" ;
        var opener = window.open( url, winname, option );
    }}   




    function favorite2(){{
        var url = '/Front/?url=Favorite';
        var winname = "favorite_install" ;
        var option = "toolbar=no location=no scrollbars=no width=355 height=185" ;
        var opener = window.open( url, winname, option );
    }}   
