function info(url,instance,width,height,xpos,ypos){

	if (xpos == -1 && ypos == -1) {
	xcenter=(screen.width/2)-(width/2);
	ycenter=(screen.height/2)-(height/2);
	window.open(url,instance,"toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no,width="+width+",height="+height+",left="+xcenter+",top="+ycenter+"")
	}
	else {
	window.open(url,instance,"toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no,width="+width+",height="+height+",left="+xpos+",top="+ypos+"")
	}
}

function swapImgRestore() { //v3.0
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function swapImage() { //v3.0
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; }}
  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
reloadPage(true);

function FindObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=FindObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function tmt_findObj(n){
	var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
	x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
	}else{x=document.getElementById(n)}return x;
}

function ShowHideLayers() { //v3.0A Modified by Al Sparber and Massimo Foti for NN6 Compatibility
  var i,p,v,obj,args=ShowHideLayers.arguments;if(document.getElementById){
   for (i=0; i<(args.length-2); i+=3){ obj=tmt_findObj(args[i]);v=args[i+2];
   v=(v=='show')?'visible':(v='hide')?'hidden':v;
   if(obj)obj.style.visibility=v;}} else{
  for (i=0; i<(args.length-2); i+=3) if ((obj=FindObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }}
}

function content_layer() {

	browser_version= parseInt(navigator.appVersion);
	browser_type = navigator.appName;
	
	document_offset = 320;
	
	if ((navigator.userAgent.indexOf("Win") != -1)){
	
		if (browser_type == "Netscape") {
		
		document.write(' <div id="content" style="Z-INDEX: 100; LEFT: 500px; TOP: 280px; VISIBILITY: visible; WIDTH: 450px; HEIGHT: '+(window.innerHeight-document_offset)+'px; POSITION: absolute; overflow: auto; padding-right: 20px"> ');
	
		}
		
		else {
		
		document.write(' <div id="content" style="Z-INDEX: 100; LEFT: 500px; TOP: 280px; VISIBILITY: visible; WIDTH: 450px; HEIGHT: '+(document.body.clientHeight-document_offset)+'px; POSITION: absolute; overflow: auto; padding-right: 20px"> ');
	
		}
	}
	
	if (navigator.userAgent.indexOf('Mac') != -1){
	
		if (navigator.appName.indexOf('Microsoft') != -1) {
		
		document.write(' <div id="content" style="Z-INDEX: 100; LEFT: 500px; TOP: 280px; VISIBILITY: visible; WIDTH: 450px; HEIGHT: '+(document.body.clientHeight-document_offset)+'px; POSITION: absolute; overflow: auto; padding-right: 20px"> ');
		}
		
		else {
		
		document.write(' <div id="content" style="Z-INDEX: 100; LEFT: 500px; TOP: 280px; VISIBILITY: visible; WIDTH: 450px; HEIGHT: '+(window.innerHeight-document_offset)+'px; POSITION: absolute; overflow: auto; padding-right: 20px"> ');
		
		}
	}

}

function set_content() {
	browser_version= parseInt(navigator.appVersion);
	browser_type = navigator.appName;
	
	if (browser_type == "Netscape") {
		document.getElementById('content').style.height=window.innerHeight-document_offset;
	}
	else {
		document.getElementById('content').style.height=document.body.clientHeight-document_offset;
	}
}


// fix 'click to activate' for IE
function ieupdate(){
 var strBrowser = navigator.userAgent.toLowerCase();
 if(strBrowser.indexOf("msie") > -1 && strBrowser.indexOf("mac") < 0){
  var theObjects = document.getElementsByTagName('object');
  var theObjectsLen = theObjects.length;
  for (var i = 0; i < theObjectsLen; i++) {
   if(theObjects[i].outerHTML){
    if(theObjects[i].data){
     theObjects[i].removeAttribute('data');
    }
    var theParams = theObjects[i].getElementsByTagName("param");
    var theParamsLength = theParams.length;
    for (var j = 0; j < theParamsLength; j++) {
      if(theParams[j].name.toLowerCase() == 'flashvars'){
        var theFlashVars = theParams[j].value;
      }
    }
    var theOuterHTML = theObjects[i].outerHTML;
    var re = /<param name="FlashVars" value="">/ig;
    theOuterHTML = theOuterHTML.replace(re,"<param name='FlashVars' value='" + theFlashVars + "'>");
    theObjects[i].outerHTML = theOuterHTML;
   }
  }
 }
}

window.onunload = function() {
 if (document.getElementsByTagName) {
  var objs = document.getElementsByTagName("object");
  for (i=0; i<objs.length; i++) {
   objs[i].outerHTML = "";
  }
 }
}
// end fix


function image(img) {
	
	status_height=30;
		
	NewWindow=window.open("","Picture","height=100,width=100,scrollbars=no,resizable=no,top=10,left=10");
	NewWindow.document.write ('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\n');
	NewWindow.document.write ('<html>\n');
	NewWindow.document.write ('<head>\n');
	
	NewWindow.document.write ('<script type="text/javascript" language="JavaScript" type="text/javascript">\n');
	NewWindow.document.write ('<!--\n');
	NewWindow.document.write ('function check_image() {\n');
    NewWindow.document.write ('var oH = document.images[0].height, oW = document.images[0].width;\n');
	NewWindow.document.write ('if(!oH || window.doneAlready ) { return; }\n');
	NewWindow.document.write ('window.doneAlready = true;\n');
	NewWindow.document.write ('window.resizeTo(oW+100,oH+120);\n');
	NewWindow.document.write ('}\n');
	NewWindow.document.write ('// -->\n');
	NewWindow.document.write ('</script>\n');

	NewWindow.document.write ('<title>Florian Nussbaumer Galerie</title>\n');
	NewWindow.document.write ('<link rel="stylesheet" href="/styles/styles.css">\n');
	NewWindow.document.write ('</head>\n');
	NewWindow.document.write ('<body style="background: none; background-color: #ffffff" onload="check_image();">\n');
	NewWindow.document.write ('<table cellspacing="0" cellpadding="0" border="0" style="width: 100%">\n');
	NewWindow.document.write ('<tr>\n');
	NewWindow.document.write ('<td colspan="2" align="center" style="padding: 20px 0px 0px 0px"><a href="javascript:window.close();" onMouseOver="window.status=\'Fenster schliessen\'; return true;" onMouseOut="window.status=\'\'; return true;"><img name="show_img" id="show_img" src="/images/'+img+'" border="0" alt="Fenster schliessen" title="Fenster schliessen" onload="check_image();"></a></td>\n');
	NewWindow.document.write ('</tr>\n');
	NewWindow.document.write ('</table>\n');
	NewWindow.document.write ('</body>\n');
	NewWindow.document.write ('</html>\n');
	NewWindow.document.close();
}

function galerie(url,instance,width,height,xpos,ypos){

	if (xpos == -1 && ypos == -1) {
	//xcenter=(screen.width/2)-(width/2);
	//ycenter=(screen.height/2)-(height/2);
	
	width=448;
	height=492;
	
	xcenter=100;
	ycenter=100;
	
	
	window.open(url,instance,"toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no,width="+width+",height="+height+",left="+xcenter+",top="+ycenter+"")
	}
	else {
	window.open(url,instance,"toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no,width="+width+",height="+height+",left="+xpos+",top="+ypos+"")
	}
}

