/*
########################################
---------------------------------------
 (c)2003 Author: Yves Landert Sota AG
---------------------------------------
#######################################  
*/

// FixCssBrowserPlattform

var pfad = "";

	if (navigator.appName.indexOf("Netscape") >= 0 & navigator.userAgent.indexOf("Mac") >= 0) {
		pfad = "css/style_ns_mac.css";
		}
		else if (navigator.appName.indexOf("Explorer") >= 0 & navigator.userAgent.indexOf("Mac") >= 0) {
			pfad = "css/style_ie_mac.css";
		}
		else if (navigator.appName.indexOf("Netscape") >= 0 & navigator.userAgent.indexOf("Win") >= 0) {
			pfad = "css/style_ns.css";
		}
	else {
		pfad = "css/style.css";
		}
		
	document.write('<link rel="stylesheet" type="text/css" href="' + pfad + '">');
	

// Datum und Uhrzeit
   var myTimer = null;

 function makeTag() {
          return this;
	    }
	
 function makeMonat() {
		  return this;
	    }
  
	function zeigeDatum(){
		
		var now   = new Date();
		var tag   = now.getDay();
		var monat = now.getMonth();
		var jahr  = now.getFullYear();
		
	// wenn datum kleiner als zehn, dann null vorne hin		       
		var date = now.getDate();
              if(date < 10) date = "0" + date;
		
		var tagArray = new makeTag();
			tagArray[0] = "SONNTAG";
			tagArray[1] = "MONTAG";
			tagArray[2] = "DIENSTAG";
			tagArray[3] = "MITTWOCH";
			tagArray[4] = "DONNERSTAG";
			tagArray[5] = "FREITAG";
			tagArray[6] = "SAMSTAG";
		
		var monatArray = new makeMonat();
			  monatArray[0]="JANUAR";
			  monatArray[1]="FEBRUAR";
			  monatArray[2]="MÄRZ";
			  monatArray[3]="APRIL";
			  monatArray[4]="MAI";
			  monatArray[5]="JUNI";
			  monatArray[6]="JULI";
			  monatArray[7]="AUGUST";
			  monatArray[8]="SEPTEMBER";
			  monatArray[9]="OKTOBER";
			  monatArray[10]="NOVEMBER";
			  monatArray[11]="DEZEMBER";
				
		var jTag    = tagArray[tag];
		var month   = monatArray[monat];
		
		var datum = "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr valign='top'><td width='32' class='uhr'>Datum:</td>"+
		"<td align='right' class='uhr'><font color='#ffb400'>"+ date  + ". " + month + " " + jahr+"</font></td>"+
		"<td><img src='img/blind.gif' width='4' height='1'></td>"+
		"<td class='uhr'>Tag:</td>"+
		"<td align='right' class='uhr'><font color='#ffb400'>" +jTag+"</font></td></tr></table>";
		
		//document.clock.date.value = datum;
		document.write(datum);
		}
		
		
	function starteZeit(ort) {
		
		var ort = null;
		var zeitzone = null;
		var now = new Date();
			
        if(document.clock.ort.value == "london"){
		   zeitzone = -1;
		   }
		     if(document.clock.ort.value == "ny"){
		   zeitzone = -6;
		   }
		     if(document.clock.ort.value == "la"){
		   zeitzone = -9;
		   }
		    if(document.clock.ort.value == "tokio"){
		   zeitzone = 7;
		   }
		    if(document.clock.ort.value == "moskau"){
		   zeitzone = 2;
		   }
		   if(document.clock.ort.value == "zuerich"){
		   zeitzone = 0;
		   }
		    		
		
		var hours = now.getHours() + (zeitzone);
		//hours += zeitzone;
        var minutes = now.getMinutes();
        var seconds = now.getSeconds();
		
			
		if (hours < 0) hours+=24;
					if (hours > 23) hours-=24;
					
				var	hour2 = hours;
					if (hour2 == 0) hour2=12;
					
		   
        StundenValue =  ((hour2 < 10) ? "0" : "") + hour2;
        MinutenValue = ((minutes < 10) ? "0" : "") + minutes;
        SekundenValue = ((seconds < 10) ? "0" : "") + seconds;
		
		
        document.clock.stunden.value = StundenValue;
		document.clock.minuten.value = MinutenValue;
		document.clock.sekunden.value = SekundenValue;
	
        myTimer = setTimeout("starteZeit()",1000);
    }
  
  function writeCountry(country) {
        document.clock.ort.value=country;
       }
  
  function resetValues(){
  	document.clock.name.value = "";
	document.clock.vorname.value = "";
	document.clock.email.value = "";
	document.clock.firma.value = "";
	document.clock.telefon.value = "";
	document.clock.url.value = "http://";
	document.clock.text.value = "";
  }
  
  
   function submitValues() {
     document.clock.submit();
   }
  
 
// BrowserFenster zentriert oeffnen
var win = null;

	function NuWin(url,myname,w,h,scroll) {
	
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition  = (screen.height) ? (screen.height-h)/2 : 0;
	settings     = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,no'
	
	win = window.open(url,myname,settings)
	
	if(win.window.focus) {
	   win.window.focus();
	}
}
 
 function schliessen(){
 	window.close();
 }
 
  
   // Fenster auf Fullscreen und x=0, y=0 setzen
 function fullscreen() {		
		window.moveTo(0,0);
		
		if (document.all) {
			window.resizeTo(screen.availWidth,screen.availHeight);
		} 
		else if (window.outerHeight < screen.availHeight || window.outerWidth<screen.availWidth) {
					window.outerHeight = screen.availHeight;
					window.outerWidth  = screen.availWidth;
					}	
  }
  
  
  /* Set und check default Text in Formularseiten*/
  var defaultText = "Schreiben Sie hier Ihren Mailtext";
		
	function setDefText(){
			var theField = document.clock.text;
			theField.value = defaultText;		  
	}
		
	function checkDefText(){
		 var f = document.clock.text;
		 
		 if(f.value != defaultText){
			 f.value;
		  } else {
		   f.value = "";
		  }
	}