/* JavaScript-Funktionen für FG Homepage */

news         = 'Norwegen Bypost';
																	/* wenn keine Nachricht, dann: news='Home' */ 
hrefnews     = '/laender/Norwegen/bypost/bypost.html';
																	/* wenn keine Nachricht, dann: hrefnews='body.html' */
var ebene0   = 'Hauptseite';			/* Beschreibung Home */
var link0    = 'body.html';			/* Sprungziel Home (ohne Pfad) */
var index0   = 'index.html';    /* Frameseite (ohne Pfad) */

var linkr;                      /* Sprungziel rückwärts (mit Pfad), wird 
                                           ermittelt */ 
var frameset = '';								/* Hauptseite (mit Pfad), wird ermittelt */ 
var prefix = '';                /* Anzahl ../ vor Pfad */
var winIMG;
IE4 = (navigator.appName == 'Microsoft Internet Explorer' 
				&& parseInt(navigator.appVersion) < 5) ? true : false;
var Fuss =
'<style> a.fuss {font-size:7pt; font-weight:bold; font-family:Verdana,Tahoma,Arial;}</style><center>'+
'<a class="fuss" href="javascript:JumpTo(linkr,'+"'self'"+');" title="zurück">ZUR&Uuml;CK</a> | '+
'<a class="fuss" href="javascript:JumpTo(link0,'+"'self'"+');" title="Hauptseite">HAUPTSEITE</a> | '+
'<a class="fuss" href="javascript:JumpTo(linkv,'+"'self'"+');" title="weiter">VORW&Auml;RTS</a>'
+'</center>';
var textnews = '<span style="color:red;font-family:Comic Sans MS,Verdana,Tahoma,Arial,sans-serif;font-weight:normal;">'+news+'</span>';

function hilightl(img) {
	var im = new Image();
	im.src = img;
	parent.Navi.document.imgleft.src = im.src;
}
 
function hilightr(img) {
	var im = new Image();
	im.src = img;
	parent.Navi.document.imgright.src = im.src;
}

