var urlAddress = 'http://www.onlinecasinotopic.com';
var pageName = 'Online Casino Topic - The best online casino guide';
		
function addToFavorites()
{
  if (window.external)
  {
  window.external.AddFavorite(urlAddress,pageName)
  }
  else
  { 
  alert("Sorry! Your browser doesn't support this function.");
}
}

function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function FormValidator(theForm)
{

  if (theForm.email.value == "")
  {
    alert("Please enter a valid e-mail address.");
    theForm.email.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.email.value))
  {
    alert("Please enter a complete email address in the form: yourname@yourdomain.com");
    theForm.email.focus();
    return (false);
  }
   
  if (theForm.email.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"email\" field.");
    theForm.email.focus();
    return (false);
  }
  if (theForm.firstname.value == "")
  {
    alert("Please enter your first name.");
    theForm.firstname.focus();
    return (false);
  }
  if (theForm.lastname.value == "")
  {
    alert("Please enter your last name.");
    theForm.lastname.focus();
    return (false);
  }
  return (true);
}

function PopConsole() {
	var Url = "http://www.gameinsert.com/box/octp/index.php?page=website";
	var WindowWidth = 800;
	var WindowHeight = 480;
	var WindowTop = (screen.availHeight/2) - (WindowHeight/2);
	var WindowLeft = (screen.availWidth/2) - (WindowWidth/2);
	var WindowProps = 'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=no,width='+WindowWidth+',height='+WindowHeight+',left='+WindowLeft+',top='+WindowTop+',screenx='+WindowLeft+',screeny='+WindowTop;
	GameWindow = window.open(Url,"ConsoleWindow",WindowProps);
	return;
}