
function func_paging(totalcnt,category,mode){
	var totpages = Math.ceil(totalcnt/LISTUNIT); //ÃÑÆäÀÌÁö¼ö
	var thisblock = Math.ceil(THISPAGE/PAGEUNIT); //ÇöÀç ÆäÀÌÂ¡ºí·°
	var startpage, endpage;
	var ret_HTML = "";
	

	// ÇöÀç ÆäÀÌÁöºí·°ÀÇ ½ÃÀÛÆäÀÌÁö¹øÈ£
	if(thisblock > 1){
		startpage = (thisblock-1)*PAGEUNIT+1;
	}else{
		startpage = 1;
	}
	
	// ÇöÀç ÆäÀÌÁöºí·°ÀÇ ³¡ÆäÀÌÁö¹øÈ£
	if( (thisblock*PAGEUNIT) >= totpages ){
		endpage = totpages;
	}else{
		endpage = thisblock*PAGEUNIT;
	}


	ret_HTML = "<TR>";
	ret_HTML += "  <TD align='center' colspan='5' class='paging_td'>";

if(totpages > 1){
	if(THISPAGE > 1){
		ret_HTML += "  [<A href='#' onclick=\"act_list(1,'"+category+"','"+mode+"');\"><B>&lt;</B></A>]"; // ¸ÇÃ³À½À¸·Î °¡±â
	//	ret_HTML += "  [<A href='#' onclick=\"act_search("+(THISPAGE-1)+");'><B>&lt;</B></A>]"; // ÇöÀçºí·°ÀÇ ÀüÆäÀÌÁö
	}
	for(i=startpage; i<=endpage; i++){
		if(i!=THISPAGE){
			ret_HTML += " <A href='#' onclick=\"act_list("+i+",'"+category+"','"+mode+"');\">"+i+"</A>";
		}else{
			ret_HTML += " <B>"+i+"</B>";
		}
	}
	
	if(THISPAGE != totpages){
	//	ret_HTML += "  [<A href='#' onclick='act_list("+(THISPAGE+1)+","+category+");'><B>&gt;</B></A>]"; // ÇöÀçºí·°ÀÇ ´ÙÀ½ÆäÀÌÁö
		ret_HTML += "  [<A href='#' onclick=\"act_list("+totpages+",'"+category+"','"+mode+"');\"><B>&gt;</B></A>]"; // ¸Ç ¸¶Áö¸·ÆäÀÌÁö
	}
}else{
ret_HTML += "&nbsp;";
}
	ret_HTML += "  </TD>";
	ret_HTML += "</TR>";
	
	return ret_HTML;
}


function newXMLHttpRequest() {
	var xmlreq = false;
	if (window.XMLHttpRequest) {
		// Create XMLHttpRequest object in non-Microsoft browsers
		xmlreq = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		// Create XMLHttpRequest via MS ActiveX
		try {
			// Try to create XMLHttpRequest in later versions
			// of Internet Explorer
			xmlreq = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			// Failed to create required ActiveXObject
			try {
				// Try version supported by older versions
				// of Internet Explorer
				xmlreq = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				// Unable to create an XMLHttpRequest with ActiveX
			}
		}
	}
	return xmlreq;
}

function clickerase(obj) {
	if (obj.value == "¿¹) gabia,°¡ºñ¾Æ,µµ¸ÞÀÎ,domain,µµ¸ÞÀÎµî·Ï") {
		obj.value='';
	}
}
function type_check(type){

	var countuse="";
	if(type=="A"){
		document.domaininfo['counter_type'][0].checked = true;		
	}else if(type=="B" || type=="C"){
	
		for(i=0;i<=11;i++){
			document.domaininfo['counter_type'][i].checked = false;

		}
	}	
	else if(type=="D"){

		countuse = document.domaininfo['counter_use'][2].checked;
		countuse1 = document.domaininfo['counter_use'][1].checked;
		if(countuse || countuse1){

			alert("Ä«¿îÅÍ±â´ÉÀ» »ç¿ëÇÏÁö ¾ÊÀ»°æ¿ì ¼±ÅÃÇÒ¼ö ¾ø½À´Ï´Ù");
			document.domaininfo['counter_use'][0].checked = true;
			
		}
	}
}

function openwindow(url){
	 open (url, "opwin", "menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=auto,resizable=no,width=1024,height=768");
}

