var Dom_NN4		= false;
var Dom_NN6		= false;

//Mac or Win判定
var Dom_mac = false;
var Dom_win = false;

Dom_mac=navigator.userAgent.indexOf('Mac')!=-1;
if(!Dom_mac)
{
	Dom_win = true;
}

//NN or IE判定
var Dom_IE = false;
var Dom_NN = false;

Dom_IE= navigator.userAgent.indexOf('MSIE') != -1;
if(!Dom_IE)
{
	Dom_NN= navigator.userAgent.indexOf('Mozilla') != -1;
}

if(Dom_NN)
{
	//NN Version判定
	Dom_NN4= navigator.userAgent.indexOf('Mozilla/4') != -1;
	//Netscape6.2以上の場合Dom_NN6はtrue
	Dom_NN6= navigator.userAgent.indexOf('Netscape6') != -1;
	//NN4.x,6.x以外のNNはNN6として処理
	if(Dom_NN4 != true && Dom_NN6 != true)
	{
		Dom_NN6=true;
	}
}



function openWin(url) {
     window.open(url,"_blank","width=420,height=420,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,favorites=no,resizable=yes");
}


function paging(totalPages,currentPage,rowsPerPage) {
 	 var startPage=1
 	 var endPage=totalPages
	if(currentPage!=1){
		document.write("<a href=\"#\" onclick=\"doList(1)\">첫 페이지</a>");
	}
	if(currentPage>10){
		startPage = Math.floor((currentPage-1)/10)*10+1
		if(endPage>(startPage+rowsPerPage)){
			endPage = startPage+rowsPerPage-1
		}
		document.write("&nbsp;<a href=\"#\" onclick=\"doList("+(startPage-1)+")\">전10페이지</a>");
	}
	for(i=startPage;i<=endPage;i++){
		if(i==currentPage){
			document.write("&nbsp;"+i);
		} else {
			document.write("&nbsp;<a href=\"#\" onclick=\"doList("+i+")\">"+i+"</a>");
		}
	}
	if(totalPages>endPage){
		document.write("&nbsp;<a href=\"#\" onclick=\"doList("+(endPage+1)+")\">후10페이지</a>");
	}
	if(currentPage!=totalPages){
		document.write("&nbsp;<a href=\"#\" onclick=\"doList("+totalPages+")\">끝 페이지</a>");
	}
	
}

function fucCheckNUM(NUM) 
{ 
	var i,j,strTemp; 
	strTemp="0123456789"; 
	if ( NUM.length== 0) {
		return false;
	}
	
	for (i=0;i<NUM.length;i++) 
	{ 
		j=strTemp.indexOf(NUM.charAt(i)); 
		if (j==-1) {
			return false; 
		} 
	}
	
	return true; 
}

function changeURLPar(destiny, par, par_value)
{
	var pattern = par+'=([^&]*)';
	var replaceText = par+'='+par_value;

	if (destiny.match(pattern))
	{
		 var tmp = '/\\'+par+'=[^&]*/';
		 tmp = destiny.replace(eval(tmp), replaceText);
		 return (tmp);
	}
	else
	{
		if (destiny.match('[\?]'))
		{
			return destiny+'&'+ replaceText;
		}
		else
		{
			return destiny+'?'+replaceText;
		}
	}
	return destiny+'\n'+par+'\n'+par_value;
}

//-->

