///////////////////////////////////////////////////////////////////////////////////////
// Àü¿ªº¯¼ö »ç¿ë½Ã util.js ¸¦ ¸ÕÀú »ç¿ëÇÏ¼¼¿ä.
///////////////////////////////////////////////////////////////////////////////////////

// ÀÌ¹ÌÁö Å©°Ôº¸±â ÆË¾÷ ½ÃÀÛ //
var imgObj = new Image();

function showImgWin(imgName) {
	imgObj.src = imgName;
	
	setTimeout("createImgWin(imgObj)", 100);
}

function createImgWin(imgObj) {
	if (! imgObj.complete) {
		setTimeout("createImgWin(imgObj)", 100);
		return;
	}
	
	if(imgObj.height > 600) {
		strWindow_height = 600;
		strWindow_scrollbars = ", scrollbars=yes, resizable=yes";
	} else {
		strWindow_height = imgObj.height;
		strWindow_scrollbars = "";
	}

	imageWin = window.open("", "imageWin","width=" + (parseInt(imgObj.width)+32) + ",height=" + strWindow_height + strWindow_scrollbars);
	imageWin.document.write("<html><head></head><body style='margin:0' oncontextmenu='return false'>");
	imageWin.document.write("<a href='javascript:window.close();' title='»çÁøÀ» Å¬¸¯ÇÏ½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù!'><img src='" + imgObj.src + "' border=0></a>");
	imageWin.document.write("</body><html>");
	imageWin.document.title = "»çÁø";
}
// ÀÌ¹ÌÁö Å©°Ôº¸±â ÆË¾÷ ³¡   //


// ¸ÞÀÎÀÌ¹ÌÁö or µ¿¿µ»óºä¾î //
function popup(goods_id, gubun, mov_id) {
	var str = "";
	if(mov_id) {
		str = "?goods_id=" + goods_id + "&gubun=" + gubun + "&data_id=" + mov_id;
	} else {
		str = "?goods_id=" + goods_id + "&gubun=" + gubun;
	}
	window.open ("/popup_imgmov.asp"+str, "DOPopup", "width=653, height=590, status=no, toolbar=no, menubar=no, location=no, resizable=no, scrollbars=yes, copyhistory=no");
}

// ÅäÅ© or µ¿¿µ»óÈÄ±â ¼öÁ¤ //
function funOpenTalkModify(goods_id, tail_code, gubun, fm) {
	var intH;
	var str = "?tail_code=" + tail_code + "&gubun=" + gubun;
	if(gubun == "M") {
		intH = 600;
	} else {
		intH = 490;
	}
	var winpos = "left=" + ((window.screen.width-653)/2) + ", top=" + ((window.screen.height-intH)/2);
	var winstyle = "width=653, height="+intH+", status=no, toolbar=no, menubar=no, location=no, resizable=no, scrollbars=yes, copyhistory=no, " + winpos;
	window.open("about:blank", "ModifyPopup", winstyle);
	fm.target = "ModifyPopup";
	fm.action = "/common/comment/comment_modify.asp"+str;
	fm.submit();

}

// »ó¼¼Á¤º¸1 //
function funOpenDetail(chk, oid, osid) {
	var winpos = "left=" + ((window.screen.width-810)/2) + ", top=" + ((window.screen.height-630)/2);
	var winstyle = "width=800, height=630, status=no, toolbar=no, menubar=no, location=no, resizable=no, scrollbars=yes, copyhistory=no, " + winpos;
	window.open("/common/popup_detail.asp?check="+chk+"&oid="+oid+"&osid="+osid, "DO"+chk, winstyle);
}

// »ó¼¼Á¤º¸2 ?? »ç¿ë¾ÈÇÔ.. //
function funOpenInfo(oid) {
	var winpos = "left=" + ((window.screen.width-810)/2) + ", top=" + ((window.screen.height-630)/2);
	var winstyle = "width=800, height=630, status=no, toolbar=no, menubar=no, location=no, resizable=no, scrollbars=yes, copyhistory=no, " + winpos;
	window.open("/old_goods_info.asp?goods_id="+oid, "Detail", winstyle);
}

// ÅäÅ© °ø°¨ top5 //
function funOpenTalkRank(str) {
	var winpos = "left=" + ((window.screen.width-467)/2) + ", top=" + ((window.screen.height-465)/2);
	var winstyle = "width=467, height=465, status=no, toolbar=no, menubar=no, location=no, resizable=no, scrollbars=yes, copyhistory=no, " + winpos;
	window.open('/popup_talk_rank.asp?goods_id='+str,'popup_rank', winstyle);
}