function ResizeFenster() {
		winWidth = win.document.images[0].width + 9;
		winHeight = win.document.images[0].height + 36;
		
			
		if (winWidth < 40) {
			win.resizeTo(800,600);
			// alert(winWidth + "x" + winHeight);
		}
		else {
			win.resizeTo(winWidth,winHeight);
			// alert(winWidth + "x" + winHeight); 
		}
	}
		
function nFenster(Spielname,BildURL){ 
var count = 1;
win = window.open('about:blank','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=0,top=0,height=485,width=649'); 
win.document.write('<html><head><Title>Gaming-Universe ' + Spielname +' Screengalerie<\/title><\/head><body><div id="Layer1" style="position:absolute; left:0px; top:0px;"><img src="' + BildURL +'" vspace="0" hspace="0" onClick=window.close()><\/div>'); 
win.document.write('<\/body><\/html>'); 
if (navigator.appName == "Microsoft Internet Explorer") {
	while (win.document.images[0].complete != true) {
	count++;
	if (count > 4000) break;}
}
ResizeFenster();
} 

function boxartFenster(Spielname,BildURL){  
  var nWin = window.open('about:blank','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=1,width=480,height=680,left=0,top=0');
  nWin.document.write('<html><head><title>'+Spielname+'<\/title><script type="text\/javascript">\n'+
    'function resizeWin() {\n'+
    'var oH = document.images[0].height, oW = document.images[0].width;\n'+
    'if( !oH || window.doneAlready ) { return; }\n'+ 
    'window.doneAlready = true;\n'+ 
    'var x = window; x.resizeTo( oW + 200, oH + 200 );\n'+
    'var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;\n'+
    'if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }\n'+
    'else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }\n'+
    'else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }\n'+
    'if( window.opera && !document.childNodes ) { myW += 16; }\n'+
    'x.resizeTo( oW = oW + ( ( oW + 200 ) - myW ), oH = oH + ( (oH + 200 ) - myH ) );\n'+
    '}\n'+
    '<\/script>'+
    '<\/head><body onload="resizeWin();">'+
    '<div style="position:absolute;left:0px;top:0px;display:table;">'+
    '<img src="'+BildURL+'" title="" onload="resizeWin();" onclick=window.close();>'+
    '<\/div><\/body><\/html>');
  nWin.document.close();
  return false;
}


function newFenster(Spielname,BildURL,Breite,Hoehe){ 
	
	if( BildURL.match(/boxart/i)) { 
		// Alte Funktion zum Resize...
		boxartFenster(Spielname,BildURL);
	}
    else {
		win = window.open('http://xbox360.gaming-universe.de/screen.php3?show='+ BildURL +'&title='+ Spielname +'','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=0,top=0,height=' + Hoehe + ',width=' + Breite); 
    }
}

function showdiv(div) {
  with(document.getElementById(div).style){
    if(display=="none"){
      display="inline";
    }
    else{
      display="none";
    }
  }
} 