/**********************Common_Top에 사용***************************/
/*window.name ="ENURI.COM";*/
var RB_BUTTONS_HEIGHT = 39;
var RB_SEARCH_BTN_H = 0;
var RB_TOP = 348;
//IE6.0백그라운드 오류수정
var rec_zzim = "";
try {document.execCommand('BackgroundImageCache', false, true);} catch(e) {}
function init(){
	if (document.getElementById("aside")){
		if (document.getElementById("aside").style.display == "none"){
			document.getElementById("aside").style.display = "";
			setAsideLeftPosition();
		}
	}
	function showRrightLayer(){
		if (document.getElementById("rb_buttons")){
			document.getElementById("rb_buttons").style.display = "";
			if (document.getElementById("catalogListDiv")){
				document.getElementById("catalogListDiv").style.visibility = "visible";
			}
			setAsideLeftPosition();
			if(!(BrowserDetect.browser == "Explorer" && BrowserDetect.version == 6)) {
				if (BrowserDetect.OS == "iPad" && BrowserDetect.browser == "Safari"){
					document.getElementById("rb_buttons").style.top = setRbButtonsTopPositionIPad();
					document.getElementById("rb_recent_zzim").style.top = setRecentZzimPositionIPad();
				}else{
					document.getElementById("rb_buttons").style.top = setRbButtonsTopPosition();
					if (document.getElementById("catalogListDiv")){
						document.getElementById("catalogListDiv").style.visibility = "visible";
						document.getElementById("catalogListDiv").style.top  = (getBodyClientHeight() - RB_BUTTONS_HEIGHT - 215) +"px";
					}
					if (document.getElementById("rb_recent_zzim")){
						document.getElementById("rb_recent_zzim").style.top  = (getBodyClientHeight() -  getRbTop()) +"px";
					}
				}
			}
		}
		if (document.getElementById("cate_log")){
			document.getElementById("cate_log").style.left = document.getElementById("rb_buttons").offsetLeft+"px";
			document.getElementById("cate_log").style.top = (document.getElementById("rb_buttons").offsetTop - 60)+"px";
			document.getElementById("cate_log").style.display = "";
		}
	}
	if (document.getElementById("favoritePoB")){
		if (getVistaFlag()){
			document.getElementById("favoritePoB").style.display = "none";
			document.getElementById("favoritePoS").style.display = "";

			document.getElementById("favoritePoS").style.left = (document.getElementById("wrap").offsetWidth/2 - 384/2)+"px"
			document.getElementById("favoritePoS").style.top = 	(getBodyClientHeight()/2 - 150/2) +"px";
		}else{
			document.getElementById("favoritePoB").style.display = "";
			document.getElementById("favoritePoS").style.display = "none";
			
			document.getElementById("favoritePoB").style.left = (document.getElementById("wrap").offsetWidth/2 - 384/2)+"px"
			document.getElementById("favoritePoB").style.top = 	(getBodyClientHeight()/2 - 182/2) +"px";					
		}
	}
	setTimeout(function(){
		showRrightLayer();
	},100);
	setTimeout(function(){
		if (document.getElementById("rb_buttons")){
			if (document.getElementById("rb_buttons").style.display == "none"){
				showRrightLayer();
			}
		}
	},200);
	if (BrowserDetect.OS == "iPad" && BrowserDetect.browser == "Safari"){
		if ($("enuriMenuFrame")){
			$("enuriMenuFrame").width = $("wrap").offsetWidth+"px";
		}
		if ($("enuriMenuFrame")){
			if (document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame")){
				document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").width = $("wrap").offsetWidth+"px";
			}
		}
		if ($("searchListFrame")){
			$("searchListFrame").width = $("wrap").offsetWidth+"px";
		}
	}
}

window.onresize = function(){
	setTimeout(function(){
		setAsideLeftPosition();
		if(!(BrowserDetect.browser == "Explorer" && BrowserDetect.version == 6)) {
			if (BrowserDetect.OS == "iPad" && BrowserDetect.browser == "Safari"){
				document.getElementById("rb_buttons").style.top = setRbButtonsTopPositionIPad();
				document.getElementById("rb_recent_zzim").style.top = setRecentZzimPositionIPad();
			}else{		
				setTimeout(function(){
					if(document.getElementById("aside")){
						document.getElementById("aside").style.top = setAsideTopPosition();
					}
					if (document.getElementById("rb_recent_zzim")){
						if (document.getElementById("rb_recent_zzim").style.display == "none"){
							document.getElementById("rb_buttons").style.display = "";
						}
					}
					if(document.getElementById("rb_buttons")){
						document.getElementById("rb_buttons").style.top = setRbButtonsTopPosition();
					}
					if (document.getElementById("catalogListDiv")){
						document.getElementById("catalogListDiv").style.visibility = "visible";
						document.getElementById("catalogListDiv").style.top  = (getBodyClientHeight() - RB_BUTTONS_HEIGHT - 215) +"px";
					}
					if (document.getElementById("rb_recent_zzim")){
						document.getElementById("rb_recent_zzim").style.top  = (getBodyClientHeight() - getRbTop()) +"px";
					}				
				},100);
			}
		}
	},100);
	if(document.URL.indexOf("/tour/index.jsp") < 0 ){
		if(document.URL.indexOf("/view/fusion/Fusion.jsp") < 0 || document.URL.indexOf("/view/fusion/Fusion_Masterpiece.jsp") < 0 || document.URL.indexOf("/tour/index.jsp") < 0
				|| document.URL.indexOf("/sdul/bid/Bid_List.jsp") < 0){
			if (document.getElementById("enuriMenuFrame")){
				document.getElementById("enuriMenuFrame").contentWindow.setPositionCategory();
				document.getElementById("enuriMenuFrame").contentWindow.syncHeightListFrame();
			}
		}
	}
	if (document.URL.indexOf("/search/Searchlist.jsp") >= 0){
		if (document.getElementById("searchListFrame").contentWindow){
			document.getElementById("searchListFrame").contentWindow.showSpreadButton();
		}
	}
	// IE6, IE7용 회원 로그인
	try {
		joinLayerResizeSet();
	} catch(e) {}
	
}