//Á¤º¸ Ã¼Å©ºÎºÐ
function checkForm(){

	var title = "";
	var contents = "";
	var email= "";
	var invalidChars = "\"|&;<>!*\'\\"   ;
	var p_code="";

	title = document.domaininfo.p_all_title.value.toUpperCase();
	contents = document.domaininfo.p_all_contents.value;
	email = document.domaininfo.p_all_email.value.toUpperCase();
	

	 if(title == ""){
			alert("Å¸ÀÌÆ²À» Àû¾î ÁÖ¼¼¿ä");
		
				document.domaininfo.p_all_title.focus();
				//document.domaininfo['p_all_title[]'].select();
		
		
			return false;
		}

		if(contents == ""){
			alert("³»¿ëÀ» Àû¾î ÁÖ¼¼¿ä.");
			
				document.domaininfo.p_all_contents.focus();
			
				return false;
		}

	//ÀÌ¸ÞÀÏÃ¼Å©
		var reg = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;
		if (email.search(reg) != -1) {
			return true;
		 }else{					
				alert("Àß¸øµÈ ÀÌ¸ÞÀÏ ÁÖ¼ÒÀÔ´Ï´Ù. ");				
				document.domaininfo.p_all_email.focus();						
				return false;
		 }

}

//±ÛÀÚ Á¦ÇÑ Ã¼Å© Ãß°¡ 2007-02-21 Çã¼º¿ì
function ChkByte(objname,maxlength) { 
	 var objstr = objname.value; // ÀÔ·ÂµÈ ¹®ÀÚ¿­À» ´ãÀ» º¯¼ö 
	 var objstrlen = objstr.length; // ÀüÃ¼±æÀÌ 

	 // º¯¼öÃÊ±âÈ­ 
	 var maxlen = maxlength; // Á¦ÇÑÇÒ ±ÛÀÚ¼ö ÃÖ´ëÅ©±â 
	 var i = 0; // for¹®¿¡ »ç¿ë 
	 var bytesize = 0; // ¹ÙÀÌÆ®Å©±â 
	 var strlen = 0; // ÀÔ·ÂµÈ ¹®ÀÚ¿­ÀÇ Å©±â
	 var onechar = ""; // char´ÜÀ§·Î ÃßÃâ½Ã ÇÊ¿äÇÑ º¯¼ö 
	 var objstr2 = ""; // Çã¿ëµÈ ±ÛÀÚ¼ö±îÁö¸¸ Æ÷ÇÔÇÑ ÃÖÁ¾¹®ÀÚ¿­

	 // ÀÔ·ÂµÈ ¹®ÀÚ¿­ÀÇ ÃÑ¹ÙÀÌÆ®¼ö ±¸ÇÏ±â
	 for(i=0; i< objstrlen; i++) { 
	  // ÇÑ±ÛÀÚÃßÃâ 
	  onechar = objstr.charAt(i); 

	  if (escape(onechar).length > 4) { 
	   bytesize += 2;     // ÇÑ±ÛÀÌ¸é 2¸¦ ´õÇÑ´Ù. 
	  } else {  
	   bytesize++;      // ±×¹ÜÀÇ °æ¿ì´Â 1À» ´õÇÑ´Ù.
	  } 

	  if(bytesize <= maxlen)  {   // ÀüÃ¼ Å©±â°¡ maxlen¸¦ ³ÑÁö¾ÊÀ¸¸é 
	   strlen = i + 1;     // 1¾¿ Áõ°¡
	  }
	 }

	 // ÃÑ¹ÙÀÌÆ®¼ö°¡ Çã¿ëµÈ ¹®ÀÚ¿­ÀÇ ÃÖ´ë°ªÀ» ÃÊ°úÇÏ¸é 
	 if(bytesize > maxlen) { 
	  alert( "Çã¿ëµÈ ¹®ÀÚ¿­ÀÇ ÃÖ´ë°ªÀ» ÃÊ°úÇß½À´Ï´Ù. \nÃÊ°úµÈ ³»¿ëÀº ÀÚµ¿À¸·Î »èÁ¦ µË´Ï´Ù."); 
	  objstr2 = objstr.substr(0, strlen); 
	  objname.value = objstr2; 
	 } 
	 objname.focus();
	 return;
} 