function SetNavi (t1, h1, t2, h2, t3, h3, t4, h4, re, vt) {
	/* if (window.name == 'Noframes') return; */

	/* beim Druck in NS zurück, da sonst Meldung:Es liegen keine zu druckenden Seiten vor */
	/* es wird beim Drucken Pseudofenster mit Größe 0 aufgemacht */ 
	if (document.layers && window.innerHeight==0 && window.innerWidth==0) return;

  frameset = index0;
	if (vt > 0) {
		for(i = 1; i <= vt; i++) {
			frameset = '../' + frameset;
         		prefix = '../' + prefix;
		}    
	}

	/* wenn nicht innerhalb unseres Frameset aufgerufen, dann erst */
	/* Frameset laden und dann Seite in Body von Frameset laden */
	/* Übergabe in URL hinter ? */
	/* if(top.frames.length == 0) { */
 	if ( !(parent.Body && parent.Top && parent.Left && parent.Upleft) &&
      	window.name != 'Noframes' ) {
		/* return; */
   	/* self.location.href = "index.html"; */
   	/* self.location.replace("index.html"); */
   	self.location.replace(frameset + "?" + self.location.href); 
	}
	else {
	  gr = new Array(5);
	  var i = 0;
	  var j = 1;

	  var akt;
	  var text0 = 'Home';
	  var text1 = t1;	
	  var text2 = t2;
	  var text3 = t3;	
	  var text4 = t4;

	  var hrefr = re;
	  var hrefl;

	  var href0 = 'body.html';
	  var href1 = h1;
	  var href2 = h2;
	  var href3 = h3;
	  var href4 = h4;

	  var pfeil1;
  	var pfeil2;
	  var pfeil3;
   	var pfeil4;

	  /* if (vt == '' || vt == 'undefined') {vt = 0}; */
	  if (window.name != 'Noframes') {

	   /* aktuelle Verzeichnistiefe ab root ermitteln */
		 var vtsv = vt;
	   vt = 0;
	   var pfad = new Image();
	   var root = new Image();
	   pfad.src = 'index.html';
         /* alert("akt.Pfad=" + pfad.src);  */
	   root.src = parent.Top.location.pathname; 
	   			/* alert("Rootpfad=" + root.src);  */
	   pfad.src = pfad.src.substring(0,pfad.src.length - 10);
	   root.src = root.src.substring(0,root.src.length - 8);
	   var difflen = pfad.src.length - root.src.length;
	   if (difflen == 0) {vt = 0}
	   else {
				posdiff = pfad.src.length - difflen;
				difftext = pfad.src.substring(posdiff, pfad.src.length);
				/* hat wieviele /'s ==> Level */
				/* alert("difftext=" + difftext); */
				while (difftext.indexOf('/') != -1) {
					difftext = difftext.substring(
				 		(difftext.indexOf('/') + 1), difftext.length);
					vt = vt + 1; 
				}
				/* alert("vt=" + vt); */
	   }; 
		}
		vt = vtsv; /* pathname bei NS6 falsch ermittelt, nur Filename! */


		var pfeil     = 'xarrowr.gif';
		var pixwhite3 = '3pixgreen.gif';
		var leftgrey  = 'leftgrey.gif';
		var rightgrey = 'rightgrey.gif';
		var leftblue  = 'leftgreyh.gif';
		var rightblue = 'rightgreyh.gif';

		if (vt > 0) {
			for(i = 1; i <= vt; i++) {
				pfeil     = '../' + pfeil;
				pixwhite3 = '../' + pixwhite3;
				leftgrey  = '../' + leftgrey;
				rightgrey = '../' + rightgrey;
				leftblue  = '../' + leftblue;
				rightblue = '../' + rightblue;
			}    
		}

		pfeil = '  <img src="' + pfeil + '" width="10" height="10">  ';

		if (text1 > '') {pfeil1 = pfeil} else {pfeil1 = ''};
		if (text2 > '') {pfeil2 = pfeil} else {pfeil2 = ''};
		if (text3 > '') {pfeil3 = pfeil} else {pfeil3 = ''};
		if (text4 > '') {pfeil4 = pfeil} else {pfeil4 = ''};

	 	i = 0;
		if (text4 == '') {gr[i] = 1} else {gr[i] = j; j = j + 1};
		i = i + 1;
  	if (text3 == '') {gr[i] = 1} else {gr[i] = j; j = j + 1};
		i = i + 1;
  	if (text2 == '') {gr[i] = 1} else {gr[i] = j; j = j + 1};
		i = i + 1;
  	if (text1 == '') {gr[i] = 1} else {gr[i] = j; j = j + 1};
		i = i + 1;		
  	gr[i] = j;

    if (href1 == '') {text0 = '<font color="#bb4411">' + textnews + '</font>'; akt = 0; href0 = hrefnews; hrefr = hrefnews;}
	   else if (href2 == '') {text1 = '<font color="#bb4411">' + text1 + '</font>'; akt = 1;}
	   else if (href3 == '') {text2 = '<font color="#bb4411">' + text2 + '</font>'; akt = 2;}
	   else if (href4 == '') {text3 = '<font color="#bb4411">' + text3 + '</font>'; akt = 3;};
	   if (text4 >  '')      {text4 = '<font color="#bb4411">' + text4 + '</font>'; akt = 4;};

		if (vt > 0) {
	   	for(i = 1; i <= vt; i++) {
				href0 = '../' + href0;
				link0 = '../' + link0;
	   	}    
		}

		if      (akt == 0) {hrefl = ''} 
		else if (akt == 1) {hrefl = href0}
		else if (akt == 2) {hrefl = href1}
		else if (akt == 3) {hrefl = href2}
		else if (akt == 4) {hrefl = href3}; 

   	linkr = hrefl; 

	 	if (window.name == 'Noframes') return;

		p = parent.Top.location.href.lastIndexOf('/');
		pfad =  parent.Top.location.href.substring(0,(p+1));
		file = parent.Top.location.href.substr(p+1);
		if (file.substr(0,2) == 'e_') {
	  	parent.Top.location.replace('/top.html');	   
		}
		p = parent.Uhr.location.href.lastIndexOf('/');
		pfad =  parent.Uhr.location.href.substring(0,(p+1));
		file = parent.Uhr.location.href.substr(p+1);
		if (file.substr(0,2) == 'e_') {
	  	parent.Uhr.location.replace('/uhr.html');	   
		}
	  p = parent.Left.location.href.lastIndexOf('/');
	  pfad =  parent.Left.location.href.substring(0,(p+1));
	  file = parent.Left.location.href.substr(p+1);
	  if (file.substr(0,9) == 'e_leftmap') {
	  	parent.Left.location.replace('/leftmap.html');	   
		}	
	  if (file.substr(0,11) == 'e_leftindex') {
	  	parent.Left.location.replace('/leftindex.html');	   
		}	

		var hreflx = hrefl;
		var hrefrx = hrefr;

		if (hreflx == '') {
	   	left = '<img src="' + pixwhite3 + '" width="20" height="19" border="0" align="absmiddle">';
		}
    else {
	    left = '<a href="' + hrefl + '" onMouseover="parent.Body.hilightl(' + "'" + leftblue + "'" + ');" onMouseout="parent.Body.hilightl(' + "'" + leftgrey + "'" + ');"><img src="' + leftgrey + '" width="20" height="19" border="0" align="absmiddle" alt="ein Thema r&uuml;ckw&auml;rts" name="imgleft"></a>';
		};		
		if (hrefrx == '') {
			right = '<img src="' + pixwhite3 + '" width="20" height="19" border="0" align="absmiddle">';
		}
    else {
	   	right = '<a href="' + hrefr + '" onMouseover="parent.Body.hilightr(' + "'" + rightblue + "'" + ');" onMouseout="parent.Body.hilightr(' + "'" + rightgrey + "'" + ');"><img src="' + rightgrey + '" width="20" height="19" border="0" align="absmiddle" alt="ein Thema vorw&auml;rts" name="imgright"></a>';
		};

		var tit = parent.Body.document.title;
		var pos = tit.indexOf(':');
		if (pos != -1) tit = tit.substring(pos + 2, tit.length);     
		div = '<div style="position:absolute; top:6px; left:12px; width:200px; font-family:Verdana,sans-serif; font-size:9px; font-weight:bold; color:#bb4411">' + tit + '</div>';
		if(document.all)
				posabs = ' style="position:absolute;top:8px;left:4px;width:250px;"';
		else posabs = ''; 
		div = '<div' + posabs +'><form method="post" action="/dgssearch/search.php"><table><tr><td class="style1">Suchen</td>' + '<td><input class="style2" type="text" name="q" size="10" maxlength="50"></td><td><input class="style3" type="submit" value="OK"><input type="hidden" name="compare" value="and"></td></tr></table></form></div>';
		/* div = ''; */ 

		parent.Navi.document.close();
		parent.Navi.document.open("text/html", "replace");
/* 10pt,9,8,7,6 */
		parent.Navi.document.write(
'<html><head><base target="Body">',
'<style> a {color:#505050;text-decoration:none} ',
        'a:hover {color:#bb4411} ',	
        'a.gr1 {color:#505050;text-decoration:none;font-size:17px;font-weight:bold;font-family:Verdana,sans-serif;} ',
        'a.gr2 {color:#505050;text-decoration:none;font-size:15px;font-weight:bold;font-family:Verdana,sans-serif;} ',
        'a.gr3 {color:#505050;text-decoration:none;font-size:14px;font-weight:bold;font-family:Verdana,sans-serif;} ',
        'a.gr4 {color:#505050;text-decoration:none;font-size:12px;font-weight:bold;font-family:Verdana,sans-serif;} ',
        'a.gr5 {color:#505050;text-decoration:none;font-size:10px;font-weight:bold;font-family:Verdana,sans-serif;} ',
        'td.style1 {font-family:Verdana,sans-serif;font-size:10px;font-weight:bold;color:#bb4411;} ',
        'input.style2 {font-family:Verdana,sans-serif;font-size:11px;font-weight:normal;} ',
        'input.style3 {font-size:10px;font-weight:normal;} ',
'</style></head>',
'<body bgcolor="#d3f1dd">',
'<table align="right" width="100%" height="43"><tr><td>',
'<div align="right">',
'<a class="gr',gr[4],'" href="',href0,'">',text0,'</a>',pfeil1,
'<a class="gr',gr[3],'" href="',href1,'">',text1,'</a>',pfeil2,
'<a class="gr',gr[2],'" href="',href2,'">',text2,'</a>',pfeil3,
'<a class="gr',gr[1],'" href="',href3,'">',text3,'</a>',pfeil4,
'<a class="gr',gr[0],'" href="',href4,'">',text4,'</a>',
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
left,
right,
'&nbsp;&nbsp;&nbsp;',
'</div>',
'</td></tr></table>',
div,
'</body></html>'
		);
		parent.Navi.document.close();
		/* alert(parent.Body.treefilenew + '|' +  parent.Left.treefile); */
    if (parent.Body.treefilenew && parent.Body.treefilenew != 'NO' && parent.Left.treefile != parent.Body.treefilenew && parent.Left.location.href.indexOf('leftmap') == -1 && parent.Left.location.href.indexOf('leftindex') == -1) {
 			var pos = treefilenew.indexOf('.out');
			var treex = treefilenew.substring(0,pos + 1);
			var treeloc;
			<!--	treeloc = prefix + 'left' + treex.substring(4,treex.length) + 'html'; -->
			treeloc = prefix + 'left.html?' + treex.substring(4,treex.length - 1) + '&+';
			/*	alert(treeloc); */
			parent.Left.location.replace(treeloc); 
      /* parent.Left.location.replace(parent.Left.location.href); */
		}
		if (parent.Body.hintergrnew && (parent.Upleft.hintergr != parent.Body.hintergrnew)) {
			parent.Upleft.location.replace(parent.Upleft.location.href);
		}
		if (document.all && !window.print) {
			document.write('<a href="javascript:parent.Top.druckenIE4();" id="Druck"></a>');
		}
  }
}

