function activeXFix(getElmtID){
	document.write(document.getElementById(getElmtID).innerHTML);
	document.getElementById(getElmtID).id = "";
}

//Layer scroll
function topFix() {
	var lId = "toplink_layer";
	var bodyTop, scrollHeight
	if (document.documentElement.scrollTop == 0)
	{
		bodyTop = eval("document.body.scrollTop");
		scrollHeight = document.body.scrollHeight;
	} else {
		bodyTop = eval("document.documentElement.scrollTop");
		scrollHeight = document.documentElement.scrollHeight;
	}

	tlayer = document.getElementById(lId);
	if (scrollHeight <= bodyTop + 205 + 265 + 83)
	{
		fh = bodyTop + 205;
	} else {
		fh = bodyTop + 205 + 265;
	}

	if (tlayer != undefined)
	{
		tlayer.style.top = fh;
	}

	tlayer = document.getElementById("quickLayer");
	if (tlayer != undefined)
	{
		tlayer.style.top = fh - 205;
	}

	tlayer = document.getElementById("topLink");
	if (tlayer != undefined)
	{
		tlayer.style.top = bodyTop + document.body.clientHeight - 20;
	}
}
/*
//Layer scroll
function topFix() {
	var lId = "quickLayer";
	tlayer = document.getElementById(lId);
	if(document.documentElement.scrollTop == 0) {
		tlayer.style.top = 265 + document.body.scrollTop;
	} else {
		tlayer.style.top = 265 + document.documentElement.scrollTop;
	}

	document.getElementById("toplink_layer").style.top = parseInt(tlayer.style.top.replace('p','').replace('x','')) + 285;
}
*/

//product info print pdf
function printArea2() {
	tmp = location.href.split("/");
	tmpFn = tmp[tmp.length-1];
	fnArr = tmpFn.split(".");
	fn = fnArr[0];
	fn = "pdf/" + fn + ".pdf";

	theWidth = screen.width;
	theHeight = screen.availHeight;
	pWin = window.open(fn,"printWin","width=" + theWidth + ",height=" + theHeight + ",scrollbars=yes,status=no,menubar=yes,resizable=yes");

	pWin.resizeTo(theWidth,theHeight);
}


//product info print
function printArea(pd) {
	pArea = document.getElementById(pd);

	pWin = window.open("/product/printWin.html","printWin","width=742,height=700,scrollbars=yes,status=no,menubar=yes");
	pWin.document.getElementById("product_layer").innerHTML = pArea.innerHTML;
	pWin.print();
}

//MSDS popup
function OpenWin(msds, goods) {
	window.open("http://darwin.noroo.co.kr/msds/home/result.asp?msdscd=" + msds + "&goods=" + goods,"result","scrollbars=no,menubar=yes,width=800,height=600")
}

//print page
function printAreaNew(pd) {
	pArea = document.getElementById(pd);

	pWin = window.open("","printWin","width=742,height=700,scrollbars=yes,status=no,menubar=yes");
	inStr = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
	inStr += '<html xmlns="http://www.w3.org/1999/xhtml">';
	inStr += '<head>';
	inStr += '<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />';
	inStr += '<link href="/css/style.css" rel="stylesheet" type="text/css">';
	inStr += '</head><body leftmargin="0" topmargin="0" ';
	inStr += 'style="background-repeat:repeat-x;overflow-x:hidden" onLoad="print();">';
	inStr += pArea.innerHTML;
	inStr += '</body></html>'

	pWin.document.write(inStr);
	pWin.location.reload();
}

//Layer align
var maxzIdx = 100;

//color popup
function LargeView(v) {
	w = (document.body.clientWidth - 513) / 2;
	if(document.documentElement.scrollTop == 0) {
		h = document.body.scrollTop + 100; //document.body.clientHeight
	} else {
		h = document.documentElement.scrollTop + 100; //document.body.clientHeight
	}
	document.getElementById(v).style.top = h;
	document.getElementById(v).style.left = w;
	document.getElementById(v).style.visibility = '';
}

//»ö»óÅ©°Ôº¸±â Ã¢ 2
function LargeView(v, rgb) {
	w = (document.body.clientWidth - 513) / 2;
	if(document.documentElement.scrollTop == 0) {
		h = document.body.scrollTop + 100; //document.body.clientHeight
	} else {
		h = document.documentElement.scrollTop + 100; //document.body.clientHeight
	}

	var html = '<iframe src="/inc/RealcolorLargeView.asp?rgbset=' + rgb + '&pdiv=' + v + '" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>';

	document.getElementById(v).innerHTML = html;

	document.getElementById(v).style.top = h;
	document.getElementById(v).style.left = w;
	document.getElementById(v).style.visibility = '';
}

function LargeViewPop(v) {
	w = (document.body.clientWidth - 513) / 2;
	if(document.documentElement.scrollTop == 0) {
		h = document.body.scrollTop + 100; //document.body.clientHeight
	} else {
		h = document.documentElement.scrollTop + 100; //document.body.clientHeight
	}

	if(document.all.popView != undefined) {
		document.all.popView.getElementById(v).style.top = document.all.popView.scrollTop + 100;
		document.all.popView.getElementById(v).style.left = (document.all.popView.clientWidth - 513)/2;
		document.all.popView.getElementById(v).style.visibility = '';
	} else {
		document.getElementById(v).style.top = h;
		document.getElementById(v).style.left = w;
		document.getElementById(v).style.visibility = '';
	}
}

window.onscroll = function() {
	topFix();
}

window.attachEvent("onload" ,function(){if(document.getElementById("topLink") != undefined) document.getElementById("topLink").style.top = document.body.scrollTop + document.body.clientHeight - 20;})

window.attachEvent("onload" ,function(){if(document.getElementById("toplink_layer") != undefined) document.getElementById("toplink_layer").style.top = 470;})