<!--

/////  ¿À´Ã º» »óÇ°
var array2Product;
var idxProduct = 0;
var lngProduct = 0;
var maxProduct = 3;

var floatTop = 50;
var floatLimit = 195;

var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isNS = navigator.appName == "Netscape";

function objToEvent( obj, evt, func )
{
	if ( !obj ) return ;
	var evt = ( document.all ) ? evt : evt.substring( 2, evt.length ) ;
	if ( document.all ) {
		obj.attachEvent( evt, eval(func) ) ;
	} else {
		obj.addEventListener( evt, eval(func), true ) ;
	}
}

function objToEventOut( obj, evt, func )
{
	if ( !obj ) return ;
	var evt = ( document.all ) ? evt : evt.substring( 2, evt.length ) ;
	if ( document.all ) {
		obj.detachEvent( evt, eval(func) ) ;
	} else {
		obj.removeEventListener( evt, eval(func), true ) ;
	}
}

function getElementsId(id) {
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}

function moveRightEdge() {
	var _y_top;
	var _y_bottom;
	var _y_offset;
	var tmNext;
	var tmp_int;
	var _y_limit = floatTop; //³ôÀÌÁ¶Á¤

	if ( isNS4) {
		_y_top = parseInt( document.getElementById("bnr_float").style.top, 10);
		_y_bottom = document.body.scrollTop + _y_limit - floatLimit - 1;
	} else if ( isDOM)  {
		_y_top = parseInt (bnr_float.style.top, 10);
		_y_bottom = document.body.scrollTop + _y_limit - floatLimit - 1;
	}

	if ( document.body.scrollTop < floatLimit ) {
		_y_bottom = 0;
	}

	tmNext = 40;

	if ( _y_top != _y_bottom ) {
		if ( ( document.body.scrollTop == 0) || ( document.body.scrollTop == ( document.body.scrollHeight - document.body.clientHeight ) ) ) {
			if ( isNS4 ) {
				tmp_int = parseInt( document.getElementById("bnr_float").style.top , 10) + _y_offset;
				document.getElementById("bnr_float").style.top = _y_bottom;
			} else if ( isDOM ) {
				bnr_float.style.top = _y_bottom;
			}
		} else {
			_y_offset = Math.ceil(Math.abs(_y_bottom - _y_top) / 7);
			if ( _y_bottom < _y_top ) {
				_y_offset = -_y_offset;
			}
			if ( isNS4 ) {
				tmp_int = parseInt( document.getElementById("bnr_float").style.top , 10) + _y_offset;
				document.getElementById("bnr_float").style.top = tmp_int;
			} else if ( isDOM ){
				bnr_float.style.top = parseInt (bnr_float.style.top, 10) + _y_offset;
			}

			tmNext = 10;
		}
	}
	setTimeout ("moveRightEdge()", tmNext);
}

function loadFloatBnr()
{
	if ( isNS4 ) {
		var bnr_float = document["bnr_float"];
		bnr_float.top = top.pageYOffset + 50;
		moveRightEdge();
	} else if ( isDOM ) {
		var bnr_float = getElementsId('bnr_float');
		bnr_float.style.top = (isNS ? window.pageYOffset : document.body.scrollTop) + 150;
		moveRightEdge();
	}
}

///// ÄíÅ°¼³Á¤
function setTodayView( product, img ) {
	if ( product == "" ) return;

	product = product + "|" + img;

	var array2x = getCookie("today_view_product").split(",");
	
	if ( array2x != "" && array2x.length > 0 ) {
		for (var i = 0; i<array2x.length; i++) {
			if ( product == array2x[i] ) {
				return;
			}
		}
		array2x = array2x + "," + product;
	} else {
		array2x = product;
	}
	setCookie("today_view_product", array2x, 1);
}

function getTodayView()
{
	var ret = "";
	var cnt = 0;
	if ( array2Product != "" && array2Product.length > 0 ) {
		for (var i = array2Product.length-1; i>-1; i--) {
			if ( cnt < maxProduct ) {
				cnt++;
				var _value = array2Product[i].split("|");
				if ( ret != "" ) {
					ret += "<img src='" + gzAppPath + "/images/body/float_line.gif' border=0 style='margin:3 0 3 0;'>";
				} else {
					idxProduct = i;
				}
				ret += "<a href=\"javascript:getProduct('" + _value[0] + "');\">";
				ret += "<img src='" + gzUploadData + "/Public/Html/Product/" + _value[0] + "/" + _value[1] + "' border=0>";
				ret += "</a>";
			} else {
				break;
			}
		}
	} else {
		/////  ÇöÀç±îÁö ¿­¶÷ÇÑ »óÇ°ÀÌ ¾øÀ» °æ¿ì ÃßÃµ»óÇ°
		for (var i=0; i<GZ_RECOMMAND.length; i++) {
			if ( cnt < maxProduct ) {
				cnt++;
				var _value = GZ_RECOMMAND[i].split("|");
				if ( ret != "" ) {
					ret += "<img src='" + gzAppPath + "/images/body/float_line.gif' border=0 style='margin:3 0 4 0;'>";
				}
				ret += "<a href=\"javascript:getProduct('" + _value[0] + "');\">";
				ret += "<img src='" + gzUploadData + "/Public/Html/Product/" + _value[0] + "/" + _value[1] + "' border=0>";
				ret += "</a>";
			} else {
				break;
			}
		}		
	}

	return ret;
}

