
var bFLAG=true;
var bPrintShow;
var goRedirect=false;

var bFLAG=true;
var NSvers="4.0"
var NSpass="0"
var NSnoPass="1"
var IEvers="4.0"
var IEpass="0"
var IEnoPass="1"
var OBpass="1"
var URL=""
var altURL=""
var newURL='', verStr=navigator.appVersion, app=navigator.appName, version = parseFloat(verStr);


// Use by Popup function
var IE = navigator.appName=="Microsoft Internet Explorer";
var NS = navigator.appName=="Netscape";
var bVer = parseInt(navigator.appVersion);
var newWin=null;



  if (app.indexOf('Netscape') != -1) {
    if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
    else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
  } else if (app.indexOf('Microsoft') != -1) {
    if (version >= IEvers || verStr.indexOf(IEvers) != -1)
     {if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
    else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
  } else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
  if (newURL) { window.location=unescape(newURL); bFLAG=false; document.MM_returnValue=false; }



  function parseURL(Index)
	{
	  var sURL = document.location + ""
	  var iURLCnt = sURL.length
	  var iIndexCnt = Index.length
	  for ( i=0; i<iURLCnt; i++){
	    if (sURL.charAt(i)=="&"){
	      var sIndex = "";
	      for (j=i; j<i+iIndexCnt; j++) {
			sIndex = sIndex + sURL.charAt(j+1)
			if (sIndex == Index){
			  var sVal = ""
			  for (k=j+3; k<iURLCnt; k++) {
			    if (sURL.charAt(k) == "&") {
			      return (sVal);
			    }
			  sVal = sVal + sURL.charAt(k)
			  }
			}
	      }
	    }
	  }
	  return false;
	}  

	
	function MM_openBrWindow(theURL,winName,features) { 
		window.open(theURL,winName,features);
	}

	
	function MapsPopupWindow(loc, name, width, height, scrollbars) {
        var _params = "width="+width+",height="+height+",resizable=no,status=0,scrollbars="+scrollbars+",toolbar=no,location=no,directories=no,menubar=no";
 
          _left = 50;
          _top  = 50;

//        if (bVer >= 4) {
//                 _left = ( (screen.width-width) >>1 );
//                 _top = ( (screen.height-height) >>1 );
//        } else {
//                 _left = ( (800-width) >>1 );
//                 _top = ( (600-height) >>1 );
//        }
 
        if (IE) _params += ",top=" + _top + ",left=" + _left;
        else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;
 
        newWin = window.open(loc, name, _params);
        if ( newWin!=null && !(IE && bVer<5) )
                newWin.focus(); 
	}

	function MapsLargePopupWindow(loc, name, scrollbars) {
        var _params = "width="+700+",height="+600+",resizable=no,status=0,scrollbars="+scrollbars+",toolbar=no,location=no,directories=no,menubar=no";
 
          _left = 50;
          _top  = 50;

        if (IE) _params += ",top=" + _top + ",left=" + _left;
        else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;
 
        newWin = window.open(loc, name, _params);
        if ( newWin!=null && !(IE && bVer<5) )
                newWin.focus(); 
	}

	function popup(loc, name, width, height) {
        var _params = "width="+width+",height="+height+",resizable=no,status=0,scrollbars=no";
 
        if (bVer >= 4) {
                 _left = ( (screen.width-width) >>1 );
                 _top = ( (screen.height-height) >>1 );
        } else {
                 _left = ( (800-width) >>1 );
                 _top = ( (600-height) >>1 );
        }
 
        if (IE) _params += ",top=" + _top + ",left=" + _left;
        else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;
 
        newWin = window.open(loc, name, _params);
        if ( newWin!=null && !(IE && bVer<5) )
                newWin.focus(); 
	}
	
	
	function PrintPage() {
		var sURL = window.location.href;
		var iStringCount = sURL.indexOf("?",0) + 1;
		if (iStringCount == 0) {
			sURL = sURL + "?";
		}
		else {
			sURL = sURL + "&";
		}
		var PrintPage = window.open(sURL + "Print=True", "PrintPage", "width=700,height=500,toolbar=yes,resizable=yes,scrollbars=yes,menubar=yes");
	}

	function LogoutUser(sURL) {
		window.location = sURL;
	}


	function SubmitLogin1() {
		if(ilevel=="")
			document.LoginForm.action="modules/login/CheckLogin.asp"
		else
			document.LoginForm.action=ilevel+"modules/login/CheckLogin.asp"
    }
    
    
  function linkForm(sPageRef,sPath)
  {
    if(sPageRef=="poll")
	 {
	  
	  window.location.href=sPath+"PollQuestions/Poll.asp";
	 }else 
	  if(sPageRef=="reg")
	 {
	  
	  window.open(sPath+"_pages/pollRegistration.asp?page=chat","registration","width=300,height=200");
	 }
	
   }    
   
   function browsercheck(sPath){
   
   var browser_type=navigator.appName;
   var browser_version=parseInt(navigator.appVersion);

	
   //if NS 4+
   if (browser_type=="Netscape"&&browser_version>=4)
	{	
		popup(sPath+'modules/mark_page/bookmark_page.asp', 'JoinNow', 400, 265);}
   //if IE 4+
   else (browser_type=="Microsoft Internet Explorer"&&browser_version>=4)
   addbookmark();
   }


   
   function addbookmark(){
   
   var bookmarkurl=document.URL;
   var bookmarktitle="SportingArena";
   
   if (document.all)
   window.external.AddFavorite(bookmarkurl,bookmarktitle)
   }
   
   function browsercheck2(sPath){
   
   var browser_type=navigator.appName;
   var browser_version=parseInt(navigator.appVersion);

   popup(sPath+'modules/mark_page/make_homepage.asp', 'JoinNow', 415, 196);
   }
   
  
