
function blank() {}

function popWin(URL,winX,winY,winName,kind) {	// URL : popup , winX, winY : , winName : , kind : 0 
	if (kind == "") {
		kind = 0;
	}
	winPath = URL;
	winStatus = "top=10,left=10,toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=0,scrollbars="+kind+",width="+winX+",height="+winY;
  newWin = window.open(winPath,winName,winStatus);
}

function popWin1(img_src,winX,winY,winName,kind) {	// URL : popup , winX, winY : , winName : , kind : 0 -  1 - 
	if (kind == "") {
		kind = 0;
	}
	winPath = "/inc/pop_up.asp?img_src="+img_src;
	winStatus = "top=10,left=10,toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=0,scrollbars="+kind+",width="+winX+",height="+winY;
  newWin = window.open(winPath,winName,winStatus);
}


function socialNumberCheck(sNum1,sNum2) {		// sNum1 : , sNum2 : 
	a = Array(6);
	b = Array(7);
	
	if (sNum1.length != 6 || sNum2.length != 7) {
		return false;
	}
	
	if (sNum1.length == 6 && sNum2.length == 7) {
		for (i=0;i<6;i++) {
			a[i] = parseInt(sNum1.charAt(i));
		}
		for (j=0;j<7;j++) {
			b[j] = parseInt(sNum2.charAt(j));
		}
		sNumTotal = (a[0]*2) + (a[1]*3) + (a[2]*4) + (a[3]*5) + (a[4]*6) + (a[5]*7) + (b[0]*8) + (b[1]*9) + (b[2]*2) + (b[3]*3) + (b[4]*4) + (b[5]*5);
		sNumCheckSum = 11 - (sNumTotal%11);
		if (sNumCheckSum == 11) {
			sNumCheckSum = 1;
		} else if (sNumCheckSum == 10) {
			sNumCheckSum = 0;
		}
		if (b[6] != sNumCheckSum) {
			return false;
		} else {
			return true;
		}
	}
}


function mailAddrCheck(obj) {
	if (obj.value.search(/(\S+)@(\S+)\.(\S+)/)== -1 ) {	
		return false;
	} else {
		if (spaceCheck(obj.value)) {
			return true;
		} else {
			return false;
		}
	}
}

function spaceCheck(strObj) {
	if (strObj.indexOf(" ") >= 0) {
		alert(".");
		return false;
	} else {
		return true;
	}
}
function digitLenCheck(obj,strLength) {
	if ((obj.value.length != strLength) || (isNaN(obj.value))) {
		return false;
	} else {
		if (spaceCheck(obj.value)) {
			return true;
		} else {
			return false;
		}
	}
}
function alphaDigitCheck(obj) {
	var alphaDigitStr = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
	var a = 0;
	for (i = 0; i < obj.value.length; i++) {
		if (alphaDigitStr.indexOf(obj.value.substring(i,i+1)) == -1) {
			a = a + 1;
		} else {
			a = a + 0;
		}
	}
	if (a == 0) {	
		return true;
	} else {
		alert(".");
		obj.value = "";
		obj.focus();
		return false;
	}
}

function memberJoin(){
	popWin("http://www1.exsoccer.com/member/ex_join1.asp", 586, 473);
}

function activeChk(){
	popWin("http://www1.exsoccer.com/member/activex_ck1.asp",586,520);
}

function editInfo(m_name, m_userid){
	popWin("http://www1.exsoccer.com/member/ex_edit.asp?m_name="+m_name+"&m_userid="+m_userid,586,473);
}

