/*//*	- common.js
*		Àü¿ª Å¬·¡½º ¹× ÇÔ¼öµé·Î ±¸¼ºµÇ¸ç »çÀÌÆ® ³»¿¡¼­ ÇÊ¿äÇÑ °¢Á¾ ´ÜÀ§º° ÇÁ·Î±×·¥À» ¼±¾ð
*
*	@author ÀÌÁÖÇö / jhlee@wylielab.co.kr / 2010-09-28
*/

/*
*	- swapImg(changeId, imgSrc)
*		ÀÌ¹ÌÁö º¯°æ
*	@args
*		changeId - º¯°æµÉ ÀÌ¹ÌÁöÀÇ ¾ÆÀÌµð
*		imgSrc   - º¯°æµÉ ÀÌ¹ÌÁö¸í
*
*	@author ÀÌÁÖÇö / jhlee@wylielab.co.kr / 2010-09-28
*/
function swapImg(changeId, imgSrc){
	//document.getElementById(changeId).src = imgSrc;
	$("#" + changeId).attr("src", imgSrc);
}

/*
*	- popImg(filename, w, h)
*		ÀÌ¹ÌÁö ÆË¾÷Ã¢
*	@args
*		filename - ÀÌ¹ÌÁö°¡ Æ÷ÇÔµÇ¾î ÄÚµùµÈ ÆÄÀÏ¸í
*		w   		 - ÆË¾÷¶ç¿ï ÀÌ¹ÌÁö ³ÐÀÌ
*		h   		 - ÆË¾÷¶ç¿ï ÀÌ¹ÌÁö ³ôÀÌ
*
*	@author ÀÌÁÖÇö / jhlee@wylielab.co.kr / 2010-09-29
*/
function popImg(filename, w, h){
	//w = w + 45;
	w = w + 40;
	window.open("/include/popImg.yes?filename="+filename, "win1", "width="+w+",height="+h+",scrollbars=yes,status=no,menubar=no,location=no");
}

function getCookie( name ){
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
				if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
						endOfCookie = document.cookie.length;
				return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
				break;
	 }
	 return "";
}