function getProduct(id)
{
	if ( id != "" ) {
		location.href = gzAppPath + "/Product/ProductDetail.jsp?id=" + id;
	} 	
}

function getTodayLoad(ix)
{
	var bNull = (array2Product == null) ? false : true;
	
	if ( bNull ) {
		var ret = "";
		var cnt = 0;
	
		lngProduct = array2Product.length;
		var n = idxProduct + ix*maxProduct;
		if ( n < lngProduct && n > -1 ) {
			for (var i = n; i>-1; i--) {
				if ( cnt < maxProduct ) {
					cnt++;
					var _value = array2Product[i].split("|");
					if ( ret != "" ) {
						ret += "<img src='" + gzAppPath + "/images/body/float_line.gif' border=0 style='margin:3 0 4 0;'>";
					} else {
						idxProduct = i;
					}
					ret += "<a href=\"javascript:getProduct('" + _value[0] + "');\">";
					ret += "<img src='" + gzUploadData + "/Public/Html/Product/" + _value[0] + "/" + _value[1] + "' border=0>";
					ret += "</a>";
				} else {
					break;
				}
			}
		}
		
		if ( ret == "" ) {
			return;
		} else {
			if ( document.getElementById("menu_float_body") ) {
				document.getElementById("menu_float_body").innerHTML = ret;
			}
		}
	}
}

/////////////////////////////////////////////////////////////////////////
/////  ÃÖ±Ùº» »óÇ° && ±¤°í¹è³Ê
/////////////////////////////////////////////////////////////////////////
if ( GZ_FLOAT_MENU ) {
	array2Product = getCookie("today_view_product").split(",");

	if (array2Product != "") {
		idxProduct = array2Product.length - 1;
		lngProduct = array2Product.length;
	}
	
	objToEvent( window, "onload", "loadFloatBnr" );

	document.write("<div class='float01' id='bnr_float'>");
	document.write("	<div><img src='" + gzAppPath + "/images/body/float_top.gif' width=77 height=46></div>");
	document.write("	<div style='background:url(" + gzAppPath + "/images/body/float_bg.gif);padding:0 8 0 8;text-align:center;'>");
	document.write("		<div style='padding:0 0 5 0;'><img src='" + gzAppPath + "/images/body/float_bt_up.gif' width=20 height=11 border=0 onclick='getTodayLoad(1);' style='cursor:pointer;'> <img src='" + gzAppPath + "/images/body/float_bt_down.gif' width=20 height=11 border=0 onclick='getTodayLoad(-1);' style='cursor:pointer;'></div>");
	document.write("		<div id='menu_float_body'>");
	document.write( getTodayView() );
	document.write("		</div>");
	document.write("	</div>");
	document.write("	<div><img src='" + gzAppPath + "/images/body/float_bottom.gif' width=77 height=43 border=0 usemap='#bottom'><map name='bottom'><area shape='rect' alt='' coords='13,14,63,31' href='#top' onfocus='this.blur();'></map></div>");
	
	if ( GZ_FLOAT_BNR ) {
		document.write("	<div style='padding:5 2 0 2;text-align:center;'>");
		document.write("		<div id='bnr_float_right'></div>");
		document.write("	</div>");
	}

	document.write('</div>');

} else {

	if ( GZ_FLOAT_BNR ) {
		
		var loc = String(window.location);
		objToEvent( window, "onload", "loadFloatBnr" );

		document.write("<div class='float01' id='bnr_float'>");
		
		/////  ÆäÀÌÁö ¹× ÀÌº¥Æ®
		if ( loc.indexOf("PageViewer.jsp") > -1 ) {
			document.write("	<div><img src='" + gzAppPath + "/images/body/float_top4.gif' width=77 height=49 border=0 usemap='#bottom'><map name='bottom'><area shape='rect' alt='¸®½ºÆ®·Î µ¹¾Æ°¡±â' coords='14,26,62,40' href='../Page/PageList.jsp' onfocus='this.blur();'><area shape='rect' alt='¸ÇÀ§·Î' coords='14,7,62,21' href='#top'  onfocus='this.blur();'></map></div>");
		} else {
			document.write("	<div><img src='" + gzAppPath + "/images/body/float_top2.gif' width=77 height=30 border=0 usemap='#bottom'><map name='bottom'><area shape='rect' alt='' coords='13,7,63,23' href='#top' onfocus='this.blur();'></map></div>");
		}
		document.write("	<div style='padding:5 2 0 2;text-align:center;'>");
		document.write("		<div id='bnr_float_right'></div>");
		document.write("	</div>");
		document.write('</div>');
	}
}
-->