document.domain = "joins.com"
	
	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 getCookie2(uName,uName2)		//ÄíÅ°¿­ Áß¿¡ uName2ÀÇ °ªÀ» ±¸ÇÑ´Ù 
	{
		var string = getCookie(uName);
		
		var flag = string.indexOf(uName2+'=');
		if (flag != -1) 
		{ 
			flag += uName2.length + 1
			end = string.indexOf('&', flag) 

			if (end == -1) end = string.length
			return unescape(string.substring(flag, end))
		}
		else
		{
			return ""
		}
	}	
	
	function login_send() {
        if (document.frm_login.txtId.value == "")  {
               alert("È¸¿ø ID¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
               document.frm_login.txtId.focus();
               return;
        }
        if (document.frm_login.txtPasswd.value == "")  {
               alert("È¸¿ø ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
               document.frm_login.txtPasswd.focus();
               return;
        }
		document.frm_login.referer.value=window.location;
		document.frm_login.submit();
	}
	
	
	
	
	
	

	function cmtlist_toggle() {
		
		if (a_cmt_list.style.display=="none") {							//³ªµµÇÑ¸¶µð ¸®½ºÆ® ¿¬´Ù
			
			tbopen.style.display = "none";
			tbclose.style.display = "block";
			a_cmt_list.style.display = "block";
			cmtconlist.style.display = "block";

		}else if (a_cmt_list.style.display=="block") {					//³ªµµÇÑ¸¶µð ¸®½ºÆ® ´Ý´Â´Ù
			tbopen.style.display = "block";
			tbclose.style.display = "none";
			a_cmt_list.style.display = "none";
			cmtconlist.style.display = "none";
		}
	}
	
	function onelineview(row,total) {				
		//for (var j=1; j <= 5; j++) {
		for (var j=1; j <= total; j++) {
			if (eval(row)==eval(j)) {
				if (document.getElementById('onelinecmt'+row).style.display=="none") {							//ÇÑÁÙ ÀÔ·ÂÃ¢ ¿¬´Ù
					document.getElementById('onelinecmt'+row).style.display="block";
				} else {																											//³ªµµÇÑ¸¶µð ¸®½ºÆ® ´Ý´Â´Ù
					document.getElementById('onelinecmt'+row).style.display="none";
				}
			}else{
				//document.getElementById('onelinecmt'+row).style.display="none";
			}
		}
	}
	
	function gocmtlist(aid,contcode,ctype) {
		document.location.href="http://isplussvc.joins.com/comment/list.asp?aid="+aid+"&contcode="+contcode+"&ctype="+ctype;	
	}
	

	function onelineinput(row) {		
		var content = document.forms('onelinecmt'+row).mm.value;
		content = content.toLowerCase();
		var cnt_chk= document.forms('onelinecmt'+row).mm.value;
		var chk_cnt = cnt_chk.length;
		var userName = getCookie2('MemArray','MemName');
		var userId = getCookie2('MemArray','MemID');
		var userMail = getCookie2('MemArray','Joins_mememail');
		var chk_script; 
		chk_script = content.indexOf ("<s");
		if (getCookie('Joins_ValidLogin') == 'True') {
		}else{
			alert ("·Î±×ÀÎÈÄ »ç¿ë°¡´ÉÇÕ´Ï´Ù.");
			return;
		}
		if (content == "" ) {
			alert ("³»¿ëÀÌ ¾ø½À´Ï´Ù. ³»¿ëÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
			document.forms('onelinecmt'+row).mm.focus();
			return;
		}else{
				if(chk_cnt>250){
					alert("250ÀÚ°¡ ³Ñ¾ú½À´Ï´Ù. Á¤¸®ÇØ ÁÖ¼¼¿ä");
					return;
				}else{
					if (chk_script == -1){
						var codeform = parent.document.forms.codes;
						document.frmreply.parentid.value = document.forms('onelinecmt'+row).parentid.value;
						document.frmreply.aid.value = codeform.aid.value;
						document.frmreply.maincode.value = codeform.maincode.value;
						document.frmreply.servcode.value = codeform.servcode.value;
						document.frmreply.sectcode.value = codeform.sectcode.value;
						document.frmreply.contcode.value = codeform.contcode.value;						
						document.frmreply.mm.value = content;
						document.frmreply.mem_id.value = userId;
						document.frmreply.name.value = userName;
						document.frmreply.email.value = userMail;

						if (codeform.c_type) {																						//form¿¡ c_typeÀÌ ÀÖÀ»¶§..¸¸È­ ³ªµµÇÑ¸¶µðÀÏ°æ¿ì ´Ù¸¥ °ªÀ» Áà¾ßÇØ¼­...
							document.frmreply.c_type.value = codeform.c_type.value;
						}

						document.frmreply.target="hiddenfrmcmt";
						document.frmreply.submit();
					}else{
						alert("½ºÅ©¸³Æ® ÄÚµå´Â ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
						return;
					}							
				}
		}
	}


	function onClick(){
		
		if (getCookie('Joins_ValidLogin') == 'True') {
		
		}else{
			alert ("·Î±×ÀÎÈÄ »ç¿ë°¡´ÉÇÕ´Ï´Ù.");
			return;
		}
		var content = document.comment.mm.value;
		content = content.toLowerCase();
		var cnt_chk= document.comment.mm.value;
		var chk_cnt = cnt_chk.length;
		var chk_script; 
		chk_script = content.indexOf ("<s");
		if (content == "" ) {
			alert ("³»¿ëÀÌ ¾ø½À´Ï´Ù. ³»¿ëÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
			document.comment.mm.focus();
			return;
		}else{

				if(chk_cnt>250){
					alert("250ÀÚ°¡ ³Ñ¾ú½À´Ï´Ù. Á¤¸®ÇØ ÁÖ¼¼¿ä");
					return;
				}else{
					if (chk_script == -1){
						var codeform = document.forms.codes;
						document.comment.aid.value = codeform.aid.value;
						document.comment.maincode.value = codeform.maincode.value;
						document.comment.servcode.value = codeform.servcode.value;
						document.comment.sectcode.value = codeform.sectcode.value;
						document.comment.contcode.value = codeform.contcode.value;						

						if (codeform.atype) {																						//form¿¡ c_typeÀÌ ÀÖÀ»¶§..¸¸È­ ³ªµµÇÑ¸¶µðÀÏ°æ¿ì ´Ù¸¥ °ªÀ» Áà¾ßÇØ¼­...
							document.comment.c_type.value = codeform.atype.value;
						}

						document.comment.target="hiddenfrmcmt";
						document.comment.submit();
					}else{
						alert("½ºÅ©¸³Æ® ÄÚµå´Â ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
						return;
					}							
				}
		}	
	}
	
	function recommend(idx) {
		hiddenfrmcmt.location.href="http://isplussvc.joins.com/comment/recommend.asp?idx="+idx;
	}
	function cmtdel(idx) {
		hiddenfrmcmt.location.href="http://isplussvc.joins.com/comment/delete.asp?idx="+idx;
		//location.href="http://isplussvc.joins.com/comment/delete.asp?idx="+idx;
	}
	
	function gomycmtlist() {
		var codeform = parent.document.forms.codes;
		document.location.href="http://isplussvc.joins.com/comment/mylist.asp?aid="+codeform.aid.value+"&contcode="+codeform.contcode.value+"&ctype="+codeform.atype.value;	
	}
		
	
	