/**
 * Dateiname       : javascript/mainframe.js
 * Erzeugungsdatum : 12.01.2009
 * Autor           : Carsten Kube
 * Version         : 1.0
 * Letzte Akt.     : 30.07.09 (JH)
 * 
 * (c) Copyright SECRA GmbH
 */

/*globals Calendar, Handler, exp, secra */

var allowedChars;

function installCalendar() {
  var year = new Date().getFullYear();
  Calendar.setup({"inputDisplayArea":"secraanreise",
                  "inputField":"secradatumA",
                  "button":"anreisebtn",
                  "range":[year,year+2]
  });
  Calendar.setup({"inputDisplayArea":"secraabreise",
                  "inputField":"secradatumB",
                  "button":"abreisebtn",
                  "range":[year,year+2]
                });
  allowedChars = ['0','1','2','3','4','5','6','7','8','9','.'];
  (new secra.InputFilter(allowedChars, "secraanreise"));
  (new secra.InputFilter(allowedChars, "secraabreise"));
  window.secradatum = document.getElementById("secradatumB");
  window.secradatumA = document.getElementById("secradatumA");
  
  Handler.add(document.getElementById("abreisebtn"), 'mouseover', setStartDateIfEmpty);
}

function setStartDateIfEmpty(e){
	if(window.secradatum.value == '' || window.secradatum.value == null){
		window.secradatum.value = window.secradatumA.value;
	}
};


Handler.add(window,"load", installCalendar);


function printWindow() {
  Browser = parseInt(navigator.appVersion);
  if(Browser >= 4) {
    window.print();
  }
}

function FontSize1 () {
  document.getElementById("content").style.fontSize = "125%";
  document.getElementById("content").style.lineHeight = "130%";
}

function FontSize0 () {
  document.getElementById("content").style.fontSize = "100%";
  document.getElementById("content").style.lineHeight = "150%";
}

