//³ªÁß¿¡ JS ÆÄÀÏ·Î ÇÕÃÄ¾ßÇÔ

// JavaScript Document

try {
document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

function setPng24(obj) { 
  obj.width=obj.height=1; 
  obj.className=obj.className.replace(/\bpng24\b/i,''); 
  obj.style.filter = 
  "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
  obj.src='';  
  return ''; 
} 


var BXUi={};

// ¸¶ÀÌµ¶ °ü·Ã ÇÁ·ÎÆÛÆ¼
BXUi.MyDockCloseWidth = 16;
BXUi.MyDockOpenWidth = 315;


BXUi.timeID = new Array();

// ÀÎÀÚ s´Â id¼Ó¼ºÀ» ³ªÅ¸³¿. ÇØ´ç id°ªÀ» °¡Áø ÅÂ±×¸¦ ÁöÁ¤ÇÏ°í ½ÍÀ»¶§ »ç¿ë
BXUi.$=function(s) { return document.getElementById(s) };

// Æ¯Á¤ ÅÂ±×¸¦ ÁöÁ¤ÇÏ°í ½ÍÀ»¶§
BXUi.$Tag=function(s,num) { return document.getElementsByTagName(s)[num]; }

// Æ¯Á¤ Object ¹Ø¿¡ ÀÖ´Â ÅÂ±×¸¦ ÁöÁ¤ÇÏ°í ½ÍÀ»¶§
BXUi.$ThisTag=function(obj,s,num) { if ( num == -1 ) { return obj.getElementsByTagName(s) } else { return obj.getElementsByTagName(s)[num] } }

//  ÃÖ¼Ò°ª(min)°ú ÃÖ´ë°ª(max) »çÀÌÀÇ ¼ýÀÚ¸¦ ·£´ýÀ¸·Î »ý¼ºÇÏ°íÀÚ ÇÒ¶§ »ç¿ë
BXUi.random=function(min,max){ return Math.floor(Math.random() * (max - min + 1) + min) };

// ³Ñ¾î¿Â °ªÀÌ this ÀÎÁö id ¼Ó¼ºÀÎÁö ±¸ºÐÇÏ±â
BXUi.division=function(s) {
	if ( BXUi.$(s) ) { return BXUi.$(s) } else { return s }
}

BXUi.dispaly=function(s) {
	if ( s.style.display == "none" || s.style.display == undefined || s.style.display == "" ) {
		s.style.display = "block";
	} else {
		s.style.display = "none";
	}
}

BXUi.dispalyPre=function(s,pre) {
	try{
		if ( pre == "block" ) {
			s.style.display = "block";
		} else {
			s.style.display = "none";
		}
	}catch(e){}
}

BXUi.MouseOverPic=function(s,pre) {
	if ( pre == "on" ) {
		s.src = s.src.replace("_off.", "_on.");
	} else {
		s.src = s.src.replace("_on.", "_off.");
	}
}

// valÀº 100À» ±âÁØÀ¸·Î Åõ¸íµµ¸¦ ³ªÅ¸³¿
BXUi.opacity=function(s,val){
	if ( navigator.appName.indexOf("Explorer") != -1 ) {
		BXUi.division(s).style.filter="Alpha(opacity=" + val + ")";
	} else {
		BXUi.division(s).style.opacity= val/100;
	}
}

// ÇöÀç À§Ä¡¿¡¼­ Æ¯Á¤ ÅÂ±×ÀÇ Display º¯È¯ÇÏ±â
BXUi.CurrentTagDispaly=function(cur,s,num) {
	BXUi.dispaly(cur.getElementsByTagName(s)[num]);
}

function fnRoll_Type1() {
	this.oTrue = null;
	
	this.FlagNum = 0;
	this.MenuImg = new Array();
	this.MenuImg["on"] = new Array();
	this.MenuImg["off"] = new Array();
	
	this.GoodsSetting = function() {
		this.MenuBox = BXUi.$(this.MenuName);
		this.TotalBox = this.MenuBox.parentNode;
		this.MenuLi = BXUi.$ThisTag(BXUi.$ThisTag(this.MenuBox,'ul',0),'li',-1);
		this.MenuTotal = this.MenuLi.length;
		
		this.CurrentGoodBox = 0;
		
		for (var i=0 ; i<this.MenuTotal; i++) {
			this.MenuImg["off"][i] = document.createElement("IMG");
			this.MenuImg["off"][i].src = this.MenuLi.item(i).getElementsByTagName("a")[0].getElementsByTagName("img")[0].src;
			this.MenuImg["on"][i] = document.createElement("IMG");
			this.MenuImg["on"][i].src = this.MenuLi.item(i).getElementsByTagName("a")[0].getElementsByTagName("img")[0].src.replace(".gif", "s.gif");
		}
		
		if ( this.RandomNum == 1 ) {
			this.RandomNumber = BXUi.random(0,this.MenuTotal-1);
			this.CurrentGoodBox = this.RandomNumber;
		}
		
		for ( var i=0; i<this.MenuTotal; i++) {
			this.MenuLink = BXUi.$ThisTag(this.MenuLi.item(i),'a',0);
			this.MenuLinkBtn = BXUi.$ThisTag(this.MenuLink,'img',0);

			if ( i == this.CurrentGoodBox ) {
				BXUi.dispalyPre(BXUi.$(this.DivName + i),'block');
				this.MenuLinkBtn.src = this.MenuImg["on"][i].src
			} else {
				BXUi.dispalyPre(BXUi.$(this.DivName + i),'none');
				this.MenuLinkBtn.src = this.MenuImg["off"][i].src
			}
			this.MenuLink.BtnNum = i;
			this.MenuLink.BtnBox = this.fnName;
			this.MenuLink.onmouseover = function() {
				eval( this.BtnBox +".fnMouseOver("+this.BtnNum+")");
			}
		}
		
		this.fnAuto();
		
		if ( this.AutoNum == 1 ) {
			this.TotalBox.fnName = this.fnName;
			this.TotalBox.NextNum = this.NextNum;
			this.TotalBox.FlagNum = this.FlagNum;
			this.TotalBox.ScrollTime = this.ScrollTime;
			this.TotalBox.onmouseover = function()	{ 
				eval("if (BXUi.timeID['" + this.fnName + "']) clearTimeout(BXUi.timeID['" + this.fnName + "']);");
				eval( this.fnName + ".FlagNum = 1");
			}
			this.TotalBox.onmouseout = function()		{
				eval( this.fnName + ".FlagNum = 0");
				eval("BXUi.timeID['" + this.fnName + "'] = setTimeout('" + this.fnName + ".fnMouseOver("+ this.NextNum +")'," + this.ScrollTime + ");");
			}
		}
	}
	
	this.fnMouseOver = function(val) {
		
		if ( this.AutoNum == 1 ) {
			this.TotalBox.fnName = this.fnName;
			this.TotalBox.NextNum = this.NextNum;
			this.TotalBox.FlagNum = this.FlagNum;
			this.TotalBox.ScrollTime = this.ScrollTime;
			this.TotalBox.onmouseover = function()	{ 
				eval("if (BXUi.timeID['" + this.fnName + "']) clearTimeout(BXUi.timeID['" + this.fnName + "']);");
				eval( this.fnName + ".FlagNum = 1");
			}
			this.TotalBox.onmouseout = function()		{
				eval( this.fnName + ".FlagNum = 0");
				eval("BXUi.timeID['" + this.fnName + "'] = setTimeout('" + this.fnName + ".fnMouseOver("+ this.NextNum +")', " + this.ScrollTime + ");");
			}
			
			if ( this.FlagNum == 1 ) return;
		}
		
		val = parseInt(val);
		if ( this.AutoNum == 1 )  { clearTimeout(this.oTrue) }
		for ( var i=0; i<this.MenuTotal; i++) {
			this.MenuLink = BXUi.$ThisTag(this.MenuLi.item(i),'a',0);
			this.MenuLinkBtn = BXUi.$ThisTag(this.MenuLink,'img',0);
			if ( i == val ) {
				BXUi.dispalyPre(BXUi.$(this.DivName + i),'block');
				this.MenuLinkBtn.src = this.MenuImg["on"][i].src
			} else {
				BXUi.dispalyPre(BXUi.$(this.DivName + i),'none');
				this.MenuLinkBtn.src = this.MenuImg["off"][i].src
			}
		}
		this.fnAuto(val);
	}
	
	this.fnAuto = function(val) {
		if ( val == undefined) { this.ScrollNum = this.CurrentGoodBox } else { this.ScrollNum = val }
		if ( this.AutoNum == 1 ) {
			if ( this.ScrollNum == this.MenuTotal - 1 ) {
				this.NextNum = 0;
			} else {
				this.NextNum = this.ScrollNum + 1;
			}
			this.oTrue = setTimeout( this.fnName + ".fnMouseOver('" + this.NextNum + "')" , this.ScrollTime );
		}
	}








}









function fnSSType1() {
	this.GoodsSetting = function() {
		this.Obj = document.getElementById(this.DivName);
		this.ObjSelect = this.Obj.getElementsByTagName("select")[0];
		this.ObjOption = this.ObjSelect.getElementsByTagName("option");
		this.ObjOptionNum = this.ObjOption.length;
		
	
		this.ObjSelectValue = this.ObjSelect.item(this.ObjSelect.selectedIndex).firstChild.nodeValue;
		
		this.SelectTi = document.createElement('div');
		this.SelectTi.className = "Boxncan_Sch_Select_1";
		this.SelectTi.style.width = this.SelectWidth + "px";
		
		this.SelectTi.style.height = this.SelectHeight + "px";
		this.SelectTi.style.lineHeight = this.SelectHeight - 2 + "px";

		//this.SelectTi.style.height = this.SelectHeight + "px";
		//this.SelectTi.style.lineHeight = this.SelectHeight - this.DefaultBoder + "px";
		
		if ( navigator.appName.indexOf("Explorer") != -1 ) {
			this.SelectTi.style.top ="0px";
			this.SelectTi.style.left ="0px";
		} else {
			this.SelectTi.style.top ="0px";
			this.SelectTi.style.left ="0px";
		}
		
		if ( navigator.userAgent.indexOf("Chrome") != -1 ) {
			this.SelectTi.style.top ="0px";
			this.SelectTi.style.left ="0px";
		}

		this.Obj.appendChild(this.SelectTi);
		
		this.SelectTiLink = document.createElement('a');
		this.SelectTiLink.href = "#";
		this.SelectTiLink.fnName = this.fnName;
		this.SelectTiLink.onmouseover = function() { eval(this.fnName + ".SelectClick(this)"); return false; }
		this.SelectTiLink.onclick = function() { eval(this.fnName + ".SelectClick(this)"); return false; }
		this.SelectTiLink.appendChild(document.createTextNode(this.ObjSelectValue));
		this.SelectTi.appendChild(this.SelectTiLink);



		this.SelectCo = document.createElement('div');
		this.SelectCo.className = "Boxncan_Sch_Select_2";
		this.SelectCo.style.width = this.SelectWidth + "px";
		this.SelectCo.fnName = this.fnName;
		this.SelectCo.onmouseout = function() { eval(this.fnName + ".SelectClose(this)"); }
		this.SelectCo.onmouseover = function() { eval(this.fnName + ".SelectOepn(this)"); }







		if ( navigator.appName.indexOf("Explorer") != -1 ) {
			this.SelectCo.style.top ="0px";
			this.SelectCo.style.left ="0px";
		} else {
			this.SelectCo.style.top ="0px";
			this.SelectCo.style.left ="0px";
		}
		



		if ( navigator.userAgent.indexOf("Chrome") != -1 ) {
			this.SelectCo.style.top ="0px";
			this.SelectCo.style.left ="0px";
		}


		this.Obj.appendChild(this.SelectCo);
		
		this.SelectCoUl = document.createElement('ul');
		this.SelectCoUl.style.width = this.SelectWidth + "px";
		this.SelectCo.appendChild(this.SelectCoUl);
		
		for ( var i=0; i<this.ObjOptionNum; i++ ) {
			this.SelectCoLi = document.createElement('li');
			this.SelectCoUl.appendChild(this.SelectCoLi);
			
			this.SelectCoLiLink = document.createElement('a');
			this.SelectCoLiLink.href = "#";
			this.SelectCoLiLink.fnName = this.fnName;
			this.SelectCoLiLink.i = i;
			this.SelectCoLiLink.onclick = function() { eval(this.fnName + ".SelectIndexClick(this," + this.i + ")"); return false; }
			this.SelectCoLiLink.appendChild(document.createTextNode(this.ObjOption.item(i).firstChild.nodeValue));
			this.SelectCoLi.appendChild(this.SelectCoLiLink);

		}
		
		this.ObjSelect.style.display = "none";
	}
	





	this.SelectClick = function(val) {
		this.SC_Div = val.parentNode.parentNode;
		this.SCTarget = this.SC_Div.getElementsByTagName("div")[1];
		this.SCTarget.style.display = "block";
		this.SelectTiLink.style.display = "none";
	}
	
	this.SelectIndexClick = function(val,valnum) {
		this.SCI_Div = val.parentNode.parentNode.parentNode.parentNode;
		this.SelectTargetIndex = this.SCI_Div.getElementsByTagName("div")[0].getElementsByTagName("a")[0];
		this.SCI_Div.getElementsByTagName("select")[0].selectedIndex = valnum;
		this.SCI_Div.getElementsByTagName("div")[1].style.display = "none";
		this.SelectTargetIndex.innerHTML = this.SCI_Div.getElementsByTagName("select")[0].getElementsByTagName("option")[valnum].firstChild.nodeValue;
		this.SelectTiLink.style.display = "block";
		location.href = this.ObjOption.item(valnum).value;
	}



	this.SelectOepn = function(val) {
		val.style.display = "block";
		this.SelectTiLink.style.display = "none";
	}
	this.SelectClose = function(val) {
		val.style.display = "none";
		this.SelectTiLink.style.display = "block";
	}
}




function goChange(cate1){

  if(cate1 == "") {

	alert('1Â÷ Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä');
  }
  else
  {


  location.href="./s_category.asp?cate1="+cate1;
  }
}


function goChange1(cate1){

  if(cate1 == "") {

	alert('1Â÷ Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä');
  }
  else
  {


  location.href="./s_category.asp?show=1&cate1="+cate1;
  }
}



function goChange2(cate1){

  if(cate1 == "") {

	alert('Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä');
  }
  else
  {


  location.href="./s_category.asp?cate1="+cate1;
  }
}





function goChange2_1(cate1,cate2){

  if(cate1 == "") {

	alert('Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä');
  }
  else
  {


  location.href="./s_category_detail.asp?cate1="+cate1+"&cate2="+cate2;
  }
}


function goChange2_2(cate1,cate2,cate3){

  if(cate1 == "") {

	alert('Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä');
  }
  else
  {


  location.href="./s_category_detail.asp?cate1="+cate1+"&cate2="+cate2+"&cate3="+cate3;
  }
}









function goChange3_1(cate1,cate2){

  if(cate1 == "") {

	alert('1Â÷ Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä');
  }
  else
  {


  location.href="./s_category_detail.asp?show=1&cate1="+cate1+"&cate2="+cate2;
  }
}
function goChange3_2(cate1,cate2,cate3){

  if(cate1 == "") {

	alert('1Â÷ Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä');
  }
  else
  {


  location.href="./s_category_detail.asp?show=1&cate1="+cate1+"&cate2="+cate2+"&cate3="+cate3;
  }
}



function goChangeNew(code,cate1,gsale){

  if(cate1 == "") {

	alert('1Â÷ Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä');
  }
  else
  {

  if (gsale == "0")
  {
      var gsale = "&gsale=1"
  }
  
  location.href="./s_category_all.asp?alltype="+code+"&cate1="+cate1+gsale;
  }
}



//




function openDiv(strDivName) 
{

	var objDiv = document.getElementById(strDivName);
	objDiv.style.visibility = "visible"; 
} 

function closeDiv(strDivName) 
{
	var objDiv = document.getElementById(strDivName);
	objDiv.style.visibility = "hidden"; 
} 


var lastID;
var lastThemeID;
var ClastThemeID;
var cnull;
function openComment(arg) 
{

	 document.getElementById("commentDiv"+arg).style.display = "block"; 
	 
	 if(lastID)
		document.getElementById("commentDiv"+lastID).style.display = "none";
	 lastID = arg;
	 
	 if(lastID==arg)
		document.getElementById("commentDiv"+lastID).style.display = "block";
	 lastID = arg;

	 if(lastThemeID)
		document.getElementById("themeDiv"+lastThemeID).style.display = "none";

	 
} 

function closeComment(arg) 
{
	document.getElementById("commentDiv"+arg).style.display = "none"; 


} 

function closeTheme(arg) 
{
	document.getElementById("themeDiv"+arg).style.display = "none"; 


} 




/*Å×¸¶±âÈ¹*/

function openTheme(arg) 
{

	 document.getElementById("themeDiv"+arg).style.display = "block"; 

 
	 if(lastID)
		document.getElementById("commentDiv"+lastID).style.display = "none";
	 
	 if(lastThemeID)
		document.getElementById("themeDiv"+lastThemeID).style.display = "none";

	 
	 if(lastThemeID==arg){
		document.getElementById("themeDiv"+arg).style.display = "block";
		ClastThemeID = arg

	 }
	
	//alert(ClastThemeID+'/'+lastThemeID+'/'+arg);

	 if(ClastThemeID==arg){
		document.getElementById("themeDiv"+lastThemeID).style.display = "none";
		ClastThemeID = "";
		lastThemeID = "";
		cnull = "1"

		//alert(ClastThemeID+'/'+lastThemeID);
	 }


	//alert(ClastThemeID+'/'+lastThemeID+'/'+arg);
	if (cnull == 1)
	{
		lastThemeID = "";
		cnull = ""
		//alert(ClastThemeID+'/'+lastThemeID+'/'+arg+'<---1ÀÏ¶§');
	}else{
		lastThemeID = arg;
		//alert(ClastThemeID+'/'+lastThemeID+'/'+arg);
	}
	 
	 	 
} 




function closeTheme(arg) 
{
	document.getElementById("themeDiv"+arg).style.display = "none"; 


} 



function cate1Open() 
{

	document.all.cate1choice.style.display = "block"; 
	document.all.cate1Basic.style.display = "none"; 
} 

function cate1Close() 
{

	document.all.cate1choice.style.display = "none"; 
	document.all.cate1Basic.style.display = "block"; 
}




function style_change(arg){
 
	//abgstyle+arg+.style.backgroundColor = "FF0000";
  document.getElementById("cellname"+arg).style.backgroundColor = "#ffe6ee"; 
  document.getElementById("fontname"+arg).style.color="#D50B67"; 
  //eval("bbgstyle"+arg).style.backgroundColor = "f0f0f0";
  //eval("cbgstyle"+arg).style.backgroundColor = "f0f0f0";
}


function style_changeOff(arg){
 
	//abgstyle+arg+.style.backgroundColor = "FF0000";
  document.getElementById("cellname"+arg).style.backgroundColor = "ffffff"; 
  document.getElementById("fontname"+arg).style.color="#5f5f5f"; 
  //eval("bbgstyle"+arg).style.backgroundColor = "ffffff";
  //eval("cbgstyle"+arg).style.backgroundColor = "ffffff";

}





function style_change1(arg){
 
	//abgstyle+arg+.style.backgroundColor = "FF0000";
  //document.getElementById("cellname"+arg).style.backgroundColor = ""; 
  document.getElementById("linkbold"+arg).style.color="#D50B67"; 
  document.getElementById("linkbold"+arg).style.fontWeight="bold"; 
  //eval("cbgstyle"+arg).style.backgroundColor = "f0f0f0";
}


function style_changeOff1(arg){
 
	//abgstyle+arg+.style.backgroundColor = "FF0000";
  //document.getElementById("cellname"+arg).style.backgroundColor = ""; 
  document.getElementById("linkbold"+arg).style.color="#666666"; 
  document.getElementById("linkbold"+arg).style.fontWeight="normal"; 
  //eval("bbgstyle"+arg).style.backgroundColor = "ffffff";
  //eval("cbgstyle"+arg).style.backgroundColor = "ffffff";

}


function style_changeGift_On(arg){
 
	//abgstyle+arg+.style.backgroundColor = "FF0000";
  //document.getElementById("cellname"+arg).style.backgroundColor = ""; 
  document.getElementById("linkbold"+arg).style.color="#666666"; 
  document.getElementById("linkbold"+arg).style.fontWeight="bold"; 
  //eval("cbgstyle"+arg).style.backgroundColor = "f0f0f0";
}


function style_changeGift_Off(arg){
  document.getElementById("linkbold"+arg).style.color="#666666"; 
  document.getElementById("linkbold"+arg).style.fontWeight="normal"; 
}



function style_change3(arg){
 
	//abgstyle+arg+.style.backgroundColor = "FF0000";
  document.getElementById("cellname2"+arg).style.backgroundColor = "#ffe6ee"; 
  document.getElementById("fontname2"+arg).style.color="#D50B67"; 
  //eval("bbgstyle"+arg).style.backgroundColor = "f0f0f0";
  //eval("cbgstyle"+arg).style.backgroundColor = "f0f0f0";
}


function style_changeOff3(arg){
 
	//abgstyle+arg+.style.backgroundColor = "FF0000";
  document.getElementById("cellname2"+arg).style.backgroundColor = "ffffff"; 
  document.getElementById("fontname2"+arg).style.color="#5f5f5f"; 
  //eval("bbgstyle"+arg).style.backgroundColor = "ffffff";
  //eval("cbgstyle"+arg).style.backgroundColor = "ffffff";

}




function style_change2(arg){
 
  document.getElementById("ch02"+arg).style.color="#D50B67"; 
  document.getElementById("ch02"+arg).style.fontWeight="bold"; 
 
}


function style_changeOff2(arg){
 
  document.getElementById("ch02"+arg).style.color="#666666"; 
  document.getElementById("ch02"+arg).style.fontWeight="normal"; 

}



function style_change4(arg){
 

  document.getElementById("ch02"+arg).style.color="#DB1E89"; 
  document.getElementById("ch02"+arg).style.fontWeight="bold"; 
}


function style_changeOff4(arg){
  document.getElementById("ch02"+arg).style.color="#666666"; 
  document.getElementById("ch02"+arg).style.fontWeight="normal"; 
}



function style_change5(arg){
 

  document.getElementById("ch02"+arg).style.color="#DB1E89"; 
  document.getElementById("ch02"+arg).style.fontWeight="bold"; 
}


function style_changeOff5(arg){
  document.getElementById("ch02"+arg).style.color="#666666"; 
  document.getElementById("ch02"+arg).style.fontWeight="normal"; 
}


function style_change6(arg){
 

  document.getElementById("MainM"+arg).style.color="#DB1E89"; 
  document.getElementById("MainM"+arg).style.fontWeight="bold"; 
}


function style_changeOff6(arg){
  document.getElementById("MainM"+arg).style.color="#666666"; 
  document.getElementById("MainM"+arg).style.fontWeight="normal"; 
}





//À§½Ã ¸®½ºÆ® ´ã±â

function addWish(idx,divid){

$.post('/shop_new/insert_wish.asp', {'idx':idx}, function(data){
	//$('#goodsZoom').html(data);

});
			centerPopup(divid);
			openPopup(divid);
			return false;
}






function goodsXoom(idx,divid){


$.post('/shop_new/goodsZoom.asp', {idx:idx}, function(data){
			var html = data;
			$('#goodsZoom').html(html);
			//alert(data);
			
			centerPopup(divid);
			openPopup(divid);
			return false;

});

return false;

}





function insertGoods(idx,divid){

$.ajax({

url : 'insert_wish.asp',
data : 'idx='+idx+'&divid='+divid,
dataType: 'json',
type : 'POST',

success: function(msg){
      
	if (msg=="Success")
	{
			centerPopup(divid);
			openPopup(divid);
			return false;		
	}else if (msg=="Fail:0"){
	alert("ÀÌ¹Ì Ãß°¡µÈ »óÇ°ÀÔ´Ï´Ù");
	}else if (msg=="Fail:1"){
	alert("¼±ÅÃÇÏ½Å »óÇ°Áß ¿É¼Ç¼±ÅÃ »óÇ°ÀÌ Æ÷ÇÔµÇ¾î ÀÖ½À´Ï´Ù.\n»óÇ°»ó¼¼¿¡¼­ Àå¹Ù±¸´Ï¿¡ ´ã¾ÆÁÖ¼¼¿ä");
	}

	  


   }

});


//$.post('/shop_new/goodsZoom.asp', {idx:idx}, function(data){
//			var html = data;
//			$('#goodsZoom').html(html);
			//alert(data);
			
//			centerPopup(divid);
//			openPopup(divid);
//			return false;

//});

return false;

}





function centerPopup(divid){
	//request data for centering

		var h = (window.innerHeight || self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight);
		var w = (window.innerWidth || self.innerWidth || document.documentElement.clientWidth || document.body.clientWidth);
		
		if ( divid == 'goodsZoom')
		{
			var popupHeight = 440;
			var popupWidth = 500;

		}else
		{
			var popupHeight = 200;
			var popupWidth = 300;
		
		}

		
		var l = ( (w-popupWidth)/2 );
		var t = (((window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop)+(h/2-popupHeight/2)) );
		
		//var t = (h/2);
		//var l = w/2-popupHeight/2;


if (divid == 'wishList')
{
	$("#wishList").css({
		"position": "absolute",
		"top": t,
		"left": l
	});
}else if (divid == 'addBasket_wish')
{
	$("#addBasket_wish").css({
		"position": "absolute",
		"top": t,
		"left": l
	});
}else if (divid == 'addBasket')
{
	$("#basket").css({
		"position": "absolute",
		"top": t,
		"left": l
	});
}else if (divid == 'goodsZoom')
{
	$("#goodsZoom").css({
		"position": "absolute",
		"top": t,
		"left": l
	});
}else 
{
	$("#delPass").css({
		"position": "absolute",
		"top": t,
		"left": l
	});
}





//alert(h+'/'+w+'/'+l+'/'+t+'/'+popupHeight+'/'+popupWidth);
}



function openPopup(divid){
//popupStatus °¡ È°¼ºÈ­ µÇ¾î ÀÖ´Ù¸éÀÖ´Ù¸é ºñÈ°¼ºÈ­ ½ÃÅ°±â / disables popup only if it is enabled


if (divid == 'wishList')
{
//$("#wishList").fadeIn("slow");
$("#wishList").show();
setTimeout("disablePopup('wishList')",3000);


}else if (divid == 'addBasket_wish')
{
//$("#basket").fadeIn("slow");
$("#addBasket_wish").show();
setTimeout("disablePopup('addBasket_wish')",3000);

}else if (divid == 'addBasket')
{
//$("#basket").fadeIn("slow");
$("#basket").show();
setTimeout("disablePopup('addBasket')",3000);

}else if (divid == 'goodsZoom')
{
//$("#goodsZoom").fadeIn();
$("#goodsZoom").show();
//setTimeout("disablePopup('goodsZoom')",20000);
}else
{
//$("#goodsZoom").fadeIn();
$("#delPass").show();
//setTimeout("disablePopup('goodsZoom')",20000);
}


} 



function disablePopup(divid){
//popupStatus °¡ È°¼ºÈ­ µÇ¾î ÀÖ´Ù¸éÀÖ´Ù¸é ºñÈ°¼ºÈ­ ½ÃÅ°±â / disables popup only if it is enabled


if (divid == 'wishList')
{
//$("#wishList").fadeOut("slow");
$("#wishList").hide();
}

else if (divid == 'addBasket_wish')
{
//$("#basket").fadeOut("slow");
$("#addBasket_wish").hide();
}

else if (divid == 'addBasket')
{
//$("#basket").fadeOut("slow");
$("#basket").hide();
}

else if (divid == 'goodsZoom')
{
//$("#goodsZoom").fadeOut("slow");
$("#goodsZoom").hide();
}else
{
//$("#goodsZoom").fadeIn();
$("#delPass").hide();
//setTimeout("disablePopup('goodsZoom')",20000);
}



} 



function openWish(divid){

			centerPopup(divid);
			openPopup(divid);
			return false;
}



function closeWish(divid){

			 disablePopup(divid);
			return false;

}


function openZoom(idx,divid){

			centerPopup(divid);
			openPopup(divid);
			return false;
}




function allCheck()
{
	if(document.all.goidx){
		if(document.all.goidx.length){
			for(i=0;i<document.all.goidx.length;i++){
				document.all.goidx[i].checked = document.all.allcheck.checked;
			}
		}else{
			document.all.goidx.checked = document.all.allcheck.checked;
		}
	}
}


function allCheck_main()
{
	if(document.all.goidx){
		if(document.all.goidx.length){
			for(i=0;i<document.all.goidx.length;i++){
				document.all.goidx[i].checked = true;
			}
		}else{
			document.all.goidx.checked = document.all.allcheck.checked;
		}
	}
}


function checkBoxInsert(divid){

   var  v = '';
   for (var i = 0; i < $("input:checkbox").length; i++) {
        if ($("input:checkbox")[i].checked == true) {
           v = v + "," + $("input:checkbox")[i].value;
        }
    }
	
	//alert(v);

if (v=="")
{
	alert("»óÇ°À» ¼±ÅÃÇÏ¼¼¿ä!!");
}else{


$.ajax({

url : 'insert_checkall.asp',
data : 'idx='+v+'&mode='+divid,
dataType: 'json',
type : 'get',

		success: function(d){
			//alert("ÀÌ¸§: " + d.result );

			if (d.result == "Success" )
			{
				centerPopup(divid);
				openPopup(divid);
				return false;	

			}else if (d.result == "needLogin")
			{
				alert('·Î±×ÀÎÀÌ ÇÊ¿äÇÕ´Ï´Ù');
			}else if (d.result == "Fail:0")
			{
				alert('ÀÌ¹Ì Ãß°¡µÈ »óÇ°ÀÔ´Ï´Ù');
			}else if (d.result == "Fail:1")
			{
				alert('¼±ÅÃÇÏ½Å »óÇ°Áß ¿É¼Ç¼±ÅÃ »óÇ°ÀÌ Æ÷ÇÔµÇ¾î ÀÖ½À´Ï´Ù.\n»óÇ°»ó¼¼¿¡¼­ Àå¹Ù±¸´Ï¿¡ ´ã¾ÆÁÖ¼¼¿ä');
			}

		},
		error: function() {
			alert("ºñÁ¤»óÀûÀ¸·Î Ã³¸®µÇ¾ú½À´Ï´Ù.\n´Ù½Ã ÇÑ ¹ø È®ÀÎÇØÁÖ¼¼¿ä");
		}

});


}



return false;

}




function checkBoxInsert_main(divid){

   var  v = '';
   for (var i = 0; i < $("input:checkbox").length; i++) {
        if ($("input:checkbox")[i].checked == true) {
           v = v + "," + $("input:checkbox")[i].value;
        }
    }
	
	//alert(v);

if (v=="")
{
	alert("»óÇ°À» ¼±ÅÃÇÏ¼¼¿ä!!");
}else{


$.ajax({

url : 'insert_checkall.asp',
data : 'idx='+v+'&mode='+divid,
dataType: 'json',
type : 'get',

		success: function(d){
			//alert("ÀÌ¸§: " + d.result );

			if (d.result == "Success" )
			{
				centerPopup(divid);
				openPopup(divid);
				return false;	

			}else if (d.result == "needLogin")
			{
				alert('·Î±×ÀÎÀÌ ÇÊ¿äÇÕ´Ï´Ù');
			}else if (d.result == "Fail:0")
			{
				alert('ÀÌ¹Ì Ãß°¡µÈ »óÇ°ÀÔ´Ï´Ù');
			}

		},
		error: function() {
			alert("ºñÁ¤»óÀûÀ¸·Î Ã³¸®µÇ¾ú½À´Ï´Ù.\n´Ù½Ã ÇÑ ¹ø È®ÀÎÇØÁÖ¼¼¿ä");
		}

});


}



return false;

}




BXUi.getStyle=function(el, style) {
	var value = el.style[style];
	if(!value)
	{
		if(document.defaultView && document.defaultView.getComputedStyle) 
		{
			var css = document.defaultView.getComputedStyle(el, null);
			value = css ? css[style] : null;
		} 
		else if (el.currentStyle) value = el.currentStyle[style];
	}
	return value == 'auto' ? null : value;
};

BXUi.Move=function(id) {
	this.id=id;
	this.div=BXUi.$(id);
	this.x= parseInt(BXUi.getStyle(this.div,'left'))||0;
	this.y= parseInt(BXUi.getStyle(this.div,'top'))||0;
};
BXUi.Move.prototype={
	slide : function(pos) {
		this.pos = pos;
		this.pos_n = 0;
		this.speed=0.3;
		this.inteval = 20;
		this.setPos();
		this.playing =true;
		var self=this;
		this.tid=setInterval(function(){self.play()}, this.inteval);
	},
	play : function() {
		this.x += (this.x2-this.x)*this.speed;		
		this.y += (this.y2-this.y)*this.speed;
		this.set(this.x,this.y);
		if(Math.round(this.x)==this.x2 && Math.round(this.y)==this.y2)
		{
			this.x=Math.round(this.x);
			this.y=Math.round(this.y);
			this.set(this.x,this.y);

			if(this.pos_n>=this.pos.length)	{this.playing=false; clearInterval(this.tid)}
			else this.setPos();
		}
	},
	setPos:function(){
		var arr=this.pos[this.pos_n].split(",");
		this.x2 = arr[0];
		this.y2 = arr[1];
		this.pos_n++;
	},
	set:function(x,y){
		this.div.style.left = x+"px";
		this.div.style.top = y+"px";
	}
};




//Áñ°ÜÃ£±â
 

function bookmarksite(title,url) {
   if (window.sidebar) // firefox
   window.sidebar.addPanel(title, url, "");
   else if(window.opera && window.print)

   { // opera
      var elem = document.createElement('a');
      elem.setAttribute('href',url);
      elem.setAttribute('title',title);
      elem.setAttribute('rel','sidebar');
      elem.click();
   }

   else if(document.all) // ie
   window.external.AddFavorite(url, title);
}



// ¸ÞÀÎÆäÀÌÁö ¸Þ´º
function showMainMenu(idNum,playStyle){


if (playStyle=="on")
{

document.getElementById("main_menu"+idNum).style.display="block"; 

//  $.post('/shop_new/jquery/jQuery.Main.Menu.asp', {
//  divnum:idNum
//  }, function(html){

      

//      $('#main_menu'+idNum).html(html);
      
//  });
  
}else if(playStyle=="off") {

  document.getElementById("main_menu"+idNum).style.display="none"; 
}


};



//¸ÞÀÎ ÀüÃ¼Ä«Å×°í¸®


function showCategoryAll(playStyle){

	var imgobj = document.getElementById("ctegoryallImg");

  if (playStyle=="on")
  {
    document.getElementById("main_category").style.display="block";
	imgobj.src = document.getElementById("ctegoryallImg").getAttribute("src").replace('nst_c11.gif','nst_c11_s.gif');
	//alert(document.getElementById("ctegoryallImg").src );
  }else if(playStyle=="off") {
    
	document.getElementById("main_category").style.display="none";
	imgobj.src = document.getElementById("ctegoryallImg").getAttribute("src").replace('nst_c11_s.gif','nst_c11.gif');
	//alert(document.getElementById("ctegoryallImg").src );
  }

}

function showBrandAll(playStyle){

	var imgobj = document.getElementById("brandAllImg");

  if (playStyle=="on")
  {
    document.getElementById("main_brandAll").style.display="block";
	imgobj.src = document.getElementById("brandAllImg").getAttribute("src").replace('nst_06.gif','nst_06_s.gif');
  }else if(playStyle=="off") {
    document.getElementById("main_brandAll").style.display="none";
	imgobj.src = document.getElementById("brandAllImg").getAttribute("src").replace('nst_06_s.gif','nst_06.gif');
  }

}


function showToday(playStyle){

	var imgobj = document.getElementById("todayImg");

  if (playStyle=="on")
  {
    document.getElementById("main_TodayCart").style.display="block";
	imgobj.src = document.getElementById("todayImg").getAttribute("src").replace('nst_12.gif','nst_12_s.gif');
  }else if(playStyle=="off") {
    document.getElementById("main_TodayCart").style.display="none";
	imgobj.src = document.getElementById("todayImg").getAttribute("src").replace('nst_12_s.gif','nst_12.gif');
  }

}



function goCategory2(cate1,cate2){
location.href="./s_category_detail.asp?cate1="+cate1+"&cate2="+cate2
}