String.prototype.trim = function()
{
	return this.replace(/(^\s*)|(\s*$)/g, "");
}

function ListButton_onClick(position){
    var fm=document.form1;
    fm.searchPosition.value = position;

    fm.action="player_list.jsp";
    fm.submit();
}

//list delete
function chkDelete(){
	var cfm=document.cbox;
	var k=0;
	
	if(cfm.cno == null){
		alert("°Ô½Ã¹°ÀÌ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.");
		return;
	}else{

		if(cfm.cno.length == null){
			if(cfm.cno.checked){
				var cf=confirm("¼±ÅÃÇÏ½Å Ç×¸ñÀ» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?");
				var cno=cfm.cno.value + "^";

				cfm.seqlist.value = cno;
				cfm.aT.value = "delete";
				cfm.submit();
			}else{
				alert("¼±ÅÃÇÏ½Å Ç×¸ñÀÌ ¾ø½À´Ï´Ù.");
				return;			
			}
		}else{

			for(i=0; i < cfm.cno.length; i++){
				if(cfm.cno[i].checked){
					k++;
				}
			}

			if(k == 0){
				alert("¼±ÅÃÇÏ½Å Ç×¸ñÀÌ ¾ø½À´Ï´Ù.");
				return;
			}else{
				var cf=confirm("¼±ÅÃÇÏ½Å Ç×¸ñÀ» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?");
				var cno="";
				
				if(cf == 1){
					for(i=0; i < cfm.cno.length; i++){
						if(cfm.cno[i].checked){
							cno += cfm.cno[i].value + "^";
						}
					}
					
					cfm.seqlist.value = cno;
					cfm.aT.value = "delete";
					cfm.submit();
				}
			}
		}
	}
}
//view delete
function deleteChk2(){

	var fm=document.fm;
	var cf=confirm("»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?");

	if(cf == 1){

		fm.action = "letter_reg.jsp";
		fm.aT.value = "DEL";

		fm.submit();
	}
}

//°ü¸®ÀÚ check.
function chkAll(){
	var cfm= document.cbox;
	
	//alert(cfm);
	
	if(cfm.cno == null){

	}else{
		for(i=0; i < cfm.cno.length; i++){
			if(cfm.all.checked){
				cfm.cno[i].checked = true;
			}else{
				cfm.cno[i].checked = false;		
			}
		}
		
		if(cfm.cno.length == undefined){ //°Ô½Ã¹°ÀÌ ÇÏ³ªÀÏ ¶§
			if(cfm.all.checked){
				cfm.cno.checked = true;
			}else{
				cfm.cno.checked = false;
			}
		}
	}
}

//ÆäÀÌÂ¡ & Search!
function searchBox(pg){

	document.cbox.pg.value = pg;
	cbox.action = "player_detail.jsp";
	document.cbox.submit();
}

//°ø¹éÃ¼Å©
function Com_chBlank(object) {    
    var str = object.value;                         
    var len = object.value.length;                                                                

    if (str == "" || len == 0 ){                    
        return false;                                             
    }else if(str != "" && len >0) {
	    for(i=0; i < len; i++){                      
	        if(str.substring(i,i+1) != " ") 	{
              return true;                          
		       }                                         
        }                                            	
    }else{                                           
        return true;                                
    }         
		object.value = "";   
    return false;
}    