<!--

function preViewImageLayer(id, _left, _top){
	var divObj     = document.getElementById(id);

	divObj.style.zIndex 	= "99999";
	divObj.style.display    = "block";

	var obj_left = 0;
	var obj_top  = 0;

	if (_left != null) {
		obj_left = _left;
	} else {
//		obj_left = (document.body.clientWidth/2) + document.body.scrollLeft - (divObj.clientWidth/2) ;
		obj_left = (document.documentElement.clientWidth/2) + document.body.scrollLeft - (divObj.clientWidth/2) - 200;
	}

	if (_top != null) {
		obj_top  = getHeightPosition();
	} else {
		if(parseInt(getHeightPosition(),10) > 0) {
			obj_top  = 100 + getHeightPosition();
		} else {
			obj_top  = 100;
		}
	}

	divObj.style.left = obj_left + "px";
	divObj.style.top  = obj_top + "px";
}

// 화면 크기 설정

// 세로

var screenHeight = screen.height;
// 가로

var screenWidth =  screen.width;

// 화면에서 팝업 또는 레이어의 값으로 나눠서 위치를 반환

function getWidthPosition(w){
    return screenWidth/2 - w/2;
}

// 화면에서 팝업 또는 레이어의 값으로 나눠서 위치를 반환

function getHeightPosition(){
	return document.documentElement.scrollTop;

//    return screenHeight/2 - w/2;
}

// 팝업 띄우기

function OpenWin(URL,width,height) {
    var str,width,height;
    str="'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,";
    str=str+"width="+width;
    str=str+",height="+height+"',left="+getWidthPosition(width)+",top="+getHeightPosition(height);
    window.open(URL,'popItemZoom',str);
}

// 레이어 띄우기

function openQuickView(prdid) {
//   var pHeight = 583;
//   var pWidth = 552;
   var pHeight = 1024;
   var pWidth = 768;
   document.getElementById(prdid).style.zIndex = 999;
   document.getElementById(prdid).style.left = getWidthPosition(pWidth) + 'px';
   document.getElementById(prdid).style.top = getHeightPosition(pHeight) + 'px';
   document.getElementById(prdid).style.display = "";
}

function itemZoom(itemCode,left){
	document.getElementById('itemZoomIframe').src = "/mall/disp/itemZoom.htm?itemCode="+itemCode;

	preViewImageLayer('itemZoomDiv',100,100);
}

function wishListComplete(left){
	var hp = eval(getHeightPosition()+70);
	if(hp > 140) hp = hp - 120;

	document.getElementById('wishListDiv').style.left = left+'px';
	document.getElementById('wishListDiv').style.top = hp + 'px';
	document.getElementById('wishListDiv').style.display = "";
}

String.prototype.cut = function(len) {
    var str = this;
    var l = 0;
    for (var i=0; i<str.length; i++) {
        l += (str.charCodeAt(i) > 128) ? 2 : 1;
        if (l > len) return str.substring(0,i) + "...";
    }
    return str;
}

//-->