var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");
function CheckUIElements(){
        var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;

        if ( bNetscape4plus ) { 
                yMenuFrom   = document["subleftmenu"].top;
                yMenuTo     = top.pageYOffset + 218; //)
        }
        else if ( bExplorer4plus ) {
                yMenuFrom   = parseInt (subleftmenu.style.top, 10);
                yMenuTo     = document.body.scrollTop + 218;//
        }

        timeoutNextCheck = 500;

        if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
                setTimeout ("CheckUIElements()", timeoutNextCheck);
                return;
        }

        if ( yButtonFrom != yButtonTo ) {
                yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
                if ( yButtonTo < yButtonFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["divLinkButton"].top += yOffset;
                else if ( bExplorer4plus )
                        divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }
        if ( yMenuFrom != yMenuTo ) {
                yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
                if ( yMenuTo < yMenuFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["subleftmenu"].top += yOffset;
                else if ( bExplorer4plus )
                        subleftmenu.style.top = parseInt (subleftmenu.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }

        setTimeout ("CheckUIElements()", timeoutNextCheck);
}
function OnLoad()
{
        var y;
        if ( top.frames.length )
        if ( bNetscape4plus ) {
                document["subleftmenu"].top = top.pageYOffset + 135;
                document["subleftmenu"].visibility = "visible";
        }
        else if ( bExplorer4plus ) {
                subleftmenu.style.top = document.body.scrollTop + 218;
                subleftmenu.style.visibility = "visible";
        }
        CheckUIElements();
        return true;
}


function clearText(thefield){
	if (thefield.defaultValue==thefield.value)
	        thefield.value = ""
} 


function BoardSearch()
{
  frm   = document.searchForm
  var str = frm.m_searchstring.value;
   
   if (CheckNull(str, " ", "")==0) 
    {
      alert(".");
      frm.m_searchstring.value="";
      frm.m_searchstring.focus();
      return;
    }
   frm.action = "ex_list.asp"
   frm.submit()
}
function CheckNull(strOriginal, strFind, strChange){
    var position, strOri_Length;
    position = strOriginal.indexOf(strFind);  
    
    while (position != -1){
      strOriginal = strOriginal.replace(strFind, strChange);
      position    = strOriginal.indexOf(strFind);
    }
  
    strOri_Length = strOriginal.length;
    return strOri_Length;
}

function beta_chk(){
	popWin("http://www1.exsoccer.com/www/member/beta_chk.asp", 415, 405);
}
function loginPop(){
	popWin("http://www1.exsoccer.com/www/member/pop_login.asp", 400, 180, "popLogin");
}
function searchPop(){
	popWin("http://www1.exsoccer.com/www/member/ex_find_id.asp", 423, 280, "popSearch");
}
function mainMessage(){
	alert(".");
	
}
function flash_view(flash_src,width,height){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'"><PARAM NAME="movie" VALUE="'+flash_src+'"><PARAM NAME="quality" VALUE="high"><param name="wmode" value="transparent"><embed src="'+flash_src+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></object>');
}
function getPageNavigator( pageSize, blkSize, totalRowCount, currentPage, func ) {

	var firstImg  = "<img src='/images/board_btn_prepre.gif' align='absmiddle'> "
	var prevImg   = "<img src='/images/board_btn_pre.gif' align='absmiddle'> "
	var nextImg   = "<img src='/images/board_btn_next.gif' align='absmiddle'> "
	var lastImg   = "<img src='/images/board_btn_nextnext.gif' align='absmiddle'> "


	if( totalRowCount * pageSize * blkSize == 0 ) return "";

	firstPage = 1;
	lastPage  = Math.ceil( totalRowCount / pageSize );

	currentPage = ( currentPage < 1 ) ? 1 : currentPage;
	currentPage = ( currentPage > lastPage ) ? lastPage : currentPage;

	currentBlkFirstPage = Math.floor((currentPage-1)/blkSize) * blkSize + 1;
	prevBlkLastPage     = currentBlkFirstPage - 1;
	nextBlkFirstPage    = currentBlkFirstPage + blkSize;

	toFirst = (currentPage==firstPage) ? "<font color=#9B9B9B>"+firstImg+"</font>" : "<a href='javascript:" +func+ "(" +firstPage+ ");'>"+firstImg+"</a>";
	toLast  = (currentPage==lastPage)  ? "<font color=#9B9B9B>"+lastImg+"</font>"  : "<a href='javascript:" +func+ "(" +lastPage+ ");'>" +lastImg +"</a>";

	toPrev = (prevBlkLastPage<=firstPage) ? "<font color=#9B9B9B>"+prevImg+"</font>" : "<a href='javascript:" +func+ "(" +prevBlkLastPage+ ");'>" +prevImg+"</a>";
	toNext = (nextBlkFirstPage>lastPage)  ? "<font color=#9B9B9B>"+nextImg+"</font>" : "<a href='javascript:" +func+ "(" +nextBlkFirstPage+ ");'>"+nextImg+"</a>";

	blkPageNavi = "";
	for( i=currentBlkFirstPage; i<currentBlkFirstPage+blkSize && i<=lastPage; i++ ) {
		blkPageNavi += (i==currentBlkFirstPage) ? " " : " | ";
		blkPageNavi += (i==currentPage) ? "<font color=#FFFF00><b>"+i+"</b></font>" : "<a href='javascript:"+func+"("+i+");'>"+i+"</a>";
	}

	pageNavi = "<table width='100%' cellpadding='0' cellspacing='0' border='0'><tr>";
	pageNavi += "<td align=right>" + toFirst + toPrev + "</td>";
//	pageNavi += "<td align=right width='*'>" + toPrev + "</td>";
	pageNavi += "<td align=center width='310'>" + blkPageNavi + "</td>";
	pageNavi += "<td>" + toNext + toLast + "</td>";
//	pageNavi += "<td width='*'>" + toNext + "</td>";
	pageNavi += "</tr></table>";

	return pageNavi;
}

function cDown1(downurl) {
        window.open("/neffy/exsoccer_pop.asp?downurl="+downurl, "exsoccer","titlebar = no, toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=436");
}

function Multiplay(src,width,height) {
	document.write('<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="mlist" width="'+width+'" height="'+height+'"><param name="Filename" value="'+src+'"><param name="AutoStart" value="0"><param name="ShowControls" value="false"><param name="Volume" value="600"></object>');
}


function chkMsgLength(intMax,objMsg,st) {
 var length = lengthMsg(objMsg.value);
 st.innerHTML = length;//
 if (length > intMax) {
  alert("" + intMax + "byte.\n");
  objMsg.value = objMsg.value.replace(/\r\n$/, "");
  objMsg.value = assertMsg(intMax,objMsg.value,st );
 }
}

function lengthMsg(objMsg) {
 var nbytes = 0;
 for (i=0; i<objMsg.length; i++) {
  var ch = objMsg.charAt(i);
  if(escape(ch).length > 4) {
  nbytes += 2;
  } else if (ch == '\n') {
   if (objMsg.charAt(i-1) != '\r') {
    nbytes += 1;
   }
  } else if (ch == '<' || ch == '>') {
   nbytes += 4;
  } else {
   nbytes += 1;
  }
 }
 return nbytes;
}

function assertMsg(intMax,objMsg,st ) {
 var inc = 0;
 var nbytes = 0;
 var msg = "";

 var msglen = objMsg.length;
 for (i=0; i<msglen; i++) {
  var ch = objMsg.charAt(i);
  if (escape(ch).length > 4) {
  inc = 2;
  } else if (ch == '\n') {
   if (objMsg.charAt(i-1) != '\r') {
   inc = 1;
   }
  } else if (ch == '<' || ch == '>') {
   inc = 4;
  } else {
   inc = 1;
  }
  if ((nbytes + inc) > intMax) {
   break;
  }
  nbytes += inc;
  msg += ch;
 }
 st.innerHTML = nbytes; //
 return msg;
}