// Preload function - call onload (bottommenu images, koenigsegg engineering)
function doPreload()
{
	if(document.images)
	{
		var the_images = new Array(
		'/graphics/topmenu_home_on.gif',
		'/graphics/topmenu_gameinfo_on.gif',
		'/graphics/topmenu_download_on.gif',
		'/graphics/topmenu_community_on.gif');
		preloadImages(the_images);
	}
}
function preloadImages(the_images_array) {
  
	for(loop = 0; loop < the_images_array.length; loop++)
	{
   		var an_image = new Image();
		an_image.src = the_images_array[loop];
	}
}
// Change function

function change(img,on,msg)
{ 
	if(document.images)
	{
		var image = "/graphics/" + img + ((on)?'_on.gif':'_off.gif');
		document.images[img].src= image;
		status = msg;
		return true;
	}
}


function openWindowcenter(url, name, height, width) {
  var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;

    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
  }
  window.open(url, name, str);
}

function openWindowcenterscroll(url, name, height, width) {
  var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;

    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
    str += ",scrollbars=1"
  }
  window.open(url, name, str);
}