//function to put zanother apostrope in front of another apostrophe

function ReplaceString(obj)
	{
	var Str = obj.value 
	var pos = 0;
	var Expr1 ="'";
	var Rep1 = "''";
	
	var pos = Str.indexOf(Expr1,0) ;
	while (pos != -1)
		{ 
		devant = Str.substring(0, pos);
		apres = Str.substring(pos+1, Str.length);
		Str = devant + Rep1  + apres;
		pos = Str.indexOf( Expr1, pos + 2) ;
		} 

	obj.value = Str;
	} 

//Open a ts2 connection to Team Patriots ts2 server
function OpenPage() 
{
  var url;
  url = "teamspeak://xgs1.com:8779?password=pats?nickname=" + formulaire.nick.value;
  document.location = url;
  return false;
}
	
function CheckSubmit()
	{
		var submitcount = 0;
		
		if (document.Login.username.value == ""){
	  		alert("You forgot to enter your username.")
			return false;
		}
		if (document.Login.password.value == ""){
	  		alert("You forgot to enter your password.")
			return false;
		}
		if (submitcount == 0){
	      submitcount++;
	      return true;
	    }
	    else{
	      alert("This form has already been submitted.  Thanks!");
	      return false;
	    }
	}

function OpenWindow(page, w, h, x, y)
	{
		if (navigator.appName == "Microsoft Internet Explorer"){
			window.open(page,"","toolbar=no, width=" + w + ", height=" + h + ", left=" + x + ", top=" + y + ", scrollbars=yes");
		}else{
			window.open(page,"","toolbar=no, width=" + w + ", height=" + h + ", screenX=" + x + ", screenY=" + y + ", scrollbars=yes");
		}
	}