document.domain="joins.com";

//°Ë»ö
function GoSearch2() { 
	var i,w;
	var Query; 
	var URL; 
	var theForm = document.frmBasic;

	Query = ""; 
	Query = theForm.txtquery.value; 

	if (Query == "") { 
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä."); 
		theForm.txtquery.focus();
		return; 
	}
	if (theForm.sch_col.value=="m_total") {
		URL = "http://myfriday.joins.com/search/search_list.asp?query=" + Query ;
	} else if(theForm.sch_col.value=="leisure") {
		URL = "http://myfriday.joins.com/search/search_triplist.asp?query=" + Query ;
	} else if (theForm.sch_col.value=="taste") {
		URL = "http://myfriday.joins.com/search/search_tastelist.asp?query=" + Query ;
	} else if (theForm.sch_col.value=="photo") {
		URL = "http://myfriday.joins.com/search/search_photolist.asp?query=" + Query ;
	} else {
		URL = "http://find.joins.com/search_result01.asp?sch_col=all&query=" + Query ;
	}
	document.location.href = URL
} 

function onEnter() { 
	var strQuery = document.frmBasic.txtquery.value; 
	if (event.keyCode==13) { GoSearch2();return; } 
} 

function win_open(pop_url) { 
	popWindow = window.open(pop_url,"search_pop",""); 
}

function chk() {
	if (document.frmBasic.q.value=="") {
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À.');
		document.frmBasic.q.focus();
		return;
	}
	document.frmBasic.action="http://find.joins.com/myfriday/search_result_trip01.asp"
	document.frmBasic.submit();
}


// ÁÂÃø °ø¹é Á¦°Å ÇÔ¼ö
function Ltrim(strValue){
	while (strValue.length>0){
	   if(strValue.charAt(0)==' '){
		   strValue=strValue.substring(1,strValue.length);              
	   }
	   else
		  return strValue;	    
	}
	return strValue;
}

// ¿ìÃø °ø¹é Á¦°Å ÇÔ¼ö
function Rtrim(strValue){
	while (strValue.length>0){
	   if(strValue.charAt(strValue.length-1)==' '){
		   strValue=strValue.substring(0,strValue.length-1);              
	   }
	   else
		   return strValue;	    
   }
   return strValue;
}

// ¾çÂÊ °ø¹é Á¦°Å ÇÔ¼ö
function Trim(strValue){
   strValue = Ltrim(strValue);
   strValue = Rtrim(strValue);
   return strValue;
}

// ·¹ÀÌ¾î º¯°æ
function changeLayer(area_name, total_num, area_no) {
	for(i=1; i<=total_num; i++) {	
		if (area_no==i) {
			document.getElementById(area_name+i).style.display="block";				
		}else{
			document.getElementById(area_name+i).style.display="none";
		}
	}		
}

//ÀÌ¹ÌÁö displayº¯°æ
function changeImg(imgName, imgTot, imgNo) {
	for (i=1; i<=imgTot; i++) {
		if (i==imgNo) document.getElementById(imgName + "_" + i).style.display = "block";
		else document.getElementById(imgName + "_" + i).style.display = "none";
	}
}


function printHTML(str) {var strHTML=str; document.write(strHTML);}

// °¶·¯¸® ¿ÀÇÂ
function gallery_open(url,type) {	
	win = window.open(url , 'gallery' ,"resize=yes,scrollbars=no,width=600,height=800,left=50,top=50").focus();	
}

function showme_pop(url,width,height,name) {
	win = window.open(url , name,"scrollbars=no,width="+width+",height="+height+",left=50,top=50");
}

function getCookie(varname) {
		varname += "=";
		startpos = document.cookie.indexOf(varname);

		if (startpos >= 0) {
			startpos += varname.length;
			endpos = document.cookie.indexOf(";", startpos);
			if (endpos == -1) endpos = document.cookie.length;
			return unescape(document.cookie.substring(startpos, endpos));
		}
}

function print_login_message() {
	var strstring;
	strstring = "<span>";
	if (getCookie('Joins_ValidLogin') == 'True') {		 	
		strstring += '<a href="http://login.joins.com/logout_myfriday.asp"><img src="http://images.joins.com/ui_joins/news06/common/btn_gn_logout01.gif" alt="" border="0" class="img_valign"/></a><a href="http://myjoins.joins.com/myfriday/personal/modUserInfo.asp"><img src="http://images.joins.com/ui_joins/news06/common/btn_gn_amend01.gif" alt="" border="0" class="img_valign"/></a>';
	} else {
		strstring += '<a href="http://login.joins.com/login_myfriday.asp"><img src="http://images.joins.com/ui_joins/news06/common/btn_gn_login01.gif" alt="" border="0" class="img_valign"/></a><a href="http://myjoins.joins.com/myfriday/myfriday_member_reg.asp"><img src="http://images.joins.com/ui_joins/news06/common/btn_gn_join01.gif" alt="" border="0" class="img_valign"/></a>';
	}
	strstring += "</span>";
	document.write(strstring);
}

function print_login_message_main() {
	var strstring;
	strstring = "<span>";
	if (getCookie('Joins_ValidLogin') == 'True') {		 	
		strstring += '<a href="http://login.joins.com/logout_myfriday.asp"><img src="http://images.joins.com/ui_joins/news06/common/btn_gn_logout01.gif" alt="" border="0" /></a><a href="http://myjoins.joins.com/myfriday/personal/modUserInfo.asp"><img src="http://images.joins.com/ui_joins/news06/common/btn_gn_amend01.gif" alt="" border="0" /></a>';
	} else {
		strstring += '<a href="http://login.joins.com/login_myfriday.asp"><img src="http://images.joins.com/ui_joins/news06/common/btn_gn_login01.gif" alt="" border="0" /></a><a href="http://myjoins.joins.com/myfriday/myfriday_member_reg.asp"><img src="http://images.joins.com/ui_joins/news06/common/btn_gn_join01.gif" alt="" border="0" /></a>';
	}
	strstring += "</span>";
	document.write(strstring);
}