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 go_category(num)
{
	switch(num) {
		case 1:
			url = '/Front/Product/?url=Category&cate_no=AFAF0000';
			break;
		case 2:
			url = '/Front/Product/?url=Category&cate_no=AAAA0000';
			break;
		case 3:
			url = '/Front/Product/?url=Category&cate_no=AAAB0000';
			break;
		case 4:
			url = '/Front/Product/?url=Category&cate_no=AAAE0000';
			break;
		case 5:
			url = '/Front/Product/?url=Category&cate_no=AAAC0000';
			break;
		case 6:
			url = '/Front/Product/?url=Category&cate_no=ABAA0000';
			break;
		case 7:
			url = '/Front/Product/?url=Category&cate_no=AAAD0000';
			break;
		case 8:
			url = '/Front/Product/?url=Category&cate_no=ABAB0000';
			break;
		case 9:
			url = '/Front/Product/?url=Category&cate_no=ABAC0000';
			break;
		case 10:
			url = '/Front/Product/?url=Category&cate_no=AC000000';
			break;
		case 11:
			url = '/Front/Product/?url=Category&cate_no=AD000000';
			break;
		case 12:
			url = '/Front/Product/?url=Category&cate_no=AE000000';
			break;
		case 13:
			url = '/Front/Product/?url=Category&cate_no=AG000000';
			break;
		case 14:
			url = '/Front/Product/?url=Category&cate_no=AH000000';
			break;
		case 15:
			url = '/Front/Product/?url=Category&cate_no=AFAC0000';
			break;
		case 16:
			url = '/Front/Product/?url=Category&cate_no=AI000000';
			break;
	}

	location.href = url;
}


/**
 * 바가지머리에서 쓰는 함수
 **/
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="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 += ' 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');
}


var flashLink=new Array();
/*080611 이전
flashLink[1]="/shop/big_section.php?cno1=1050";//
flashLink[2]="/shop/big_section.php?cno1=1006";//
flashLink[3]="/shop/big_section.php?cno1=1086";//
flashLink[4]="/shop/big_section.php?cno1=1005";//
flashLink[5]="/shop/big_section.php?cno1=1009";//
flashLink[6]="/shop/big_section.php?cno1=1004";//
flashLink[7]="/shop/big_section.php?cno1=1007";//
flashLink[8]="/shop/big_section.php?cno1=1008";//
flashLink[9]="/shop/big_section.php?cno1=1069";//
flashLink[10]="/shop/big_section.php?cno1=1070";//
flashLink[11]="/shop/big_section.php?cno1=1003";//
flashLink[12]="/shop/big_section.php?cno1=1060";//
flashLink[13]="/shop/big_section.php?cno1=1022";//
flashLink[14]="/shop/big_section.php?cno1=1031";//
*/
flashLink[1]="/shop/big_section.php?cno1=1050";//
flashLink[2]="/shop/big_section.php?cno1=1006";//
flashLink[3]="/shop/big_section.php?cno1=1089";//
flashLink[4]="/shop/big_section.php?cno1=1086";//
flashLink[5]="/shop/big_section.php?cno1=1005";//
flashLink[6]="/shop/big_section.php?cno1=1009";//
flashLink[7]="/shop/big_section.php?cno1=1004";//
flashLink[8]="/shop/big_section.php?cno1=1007";//
flashLink[9]="/shop/big_section.php?cno1=1008";//
flashLink[10]="/shop/big_section.php?cno1=1069";//
flashLink[11]="/shop/big_section.php?cno1=1070";//
flashLink[12]="/shop/big_section.php?cno1=1003";//
flashLink[13]="/shop/big_section.php?cno1=1090";//
flashLink[14]="/shop/big_section.php?cno1=1060";//
flashLink[15]="/shop/big_section.php?cno1=1022";//
flashLink[16]="/shop/big_section.php?cno1=1031";//

function goFlash(n){
	if (flashLink[n]) location.href=flashLink[n];
}

//quick
var verticalpos="frombottom"

function JSFX_FloatTopDiv() {
    var startX = 830;   //X축 위치
	var startY = 148;  //브라우저 하단에서의 위치

    var ns = (navigator.appName.indexOf("Netscape") != -1);
    var d = document;
    function ml(id) {
        var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
        if(d.layers)el.style=el;
        el.sP=function(x,y){this.style.left=x;this.style.top=y;};
        el.x = startX;
        if (verticalpos=="fromtop")
        el.y = startY;
        else{
        el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
        el.y -= startY;
        }
        return el;
    }
    window.stayTopLeft=function() {
        if (verticalpos=="fromtop"){
        var pY = ns ? pageYOffset : document.body.scrollTop;
        ftlObj.y += (pY + startY - ftlObj.y)/8;
        }
        else{
        var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
        ftlObj.y += (pY - startY - ftlObj.y)/8;
        }
        ftlObj.sP(ftlObj.x, ftlObj.y);
        setTimeout("stayTopLeft()", 15);
    }
    ftlObj = ml("topBtn");
    stayTopLeft();
}