window.onscroll = function(){
	/*IE6에서는 css에서 expression으로 위치 설정한다*/
	if(!(BrowserDetect.browser == "Explorer" && BrowserDetect.version == 6)) {
		if (BrowserDetect.OS == "iPad" && BrowserDetect.browser == "Safari"){
			document.getElementById("aside").style.top = setAsideTopPositionIE6();
			document.getElementById("rb_buttons").style.top = setRbButtonsTopPositionIPad();
			document.getElementById("rb_recent_zzim").style.top = setRecentZzimPositionIPad();
		}else{
			setTimeout(function(){
				if(document.getElementById("aside")){
					document.getElementById("aside").style.top = setAsideTopPosition();
				}
				var showRbButtons = true;
				if (document.getElementById("rb_recent_zzim")){
					if ( document.getElementById("rb_recent_zzim").style.display != "none" ){
						showRbButtons = false;
					}
				}
				if(showRbButtons){
					if(document.getElementById("rb_buttons")){
						document.getElementById("rb_buttons").style.display = "";
						document.getElementById("rb_buttons").style.top = setRbButtonsTopPosition();
					}
				}
				if (document.getElementById("catalogListDiv")){
					document.getElementById("catalogListDiv").style.visibility = "visible";
					document.getElementById("catalogListDiv").style.top  = (getBodyClientHeight() - RB_BUTTONS_HEIGHT - 215) +"px";
				}
				if (document.getElementById("rb_recent_zzim")){
					document.getElementById("rb_recent_zzim").style.top  = (getBodyClientHeight() - getRbTop()) +"px";
				}
			},100);
		}
	}
	
	//if (getBodyScrollLeft() > 0 ){
		if (document.getElementById("main_price_layer")){
			if (document.getElementById("main_price_layer").style.display != "none"){
				document.getElementById("main_price_layer").style.display = "none";
			}
			if (document.getElementById("main_price_layer_bar").style.display != "none"){
				document.getElementById("main_price_layer_bar").style.display = "none";
			}				
		}
		if (document.getElementById("main_price_layer_info")){
			if (document.getElementById("main_price_layer_info").style.display != "none"){
				document.getElementById("main_price_layer_info").style.display = "none";
			}
		}		
		setTimeout(function(){
			setAsideLeftPosition();
		},100);		
	//}	
	if (getBodyScrollHeight() == ( getBodyScrollTop() +  getBodyClientHeight())){
		if (document.URL.indexOf("/view/List.jsp") >= 0 || document.URL.indexOf("/view/Listmp3.jsp") >= 0  || document.URL.indexOf("/view/Listhandphone.jsp") >= 0 || document.URL.indexOf("/view/Listprinter.jsp") >= 0 ){
			document.getElementById("enuriMenuFrame").contentWindow.syncHeightListFrame()
		}else if(document.URL.indexOf("/search/Searchlist.jsp") >= 0){
			syncHeightListFrame();
		}
	}
}
/*IE6에서 aside top 위치 설정*/
function setAsideTopPositionIE6(){
	var varTop = 0;
	if (document.getElementById("aside").offsetHeight > (getBodyClientHeight() - RB_BUTTONS_HEIGHT - getCatalogDownHeight() + getBodyScrollTop())){
		varTop = document.getElementById("aside").offsetTop;
	}else{
		if ((getBodyClientHeight() - RB_BUTTONS_HEIGHT - getCatalogDownHeight()) > document.getElementById("aside").offsetHeight){
			varTop = getBodyScrollTop();
		}else{
			varTop = getBodyScrollTop() - (document.getElementById("aside").offsetHeight - (getBodyClientHeight() - RB_BUTTONS_HEIGHT - getCatalogDownHeight()))
		}
	}
	if(getBodyScrollTop()==0) varTop = 0;

	return varTop + "px";
}
/*IE6제외 나머지 브라우저에서  aside top 위치 설정*/
function setAsideTopPosition(){
	var varTop = 0;
	if (document.getElementById("aside").offsetHeight > ((getBodyClientHeight() - RB_BUTTONS_HEIGHT - getCatalogDownHeight() ) + getBodyScrollTop())){
		varTop = -getBodyScrollTop();
	}else{
		if (document.getElementById("aside").offsetHeight > (getBodyClientHeight() - RB_BUTTONS_HEIGHT - getCatalogDownHeight())){
			varTop = (getBodyClientHeight() - RB_BUTTONS_HEIGHT - getCatalogDownHeight()) - document.getElementById("aside").offsetHeight;
		}else{
			if (document.getElementById("aside").offsetTop < 0){
				if (-document.getElementById("aside").offsetTop > getBodyScrollTop() ){
					varTop = getBodyScrollTop() + document.getElementById("aside").offsetTop;
				}
			}else{
				if (getBodyScrollTop() == 0 ){
					varTop = 0;
				}else{
					varTop = document.getElementById("aside").offsetTop;
				}
			}
		}
	}

	return varTop + "px";
}
/* aside left 위치 설정*/
function setAsideLeftPosition(){
	var varLeftPos = 0;
	if (screen.width >= 1024 && screen.width < 1280){
		varLeftPos = 856;
	}else{
		varLeftPos = 1006;
	}
	if (document.getElementById("wrap")){
		varLeftPos = document.getElementById("wrap").offsetWidth + 6;
		if(!(BrowserDetect.browser == "Explorer" && BrowserDetect.version == 6) && !(BrowserDetect.OS == "iPad" && BrowserDetect.browser == "Safari")) {
			varLeftPos = varLeftPos - getBodyScrollLeft();
		}
	}
	if (document.getElementById("div_map_detail_info")){
		document.getElementById("div_map_detail_info").style.left = varLeftPos-70 + getBodyScrollLeft() + "px"
	}
	
	//showLog("varLeftPos="+varLeftPos);
	if(document.getElementById("aside")){
		document.getElementById("aside").style.left = varLeftPos + "px"
	}
	if (document.getElementById("rb_buttons")){
		document.getElementById("rb_buttons").style.left = (varLeftPos-2) + "px";
	}	
	if (document.getElementById("catalogListDiv")){
		document.getElementById("catalogListDiv").style.left = (varLeftPos) + "px"
	}
	if (document.getElementById("rb_recent_zzim")){
		document.getElementById("rb_recent_zzim").style.left = (varLeftPos-2) + "px"
	}
	if (document.getElementById("cate_log")){
		document.getElementById("cate_log").style.left = (varLeftPos-2) + "px"
	}
	
}
function setRbButtonsTopPosition(){
	var varTop = 0;
	varTop = (getBodyClientHeight() - RB_BUTTONS_HEIGHT);
	return varTop + "px";
}
/*IE6에서 rb_button top 위치 설정*/
function setRbButtonsTopPositionIE6(){
	var varTop = 0;
	varTop = (getBodyScrollTop() + getBodyClientHeight() - RB_BUTTONS_HEIGHT);
	return varTop + "px";
}
function setRbButtonsTopPositionIPad(){
	var varTop = 0;
	varTop = (getBodyScrollTop() + window.innerHeight - RB_BUTTONS_HEIGHT);
	return varTop + "px";
}
function setCatalogDownTopPositionIE6(){
	var varTop = 0;
	varTop = (getBodyScrollTop() + getBodyClientHeight() - RB_BUTTONS_HEIGHT) - 215;
	return varTop + "px";
}
function getCatalogDownHeight(){
	var varHeight = 0;
	if (document.getElementById("catalogListDiv")){
		if (document.getElementById("catalogListDiv").style.display != "none"){
			varHeight = document.getElementById("catalogListDiv").offsetHeight+5;
		}	
	}
	return varHeight;
}
function setRecentZzimPositionIE6(){
	var varTop = 0;
	varTop = (getBodyScrollTop() + getBodyClientHeight() -  getRbTop());
	return varTop + "px";
}
function setRecentZzimPositionIPad(){
	var varTop = 0;
	varTop = (getBodyScrollTop() + window.innerHeight -  getRbTop());
	return varTop + "px";
}
/*최근본/찜상품 레이어 관련 스크립트*/
function syncWHSaveGoods(){
	if (document.getElementById("frmSaveGoods").contentWindow.document.location.href != "" && document.getElementById("frmSaveGoods").contentWindow.document.location.href != "about:blank"){
		setTimeout("syncHeightSaveGoods()",500);
		document.getElementById("frmSaveGoods").style.display = "";
		window.scrollTo(0,0);
   	}
}
function syncHeightSaveGoods(){
	document.getElementById("frmSaveGoods").contentWindow.init();
	document.getElementById("frmSaveGoods").height = document.getElementById("frmSaveGoods").contentWindow.document.body.scrollHeight + "px";		
}
function hideSaveGoods(){
	document.getElementById("frmSaveGoods").style.display = "none";
}
/*전체 메뉴 관련 스크립트*/
function syncWHAllMenu(){
	if(document.getElementById("frmAllMenu").contentWindow.document.location.href != "" && document.getElementById("frmAllMenu").contentWindow.document.location.href != "about:blank") {
		syncHeightAllMenu();	
		document.getElementById("frmAllMenu").style.display = "";
		window.scrollTo(0,0);	
	}
}
function syncHeightAllMenu() {
	document.getElementById("frmAllMenu").height = document.getElementById("frmAllMenu").contentWindow.document.body.scrollHeight + "px";
}
function hideAllMenu() {
	document.getElementById("frmAllMenu").style.display = "none";

}
function setWidthWrap(){
	var varWidth = getBodyClientWidth()*0.83;
	return varWidth < 850 ? "850px" : varWidth > 1000 ? "1000px" : (varWidth)+"px"
}
function getBeginnerDic(){
}
function closeAllBeginnerDic(){
	closeBeginnerDic();
	closeBeginnerDic2();
}
function closeBeginnerDic(kb_no){
	if($("ifrmBeginnerFrame")) $("ifrmBeginnerFrame").src = "/html/etc/Blank.htm";
	if($("div_beginnerFrame")) $("div_beginnerFrame").style.display = "none";
	if($("dicGoogleLayer")) $("dicGoogleLayer").style.display = "none";
	if($("div_inconv")) $("div_inconv").style.display = "none";
}
function closeBeginnerDic2(kb_no){
	if($("ifrmBeginnerFrame2")) $("ifrmBeginnerFrame2").src = "/html/etc/Blank.htm";
	if($("div_beginnerFrame2")) $("div_beginnerFrame2").style.display = "none";
	if($("dicGoogleLayer")) $("dicGoogleLayer").style.display = "none";
	if($("div_inconv")) $("div_inconv").style.display = "none";
}

