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 display_switch(id) {
	if (document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display='block';
	}
	else {
		document.getElementById(id).style.display='none';
	}
}

function lexikon(id) {

	close_lex=0;
	if (document.getElementById(id).style.display== 'block') {
		close_lex=1;
	}
	
	document.getElementById('uhr_mechanisch').style.display='none';
	document.getElementById('icon_uhr_mechanisch').src='/images/icon_question.gif';
	document.getElementById('uhr_revision').style.display='none';
	document.getElementById('icon_uhr_revision').src='/images/icon_question.gif';
	document.getElementById('chronograph').style.display='none';
	document.getElementById('icon_chronograph').src='/images/icon_question.gif';
	document.getElementById('chronometer').style.display='none';
	document.getElementById('icon_chronometer').src='/images/icon_question.gif';
	document.getElementById('genfer_streifen').style.display='none';
	document.getElementById('icon_genfer_streifen').src='/images/icon_question.gif';
	document.getElementById('kalender').style.display='none';
	document.getElementById('icon_kalender').src='/images/icon_question.gif';
	document.getElementById('gangreserveanzeige').style.display='none';
	document.getElementById('icon_gangreserveanzeige').src='/images/icon_question.gif';
	document.getElementById('schrauben').style.display='none';
	document.getElementById('icon_schrauben').src='/images/icon_question.gif';
	document.getElementById('guillochieren').style.display='none';
	document.getElementById('icon_guillochieren').src='/images/icon_question.gif';
	document.getElementById('kleine_sekunde').style.display='none';
	document.getElementById('icon_kleine_sekunde').src='/images/icon_question.gif';
	document.getElementById('komplikation').style.display='none';
	document.getElementById('icon_komplikation').src='/images/icon_question.gif';
	document.getElementById('manufaktur').style.display='none';
	document.getElementById('icon_manufaktur').src='/images/icon_question.gif';
	document.getElementById('manufakturwerk').style.display='none';
	document.getElementById('icon_manufakturwerk').src='/images/icon_question.gif';
	document.getElementById('schwanenhals').style.display='none';
	document.getElementById('icon_schwanenhals').src='/images/icon_question.gif';
	document.getElementById('tourbillon').style.display='none';
	document.getElementById('icon_tourbillon').src='/images/icon_question.gif';
	
	if (close_lex != 1) {
		display_switch(id);
		document.getElementById('icon_'+id).src='/images/icon_question_active.gif';
	}
}

function picture_hover(id) {

	//alert(document.getElementById('picture_hover').src);
	//alert('/images/'+id);
	
	if (!id) {
		document.getElementById('picture_hover').src='/images/spacer.gif';
		ShowHideLayers('img_head_hover','','hide');
		ShowHideLayers('img_head','','show');
	}
	else if (document.getElementById('picture_hover').src == 'http://web34.escapenet.ch/images/'+id){
		document.getElementById('picture_hover').src='/images/spacer.gif';
		ShowHideLayers('img_head_hover','','hide');
		ShowHideLayers('img_head','','show');
	}
	else {
		ShowHideLayers('img_head','','hide');
		ShowHideLayers('img_head_hover','','show');
		document.getElementById('picture_hover').src='/images/'+id;
		
		//setTimeout('picture_hover()',10000);
	}
	
}




/* bild öffner */ 

function BildFenster01(bildurl,b,h,bildtitel)
{
var eigenschaften,sbreite,shoehe,fenster,b,h;

// wenn eine feste Position für die Anzeige gewünscht wird
// dann für die Variable 'FestePosition' ein "ja" eintragen
// und die X- / Y-Werte (linke obere Ecke) hier eintragen

var FestePosition = "ja";  // "ja" oder "nein" eintragen
VonLinks = 20;
VonOben = 20;

if(FestePosition == "ja") {
x = VonLinks;
y = VonOben;
} else {

// stellt die Bildschirmabmessungen fest
var ns6 = (!document.all && document.getElementById);
var ie4 = (document.all);
var ns4 = (document.layers);

if(ns6||ns4) {
sbreite = innerWidth;
shoehe = innerHeight;
}
else if(ie4) {
sbreite = document.body.clientWidth;
shoehe = document.body.clientHeight;
//shoehe = document.documentElement.clientHeight;
}

x = parseInt((sbreite-b)/2);
y = parseInt((shoehe-h)/2);

}

eigenschaften="left="+x+",top="+y+",screenX="+x+",screenY="+y+",width="+b+",height="+h+",menubar=no,toolbar=no,location=no,status=no,scrollbars=no";

fenster=window.open("","",eigenschaften);
fenster.focus();
fenster.document.open();
with (fenster) {
  document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head>');
  // geändert für Mozilla
  document.write('<scr' + 'ipt type="text/javascr' + 'ipt" language="JavaScr' + 'ipt">');
  document.write("function click() { window.close(); } ");  // bei click  schliessen
  document.write("document.onmousedown=click ");
  // geändert für Mozilla
  document.write('</scr' + 'ipt>');
  document.write('<title>'+ bildtitel +'</title></head>');
  // Zeile geändert 2003
  document.write('<body style="padding: 0px; margin: 0px; onblur: window.close();">');
  document.write('<img src="'+ bildurl +'"border="0" alt="">');
  document.write('</body></html>');
  fenster.document.close();
}
}



