
//*** Global variables
var gElementID;
var bookmarkURL = "http://www.dreamstripper.com"
var bookmarkTitle="Dream Stripper - The Virtual 3D Stripper Game"


function centerPopUpWindow(URL, title, winName, winWidth, winHeight, msg) {
  if (document.all) {
    var leftPos = (screen.width) ? (screen.width-winWidth)/2 : 0;
    var topPos = (screen.height) ? (screen.height-winHeight)/2 : 0;
  }
  else {
    if (document.layers) {
      var leftPos = (window.outerWidth) ? (window.width-winWidth)/2 : 0;
      var topPos = (window.outerHeight) ? (window.height-winHeight)/2 : 0;
    }
    else {
      var leftPos = 1024, topPos=768;  //default to most popular window size
    }
  }
	
  var tempWin = window.open(URL,winName,
  'width=winWidth,height=winHeight,screenX='+leftPos+',screenY='+topPos+',top='+topPos+',left='+leftPos+'');
		
  tempWin.document.open();
  tempWin.document.title = bookmarkTitle;
  tempWin.document.write('<HTML><BODY onBlur="self.focus()"><CENTER><BR>'+msg+'</CENTER></BODY></HTML>');
  tempWin.document.close();
}

function bookmarkMe()
{
  if (!document.all) {
    if (navigator.appName=='Netscape') {
      var msg = "Sorry, your browser do not allow automatic bookmark.  Hit CTRL+D to add a bookmark to this site after you close this window.";
      alert(msg);
//      centerPopUpWindow("", "Add Bookmark to Favorite", "myWindow", 4500, 1000, msg);
    }
  }
  else {
    window.external.AddFavorite(bookmarkURL,bookmarkTitle);
  }
}

function getElementById(IdName)
{
  gElementID = document.getElementById(IdName);
}

function showElement(IdName)
{
  getElementById(IdName);
  gElementID.style.visibility = "visible";
}

function hideElement(IdName)
{
  getElementById(IdName);
  gElementID.style.visibility = "hidden";
}

/* shows the first arg, hides the rest */
function showSubmenu()
{
  var argv = showSubmenu.arguments;
  var argc = argv.length;
  
  showElement(argv[0]);

  for (var i = 1; i < argc ; i++) {
    hideElement(argv[i]);
  }
}

/* Hides all the arg */
function hideSubmenus()
{
  var argv = hideSubmenus.arguments;
  var argc = argv.length;
  
  for (var i = 0; i < argc ; i++) {
    hideElement(argv[i]);
  }
}

/* Load image as fix with no-repeat */
function staticBackground (Image) {

  if (document.all || document.getElementById)
    document.body.style.background="url(Image) white center no-repeat fixed";

}

