 //<![CDATA[
function dockShowMsg(targetId, type, message, e, rmdCnt) {

	var msg	= eval(message + "();");

	//임시 alert 설정
//	type = "alert"; 

	if (type == "layer") {
		var Content =	"<div class=\"top\"><a href=\"#\" onclick=\"closeBox('"+targetId+"'); return false;\"><img src=\"/"+CONTEXT_SITE_CD+"/p2images/common/btn_x.gif\" border=\"0\" alt=\"\" /></a></div>" +
		"	<div class=\"middle\">";

		if (targetId == "alert2") {
			Content += msg;
		} else {
			Content += "<div class=\"notice\" id=\"error_notice\">" + msg + "</div>";
		}

		Content		+= "	</div>" +
		"	<div class=\"bottom\">" +
		"</div>";


		if (targetId == "error1") {
			ShowMsg(targetId, Content, 1);
			openXY(targetId, e);
		} else if (targetId == "error_compare_special") {
			ShowMsg(targetId, Content, 1);
			document.getElementById(targetId).style.display = "block";

			document.getElementById(targetId).style.bottom = "50px";
			if (rmdCnt == 1) {
				document.getElementById(targetId).style.left="535px";//535px,700px
			} else if (rmdCnt == 2) {
				document.getElementById(targetId).style.left="675px";//675px,840px
			}
		} else if (targetId == "alert2") {
			ShowMsg(targetId, Content, 1);
//			openXY(targetId, e);
			document.getElementById(targetId).style.display = "block";
//			document.getElementById(targetId).style.left="635px";
//			document.getElementById(targetId).style.bottom = "220px";
		}

	} else if (type == "alert") {
		msg =  msg.replace(/<br \/>/gi, "\r\n");
		alert(msg);
		return;
	}
}

function ShowMsg(targetId, content, Reset) {
	if (Reset == 1) {
		document.getElementById(targetId).innerHTML = content;
	} else {
		document.getElementById(targetId).innerHTML += content;
	}
}

function otherXY(txt,thisnum,allnum) {
	for (var i=1; i<allnum+1; i++) {
		var box = document.getElementById(txt+i);
		box.style.display = "none";
	}
	document.getElementById(txt+thisnum).style.display = "block";
}

function openXY(targetId, e) {
//	var posx = e.pageX - 152;
//	var posy = e.pageY - 148;
	var posx = '';
	var posy = '';
	if( typeof(e)=='string') {
	  	posx = "500";
	  	posy = "500";
	} else {
	  	posx = e.clientX+document.documentElement.scrollLeft - 152;
	  	posy = e.clientY+document.documentElement.scrollTop - 148;
	}

	var box = document.getElementById(targetId);
	box.style.display = "block";
	box.style.left = posx + "px";
	box.style.top = posy + "px";
}

function closeBox(id) {document.getElementById(id).style.display = "none";}

//호출 메세지
function msg_noCompare () {
	var msg =	"Ajoutez un ou plusieurs produits similaires" + "<br />" +
				"dans le panier de comparaison," + "<br />" +
				"puis, cliquez sur \"Comparer maintenant.\" ";
	return msg;
}

function msg_fullCompare() {
	var msg =	"Désolé, vous ne pouvez" + "<br />" +
				" comparer seulement que" + "<br />" +
				"4 produits à la fois.";
	return msg;
}

function msg_fullSave() {
	var msg =	"Vous ne pouvez pas enregistrer" + "<br />" +
				" plus de 12 produits";
	return msg;
}

function msg_otherCategory() {
	var msg =	"Désolé, vous ne pouvez" + "<br />" +
				"comparer que les" + "<br />" +
				"produits au sein d'une même " + "<br />" +
				"catégorie de produits";
	return msg;
}

function msg_equalCompareModel() {
	var msg =	"Déjà dans le panier de comparaison";
	return msg;
}

function msg_equalSavedModel() {
	var msg =	"Ce produit a déjà été sauvegardé";
	return msg;
}

function msg_savedClist() {
	var msg =	"La comparaison a été enregistrée!";
	return msg;
}

function msg_fullClist() {
	var msg =	"Désolé, Vous pouvez uniquement enregistrer" + "<br />" +
				"jusqu'à maximum" +  "<br />" +
				"3 comparaisons de produits";
	return msg;
}



//]]>