// J. Rathlev - physik.uni-kiel.de, May 2006
// Javascript routines

// Decode mail address
function Decode (Name,Text) {
  var ac=Text.split(":"); var s="";
  for(i=1;i<ac.length;++i){s+=String.fromCharCode(Number(ac[i])^(Number(ac[0])));}
  document.write('<a href="mailto:' + s + '">'+Name+'</a>');
  }

// insert date of last modification
function LastModDeu (Text) {
	 var d = new Date(document.lastModified);
	 var Monat = new Array("Jan.","Feb.","Mrz.","Apr.","Mai","Jun.","Jul.","Aug.","Sep.","Okt.","Nov.","Dez.");
	 var j =d.getYear()
	 if (j<1900) j+=1900
	 document.write("letzte Änderung: "+d.getDate()+". "+Monat[d.getMonth()]+" "+j+Text);
  }
  
function LastModEnu (Text) {
	 var d = new Date(document.lastModified);
	 var Monat = new Array("Jan.","Feb.","Mar.","Apr.","May","Jun.","Jul.","Aug.","Sep.","Oct.","Nov.","Dec.");
	 var j =d.getYear()
	 if (j<1900) j+=1900
	 document.write("Last modified: "+d.getDate()+". "+Monat[d.getMonth()]+" "+j+Text);
  }

// Change two frames
function ChangeFrames(URL1,URL2) {
 parent.frames[1].location.href=URL1;
 parent.frames[3].location.href=URL2;
 }

// Extract path name from UrlName
function ExtractPath (UrlName) {
  var ac=UrlName.split("/"); var s="";
  for(i=0;i<ac.length-1;++i){s+=ac[i]+"/"};
	 return s;
	 }

function SubPath (UrlName) {
  var ac=UrlName.split("?"); 
//  if (ac.length>1) s=ac[1]
//  else 
  s=ac[0];
  return s;
  }
  
function ShowDoc (Datei,Width,Height) {
//    Width=Width+20
//    Height=Height+20
  var s = "top=100,left=200,width="+Width+",height="+Height+",scrollbars=no,resizable=no";
  imagew = window.open(Datei,"Bildfenster",s);
  }
  
function ShowText (Datei,Width,Height) {
  var s = "top=100,left=200,width="+Width+",height="+Height+",scrollbars=yes,resizable=no";
  imagew = window.open(Datei,"Bildfenster",s);
  }
  
function ShowFrameImg (Path,Attr) {
// load image from top location if this page is part of a frame
  var s=SubPath(top.location.href);
  if(top.frames.length > 0)
    document.write('<img src="'+ExtractPath(s)+Path+'" '+Attr+' border="0">')
  else
    document.write('<img src="'+Path+'" '+Attr+' border="0">');
  }

function LoadStyles (StName) {
// load styles from top location if this page is part of a frame 
  var s=SubPath(top.location.href);
  if(top.frames.length > 0) 
    document.write('<link rel=stylesheet type="text/css" href="'+ExtractPath(s)+StName+'">');
  }
  
function ShowImage(Image,Width,Height) {
//        Width=Width+20
//        Height=Height+20
//        ImageW = window.open("","ImgWin","height="+Height+",width="+Width+",status=no,toolbar=no,menubar=no,directory=no")
  ImageW = window.open("","ImgWin","height="+Height+",width="+Width+",scrollbars=no,resizable=no")
  ImageW.document.open()
  ImageW.document.writeln('<HTML> <HEAD> <TITLE>'+Image+'<\/TITLE><\/HEAD>')
  ImageW.document.writeln('<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">')
  ImageW.document.writeln('<IMG SRC='+Image+'>')
  ImageW.document.writeln('<\/BODY><\/HTML>')
  ImageW.document.close()
  }

function ShowInfo(title,authors,abstrtext) {
  abstractw = window.open("","abstwin","top=100,left=200,height=500,width=650,status=no,toolbar=no,menubar=no,directory=no")
  abstractw.document.open()
  abstractw.document.writeln('<HTML><HEAD><TITLE>Beschreibung<\/TITLE><\/HEAD>')
  abstractw.document.writeln('<BODY style="font-family:arial;font-size:10pt;"><B>'+title+'<\/B><BR>')
  abstractw.document.writeln('<I>Autor: '+authors+'<\/I><BR>')
  abstractw.document.writeln('<P style="font-size:0.9em;text-align:justify;">'+abstrtext+'<\/P>')
  abstractw.document.writeln('<P style="text-align:right;"><A HREF="javascript:self.close()" ><img src="images/exit.gif" width="36" height="36" border="0" alt="Close" align="right"><\/A>')
  abstractw.document.writeln('<\/BODY><\/HTML>')
  abstractw.document.close()
  }

function ShowSummary(title,authors,location,abstrtext) {
  abstractw = window.open("","abstwin","top=100,left=200,height=550,width=650,status=no,toolbar=no,menubar=no,directory=no")
  abstractw.document.open()
  abstractw.document.writeln('<HTML> <HEAD> <TITLE>Summary<\/TITLE><\/HEAD>')
  abstractw.document.writeln('<BODY style="font-family:arial;font-size:10pt;"><CENTER><B>'+title+'<\/B><BR>')
  abstractw.document.writeln('<I>'+authors+'<\/I><BR>')
  abstractw.document.writeln(location+'<\/CENTER>')
  abstractw.document.writeln('<P style="font-size:0.9em;text-align:justify;">'+abstrtext+'<\/P>')
  abstractw.document.writeln('<P style="text-align:right;"><A HREF="javascript:self.close()" ><img src="images/exit.gif" width="36" height="36" border="0" alt="Close" align="right"><\/A>')
  abstractw.document.writeln('<A HREF="javascript:self.print()" ><img src="images/printer.gif" width="36" height="36" border="0" alt="Print" align="right"><\/A><\/P>')
  abstractw.document.writeln('<\/BODY><\/HTML>')
  abstractw.document.close()
  }
