// dank an quirksmode.org

function browserinit( relpath){	
	  var x,y;
	  if (self.innerHeight) // all except Explorer
	  {
		  x = self.innerWidth;
		  y = self.innerHeight;
	  }
	  else if (document.documentElement && document.documentElement.clientHeight)
	  // Explorer 6 Strict Mode
	  {
		  x = document.documentElement.clientWidth;
		  y = document.documentElement.clientHeight;
	  }
	  else if (document.body) // other Explorers
	  {
		  x = document.body.clientWidth;
		  y = document.body.clientHeight;
	  }

	  // Abstände an die Auflösung anpassen 
	  // Standartwerte bei 1024x768
	  Abstand ="0";
	  BG ="mika-fotografie-bg570.gif";
	  footerheight ="55";
	  boxfooterheight ="35";
	  footerlinkheight ="30";
	  
	  if ( y > 620) {		// größer als 1024x768 oder 1280x768 	
		  Abstand ="20";	
		  BG ="mika-fotografie-bg.gif";
		  footerheight ="95"
		  boxfooterheight ="55";
		  footerlinkheight ="50";
	  }

	  if ( y > 800) {		// größer als 1024x768 oder 1280x768 	
		  Abstand ="60";	
		  BG ="mika-fotografie-bg800.gif";
	  }

	  Abstandlinks ="0";
	  if (x > 1226) {
		margin =Math.round(((x -1226)/2) *0.7);
		if (margin <0) margin =0;
		if (margin >130) Abstandlinks ='130px';
		else Abstandlinks =margin +'px';
	  }
		
//	  alert(Abstandlinks);	
//	  alert(x);alert(y);
//	  alert('background-image:url('+ relpath +'fotograf-berlin/img/' + BG);

	  document.writeln('<style type="text/css">');
	  document.writeln('<!--');
	  document.writeln('.header { margin-top: '+ Abstand+'px;}');
	  document.writeln('.container { margin: 0 '+ Abstandlinks +'}');
	  document.writeln('body { background-image:url('+ relpath +'fotograf-berlin/img/' + BG + ');}');
	  document.writeln('.footer { height: '+ footerheight+'px;}');
	  document.writeln('.boxfooter, .boxfooterfill { height: '+ boxfooterheight+'px;}');
	  document.writeln('a.footerlink:link, a.footerlink:visited{ height: '+ footerlinkheight+'px;}');
	  document.writeln('-->');
	  document.writeln('</style>');
}

function fooderinit(targetID) {
	color ="#FFF";
	background= "#BBB";

	if (document.getElementById){
		document.getElementById(targetID).style.color = color;
		document.getElementById(targetID).style.background = background;	
	}
}

function bloginit(targetID, footerboxen) {
	color ="#FFF";
	background= "#BBB";

	if (document.getElementById){
		document.getElementById(targetID).style.color = color;
	}

	maxboxen =15;				/* max große Boxen */
	boxbigwidth =303,			/* breite große Box + Rand*/
	boxrand =13 +15;
	footerboxfillwidth ="0px";	/* keine extra Fooderbox */

	if ((footerboxen >4) && (footerboxen < maxboxen)) {
		footerboxfillwidth =((footerboxen -4) *boxbigwidth) -boxrand;

	  document.writeln('<style type="text/css">');
	  document.writeln('<!--');
	  document.writeln('.boxfooterfill { width: '+ footerboxfillwidth+'px; padding:0 0 0 15px;}');
	  document.writeln('-->');
	  document.writeln('</style>');

	if ( footerboxen > 5) {
	  document.writeln('<style type="text/css">');
	  document.writeln('<!--');
	  document.writeln('.boxfooterfill { color :#FFF;}'); /* Text "mehr >>" sichtbar machen */
	  document.writeln('-->');
	  document.writeln('</style>');
		
	}


	}
}