function CmdGotoBeginnerDic(kb_no,cate){
	var kind = "2";
	var wWidth = 734+30+6;
	insertLogCate(2397);
	insertTermDicTitleLog('link',kb_no);
	if (typeof(kind)=="number" && kind==20) wWidth = wWidth+35;
	var wHeight = screen.availHeight;
	var win = window.open("/purchaseguide/GuideLayer.jsp?kind="+kind+"&cate="+cate+"&kbno="+((typeof(kb_no)=="number")?kb_no:0)+"&btnhits=yes","GuideLayer","width="+wWidth+",height="+wHeight+",left=0,top=0,toolbar=no,directories=no,status=yes,scrollbars=yes,resizable=no,menubar=no");
	win.focus();
	closeBeginnerDic(kb_no);
}
function insertTermDicTitleLog(vmode,kb_no){
	var url = "/view/include/IncBeginnerDic_Loginsert.jsp";
	var param = "vmode="+vmode+"&kb_no="+kb_no+"&vtype=LIST";
	var getRec = new Ajax.Request(
		url,
		{
			method:'get',parameters:param
		}
	);
}

function searchGuideTitle(guideTitle,kb_no){
	insertLog(3555);
	closeBeginnerDic(kb_no);
	if (top.document.body.scrollTop){
		top.document.body.scrollTop = "0px";
	}else{
		top.document.documentElement.scrollTop = "0px";
	}	
	if (document.URL.indexOf("/search/Searchlist.jsp") >= 0 ){
		var varFormObj = document.getElementById("searchListFrame").contentWindow.document.frmList;
		var varFormElements = Form.getElements(varFormObj);
		for (var i=0;i<varFormElements.length;i++){
			if (varFormElements[i].name != "key" && varFormElements[i].name != "keyword"){
				varFormElements[i].value = "";
			}
		}
		document.getElementById("searchListFrame").contentWindow.document.frmList.in_keyword.value = guideTitle;
		document.getElementById("searchListFrame").contentWindow.getCountInResult();
	}else if(document.URL.indexOf("/view/Listnewgoods_New.jsp") >= 0){
		var varFormObj = document.frm_Search_New;
		var varFormElements = Form.getElements(varFormObj);
		for (var i=0;i<varFormElements.length;i++){
			varFormElements[i].value = "";
		}
		document.frm_Search_New.search_keyword.value = guideTitle;
		document.frm_Search_New.submit();				
	}else{
		var varFormObj = document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.document.frmList;
		//document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.unCheckAllPrice();
		//document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.unCheckAllFactory();
		//document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.unCheckAllCondi();
		/*
		var varFormElements = Form.getElements(varFormObj);
		for (var i=0;i<varFormElements.length;i++){
			if (varFormElements[i].name != "key" && varFormElements[i].name != "cate" &&  varFormElements[i].name != "prtmodelno"){
				varFormElements[i].value = "";
			}
		}
		*/
		document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.document.getElementById("keyword").value = document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.document.getElementById("keyword").value + " " + guideTitle;
		document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.setKeywordBackground();
		document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.getCountInResult();
		//document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.document.frmList.submit();
	}
}
function googleSearch(modelno,modelnm,spec,factory,minprice,islayer,cate){
	insertLog(2546);
	top.document.getElementById("frmGoogleSearch").src = "";
	if (islayer){
		top.document.getElementById("frmGoogleSearch").src = "/include/IncGoogleSearch_2010.jsp?modelno="+modelno+"&modelnm="+encodeURIComponent(modelnm)+"&spec="+encodeURIComponent(spec)+"&factory="+encodeURIComponent(factory)+"&minprice="+minprice;
	}else{
		if(cate == "0404"){
			top.document.getElementById("frmGoogleSearch").src = "/include/IncGuideGoogleSearch_2010.jsp?cate="+cate;
		}else{
			window.open("/view/OpenGoogleSearch.jsp?"+"modelno="+modelno+"&modelnm="+encodeURIComponent(modelnm)+"&factory="+encodeURIComponent(factory),"","toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
		}
	}
}
//리뷰보기(구글검색)관련 스크립트
function syncWHGoogleSearch(){
	try{	
		if (document.getElementById("frmGoogleSearch").contentWindow.document.location.href != "" && document.getElementById("frmGoogleSearch").contentWindow.document.location.href != "about:blank"){
			document.getElementById("frmGoogleSearch").style.left = "100px";
			document.getElementById("frmGoogleSearch").style.top = getBodyScrollTop()+20+"px";
			document.getElementById("frmGoogleSearch").style.display = "";
			syncHeightGoogleSearch();
		}
   	}catch(e){
   	}				
}
function hideGoogleSearch(){
	document.getElementById("frmGoogleSearch").src = "";
	document.getElementById("frmGoogleSearch").style.display = "none";
}
function syncHeightGoogleSearch(){
	if(document.body.scrollHeight <= 460){
		document.getElementById("frmGoogleSearch").height = "435px";
	}
	if(document.body.scrollHeight > 460 && document.body.scrollHeight < 705){
		document.getElementById("frmGoogleSearch").contentWindow.googleInit(document.body.scrollHeight-200);
		document.getElementById("frmGoogleSearch").height = (document.body.scrollHeight-90) + "px";
	}
	if(document.body.scrollHeight >= 705){
		document.getElementById("frmGoogleSearch").contentWindow.googleInit(564);
		if (document.getElementById("frmGoogleSearch").src.indexOf("IncGuideGoogleSearch_2010.jsp") >= 0 && (BrowserDetect.browser == "Explorer" )){
			document.getElementById("frmGoogleSearch").height = "655px";
		}else{
			document.getElementById("frmGoogleSearch").height = "670px";
		}
		
	}
}

function getCheckedModelNo(){
	var arrCheckedModelNo = "";
	if (document.URL.indexOf("/view/List.jsp") >= 0 || document.URL.indexOf("/view/Listmp3.jsp") >= 0  || document.URL.indexOf("/view/Listhandphone.jsp") >= 0 || document.URL.indexOf("/view/Listprinter.jsp") >= 0 ){
		var arrCheckedModelNo = document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.arrCheckedModelNo
	}else if(document.URL.indexOf("/search/Searchlist.jsp") >= 0){
		var arrCheckedModelNo = document.getElementById("searchListFrame").contentWindow.arrCheckedModelNo
	}
	var varChkModelNos = "";
	for (i=0;i<arrCheckedModelNo.length;i++){
		if (i > 0 ){
			varChkModelNos = varChkModelNos + ","; 
		}
		varChkModelNos = varChkModelNos + arrCheckedModelNo[i];
	}	
	return varChkModelNos;
}
function clickInfoDivShow(){
	if($("clickInfoDiv")) {
		var posLeftTop = Position.cumulativeOffset($("aside"));

		$("clickInfoDiv").style.left = (posLeftTop[0]-350)+"px"
		if((BrowserDetect.browser == "Explorer" && BrowserDetect.version == 6)) {
			$("clickInfoDiv").style.top = (getBodyClientHeight() - 100)+"px"
		} else {
			$("clickInfoDiv").style.top = (getBodyScrollTop() + getBodyClientHeight() - 100)+"px"
		}
		if (document.getElementById("clickInfoDiv").innerHTML == ""){
			var varClickInfoDiv = "";
			varClickInfoDiv += "<img src=\""+var_img_enuri_com+"/images/layer/layer_compare02.gif\" width=\"329\" height=\"102\" border=\"0\" usemap=\"#clickInfoMap\" />";
			varClickInfoDiv += "<map name=\"clickInfoMap\" id=\"clickInfoMap\">";
			varClickInfoDiv += "<area shape=\"rect\" coords=\"302,4,323,23\" href=\"#\" onclick=\"document.getElementById('clickInfoDiv').style.display='none';return false;\" />";
			varClickInfoDiv += "</map>";
			document.getElementById("clickInfoDiv").innerHTML = varClickInfoDiv;		
		}
		$("clickInfoDiv").style.display = "";			
		$("comparisonInfo").style.display = "none";			
		//$("myfavoriteInfo").style.display = "none";
	}			
}
function compare(){
	insertLog(939);
	var varChkModelNos = getCheckedModelNo();
	if (varChkModelNos.indexOf(",") < 0){
		var posLeftTop = Position.cumulativeOffset($("aside"));
		document.getElementById("comparisonInfo").style.left = (posLeftTop[0]-350)+"px"
		document.getElementById("comparisonInfo").style.top = (getBodyScrollTop() + getBodyClientHeight() - 110)+"px"
		if (document.getElementById("comparisonInfo").innerHTML == ""){
			var varComparisonInfo = "";
			varComparisonInfo += "<img src=\""+var_img_enuri_com+"/images/layer/layer_compare.gif\" width=\"329\" height=\"102\" border=\"0\" usemap=\"#comparisonInfoMap\" />";
			varComparisonInfo += "<map name=\"comparisonInfoMap\" id=\"comparisonInfoMap\">";
			varComparisonInfo += "<area shape=\"rect\" coords=\"302,4,323,23\" href=\"#\" onclick=\"document.getElementById('comparisonInfo').style.display='none';return false;\" />";
			varComparisonInfo += "<area shape=\"rect\" coords=\"278,73,315,94\" href=\"#\" onclick=\"insertLog(939);OpenWindowPosition('/view/popup/TowCheckInfo_Popup.jsp','towcheck_1','398','400','YES','NO','250','250');document.getElementById('comparisonInfo').style.display='none';return false;\" />";
			varComparisonInfo += "</map>";
			document.getElementById("comparisonInfo").innerHTML = varComparisonInfo;
		}
		document.getElementById("comparisonInfo").style.display = "";			
		//document.getElementById("myfavoriteInfo").style.display = "none";			
		document.getElementById("div_inconv").style.display = "none";
	}else{
		var compareMultiWin = window.open("/view/Comparemulti.jsp?chkNo="+varChkModelNos,"Comparemulti","width=700,height=600,left=0,top=0,toolbar=no,directories=no,status=yes,scrollbars=yes,resizable=no,menubar=no");
		compareMultiWin.focus();		
	}
}
function zzim(){
	insertLog(938);
	//if (rec_zzim == "zzim" && document.getElementById('rb_recent_zzim').style.display != "none"){
	//	document.getElementById('rb_recent_zzim').style.display = "none";
	//}else{
		var varChkModelNos = getCheckedModelNo();
		if(islogin()){
			insertZzimProcNew(varChkModelNos)
		}else{
			setLogintopModelno(varChkModelNos);
			Cmd_Login('inputzzim2010');
		}
	//}	 
}
function catalogDown(){
	//insertLog(938);
	var varChkModelNos = getCheckedModelNo();
	if (varChkModelNos.trim().length > 0){
		insertCatalogDownProc(varChkModelNos);
	}else{
		alert("퍼가기 할 상품을 선택하세요.")
	}
}
function insertZzimProcNew(szChkNo){
	if (szChkNo == ""){
		getGuide_Resent_Zzim(3, 1);
	}else{
		var url = "/view/include/insertSaveGoodsProc.jsp";
		var param = "modelnos="+szChkNo;
		var getRec = new Ajax.Request(
			url,
			{
				method:'get',parameters:param,onComplete:ShowSaveInfo
			}
		);	
		function ShowSaveInfo(originalRequest){
			//top.document.getElementById("IFrameMyFavoriteList").src = "/include/Incmyfavoritelistmain.jsp";
			eval("arrReturn = " + originalRequest.responseText);
			var varCount = parseInt(arrReturn.count);
			var varSaveMsgObj
			if (!document.getElementById("div_save_msg")){
				varSaveMsgObj = document.createElement("DIV");
				varSaveMsgObj.id = "div_save_msg";
				if((BrowserDetect.browser == "Explorer" && BrowserDetect.version == 6)) {
					varSaveMsgObj.style.position = "absolute";
					varSaveMsgObj.style.top = (400 + getBodyScrollTop()) + "px";
				}else{
					varSaveMsgObj.style.position = "fixed";
					varSaveMsgObj.style.top = "400px";
				}
				varSaveMsgObj.style.left = (document.getElementById("wrap").offsetWidth/2 - 90) + "px";
				
				varSaveMsgObj.style.width="185";
				varSaveMsgObj.style.height="35";
				varSaveMsgObj.style.backgroundColor="#FFFFFF";
				document.getElementById("wrap").insertBefore(varSaveMsgObj,null);
			}else{
				if((BrowserDetect.browser == "Explorer" && BrowserDetect.version == 6)) {
					document.getElementById("div_save_msg").style.top = (400 + getBodyScrollTop()) + "px"; 
				}else{
					document.getElementById("div_save_msg").style.top = "400px";
				}
				document.getElementById("div_save_msg").style.left = (document.getElementById("wrap").offsetWidth/2 - 90) + "px";
				document.getElementById("div_save_msg").style.display = ""; 
			}
			if (varCount == 0 ){
				document.getElementById("div_save_msg").innerHTML = "<img src='"+var_img_enuri_com+"/images/view/savegoods/zzim_text02.gif' border='0' align='absmiddle' border='0' align='absmiddle'>";
			}else if (varCount > 0){
				document.getElementById("div_save_msg").innerHTML = "<img src='"+var_img_enuri_com+"/images/view/savegoods/zzim_text01.gif' border='0' align='absmiddle' border='0' align='absmiddle'>";
			}else{
				document.getElementById("div_save_msg").innerHTML = "<img src='"+var_img_enuri_com+"/images/view/savegoods/zzim_text_re.gif' border='0' align='absmiddle' border='0' align='absmiddle'>";
			}
			var strPageName = this.document.URL;
			if( strPageName.indexOf("/search/Searchlist.jsp") > -1 ){
				setTimeout(function(){$('div_save_msg').hide();},3000);	
				
			}else{
				new Effect.Fade($('div_save_msg'), {duration:3.0, from: 3, to: 0});
			}
			// 찜한후에 리스트열기
			selectedRGuideNum = 2;
			getGuide_Resent_Zzim(3, 1);
		}	
	}
}
function insertCatalogDownProc(szChkNo){

	var url = "/view/include/insertCatalogDownProc.jsp";
	var param = "modelnos="+szChkNo;
	var getRec = new Ajax.Request(
		url,
		{
			method:'get',parameters:param,onComplete:OpenCatalogDownWin
		}
	);	
	function OpenCatalogDownWin(originalRequest){
		//top.document.getElementById("IFrameMyFavoriteList").src = "/include/Incmyfavoritelistmain.jsp";
		eval("arrReturn = " + originalRequest.responseText);
		var varCount = parseInt(arrReturn.count);
		if (varCount > 0){
		
		}
	}	
}
function notice(){
	insertLog(2068);
	if (typeof(notice._f_none) == "undefined"){
		notice._f_none = ""
	}else if(notice._f_none == ""){
		notice._f_none= "none";
	}else{
		notice._f_none= "";
	}
	if (document.URL.indexOf("/view/List.jsp") >= 0 || document.URL.indexOf("/view/Listmp3.jsp") >= 0  || document.URL.indexOf("/view/Listhandphone.jsp") >= 0 ){
		var goodsListObj = document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.document.getElementById("goodslist");
		var singoObjs = $(goodsListObj).getElementsBySelector('*[class="btn_singo"]');
		for (var i=0;i<singoObjs.length;i++){
			singoObjs[i].style.display = notice._f_none;
		}
		document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.hideAllLayer();
	}else if(document.URL.indexOf("/search/Searchlist.jsp") >= 0){
		var goodsListObj =document.getElementById("searchListFrame").contentWindow.document.getElementById("goodslist");
		if(goodsListObj!=null && $(goodsListObj)) {
			var singoObjs = $(goodsListObj).getElementsBySelector('*[class="btn_singo"]');
			for (var i=0;i<singoObjs.length;i++){
				singoObjs[i].style.display = notice._f_none;
			}
		}	
		document.getElementById("searchListFrame").contentWindow.hideAllLayer();	
	}
	function ShowInConv(originalRequest){
		document.getElementById("div_inconv").innerHTML = originalRequest.responseText;
		document.getElementById("div_inconv").style.top = (getBodyClientHeight() + getBodyScrollTop()  - 300) +"px";;
		document.getElementById("div_inconv").style.left = (document.getElementById("wrap").offsetWidth - 200) +"px";;		
		document.getElementById("div_inconv").style.display = "";
		document.getElementById("rb_buttons").style.display="";
		document.getElementById("rb_recent_zzim").style.display='none';	
	}	
	setTimeout(function(){
		if( notice._f_none == "") {
			var varType = "";
			var varNowUrl = document.URL;
			if(varNowUrl.indexOf("/Index.jsp") >= 0 || varNowUrl.indexOf("/mime/Err_404.jsp") >= 0 || varNowUrl.indexOf("/fashion/Fashion_SubList.jsp") >= 0 || 
				varNowUrl.indexOf("/fashion/Fashion_Masstige_SubList.jsp") >= 0 || varNowUrl.indexOf("/view/fusion/Fusion.jsp") >= 0 ||  varNowUrl.indexOf("/view/fusion/Fusion_Masterpiece.jsp") >= 0 ||
				varNowUrl.indexOf("/view/fusion/Fusion_Sub.jsp") >= 0 || varNowUrl.indexOf("/view/fusion/Fusion_Scate.jsp") >= 0 || varNowUrl.indexOf("/view/fusion/Fusion_Brand_Sub.jsp") >= 0
			){
				varType = "1";
			}
			var url = "/include/ajax/AjaxInconv.jsp";
			var param = "type="+varType+"&cate="+grzTempCate;
			var getRec = new Ajax.Request(
				url,
				{
					method:'get',parameters:param,onComplete:ShowInConv
				}
			);	
			
		}else{
			document.getElementById("div_inconv").style.display = notice._f_none;
		}
	},100);
}
function checkBackground(obj){
	if (obj.value.trim().length == 0 ){
		if (obj.id == "inconv_txt"){
			obj.style.backgroundImage = "url("+var_img_enuri_com+"/images/view/error/error_webFont01.gif)";
		}else{
			obj.style.backgroundImage = "url("+var_img_enuri_com+"/images/view/error/error_webFont02.gif)";
		}
	}
}	
function noticeInconvenionce(cate,kbno){
	if (document.getElementById("inconv_txt").value.trim().length == 0 ){
		alert("오류내용을 입력해 주십시오.");
		document.getElementById("inconv_txt").focus();
		return;
	}
	if (document.getElementById("inconv_txt").value.trim().korlen() > 500){
		alert("500자 이상 입력하실수 없습니다.")
		document.getElementById("inconv_txt").focus();
		return;		
	}
	if (document.getElementById("inconv_email").value.trim().length > 0 ){
		if (!document.getElementById("inconv_email").value.trim().isemail()){
			alert("올바른 E-Mail주소를 입력해 주십시오.");
			document.getElementById("inconv_email").focus();
			return;			
		}
	}
	var url = "/include/layer/InsertInconvenience.jsp";
	var param = "cate="+cate+"&inconv_txt="+encodeURIComponent(document.getElementById("inconv_txt").value.trim())+"<BR>"+navigator.userAgent+"<BR>"+getOSInfoStr()+"&inconv_email="+document.getElementById("inconv_email").value;
	if (typeof(kbno) != "undefined"){
		param += "&kbno="+kbno;
	}
	
	var getRec = new Ajax.Request(
		url,
		{
			method:'post',parameters:param,onComplete:showSaveMsg
		}
	);		
	function showSaveMsg(originalRequest){
		alert(originalRequest.responseText);
		document.getElementById("inconv_txt").value="";
		document.getElementById("inconv_email").value="";
		document.getElementById("div_inconv").style.display = "none";
	}
}
function getOSInfoStr(){
	var ua = navigator.userAgent;
	if(ua.indexOf("NT 6.0") != -1) return "Windows Vista/Server 2008";
	else if(ua.indexOf("NT 5.2") != -1) return "Windows Server 2003";
	else if(ua.indexOf("NT 5.1") != -1) return "Windows XP";
	else if(ua.indexOf("NT 5.0") != -1) return "Windows 2000";
	else if(ua.indexOf("NT") != -1) return "Windows NT";
	else if(ua.indexOf("9x 4.90") != -1) return "Windows Me";
	else if(ua.indexOf("98") != -1) return "Windows 98";
	else if(ua.indexOf("95") != -1) return "Windows 95";
	else if(ua.indexOf("Win16") != -1) return "Windows 3.x";
	else if(ua.indexOf("Windows") != -1) return "Windows";
	else if(ua.indexOf("Linux") != -1) return "Linux";
	else if(ua.indexOf("Macintosh") != -1) return "Macintosh";
	else return "";
}

// 브라우져 정보 읽어오기
function getBrowserName() {
	if(navigator.userAgent.toLowerCase().indexOf('msie 6')>-1 && navigator.userAgent.toLowerCase().indexOf('msie 7')==-1 && navigator.userAgent.toLowerCase().indexOf('msie 8')==-1) {
		return "msie6";
	}
	if(navigator.userAgent.toLowerCase().indexOf('msie 7')>-1 && navigator.userAgent.toLowerCase().indexOf('msie 8')==-1) {
		return "msie7";
	}
	if(navigator.userAgent.toLowerCase().indexOf('msie 9')>-1) {
		return "msie9";
	}
	if(navigator.userAgent.toLowerCase().indexOf('msie')!=-1) {
		return "msie";
	}
	if(navigator.userAgent.toLowerCase().indexOf('firefox')>-1) {
		return "firefox";
	}
	if(navigator.userAgent.toLowerCase().indexOf('opera')>-1) {
		return "opera";
	}
	if(navigator.userAgent.toLowerCase().indexOf('chrome')>-1) {
		return "chrome";
	}
	if(navigator.userAgent.toLowerCase().indexOf('safari')>-1) {
		return "safari";
	}
}
function getAdditionalBeginnerDic(kb_no,org_kb_no,cate,level){
	if (document.URL.indexOf("/view/List.jsp") >= 0 || document.URL.indexOf("/view/Listmp3.jsp") >= 0  || document.URL.indexOf("/view/Listhandphone.jsp") >= 0 || document.URL.indexOf("/view/Listprinter.jsp") >= 0 ){
		document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.getAdditionalBeginnerDic(kb_no,org_kb_no,cate,level)
	}else if(document.URL.indexOf("/view/Searchlist.jsp") >= 0 ){
		document.getElementById("searchListFrame").contentWindow.getAdditionalBeginnerDic(kb_no,org_kb_no,cate,level);
	}

}
function openGoodsDetailInfoLayer(){
	if (document.getElementById("divGoodsDetailInfo")){
		if (document.getElementById("divGoodsDetailInfo").style.display != "none"){
			document.getElementById("divGoodsDetailInfo").style.display = "none";
		}else{
			document.getElementById("divGoodsDetailInfo").style.left = (document.getElementById("wrap").offsetWidth - 550)+"px";
			if (document.getElementById("divGoodsDetailInfo").innerHTML == ""){
				var varDivGoodsDetailInfo = "";
				varDivGoodsDetailInfo = "<table cellpadding=\"0\" cellspacing=\"0\" width=\"449\" border=\"0\">";
				varDivGoodsDetailInfo += "<tr>";
				varDivGoodsDetailInfo += "<td height=\"243\" align=\"center\"><img usemap=\"#divGoodsDetailInfoMap\" src=\""+var_img_enuri_com+"/images/view/layer1101.gif\" width=\"449\" height=\"243\" /></td>";
				varDivGoodsDetailInfo += "</tr>";
				varDivGoodsDetailInfo += "</table>";
				varDivGoodsDetailInfo += "<map name=\"divGoodsDetailInfoMap\" id=\"divGoodsDetailInfoMap\">";
				varDivGoodsDetailInfo += "<area shape=\"rect\" coords=\"428,9,441,22\" href=\"#\" onclick=\"document.getElementById('divGoodsDetailInfo').style.display='none';return false;\" />";
				varDivGoodsDetailInfo += "</map>";
				document.getElementById("divGoodsDetailInfo").innerHTML = varDivGoodsDetailInfo; 
			}			
			document.getElementById("divGoodsDetailInfo").style.display = "";
		}
	}
}
function viewLoadingBar(){
	document.getElementById("loading").style.left = (document.getElementById("wrap").offsetWidth/2 - 316)+"px";
	document.getElementById("loading").style.top = 350+"px"
	document.getElementById("loading").style.display = "";
}
function viewInLoadingBar(){
	document.getElementById("loading_in").style.left = (document.getElementById("wrap").offsetWidth/2 - 316)+"px";
	document.getElementById("loading_in").style.top = 350+"px"
	document.getElementById("loading_in").style.display = "";
}
function hideLoadingBar(){
	document.getElementById("loading").style.display = "none";
	document.getElementById("loading_in").style.display = "none";
}
function showBeginnerDicBigImage(varImg){
	document.getElementById("beginner_big").src = varImg;
	/*
	var beginnerBigImage = new Image();
	beginnerBigImage = document.createElement("IMG");
	beginnerBigImage.src = varImg;
	*/
	document.getElementById("beginner_big").onload = function(){
		document.getElementById("beginner_big_img").style.left = (document.getElementById("wrap").offsetWidth/2 - document.getElementById("beginner_big").width/2)+"px";
		document.getElementById("beginner_big_img").style.top = (getBodyClientHeight()/2 - document.getElementById("beginner_big").height/2 + getBodyScrollTop())+"px";
		document.getElementById("beginner_big_img").style.display = "";	
		document.getElementById("beginner_big_img").style.left = (document.getElementById("wrap").offsetWidth/2 - document.getElementById("beginner_big").width/2)+"px";
		document.getElementById("beginner_big_img").style.top = (getBodyClientHeight()/2 - document.getElementById("beginner_big").height/2 + getBodyScrollTop())+"px";		
	}
}
var detailWin = null; 
function detailMultiView(OpenFile,name,modelno){
//	var detailWin = window.open(OpenFile,"detailMultiWin","width=780,height=600,left=0,top=0,toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
//	detailWin.focus(); 	
	if(navigator.userAgent.indexOf("Chrome/")>0 && BrowserDetect.browser != "Explorer") {
		window.detailWin = window.open("","detailMultiWin","width=0,height=0,left=0,top=0");
		window.detailWin.close();
		window.detailWin = null;
	}
	//window.detailWin = window.open(OpenFile,"detailMultiWin","width=804,height="+window.screen.height+",left=0,top=0,toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
	//window.detailWin.focus();
	window.open(OpenFile,"detailMultiWin","width=804,height="+window.screen.height+",left=0,top=0,toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
} 
function clauseInfoCheckOnclick(){
	document.getElementById("chkTerms").checked = document.getElementById("clauseInfoCheck").checked
	document.getElementById("clauseInfoDiv").style.display = "none";
	checkCatalogTerms();
	if (document.getElementById("chkTerms").checked){
		document.getElementById("btn_catalog_down").style.display = "";
	}else{
		document.getElementById("btn_catalog_down").style.display = "none";
	}
	/*
	if (typeof(catalogDownload._modelno) != "undefined" && catalogDownload._modelno != ""){
		catalogDownload(catalogDownload._modelno,catalogDownload._userid)
	}
	*/		
}
function checkCatalogTermsNShow(){
	checkCatalogTerms();
	if (document.getElementById("chkTerms").checked){
		/*
		setTimeout(function(){
			showCatalogTerms();
		},100);
		*/
		document.getElementById("btn_catalog_down").style.display = "";
	}else{
		document.getElementById("btn_catalog_down").style.display = "none";
	}
}
function checkCatalogTerms(){
	var now=new Date();
	var url = "/include/ajax/AjaxCatalogUsedTerms.jsp";
	var param = "mt=put&t="+now.getTime();
	if (document.getElementById("chkTerms").checked){
		param = param + "&ck=Y";
	}
	var getTerms = new Ajax.Request(
		url,
		{
			method:'get',parameters:param
		}
	);		
}
function checkCatalogType(imgtype){
	if (imgtype == 1){
		insertLog(4968);
	}else if(imgtype == 2){
		insertLog(4969);
	}else if(imgtype == 3){
		insertLog(4970);
	}
	
	var now=new Date();
	var url = "/include/ajax/AjaxSelectedCatalogType.jsp";
	var param = "img_type="+imgtype+"&t="+now.getTime();
	var getTerms = new Ajax.Request(
		url,
		{
			method:'get',parameters:param
		}
	);		
}
function showCatalogTerms(){
	if (document.getElementById("clauseInfoDiv")){
		if (document.getElementById("clauseInfoDiv").style.display != "none"){
			document.getElementById("clauseInfoDiv").style.display = "none";
			return;
		}
	}
	var now=new Date();
	var url = "/include/ajax/AjaxCatalogUsedTerms.jsp";
	var param = "mt=get&t="+now.getTime();
	var getTerms = new Ajax.Request(
		url,
		{
			method:'get',parameters:param,onComplete:isCheckCatalogTerms
		}
	);
	function isCheckCatalogTerms(originalRequest){
		if (originalRequest.responseText.trim() == "Y"){
			document.getElementById("clauseInfoCheck").checked = true;
		}else{
			document.getElementById("clauseInfoCheck").checked = false;
		}
		
		if((BrowserDetect.browser == "Explorer" && BrowserDetect.version == 6)) {
			document.getElementById("clauseInfoDiv").style.position = "absolute";
			document.getElementById("clauseInfoDiv").style.top = ((getBodyClientHeight()/2-50) + getBodyScrollTop()) + "px";
		}else{
			document.getElementById("clauseInfoDiv").style.position = "fixed";
			document.getElementById("clauseInfoDiv").style.top = (getBodyClientHeight()/2-50) + "px";
		}
		document.getElementById("clauseInfoDiv").style.left = (document.getElementById("wrap").offsetWidth/2 - 320) + "px";
		document.getElementById("clauseInfoDiv").style.display = "";
				
		
	}	
}
function hiddenClauseInfoDiv(){
	document.getElementById("clauseInfoDiv").style.display = "none";
}
// 퍼가기를 클릭했을 경우
function showCatalogDownload(modelno,userid,top,modelname,factory) {
	if (typeof(userid) != ""){
		insertLog(4965);
	}
	function ShowClauseLayer(originalRequest){
		document.getElementById("clauseLayer").style.position = "absolute";
		document.getElementById("clauseLayer").style.top = top + "px";
		document.getElementById("clauseLayer").style.left = (document.getElementById("wrap").offsetWidth/2 - 180) + "px";
		document.getElementById("clauseLayer").innerHTML = originalRequest.responseText;
		document.getElementById("clauseLayer").style.display = "";
		showCatalogDownload._modelno = modelno;
		showCatalogDownload._userid = userid;
	}	
	var url = "/include/ajax/AjaxClauseLayer.jsp";
	var param = "modelname="+modelname+"&factory="+factory;
	var getRec = new Ajax.Request(
		url,
		{
			method:'get',parameters:param,onComplete:ShowClauseLayer
		}
	);	
}
function catalogDownload(){
	var modelno = showCatalogDownload._modelno;
	var userid = showCatalogDownload._userid;
	
	var imgtype = "";
	if (document.getElementById("rdoCopyType1").checked){
		imgtype = "1";
	}else if(document.getElementById("rdoCopyType2").checked){
		imgtype = "2";
	}else if(document.getElementById("rdoCopyType3").checked){
		imgtype = "3";
	}
	
	var widthtype = "";
	if (document.getElementById("rdoWidthType1").checked){
		widthtype = "1";
	}else if(document.getElementById("rdoWidthType2").checked){
		widthtype = "2";
	}else if(document.getElementById("rdoWidthType3").checked){
		widthtype = "3";
	}
	copyCatalogUrl(modelno,userid,imgtype,widthtype);
}
// 퍼가기 실행
function copyCatalogUrl(modelno,userid,imgtype,widthtype) {
	var url = "/view/include/catalog/AjaxGetCatalogImage.jsp";
	var param = "imgtype="+imgtype+"&modelno="+modelno+"&userid="+userid+"&widthtype="+widthtype;

	var dateLong = (new Date()).getTime();
	param += "&dateLong="+dateLong;
	var getCatalogImg = new Ajax.Request(
		url,
		{
			method:'get',parameters:param
		}
	);
	
	var withtype_name = "";
	if (widthtype == "2" || widthtype == "3"){
		withtype_name = "_1";
	}
	if (userid == ""){
		userid = "enuri";
	}
	var returnImageUrl = "";
	if (widthtype != "3"){
		returnImageUrl = "<img src='http://catalog.enuri.gscdn.com/func_info/"+userid+"/"+modelno+"_"+imgtype+withtype_name+".png' border='0' >";
	}else{
		userid = "enuri";
		returnImageUrl = "<img src='http://goodsinfo.enuri.gscdn.com/func_info/"+userid+"/"+modelno+"_"+imgtype+withtype_name+".png' border='0' >";
	}
	
	if(window.clipboardData) {
		window.clipboardData.setData("Text", returnImageUrl);
		if (fnGetCookie2010("copy_today") != "Y"){ 
			showCatalogCopyInfoDiv();
		}
	}else{
		alert("해당 브라우저에서 지원하지않습니다.");
	}
	catalogDownload._modelno = "";
	catalogDownload._userid = "";
	document.getElementById("clauseLayer").style.display = "none";
		
}
function showCatalogCopyInfoDiv() {
	if(document.getElementById("catalogCopyInfoDiv").style.display=="none") {
		hiddenClauseInfoDiv();
		
		if((BrowserDetect.browser == "Explorer" && BrowserDetect.version == 6)) {
			document.getElementById("catalogCopyInfoDiv").style.position = "absolute";
			document.getElementById("catalogCopyInfoDiv").style.top = ((getBodyClientHeight()/2-20) + getBodyScrollTop()) + "px";
		}else{
			document.getElementById("catalogCopyInfoDiv").style.position = "fixed";
			document.getElementById("catalogCopyInfoDiv").style.top = (getBodyClientHeight()/2-20) + "px";
		}
		document.getElementById("catalogCopyInfoDiv").style.left = (document.getElementById("wrap").offsetWidth/2 - 40) + "px";
		document.getElementById("catalogCopyInfoDiv").style.display = "";
	} else {
		hiddenCatalogCopyInfoDiv();
	}
}
function hiddenCatalogCopyInfoDiv() {
	document.getElementById("catalogCopyInfoDiv").style.display = "none";
}
function showCatalogCopyInfoDiv2(){
	if((BrowserDetect.browser == "Explorer" && BrowserDetect.version == 6)) {
		document.getElementById("catalogCopyInfoDiv2").style.position = "absolute";
		document.getElementById("catalogCopyInfoDiv2").style.top = ((getBodyClientHeight()/2-20) + getBodyScrollTop()) + "px";
	}else{
		document.getElementById("catalogCopyInfoDiv2").style.position = "fixed";
		document.getElementById("catalogCopyInfoDiv2").style.top = (getBodyClientHeight()/2-20) + "px";
	}
	document.getElementById("catalogCopyInfoDiv2").style.left = (document.getElementById("wrap").offsetWidth/2 - 40) + "px";
	document.getElementById("catalogCopyInfoDiv2").style.display = "";
}
function goCatalogSample() {
	insertLog(4967);
	
	var imgtype = "";
	if (document.getElementById("rdoCopyType1").checked){
		imgtype = "3";
	}else if(document.getElementById("rdoCopyType2").checked){
		imgtype = "1";
	}else if(document.getElementById("rdoCopyType3").checked){
		imgtype = "2";
	}

	var widthtype = "";
	if (document.getElementById("rdoWidthType1").checked){
		widthtype = "1";
	}else if(document.getElementById("rdoWidthType2").checked){
		widthtype = "2";
	}
	
	var showUrl = "/view/include/catalog/catalogDownloadSample.jsp?checkedValue="+imgtype+"&checkedWidthValue="+widthtype;
	var catalogSample = window.open (showUrl,"catalogSample","width=908,height="+window.screen.height+",top=0,left=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,personalbar=no");
	catalogSample.focus();
}
function checkCatalogWidthType(widthtype){
	if (widthtype == 1){
		insertLog(4977);
	}else if(widthtype == 2){
		insertLog(4978);
	}else if(widthtype == 3){
		insertLog(4978);
	}
	
	var now=new Date();
	var url = "/include/ajax/AjaxSelectedCatalogType.jsp";
	var param = "width_type="+widthtype+"&t="+now.getTime();
	var getTerms = new Ajax.Request(
		url,
		{
			method:'get',parameters:param
		}
	);
}
function addFavorite(){
	if (document.getElementById("enuriMenuFrame")){
		var addFavoriteFunction = document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.document.getElementById("add_favorite").onclick.toString(); 
		var addFavoriteFunction1 = addFavoriteFunction.substring(0,addFavoriteFunction.indexOf("favoriteURL_NEW"));
		var varParam1 = addFavoriteFunction.substring(addFavoriteFunction.indexOf("favoriteURL_NEW")+17,addFavoriteFunction.indexOf(",",addFavoriteFunction.indexOf("favoriteURL_NEW"))-1) + "&_C_=41"
		var varParam2 = addFavoriteFunction.substring(addFavoriteFunction.indexOf(",",addFavoriteFunction.indexOf("favoriteURL_NEW"))+3, addFavoriteFunction.lastIndexOf("'") )
		//document.getElementById("enuriMenuFrame").contentWindow.favoriteURL_NEW(varParam1,varParam2)
		if (window.sidebar){ // 파폭
			window.sidebar.addPanel(param_text, param, "");
		}else if (document.all){ // IE
			window.external.AddFavorite(varParam1, varParam2);
		}else if (navigator.appName=="Netscape") { //크롬
			alert("확인을 누르시고 <Ctrl-D>를 사용하여 이 페이지를 즐겨찾기 하세요.");
		}		
		insertLog(5022);
	}	
}
function addBattang(){
	if (document.getElementById("enuriMenuFrame")){
		//document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.document.frmFavorite.batang.value = "Y";
		document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.go_icon();  
		//document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.document.frmFavorite.batang.value = "";
		insertLog(5023);
	}
}
function today(pricelist){
	if (rec_zzim == "today" && document.getElementById('rb_recent_zzim').style.display != "none"){
		document.getElementById('rb_buttons').style.display="";
		document.getElementById('rb_recent_zzim').style.display = "none";
	}else{
		document.getElementById('div_inconv').style.display="none";
		if (typeof(pricelist) == "undefined"){
			if (document.getElementById("main_price_layer")){
				if (document.getElementById("main_price_layer").style.display != "none"){
					document.getElementById("main_price_layer").style.display = "none";
				}
				if (document.getElementById("main_price_layer_bar").style.display != "none"){
					document.getElementById("main_price_layer_bar").style.display = "none";
				}				
			}
			if (document.getElementById("main_price_layer_info")){
				if (document.getElementById("main_price_layer_info").style.display != "none"){
					document.getElementById("main_price_layer_info").style.display = "none";
				}
			}			
		}	
		top.getGuide_Resent_ZzimCate(2,1,"");
	}
}
function begGoogleShow(){
	insertLog(5155);
	var varDicLoc = $("ifrmBeginnerFrame").contentWindow.document.location.href
	if (varDicLoc.indexOf("kb_no=") >= 0){
		var kb_no = varDicLoc.substring(varDicLoc.indexOf("kb_no=")+6,varDicLoc.indexOf("&",varDicLoc.indexOf("kb_no=")+6))
		document.getElementById("dicGoogleLayer").style.top = 90 + getBodyScrollTop() +"px"; 
		document.getElementById("dicGoogleLayer").style.display = "";
		document.getElementById("ifGoogle").src = "/include/IncGuideGoogleSearch_2010.jsp?kb_no="+kb_no+"&dic=y";
	}
}
function changeDicType(type){
	$("beg_dic_btn").style.height = "20px";
	$("beg_dic_btn").style.backgroundImage="url("+var_img_enuri_com+"/2010/images/view/beg_tab01.gif)";
	$("beg_board_btn").style.height = "20px";
	$("beg_board_btn").style.backgroundImage="url("+var_img_enuri_com+"/2010/images/view/beg_tab02.gif)";
	$("beg_google").style.height = "20px";
	$("beg_google").style.backgroundImage="url("+var_img_enuri_com+"/2010/images/view/beg_tab03.gif)";
	if (type == "dic"){
		$("beg_dic_btn").style.height = "24px"
		$("beg_dic_btn").style.backgroundImage="url("+var_img_enuri_com+"/2010/images/view/beg_tab01_on.gif)";
	}else if(type == "bbs"){
		insertLog(5154);
		$("beg_board_btn").style.height = "22px";
		$("beg_board_btn").style.backgroundImage="url("+var_img_enuri_com+"/2010/images/view/beg_tab02_on.gif)";
	}else{
		insertLog(5155);
		var varDicLoc = $("ifrmBeginnerFrame").contentWindow.document.location.href
		if (varDicLoc.indexOf("kb_no=") >= 0){
			var kb_no = varDicLoc.substring(varDicLoc.indexOf("kb_no=")+6,varDicLoc.indexOf("&",varDicLoc.indexOf("kb_no=")+6))
			document.getElementById("dicGoogleLayer").style.top = 90 + getBodyScrollTop() +"px"; 
			document.getElementById("dicGoogleLayer").style.display = "";
			document.getElementById("ifGoogle").src = "/include/IncGuideGoogleSearch_2010.jsp?kb_no="+kb_no+"&dic=y";
		}
		return;
	}
	if (type == "bbs"){
		var varBtnTop = Position.cumulativeOffset($("beg_dic_btn"))[1] - 10;
		window.scrollTo(0,varBtnTop)
	}
	if (type == "dic"){
		$("ifrmBeginnerFrame").height = ($("ifrmBeginnerFrame").contentWindow.document.getElementById("dic_desc").offsetHeight ) + "px"
	}else{
		$("ifrmBeginnerFrame").height = ($("ifrmBeginnerFrame").contentWindow.document.getElementById("dic_desc").offsetHeight + 110 ) + "px"
	}	
	var varDicLoc = $("ifrmBeginnerFrame").contentWindow.document.location.href
	if (varDicLoc.indexOf("&type") >= 0){
		varDicLoc = varDicLoc.substring(0,varDicLoc.indexOf("&type")+6) + type;
	}else{
		varDicLoc = varDicLoc + "&type=" + type;
	} 
	$("ifrmBeginnerFrame").contentWindow.document.location.href = varDicLoc; 
}
function setDragGleEffect(){
	try{
		if (setDragGleEffect.count){
			setDragGleEffect.count++;
		}else{
			setDragGleEffect.count=1;
		}
		new Draggable(document.getElementById("dicGoogleLayer"),
			{handle:'gle_handle',starteffect:null,endeffect:null,
			onEnd:function(){
				if (document.getElementById("dicGoogleLayer").offsetTop < 0 ){
					document.getElementById("dicGoogleLayer").style.top = 0+"px";
				}
				if ((document.getElementById("dicGoogleLayer").offsetLeft + document.getElementById("dicGoogleLayer").offsetWidth)  > document.body.offsetWidth ){
					document.getElementById("dicGoogleLayer").style.left = (document.body.offsetWidth - document.getElementById("dicGoogleLayer").offsetWidth) - 22 + "px";
				}
				if (document.getElementById("dicGoogleLayer").offsetLeft < 0 ){
					document.getElementById("dicGoogleLayer").style.left = 0+"px";
				}				
				if ((document.getElementById("dicGoogleLayer").offsetTop + 30)  > document.body.offsetHeight ){
					document.getElementById("dicGoogleLayer").style.top = (document.body.offsetHeight - document.getElementById("dicGoogleLayer").offsetHeight) - 4 + "px";
				}
			} 
		});		
	}catch(e){
		if (setDragGleEffect.count < 5 ){
			setTimeout("setDragGleEffect()", 1000);	
		}
	}
}
function getRbTop(){
	if ($("rz_num_2_on")){
		return RB_TOP;	
	}else{
		return $("rb_recent_zzim").offsetHeight
	}
}
function CmdGotoMall(type, cmd, vcode, modelno, price, url,cate,pl_no,imgurl){
	var varMoveTargetPage = "/move/Redirect.jsp";
	var w = window.screen.width;
	var h = screen.availHeight ;
	var varTargetUrl = varMoveTargetPage+"?type="+type+"&cmd="+cmd+"&vcode="+vcode+"&modelno="+modelno+"&price="+price+"&pl_no="+pl_no+"&imgurl="+imgurl;
	//k = window.open (varTargetUrl,"","width="+w+" height="+h+" top=0 left=0 toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,resizable=yes,menubar=yes,personalbar=yes");
	k = window.open (varTargetUrl,"_blank");
	k.focus();		
	return;
		
}
function fum(){
	var varChkModelNos = getCheckedModelNo();
	var fHeight=screen.availHeight;
	if(BrowserDetect.browser == "Chrome"){
		fHeight = fHeight - 60;
	}	
	var fumWin = window.open("/view/include/insertCatalogDownProc.jsp?cmd=insert&modelnos="+varChkModelNos,"Fum","width=310,height="+fHeight+",left=0,top=0,toolbar=no,directories=no,status=yes,scrollbars=no,resizable=no,menubar=no");
	fumWin.focus();		
}
function showOffToday(){
	insertLog(6029);
	fnSetCookie2010("copy_today","Y",7);
}
function showCateLayer(){
	if ($("catelayer").style.display != "none"){
		$("btn_arrow").src= var_img_enuri_com +"/images/view/detail/ingi/combo_btn.gif";
		$("catelayer").style.display = "none"
	}else{
		$("btn_arrow").src= var_img_enuri_com + "/images/view/detail/ingi/combo_x_btn.gif";
		$("catelayer").style.display = ""
	}
	
}
function showPopularList(flag){
	var tdMObjs = $("popularListDiv").getElementsBySelector('td[class="mcate_rank"]');
	var tdSObjs = $("popularListDiv").getElementsBySelector('td[class="scate_rank"]');
	for (var i=0;i<tdMObjs.length;i++){
		if (flag == "M"){
			tdMObjs[i].style.display = "";
			tdSObjs[i].style.display = "none";
			$("catename").innerHTML = $("mcatename").innerHTML 
			$("catecnt").innerHTML = $("mcatecnt").innerHTML
		}else{
			tdMObjs[i].style.display = "none";
			tdSObjs[i].style.display = "";			
			$("catename").innerHTML = $("scatename").innerHTML 
			$("catecnt").innerHTML = $("scatecnt").innerHTML				
		}			
	}
	$("catelayer").style.display = "none";
	$("btn_arrow").src= var_img_enuri_com + "/images/view/detail/ingi/combo_btn.gif";
}
function popOrderlist(){
	if($("orderListDiv")){
		var varLeft = 0;
		var varTop = 0;
		if ($("popularListDiv") && $("popularListDiv").style.display != "none"){
			varTop = $("popularListDiv").offsetTop+50;
			varLeft = $("popularListDiv").offsetLeft+80;
		}else{
			if (top.document.getElementById("enuriMenuFrame")){
				//varTop = Position.cumulativeOffset(top.document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame").contentWindow.document.getElementById("tab_seach_sort"))[1];
				varLeft = 2;
				varTop = Position.cumulativeOffset(top.document.getElementById("enuriMenuFrame").contentWindow.document.getElementById("enuriListFrame"))[1]+60;
			}else if (top.document.getElementById("searchListFrame")){
				varTop = Position.cumulativeOffset(top.document.getElementById("searchListFrame").contentWindow.document.getElementById("location"))[1];
				varTop = varTop + Position.cumulativeOffset(top.document.getElementById("searchListFrame"))[1];
				varLeft = 2;
			}		
		}
		function ShowOrderInfoLayer(originalRequest){
			document.getElementById("orderListDiv").innerHTML = originalRequest.responseText;
			$("orderListDiv").style.top = varTop + "px";
			$("orderListDiv").style.left = varLeft + "px";
			$("orderListDiv").style.display = "";			
		}
		if($("orderListDiv").innerHTML==""){
			var url = "/include/ajax/AjaxOrderInfoLayer.jsp";
			var getRec = new Ajax.Request(
				url,
				{
					method:'get',onComplete:ShowOrderInfoLayer
				}
			);				
		}else{
			$("orderListDiv").style.top = varTop + "px";
			$("orderListDiv").style.left = varLeft + "px";
			$("orderListDiv").style.display = "";
		}
	}	
}
function orderListClose() {
	$("orderListDiv").style.display = "none";
}
function changeOrderLayer(){
	top.document.getElementById("orderLayer").style.display = "none";
	top.document.getElementById("popLayer").style.display = "";
}
function changePopLayer(){
	top.document.getElementById("popLayer").style.display = "none";
	top.document.getElementById("orderLayer").style.display = "";
}
function showMainPriceLayerInfo(){
	if (document.getElementById("main_price_layer_info")){
		if (document.getElementById("main_price_layer_info").style.display != "none"){
			document.getElementById("main_price_layer_info").style.display = "none";
		}else{
			if (document.getElementById("main_price_layer_info").innerHTML == ""){
				var varMainPriceInfo = "";
				varMainPriceInfo += "<img src=\""+var_img_enuri_com+"/2010/images/view/layer_111102.gif\" width=\"337\" height=\"124\" border=\"0\" usemap=\"#mainPriceInfoMap\" />";
				varMainPriceInfo += "<map name=\"mainPriceInfoMap\" id=\"mainPriceInfoMap\">";
				varMainPriceInfo += "<area shape=\"rect\" coords=\"318,4,333,19\" href=\"#\" onclick=\"document.getElementById('main_price_layer_info').style.display='none';return false;\" />";
				varMainPriceInfo += "</map>";			
				document.getElementById("main_price_layer_info").innerHTML = varMainPriceInfo;	
			}
			document.getElementById("main_price_layer_info").style.left = (document.getElementById("main_price_layer").offsetLeft+50)+"px"; 
			document.getElementById("main_price_layer_info").style.top = (document.getElementById("main_price_layer").offsetTop+20)+"px";
			document.getElementById("main_price_layer_info").style.display = "";
		}
	}
}
function notifyDic(kbno,cate,title){
	function ShowInConv(originalRequest){
		document.getElementById("div_inconv").innerHTML = originalRequest.responseText;
		document.getElementById("div_inconv").style.top = (getBodyClientHeight() + getBodyScrollTop()  - 300) +"px";;
		document.getElementById("div_inconv").style.left = (document.getElementById("wrap").offsetWidth - 200) +"px";;
		document.getElementById("div_inconv").style.display = "";
		document.getElementById("rb_buttons").style.display="";
		document.getElementById("rb_recent_zzim").style.display='none';	
	}	

	var url = "/include/ajax/AjaxInconv.jsp";
	var param = "isdic=y&kbno="+kbno+"&cate="+cate+"&title="+title;
	var getRec = new Ajax.Request(
		url,
		{
			method:'get',parameters:param,onComplete:ShowInConv
		}
	);	
}

