/* default */

function preloadImage(imgObj, imgSrc) 
{
	if ( document.images ) 
	{
		eval (imgObj+' = new Image()');
		eval (imgObj+'.src = "'+imgSrc+'"');
	}
}

function changeImage(imgName, imgObj) 
{
	if ( document.images ) 
	{
		document.images[imgName].src = eval (imgObj+".src");
	}
}

function winOpen(url, myname, w, h) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no,status=no,toolbar=no'; 
	win = window.open(url, myname, winprops);
}



// Browser detection
function checkBrowser() {

  var detect = navigator.userAgent.toLowerCase();
  var browser;
  
  if(checkIt('konqueror'))    browser = "Konqueror"
  else if (checkIt('safari')) browser = "Safari"
  else if (checkIt('firefox')) browser = "Firefox"
  else if (checkIt('omniweb')) browser = "OmniWeb"
  else if (checkIt('opera')) browser = "Opera"
  else if (checkIt('webtv')) browser = "WebTV";
  else if (checkIt('icab')) browser = "iCab"
  else if (checkIt('msie')) browser = "Internet Explorer"
  else if (!checkIt('compatible')) browser = "Netscape Navigator"
  
  /*
  if(browser == "Konqueror" || browser == "Safari" || browser == "Firefox" || browser == "Mozilla" || browser == "OmniWeb" || browser == "Opera" || browser == "WebTV" || browser == "iCab" || browser == "Netscape Navigator")
    document.write("<link rel='stylesheet' type='text/css' href='http://www.ego-games.de/v2/css/menu_ff.css' />");
  if(browser == "Internet Explorer")
    document.write("<link rel='stylesheet' type='text/css' href='http://www.ego-games.de/v2/css/menu_ie.css' />");
  else
    document.write("<link rel='stylesheet' type='text/css' href='http://www.ego-games.de/v2/css/menu_ff.css' />");
  */
  
  if(browser == "Safari") {
    document.getElementById("stylesheet").href = "css/screen_safari.css";
    //document.write('<link id="stylesheet" rel="stylesheet" media="screen" type="text/css" href="css/screen_safari.css" />');
  }
  
  function checkIt(string)
  {
       place = detect.indexOf(string) + 1;
       thestring = string;
       return place;
  }
}