function OpenSite (Seite) {
  var widthWert = screen.availWidth * 0.25;
  var heightWert = screen.availHeight * 0.8;
  var ParamWH = 'width=' + widthWert  + ',height=' + heightWert + 	      ',status=yes,resizable=yes,screenX=0,screenY=0';
  /* dependent=yes */

  var firstchar = Seite.substr(0,1);
  var restchars = Seite.substr(1,Seite.length - 1);
  firstchar = firstchar.toUpperCase();
  Target = firstchar + restchars;
  SiteMap = window.open(Seite + '.html', Target, ParamWH);
  window.setTimeout("SiteMap.focus()",200);
}
 
function JumpTo (lnk, tgt) {
  var tolink = lnk;
  var totarget = tgt;
	if (tolink != '') {
		if (totarget == 'self') {window.location.href = tolink}
 		else if (totarget == 'parent') {parent.window.location.href = tolink}
			else if (totarget == 'new') {New = window.open(tolink,'New')}
				else parent.window.location.href = tolink;
 	 } 
}

function statmess(txt){
	window.status = txt;
  setTimeout('remove_message()',2000);
}
function remove_message(){
  window.status='';
}

function date_ddmmmyy(date) {
  var d = date.getDate();
  var m = date.getMonth() + 1;
  var y = date.getYear();
  if(y >= 2000){ y -= 2000; }
  if(y >= 100) { y -= 100;  }
  return "" + (d<10?"0"+d:d) + "-" + (m<10?"0"+m:m) + "-" + (y<10?"0"+y:y);
}