function setCookie(name, value, expiredays){
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function goCyworld(stylecd){
	var url = encodeURIComponent("http://www.yescode.co.kr/shop/product/xml/yesToCyworld_xml.yes?STYLECD="+stylecd);
		window.open('http://api.cyworld.com/openscrap/shopping/v1/?xu=' + url + '&sid=s0214266', 'cyopenscrap', 'width=450,height=410');
}

/*
*	- goSNS(what, url)
*		Æ®À§ÅÍ, ¹ÌÅõµ¥ÀÌ, ÆäÀÌ½ººÏÀ¸·Î ÆÛ°¡±â
*	@args
*   what 		 - twit:Æ®À§ÅÍ, me:¹ÌÅõµ¥ÀÌ, face:ÆäÀÌ½ººÏ
*		url 		 - °¢ »çÀÌÆ®¿¡ ÆÛ°¥ ÁÖ¼Ò (http://www ·Î ½ÃÀÛÇÏ´Â ÁÖ¼Ò ³Ö¾î¾ß ÇÔ.)
*		msg 	 	 - ÆÛ°¥ ³»¿ë (Me2Day ¸µÅ©¶§¹®¿¡ µû·Î »©¾ßÇÔ)
*
*	@author ÀÌÁÖÇö / jhlee@wylielab.co.kr / 2010-11-19
*/
function goSNS(what, url, msg ,titles){
	if(what == "twit"){
		window.open("http://twitter.com/home?status="+encodeURIComponent(msg)+" "+url, "_blank");
	}else if(what == "me"){
		window.open("http://me2day.net/posts/new?new_post[body]="+url+" \""+encodeURIComponent(msg)+"\":"+url+" ", "_blank");
	}else if(what == "face"){
/*
		window.open("/ajaxData/SNSMASSAGE.bog?url="+encodeURIComponent(url)+"&msg="+encodeURIComponent(msg)+"&titles="+encodeURIComponent(msg), "_blank");
		totalText = encodeURI("http://www.facebook.com/sharer/sharer.php?u="+url+"&t="+msg);
		window.open(totalText, "_blank");		window.open("http://www.facebook.com/share.php?s=100&p[url]="+url+"&p[title]="+encodeURIComponent(msg)+"&p[Images]="+encodeURIComponent("http://www.ebodyguard.co.kr/logsexycookie.jpg")+"&p[summary]="+encodeURIComponent(msg), "_blank");
*/
		
		totalText = encodeURI("http://www.facebook.com/sharer/sharer.php?u="+url+"&t="+msg);
		window.open(totalText, "_blank");

	}
}


/*
*	- getLength(str, maxStr, txtId, progressId)
*		±ÛÀÚ¼ö ¼¼±â
*	@args
*		str 		 		 - ±ÛÀÚ¼ö¸¦ ¼¿ ÅØ½ºÆ® ³»¿ë
*		maxStr 		 	 - ÃÖ´ë ±ÛÀÚ ¼ö
*		txtId 			 - ÅØ½ºÆ®¹Ú½º ¾ÆÀÌµð
*		progressId 	 - ±ÛÀÚÀÔ·ÂÇÒ¶§¸¶´Ù ÇÁ·ÐÆ®¿¡ ±ÛÀÚ¼ö¸¦ ³ëÃâ½ÃÅ³ ¶§ ³ëÃâµÇ´Â °÷ÀÇ  element id (¿¹ : 12ÀÚ / 300ÀÚ -> [12ÀÚ] ºÎºÐ)
*								   ³ëÃâ ¾È½ÃÅ³ °Å¶ó¸é ºó °ªÀ¸·Î ³Ö¾îÁÜ.

* @ »ç¿ë ¿¹ 		 - getLength(this.value, 150, 'commentText', 'strLength');
*
*	@author ÀÌÁÖÇö / jhlee@wylielab.co.kr / 2010-10-20
*/
function getLength(str, maxStr, txtId, progressId){
	var maxByte = str.length+(escape(str)+"%u").match(/%u/g).length-1;
	maxStrSize = Math.ceil(maxByte / 2);
	var strLen = getId(txtId).value.length;

	if (maxStr <= maxStrSize){
		alert(maxStr + "ÀÚ ÀÌ»ó ÀÛ¼ºÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
		getId(txtId).value = getId(txtId).value.substring(0, strLen-2);

		// ÇöÀçÀÇ ±ÛÀÚ¼ö¸¦ ³Ö´Â ºÎºÐÀÌ ÀÖÀ» ¶§¸¸ ÁøÇàÇÔ.
		if (progressId != ""){
			getId(progressId).value = maxStrSize;
		}
		return;

	} else{
		if (progressId != ""){
			getId(progressId).innerHTML = maxStrSize;
		}
	}
}

/*
*	- getId(id)
*		id·Î ¹ÞÀº °³Ã¼ ¸®ÅÏ
*	@args
*		id 		 		 	- ¸®ÅÏÇÑ °³Ã¼ ¾ÆÀÌµð
*
*	@author ÀÌÁÖÇö / jhlee@wylielab.co.kr / 2010-10-20
*/
function getId(id) {
	return document.getElementById(id);
}

/*
*	- changeDate(y, m, d, ys, ms, ds, ye, me, de, formNm)
*		ÀÎÀÚ·Î ¹ÞÀº ³¯Â¥¸¦ ¼¿·ºÆ® ¹Ú½º¿¡ ¼ÂÆÃ
*	@args
*		y 		 		 	- ¹Ù²Ü ³¯Â¥(³â)
*		m 		 		 	- ¹Ù²Ü ³¯Â¥(¿ù)
*		d 		 		 	- ¹Ù²Ü ³¯Â¥(ÀÏ)
*		ys 		 			- ³¯Â¥¸¦ ¹Ù²Ü ½ÃÀÛ ³¯Â¥(³â)¿¡ ´ëÇÑ ¼¿·ºÆ® ¹Ú½º ¾ÆÀÌµð
*		ms 		 			- ³¯Â¥¸¦ ¹Ù²Ü ½ÃÀÛ ³¯Â¥(¿ù)¿¡ ´ëÇÑ ¼¿·ºÆ® ¹Ú½º ¾ÆÀÌµð
*		ds 		 			- ³¯Â¥¸¦ ¹Ù²Ü ½ÃÀÛ ³¯Â¥(ÀÏ)¿¡ ´ëÇÑ ¼¿·ºÆ® ¹Ú½º ¾ÆÀÌµð
*		ye 		 			- ³¯Â¥¸¦ ¹Ù²Ü ³¡ ³¯Â¥(³â)¿¡ ´ëÇÑ ¼¿·ºÆ® ¹Ú½º ¾ÆÀÌµð
*		me 		 			- ³¯Â¥¸¦ ¹Ù²Ü ³¡ ³¯Â¥(¿ù)¿¡ ´ëÇÑ ¼¿·ºÆ® ¹Ú½º ¾ÆÀÌµð
*		de 		 			- ³¯Â¥¸¦ ¹Ù²Ü ³¡ ³¯Â¥(ÀÏ)¿¡ ´ëÇÑ ¼¿·ºÆ® ¹Ú½º ¾ÆÀÌµð
*		formNm 			- Æû ÀÌ¸§
*
*	@author ÀÌÁÖÇö / jhlee@wylielab.co.kr / 2010-10-20
*/
function changeDate(y, m, d, ys, ms, ds, ye, me, de, formNm, termVal){
	var date = new Date();
	getId(ys).value = y;
	getId(ms).value = m;
	getId(ds).value = d;
	getId(ye).value = date.getFullYear();
	getId(me).value = date.getMonth()+1;
	getId(de).value = date.getDate();
	document.forms[formNm].setTerm.value = termVal;
	document.forms[formNm].submit();		//submit ÇØÁÖÁö ¾ÊÀ¸¸é ¿ù¸¸ ¹Ù²ð »Ó ¿ù¿¡ ´ëÇÑ ³¡³¯Â¥(30 / 31 / 28)Àº º¯°æµÇÁö ¾ÊÀ½.
}

function smartSearchLayer(distance){
	if(distance == "appear"){
		$("div#Lnb_section").css("zIndex", 6);
	}else if(distance = "disappear"){
		$("div#Lnb_section").css("zIndex", 3);
	}
}

function allCategoryLayer(distance){
	if(distance == "appear"){
		$("div#Lnb_section div:eq(0)").css("zIndex", 5);
	}else if(distance = "disappear"){
		$("div#Lnb_section div:eq(0)").css("zIndex", 2);
	}
}

// ·¹ÀÌ¾îÆË¾÷
function openLayer(str){
	var url = "";
	var layerId = "";
	if(str == "store"){		// ¸ÅÀåÃ£±â
		url = "/common/popup/pop_choicestore.sx";
		layerId = "selectShop";		// ·¹ÀÌ¾îÆË¾÷ÀÌ ¶ã DIV ¾ÆÀÌµð
	}else if(str == "zip"){
		url = "/common/popup/pop_findzipcode.sx";
		layerId = "findZip";
	}
	if(str == "store_tmp"){		// ¸ÅÀåÃ£±â
		url = "/common/popup/pop_choicestore_tmp.sx";
		layerId = "selectShop";		// ·¹ÀÌ¾îÆË¾÷ÀÌ ¶ã DIV ¾ÆÀÌµð
	}
	if(str == "zip2"){
		url = "/common/popup/pop_findzipcode_r.sx";
		layerId = "findZip";
	}
	if(str == "zipMyPage"){
		url = "/common/popup/pop_findzipcode_my.sx";
		layerId = "findZip";
	}
	if(str == "prevdelivery"){
		url = "/common/popup/pop_beforeaddress.sx";
		layerId = "prevdelivery";
	}
	if(str == "qnaPop"){
		url = "/customer/pop_qna.sx";
		layerId = "qnaPOP";
	}
	if(str == "giftset"){
		url = "/common/popup/pop_showgiftset.sx";
		layerId = "giftset";
	}
	
	if(str == "giftset_2"){
		url = "/common/popup/pop_showgiftset_2.sx";
		layerId = "giftset";
	}

	$.post(url, {}, function(resultData){
		$("#"+layerId).html(resultData);
		$.setLayer({ id:layerId });
	});
}

// ¸ÅÀå Ã£±â ¹öÆ°À» ´­·¶À» ¶§ (·¹ÀÌ¾îÆË¾÷¿¡¼­)
function searchStore(sido,gugun) {
	if (sido ==""){
		alert("Ã£°íÀÚ ÇÏ´Â ¸ÅÀåÀÇ Áö¿ªÀÌ³ª ±¸ºÐÀ» ¼±ÅÃÇØÁÖ¼¼¿ä.");
		return;
	} else{
		$.post("/common/popup/exec/store_list_exec.yes", {"sido" : sido, "gugun" : gugun }, function(resultData){
			$("#search_list2").html(resultData);
		});
	}
}

function searchStore_tmp(sido,gugun) {
	if (sido ==""){
		alert("Ã£°íÀÚ ÇÏ´Â ¸ÅÀåÀÇ Áö¿ªÀÌ³ª ±¸ºÐÀ» ¼±ÅÃÇØÁÖ¼¼¿ä.");
		return;
	} else{
		$.post("/common/popup/exec/store_list_exec_tmp.yes", {"sido" : sido }, function(resultData){
			$("#search_list2").html(resultData);
		});
	}
}

// ¿ìÆí¹øÈ£ ¹öÆ°À» ´­·¶À» ¶§ (·¹ÀÌ¾îÆË¾÷¿¡¼­)
function findZip(addrNm){
	if (addrNm == ""){
		alert("Ã£°íÀÚ ÇÏ´Â µ¿/À¾/¸éÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		return;
	} else{
		$.post("/common/popup/exec/zip_list_exec.sx", {"addrNm" : addrNm}, function(resultData){
			$("#search_list").html(resultData);
		});
	}
}

// ¿ìÆí¹øÈ£ ¹öÆ°À» ´­·¶À» ¶§ (¹è¼ÛÁö)
function findZip2(addrNm){
	if (addrNm == ""){
		alert("Ã£°íÀÚ ÇÏ´Â µ¿/À¾/¸éÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		return;
	} else{
		$.post("/common/popup/exec/zip_list_r_exec.sx", {"addrNm" : addrNm}, function(resultData){
			$("#search_list3").html(resultData);
		});
	}
}

// ¿ìÆí¹øÈ£ ¹öÆ°À» ´­·¶À» ¶§ (¹è¼ÛÁö)
function findZipMyPage(addrNm){
	if (addrNm == ""){
		alert("Ã£°íÀÚ ÇÏ´Â µ¿/À¾/¸éÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		return;
	} else{
		$.post("/common/popup/exec/zip_list_my_exec.sx", {"addrNm" : addrNm}, function(resultData){
			$("#search_list4").html(resultData);
		});
	}
}

// ¸ÅÀå¸í Å¬¸¯ ½Ã ºÎ¸ðÃ¢¿¡ ¸ÅÀå¸í ³Ö¾îÁÖ±â
function copyStore(storeNm, storeCD, layerId){
	$("#storeNm").val(storeNm);
	$("#storeCD").val(storeCD);
	$.setLayer.close();
	return;
}

function copyStore2(storeNm, storeCD, layerId){
	store_arr=storeNm.split("-");
	$("#storeNm").val(store_arr[0]);
	$("#storeCD").val(store_arr[1]);
	return;
}
function copyStore_tmp(storeNm, storeCD, layerId){
	store_arr=storeNm.split("-");
	alert(store_arr);
	alert(storeNm);
	$("#storeNm").val(store_arr[0]);
	$("#storeCD").val(store_arr[1]);
	return;
}

// ¿ìÆí¹øÈ£ Å¬¸¯ ½Ã ºÎ¸ðÃ¢¿¡ ¿ìÆí¹øÈ£ ³Ö¾îÁÖ±â
function copyZip(zipCD, sido, gugun, dong, ri, bunji, layerId){
	var zip = zipCD.split("-");
	var addr_1 = sido + " " + gugun + " " + dong + " " + ri + " " + bunji;
	$("#Mzip1").val(zip[0]);
	$("#Mzip2").val(zip[1]);
	$("#Madd1").val(addr_1);
//document.getElementById("addr_1").disabled=true;
	$("#Madd2").focus();
	$.setLayer.close();
	return;
}

// ¿ìÆí¹øÈ£ Å¬¸¯ ½Ã ºÎ¸ðÃ¢¿¡ ¿ìÆí¹øÈ£ ³Ö¾îÁÖ±â(¹è¼ÛÁö)
function copyZip2(zipCD, sido, gugun, dong, ri, bunji, layerId){
	var zip = zipCD.split("-");
	var addr_1 = sido + " " + gugun + " " + dong + " " + ri + " " + bunji;
	$("#zip1").val(zip[0]);
	$("#zip2").val(zip[1]);
	$("#add1").val(addr_1);
//	document.getElementById("add1").disabled=false;
	$("#add2").focus();
	$.setLayer.close();
	return;
}

// ¿ìÆí¹øÈ£ Å¬¸¯ ½Ã ºÎ¸ðÃ¢¿¡ ¿ìÆí¹øÈ£ ³Ö¾îÁÖ±â(¹è¼ÛÁö)
function copyZipMyPage(zipCD, sido, gugun, dong, ri, bunji, layerId){
	var zip = zipCD.split("-");
	var addr_1 = sido + " " + gugun + " " + dong + " " + ri + " " + bunji;
	$("#zip_1").val(zip[0]);
	$("#zip_2").val(zip[1]);
	$("#addr_1").val(addr_1);
//	document.getElementById("add1").disabled=false;
	$("#addr_2").focus();
	$.setLayer.close();
	return;
}

//ÀÌÀü ¹è¼ÛÁö
function copyaddress(str){
	var addressArr=str.split(",");
	var tel=addressArr[1].split("-");
	var hphone=addressArr[2].split("-");
	zip1=addressArr[3].substr(0,3);
	zip2=addressArr[3].substr(3,6);


	$("#zip1").val(zip1);
	$("#zip2").val(zip2);
	$("#names").val(addressArr[0]);
	$("#Phone1").val(tel[0]);
	$("#Phone2").val(tel[1]);
	$("#Phone3").val(tel[2]);
	$("#HPhone1").val(hphone[0]);
	$("#HPhone2").val(hphone[1]);
	$("#HPhone3").val(hphone[2]);
	$("#add1").val(addressArr[4]);
	$("#add2").val(addressArr[5]);
	$.setLayer.close();
	return;
}

function setComma(str)
{
	str = ""+str+"";
	var retValue = "";
	for(i=0; i<str.length; i++)
	{
		if(i > 0 && (i%3)==0) {
			retValue = str.charAt(str.length - i -1) + "," + retValue;
		} else {
			retValue = str.charAt(str.length - i -1) + retValue;
		}
	}
	return retValue;
}

// Å¬¸³º¸µå¿¡ ³»¿ë º¹»ç
function copyToClipboard(targetText){
	if (window.clipboardData){
	  window.clipboardData.setData("Text", targetText);
	}else if (window.netscape){
	  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
	  var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
	  if (!clip) return;
	  var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
	  if (!trans) return;
	  trans.addDataFlavor('text/unicode');
	  var str = new Object();
	  var len = new Object();
	  var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
	  var copytext = targetText;
	  str.data = copytext;
	  trans.setTransferData("text/unicode",str,copytext.length*2);
	  var clipid=Components.interfaces.nsIClipboard;
	  if (!clip) return false;
	  clip.setData(trans,null,clipid.kGlobalClipboard);
	}

	return false;
}


function loginReturn(url){
	if(confirm("·Î±×ÀÎÀ» ÇÏ¼Å¾ß ÀÌ¿ë °¡´ÉÇÕ´Ï´Ù.\n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")){
		document.location.href = "/mm/login.sx?ru=" + url;
	}
}

function loginParentReturn(url){
	if(confirm("·Î±×ÀÎÀ» ÇÏ¼Å¾ß ÀÌ¿ë °¡´ÉÇÕ´Ï´Ù.\n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")){
		parent.document.location.href = "/mm/login.sx?ru=" + url;
	}
}


/*
*	- showPopupCenter
*		ÁöÁ¤µÈ °æ·ÎÀÇ ÆÄÀÏÀ» È­¸é Á¤Áß¾Ó¿¡ ¶ç¿ò
* @args
*		filePath -
*		windowName -
*		popupWidth -
*		popupHeight -
*		scrollFlag -
* @usage
*			showPopupCenter('¾Ð¾÷ÁÖ¼Ò','ÆË¾÷ÀÌ¸§', °¡·Î, ¼¼·Î, '½ºÅ©·Ñ¿©ºÎ');
*
*	@author ÀÌ½ÂÀç / saystone@wylielab.co.kr / 2008-01-01
*/
function showPopupCenter(filePath, windowName, popupWidth, popupHeight, scrollFlag){
	var scrFlag = (typeof scrollFlag == "undefined" || scrFlag == "no") ? "no" : "yes";
	var leftPosition = (screen.width) ? (screen.width - popupWidth) / 2 : 0;
	var topPosition = (screen.height) ? (screen.height - popupHeight) / 2 : 0;
	var settings = 'height=' + popupHeight + ',width=' + popupWidth + ',top=' + topPosition + ',left=' + leftPosition + ',scrollbars=' + scrFlag + ',resizable=no'
	var popupWindow = window.open(filePath, windowName, settings);
	popupWindow.focus();
}

/*
*	- showPopup
*		ÁöÁ¤µÈ °æ·ÎÀÇ ÆÄÀÏÀ» ÁöÁ¤µÈ ÁÂÇ¥¿¡ ¶ç¿ò
*		@args
*			filePath -
*			windowName -
*			popupWidth -
*			popupHeight -
*			positionLeft -
*			positionTop -
*			scrollFlag -
*		@usage
*			showPopup('¾Ð¾÷ÁÖ¼Ò','ÆË¾÷ÀÌ¸§', °¡·Î, ¼¼·Î, °¡·ÎÃà, ¼¼·ÎÃà, '½ºÅ©·Ñ¿©ºÎ');
*
*	@author ÀÌ½ÂÀç / saystone@wylielab.co.kr / 2008-01-01
*/
function showPopup(filePath, windowName, popupWidth, popupHeight, positionLeft, positionTop, scrollFlag){
	var scrFlag = (typeof scrollFlag == "undefined" || scroll == "no") ? "no" : "yes";
	var posLeft = (positionLeft == "") ? 0 : positionLeft;
	var posTop = (positionTop == "") ? 0 : positionTop;
	var settings = 'height=' + popupHeight + ',width=' + popupWidth + ',top=' + positionTop + ',left=' + positionLeft + ',scrollbars=' + scrFlag + ',resizable=no'
	var popupWindow = window.open(filePath, windowName, settings);
	popupWindow.focus();
}

function terminateSession(){
	document.location.href = "/TwoChk/SSOout.asp";
}
 
function GrpBox(bool, str, grpstr) {
	
	var AllVar = document.getElementById(AllVar);
	
    var obj = document.getElementsByName(str); 
    //var grpstr = document.getElementById(grpstr); 
    for (var i=0; i<obj.length; i++){
    	if (obj[i].id == grpstr){     
			obj[i].checked = bool; 
		}	
    }	
} 


/* img over */
function imgMenuOver(containderID) {
	var objwrap = document.getElementById(containderID);
	var imgMenu = objwrap.getElementsByTagName("a");

	for (i=0; i<imgMenu.length; i++) {
		if(imgMenu[i].getElementsByTagName("img").length == 0) continue;

		if (imgMenu[i].getElementsByTagName("img")[0].src.indexOf("_on.gif") != -1 ) {
			continue;
		}
		imgMenu[i].onmouseover = function() {
			subImage = this.getElementsByTagName("img")[0];
			if (subImage.src.indexOf("_on.gif") != -1) return false;
			subImage.src = subImage.src.replace("_off.gif","_on.gif");
		}
		imgMenu[i].onfocus = function() {
			subImage = this.getElementsByTagName("img")[0];
			if (subImage.src.indexOf("_ove_on.gif") != -1) return false;
			subImage.src = subImage.src.replace("_off.gif","_on.gif");
		}
		imgMenu[i].onmouseout = function() {
			subImage = this.getElementsByTagName("img")[0];
			subImage.src = subImage.src.replace("_on.gif", "_off.gif");
		}
		imgMenu[i].onblur = function() {
			subImage = this.getElementsByTagName("img")[0];
			subImage.src = subImage.src.replace("_on.gif", "_off.gif");
		}
	}
}

function mainPickChainge(str)
 {
  str.style.display='none';     //ÇØ´ç ºÎºÐÀ» »ç¿ëÇÏ½Ã¸é ¾Æ¿¹ ÀÌ¹ÌÁö°¡ ¾Èº¸ÀÌ´Â°Å±¸¿ä
 }


// Àå¹Ù±¸´Ï Å¬¸¯½Ã ·¹ÀÌ¾î ¶ç¿ì±â Start
function moreProData(styleCd){
    if(typeof getProData == "undefined"){
        alert("getProData°¡ ¼±¾ðµÇÁö ¾Ê¾Ò½À´Ï´Ù.");
    }else{	    	
    	getProData.params.styleCd 	= styleCd;
    	  if(typeof getProData.runBeforeRequest != "undefined"){
            getProData.runBeforeRequest();
        }

        $.post(getProData.requestURL, getProData.params, function(response){
            getProData.runAfterResponse(response);
        });
    }
}

function closeProDiv(str){
	$(".order").hide();
	$.setLayer.close();
}

//****** Call Order Deatil data ***************//
var getProData = {
    requestURL : "/ajaxData/sl/proDetailAjax.sx",

    params : {
    },

    runBeforeRequest : function(){
    },

    runAfterResponse : function(response){
        $(".order").html(response);
       	$.setLayer({ id:"orderPop" });
        
     }
};

function proDiv(classNm,Gn,Idx){
	if(Gn == "In"){
		$("."+classNm).eq(Idx).show();
	}
	else{
		$("."+classNm).eq(Idx).hide();
	}	
}
// Àå¹Ù±¸´Ï Å¬¸¯½Ã ·¹ÀÌ¾î ¶ç¿ì±â End

function proMenuDiv(Gn,Idx){

	if(Gn == "In"){
		for(i=0;i<$(".bigMenu").length;i++){
			$(".bigMenu").eq(i).hide();	
			$(".subMenu").eq(i).hide();	
		}
		$(".bigMenu").eq(Idx).show();
		$(".subMenu").eq(Idx).show();
		
	}	

}


/*Áñ°Ü Ã£±â*/
function addfavorites(adtitle){ 
	if (document.all){
		window.external.AddFavorite(document.location.href,adtitle) 		
	}
}

