function GetLoginUrl()
{
	var conf = confirm("Á¦Ç° ÀÎÁõµÈ È¸¿ø¸¸ÀÌ ·Î±×ÀÎ ÈÄ º» ¼­ºñ½º¸¦ ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.\n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?");
	if(conf)
		document.location.href = "https://member.whereis.co.kr/Login.aspx?rurl=" + document.location.href;
}

function GetLoginUrl2()
{
	var conf = confirm("·Î±×ÀÎ ÈÄ º» ¼­ºñ½º¸¦ ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.\n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?");
	if(conf)
		document.location.href = "https://member.whereis.co.kr/Login.aspx?rurl=" + document.location.href;
}

function checkAllDown(){
  frm = document.f1;
  for(i=0;i<frm.elements.length;i++){
    frm.elements[i].checked=true;   
  }
}


//Å×¸¶ÄÁÅÙÃ÷ ´ã±â (Ã¼Å©¹Ú½º Value°ªÀÌ (½ºÆÌ³×ÀÓ:½ºÆÌ¾ÆÀÌµð)ÀÎ°æ¿ì)
function GetScrapContents(frm,gbn){
    
    var chkCnt  = 0;
    
    for(k=0;k<frm.elements.length;k++){ 
        if(frm.elements[k].checked==true){
            chkCnt++;
        } 
    }
    if(chkCnt > 0 ){       
        
        if(chkCnt > 1){   
          var conf = confirm('¼±ÅÃÇÏ½Å ÄÁÅÙÃ÷¸¦ ½ºÅ©·¦ÇÏ½Ã°Ú½À´Ï±î?');
	        if(!conf)  return; 
		}
		
        for(k=0;k<frm.elements.length;k++){ 
        
            if(frm.elements[k].checked==true){
                spotNM = frm.elements[k].value.split(":")[0];
                spotID = frm.elements[k].value.split(":")[1];
              
                if(chkCnt > 1){                    
                    var r = SetScrap(spotNM,spotID,gbn,'yes');
                    if(false == r) {
                        break;
                    }
                }else {
                    SetScrap(spotNM,spotID,gbn);    
                }
                
            } 
        }    
    }else{    
        alert("½ºÅ©·¦ ÇÒ ÄÁÅÙÃ÷¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
    }
    SetCheckBox(frm,false);
    
}

function SetCheckBox(frm,val){

    for(j=0;j<frm.elements.length;j++){ 
        frm.elements[j].checked=val;
    }
}


//Ã¼Å©¹Ú½º Value°ªÀÌ (½ºÆÌ³×ÀÓ:½ºÆÌ¾ÆÀÌµð)ÀÎ°æ¿ì
function GetUserConfirmSplit(sname, mappy, gini,gbn)
{
    // gbn ( spt,userTM)¿µÀÚ,ÀÌ´ÞÀÇ Å×¸¶µî.. ½ºÆÌÀÏ°æ¿ì... ÆäÀÌÁö¿¡¼­ ³Ñ°Ü¾ßÇÔ.
	var chkValue = "";
	
	for(var i=0;i<document.f1.elements.length;i++)
	{
		var el	= document.f1.elements[i];							
		if(el.type=="checkbox" && el.name == sname && el.checked == true){
			
			if(chkValue == "")
				chkValue = el.value.split(":")[1];
			else
				chkValue = chkValue + "," + el.value.split(":")[1];
		}
	}
	if(chkValue == "") { alert("ÃÖ¼Ò 1°³ ÀÌ»óÀÇ Å×¸¶¸¦ ¼±ÅÃ ÇÏ½Ê½Ã¿À."); return; }
										
	GetUserConfirmResult(mappy, gini, chkValue, gbn);	//ÀÎÁõ¿©ºÎ¿¡µû¶ó ÆäÀÌÁö È£Ãâ °áÁ¤  
	                    			
}

//Ã¼Å©¹Ú½º Value°ªÀÌ ½ºÆÌ ¾ÆÀÌµðÀÎ°æ¿ì
function GetUserConfirm(sname, mappy, gini,gbn)
{
    // gbn ( spt,userTM)¿µÀÚ,ÀÌ´ÞÀÇ Å×¸¶µî.. ½ºÆÌÀÏ°æ¿ì... ÆäÀÌÁö¿¡¼­ ³Ñ°Ü¾ßÇÔ.
	var chkValue = "";
	
	for(var i=0;i<document.f1.elements.length;i++)
	{
		var el	= document.f1.elements[i];							
		if(el.type=="checkbox" && el.name == sname && el.checked == true){
			
			if(chkValue == "")
				chkValue = el.value;
			else
				chkValue = chkValue + "," + el.value;
		}
	}
	if(chkValue == "") { alert("ÃÖ¼Ò 1°³ ÀÌ»óÀÇ Å×¸¶¸¦ ¼±ÅÃ ÇÏ½Ê½Ã¿À."); return; }

	GetUserConfirmResult(mappy, gini, chkValue, gbn);	//ÀÎÁõ¿©ºÎ¿¡µû¶ó ÆäÀÌÁö È£Ãâ °áÁ¤   
	
}

function GetUserConfirmResult(mappy, gini, chkValue, gbn)
{

    //alert(mappy+"/"+gini+"/"+ chkValue+"/"+ gbn);
	/*
	var aoc = ActiveXObjectConfirm();
	if(aoc == false)
	{
		//alert("ActiveX°¡ ¼³Ä¡ µÇÁö ¾Ê¾Ò½À´Ï´Ù.\n»ó´ÜÀÇ ");
		window.open("/Scripts/Common/PopContentsActiveX.aspx","Pop","width=530, height=680, status=yes");
		return;
	}
	*/
	if(mappy == "MX" && gini == "GX") 	// ¸ÊÇÇÁö´Ï ÀÎÁõ ¾ÈµÇ¾úÀ»½Ã
	{ 
		window.open("/Scripts/MyPage/MyTheme/PCdownFail.aspx","Save", "width=400,height=330,status=yes");
	}
	else if(mappy != "MX" && gini != "GX")	//¸ðµÎ´Ù
	{
	    //2010.03.12 ¼öÁ¤(¸ÅÇÇ°í Ãß°¡)
		window.open("/Scripts/MyPage/MyTheme/PCdownAll.aspx?gbn="+gbn+"&spotCode=" + chkValue,"Save", "width=400,height=350,status=yes");
	}
	else if(mappy != "MX")	// ¸ÊÇÇ ÀÎÁõ
	{
		//PCSave(document.f1, '/Scripts/Common/ThemeConvert.aspx?kind=mappy');
		//DownFrame.document.location.href="/Scripts/Common/ThemeConvert.aspx?gbn="+gbn+"&kind=mappy&spotCode=" + chkValue;
		//2010.03.12 ¼öÁ¤(¸ÅÇÇ°í Ãß°¡)
		//document.location.href="/Scripts/Common/ThemeConvert_new.aspx?gbn="+gbn+"&kind=mappy&spotCode=" + chkValue;
		window.open("/Scripts/MyPage/MyTheme/PCdownMappy.aspx?gbn="+gbn+"&spotCode=" + chkValue,"Save", "width=400,height=295,status=yes");
	}
	else if(gini != "GX")	//Áö´Ï ÀÎÁõ
	{ 
		//PCSave(document.f1, '/Scripts/Common/ThemeConvert.aspx?kind=jini');
		//DownFrame.document.location.href="/Scripts/Common/ThemeConvert.aspx?gbn="+gbn+"&kind=jini&spotCode=" + chkValue;
		document.location.href="/Scripts/Common/ThemeConvert_new.aspx?gbn="+gbn+"&kind=jini&spotCode=" + chkValue;
	}
} 

/*
function GetThemeDown(pno)
{
	window.open("/Scripts/Mypage/Theme/PopFolder.aspx?kind=userTheme&pno="+pno,"add","width=403, height=228,status=yes");
}
*/

function GetThemeDownLoad_ThemeContents()
{
	var chkValue = "";
	for(var i=0;i<document.f1.elements.length;i++)
	{
		var el	= document.f1.elements[i];							
		if(el.type=="checkbox" && el.name == "spotCode" && el.checked == true){
			if(chkValue == "")
				chkValue = el.value;
			else
				chkValue = chkValue + "," + el.value;
		}
	}
	
	if(chkValue == "") { alert("ÃÖ¼Ò 1°³ ÀÌ»óÀÇ Å×¸¶¸¦ ¼±ÅÃ ÇÏ½Ê½Ã¿À."); return; }
	window.open("/Scripts/Common/SaveContents/SaveContents.aspx?ContentGubun=spot&ContentCodes="+chkValue,"add","width=403, height=228,status=yes");
}

function ActiveXObjectConfirm()
{
	var installed = "";
	
	if(DataXFrame.document.getElementById("DataX").MappyThemeMan == undefined)
	{
		installed = false;
	}
	else
	{
		installed = true;
	}
		
	return installed;
} 