var myurl;
var mytitle;

myurl="http://www.1000addictinggames.com";
mytitle="Play a game every day! - 1000 Addicting Games";

function favorite(){
   if(navigator.appName!="Netscape"){
      window.external.AddFavorite(myurl,mytitle);
   } else{
      alert("Press Ctrl-D to Bookmark!");
   }
}

function playGame(gameN,gameW,gameH) {
   if(gameW < 500) {
       windowW = 900;
   } 
   else {
       windowW = gameW+200;
   }
   if(gameH < 400) {
       windowH = 700;
   }
   else {
       windowH = gameH + 325;
   }
   window.open('play.php?GAME='+gameN+'&WIDTH='+gameW+'&HEIGHT='+gameH ,'Game', 'width='+ windowW +',height='+ windowH +',top=50,left=50,scrollbars=yes');
}

function expMenu(id) {
  var itm = null;
  if (document.getElementById) {
     itm = document.getElementById(id);
  }
  else if (document.all){
     itm = document.all[id];
  }
  else if (document.layers){
     itm = document.layers[id];
  }
	
  if (!itm) {
  // do nothing
  }
  else if (itm.style) {
       if (itm.style.display == "none") { itm.style.display = ""; }
       else { itm.style.display = "none"; }
  }
	  
  else { itm.visibility = "show"; }

}


function textCounter(field,cntfield,maxlimit) {
  if (field.value.length > maxlimit)
  field.value = field.value.substring(0, maxlimit);

  else
  cntfield.value = maxlimit - field.value.length;
}

function addsmiley(symbol) {
  document.postshout.msg.value += symbol;
  document.postshout.msg.focus();
}