function LastModified(){
  var lmd = document.lastModified;
  var s   = "Unknown";
  var d1;
  if(0 != (d1=Date.parse(lmd))) {
     s = "" + date_ddmmmyy(new Date(d1));
  }
  document.write(s);
}

function ladeBild(img,w,h,t) {
	 if (typeof w == 'undefined' || typeof h == 'undefined') {
			IMG = new Image();
			IMG.src = img;
			var w = IMG.width;
			var h = IMG.height;
	 }
	 if (!document.layers) { wplus = 60; hplus = 80; }
	 else                  { wplus = 40; hplus = 50; }
	 if (w == 0 && h == 0) {     /* NS 6 */ 
			ww = 400; hh = 350;
			wi = ' '; hi = ' '; 
	 }            
	 else {
			ww = w + wplus; hh = h + hplus;                  
			wi = ' width=' + w; hi = ' height=' + h; 
	 }
	 if (typeof t == 'undefined') t = 'Bild';
   var ParamWH = 'width='+ww+',height='+hh+',status=no,scrollbars=yes,resizable=yes,screenX=0,screenY=0,left=0,top=0';
	 window.setTimeout("winIMG.resizeTo(ww,hh)", 200);
   winIMG = window.open('', 'Bildfenster', ParamWH);
	 /* style = ' style="position:absolute; top:0px; left:0px;"'; */
	 style = ' ';
   winIMG.document.writeln('<html><title>'+t+'</title><body><table align="left"><tr><td align="left" valign="top"><img'+style+'name="Bild" id="Bild"'+wi+hi+' src="', img, '" ></td></tr></table></body></html>');
	 winIMG.document.close();
   window.setTimeout("winIMG.focus()", 200);
}

function em(suf, dm, name) {
link = 'm'+'a'+'i'+'l'+'t'+'o'+':' + name + '%40' + dm + '.' + suf;
location.href = link;
}