function eScroll()
{
	/*********************************
	 * eScroll ( eNamoo scroll script )
	 * by mirrh
	 * 2006.07.16
	 ********************************/

	var thisObj = this;
	this.timeObj = null;

	/*** 설정변수 ***/
	this.mode = "top";				// 스크롤 방향 (top|left)
	this.width = "100%";			// 라인당 가로값 (pixel)
	this.height = 18;				// 라인당 높이값 (pixel)
	this.line = 1;					// 출력 라인수
	this.delay = 150;				// 스크롤후 딜레이 시간
	this.speed = 1;					// 스크롤 속도 (작을수록 빠름)
	this.id = 'obj_eScroll';		// 객체 id (클래스 다중 사용시 id 다르게 지정 요망)
	this.contents = new Array();	// 출력 내용 (배열로 내용 지정 요망)
	this.align = "left";			// 내용 aligne
	this.valign = "middle";			// 내용 valigne

	/*** 내장변수 ***/
	this.gap = 0;
	this.direction = 1;

	this.add = add;
	this.exec = exec;
	this.start = start;
	this.stop = stop;
	this.scroll = scroll;
	this.direct = direct;
	this.go = go;

	function add(str)
	{
		this.contents[this.contents.length] = str;
	}

	function exec()
	{
		this.basis = (this.mode == "left") ? this.width : this.height;
		var outWidth = this.width * ((this.mode == "left") ? this.line : 1);
		var outHeight = this.height * ((this.mode == "top") ? this.line : 1);
		var outline = "<div style='font-size:11px;' id=" + this.id + " style='overflow:hidden;width:" + outWidth + ";height:" + outHeight + "'><table></table></div>";
		document.write(outline);
		this.obj = document.getElementById(this.id);

		var tb = this.obj.appendChild(document.createElement("table"));
		var tbody = tb.appendChild(document.createElement("tbody"));
		tb.cellPadding = 0 ;
		tb.cellSpacing = 0 ;
		tb.onmouseover = function(){thisObj.stop()};
		tb.onmouseout = function(){thisObj.start()};

		if (this.mode=="left") var tr = tbody.appendChild(document.createElement("tr"));
		for (k in this.contents){
			if (this.mode=="top") var tr = tbody.appendChild(document.createElement("tr"));
			var td = tr.appendChild(document.createElement("td"));
			td.noWrap = true;
			td.style.width = this.width;
			td.style.height = this.height;
			td.style.textAlign = this.align;
			td.style.verticalAlign = this.valign;
			td.innerHTML = this.contents[k];
		}

		var len = (this.contents.length<this.line) ? this.contents.length : this.line;
		len = len - 1;
		for (i=0;i<len;i++){
			if (this.mode=="top") var tr = tbody.appendChild(document.createElement("tr"));
			td = tr.appendChild(document.createElement("td"));
			td.noWrap = true;
			td.style.width = this.width;
			td.style.height = this.height;
			td.style.textAlign = this.align;
			td.style.verticalAlign = this.valign;
			td.innerHTML = this.contents[i];
		}

		this.obj.parent = this;
		this.tpoint = this.basis * this.contents.length;
		this.start();
	}

	function scroll()
	{
		var out = (this.mode=="left") ? this.obj.scrollLeft : this.obj.scrollTop;
		if (out%this.basis==0){
			this.gap++;
			if (this.gap>=this.delay) this.gap = 0;
		}
		if (!this.gap){
			var ret = (out==this.tpoint) ? this.direction : out + this.direction;
			if (ret<0) ret = this.tpoint + ret;
			if (this.mode=="left") this.obj.scrollLeft = ret;
			else this.obj.scrollTop = ret;
		}
	}

	function start()
	{
		this.timeObj = window.setInterval("(document.getElementById('" + this.id + "')).parent.scroll()",this.speed);
	}

	function stop()
	{
		clearTimeout(this.timeObj);
	}

	function direct(d)
	{
		this.direction = d;
	}

	function go()
	{
		this.stop();
		var out = (this.mode=="left") ? this.obj.scrollLeft : this.obj.scrollTop;
		var ret = (parseInt(out / this.basis) + this.direction) * this.basis;
		if (ret<0) ret = this.tpoint + ret;
		if (ret>this.tpoint) ret = this.basis;
		if (this.mode=="left") this.obj.scrollLeft = ret;
		else this.obj.scrollTop = ret;
	}

}



//IE PNG use
var png_alpha=true;
function setPng24(obj) {
      var browser = navigator.appName;
      var version = parseFloat(navigator.appVersion.replace (/^.*MSIE ([.0-9]+).*$/,"$1"));

      if(browser.indexOf("Internet Explorer") && version < 7.0 && png_alpha==true) { // IE6 이하에서만 동작 2008-03-14 by zardsama
            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 '';
      }
}