function getQuerystring(key)
{
  var querystring = {};  
  if (document.location.search)
  {
    var values = location.search.substr(1).split("&"); 
    for (var i in values) 
    {
      values[i] = values[i].replace(/\+/g, " ").split("=");
      querystring[unescape(values[i][0])] = unescape(values[i][1]);
    }
  }
  if (querystring[key] == undefined )
  {
    return false;
  }
  return querystring[key];
}


function resizeWindow()
{
  window.moveTo(0,0);
  parent.resizeTo(screen.availWidth,screen.availHeight);
}


function closeWindow()
{
  window.close();
}


function printWindow()
{
  window.print();
}


function openInfoPopup(content, language)
{
	window.open("html/" + language + "/" + content + '.php',
	            "InfoPopup",
	            "width=530,height=650,directories=0,location=0,menubar=0,scrollbars=1,status=0,toolbar=0,resizable=0,left=0,top=0");
}


function openWallpaperPopup(content, language)
{
	window.open("html/" + language + "/wallpaper.php?image=" + content,
	            "InfoPopup",
	            "width=530,height=650,directories=0,location=0,menubar=0,scrollbars=1,status=0,toolbar=0,resizable=0,left=0,top=0");
}

function openNewsPopup(url)
{
	window.open(url,
	            "NewsPopup",
	            "width=670,height=750,directories=0,location=0,menubar=0,scrollbars=1,status=0,toolbar=0,resizable=0,left=0,top=0");
}

function openMotortrackPopup(url)
{
	window.open(url, "MotortrackPopup");
}

