<!--
// Browserdefinitionen
NS4=false;
IE4=false;
NS6=false;
if(document.layers) NS4=true;
if(document.all) IE4=true;
if(document.getElementById) NS6=true;	
	
// Funktion startet direkt aufgerufenen Seiten mit Rahmenansicht
if ( (self.location.pathname!="/page.php") && (self.location.pathname!="/search.php") && (self.location.pathname!="/sitemap.php") ) {
	page = self.location.pathname;
	weblicdat = page.indexOf("wTmp"); // wird Datei aus Weblication aufgerufen?
	if (weblicdat<0) {
/*		if (self.name != "DOMAINFRAME") window.top.location.href = '/?page='+page;
		else {*/
			url = '/page.php?page='+page;
			self.location.replace(url);
//		}
	}
}
/*else if ((self.location.pathname=="/page.php") && (self.name!="DOMAINFRAME")) {
	page = self.location.search;
	url = '/'+page;
	top.location.replace(url);
}*/

// Navigations- und Seitenaufruf
function showNavpoint(id, url){
	if(url != ""){
		self.location.href = "/page.php?page="+url+"&amp;navid="+id;
//		self.location.href = url;
	}
}

function showNavpoint1(id, url){
	if(url != ""){
		self.location.href = "/page.php?page="+url+"&amp;navid2="+id;
//		self.location.href = url;
	}
}

/*------------------------------------------------------------
	Document Text Sizer- Copyright 2003 - Taewook Kang.  All rights reserved.
	Coded by: Taewook Kang (txkang.REMOVETHIS@hotmail.com)
	Web Site: http://txkang.com
	Script featured on Dynamic Drive (http://www.dynamicdrive.com)
	
	Please retain this copyright notice in the script.
	License is granted to user to reuse this code on 
	their own website if, and only if, 
	this entire copyright notice is included.
--------------------------------------------------------------*/
/*
//Specify affected tags. Add or remove from list:
var tgs = new Array( 'div' , 'p');

//Specify spectrum of different font sizes:
var szs = new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );
//var startSz = 2;

function ts( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;

	sz = inc;
/*	sz += inc;*/
/*	if ( sz < 0 ) sz = 0;
	if ( sz > 6 ) sz = 6;
	startSz = sz;

	if (NS6 && !IE4) sz++;		
	
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
}
*/
// Funktion zum öffnen der Druckansicht im PopUp-Fenster
function drucken(page)
{
	url = "/druck.php?page="+page;
	window.open(url,'Druckansicht','width=480,height=550,scrollbars=yes,toolbar=no');
}

// Funktion zum öffnen eines Formulars, über das eine Seite versendet werden kann
function senden(page)
{
	url = "/send.php?page="+page;
	window.open(url,'Seitesenden','width=570,height=550,scrollbars=yes,toolbar=no');
}

// Funktion zum Bookmark setzen
function bookmark(page)
{
	bookmarkurl="http://www.stadtwerke-sigmaringen.de/page.php?page="+page;
	bookmarktitle=document.title;
	if (document.all) {
		window.external.AddFavorite(bookmarkurl,bookmarktitle)
	} else alert("STRG + D drücken"); 
}	

// Funktionen zum Aufruf von PopUp-Fenstern

function openFormcenter(service,email){
w=800;
h=600;
url="/formcenter.php?service="+service+"&email="+email;
popup = window.open(url, 'PopUp1', 'width='+w+',height='+h+',toolbar=yes,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');
//popup.resizeTo(w, h);
popup.focus();
}
function openFormcenterSchulbus(){
w=800;
h=600;
url="/formcenter.php?service=schulbus&email=";
popup = window.open(url, 'PopUp1', 'width='+w+',height='+h+',toolbar=yes,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');
//popup.resizeTo(w, h);
popup.focus();
}

function PopUp(url,w,h)
{
h=h+70;
w=w+50;
popup = window.open(url, 'PopUp2', 'width='+w+',height='+h+',scrollbars=yes,resizable=yes');
popup.resizeTo(w, h);
popup.focus();
}

function openWin(url,w,h){
popup = window.open(url, 'PopUp3', 'width='+w+',height='+h+',toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes');
}

function openShop(artnr) {
url="/shop/warenkorb.php";
if (artnr!="") url="/shop/produkt.php?SHOPArtnr="+artnr;
popup = window.open(url, "PopUp4", "top=30,left=50,width=750,height=650,scrollbars=1,resizable=1,status=yes");
popup.focus();
}

// PopUp-Funktion für Routenplaner
function openRoute(url) {
popup = window.open(url,'Anfahrt','width=652,height=540,location=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=yes');
}

// Bei IE für schöne Optik sorgen
function formOptik() {
	if (document.all) {
	 for (var _i=0; _i < document.forms[1].length; _i++) {
	  if ((document.forms[1].elements[_i].type=="button") || (document.forms[1].elements[_i].type=="submit") || (document.forms[1].elements[_i].type=="reset")) document.forms[1].elements[_i].className="formbutton";
  	  else if (document.forms[1].elements[_i].type!="hidden") document.forms[1].elements[_i].className="formfelder"; 
	 }
	}
}

function initLook() {
// Bei IE für schöne Optik sorgen
	if (document.all) {
	 var s = document.getElementsByTagName('input');
	 for (i=0; i < s.length; i++) {
	  if (s[i].type=="image") s[i].className=""; 
  	  else if ((s[i].type=="button") || (s[i].type=="submit") || (s[i].type=="reset")) s[i].className="formbutton";
	  else if (s[i].className=="") s[i].className="formfelder"; 
	 }
	}
	
// Damit Seite 100 % Höhe von Fenster
	if (IE4) {
		if (document.body.scrollHeight < document.body.offsetHeight) winh = document.body.offsetHeight - 92;
		else winh = document.body.scrollHeight - 44;
		if (winh<400) winh=400;
		document.all.mitte.style.height = winh;
		document.all.mitte.style.visibility = "visible";
	}
	else {
		if (document.body.scrollHeight <= window.innerHeight) winh = window.innerHeight - 92;
		else winh = document.body.scrollHeight - 51;
		if (winh<400) winh=400;
		if (NS4) {
			document.layers['mitte'].height = winh;
			document.layers['mitte'].visibility = "show";
		}
		if (NS6) {
			document.getElementById('mitte').style.height = winh;
			document.getElementById('mitte').style.visibility = "visible";
		}
    }

// Schriftgröße übernehmen
//	ts('body',startSz);

// Teaser-Höhe anpassen
/*	if (IE4) {
		teaserh1 = document.all.teaserbild.style.height;
		teaserh2 = document.all.teasertext.style.height;
		alert(teaserh1+" "+teaserh2);
		teaserh = Math.max(teaserh1,teaserh2);
		document.all.teaserbild.style.height = teaserh;
		document.all.teasertext.style.height = teaserh;
	}
	else if (NS6) {
		teaserh1 = document.getElementById('teaserbild').style.height;
		teaserh2 = document.getElementById('teasertext').style.height;
		alert(document.getElementById('teaserbild').style.height+" "+teaserh2);
		teaserh = Math.max(teaserh1,teaserh2);
		document.getElementById('teaserbild').style.height = teaserh;
		document.getElementById('teasertext').style.height = teaserh;
	}*/
}

// Cookie-Funktionen
function WertHolen() {
 var Wert = "";
 if(document.cookie) {
  var Wertstart = document.cookie.indexOf("=") + 1;
  var Wertende = document.cookie.indexOf(";");
  if (Wertende == -1) Wertende = document.cookie.length;
  Wert = document.cookie.substring(Wertstart,Wertende);
 }
 return Wert;
}

function WertSetzen(Bezeichner, Wert, Verfall) {
 var jetzt = new Date();
 var Auszeit = new Date(jetzt.getTime() + Verfall);
 document.cookie = Bezeichner+"="+Wert+"; expires="+Auszeit.toGMTString()+";";
}

function Laden() {
 var Checkstr = WertHolen();
 var Check = "";
 if (Checkstr != "") {
  for (var i=0; i < Checkstr.length; i++) {
   Check = Checkstr.substring(i,i+1);
   if (Check == "1") document.forms['checkliste'].elements[i].click();
  }
//  alert("Ihre gespeicherten Daten wurden geladen!\n");
 }
}

function Speichern() {
 var Verfallszeit = 1000*60*60*24*365; // 1 Jahr
 var Checkstr = "";
 var Check = "";
 for (var i=0; i < document.forms['checkliste'].length; i++) {
  if (document.forms['checkliste'].elements[i].checked) Check = "1";
  else Check = "0";
  Checkstr += Check;
 }
 WertSetzen("Checkstr",Checkstr,Verfallszeit);
}

// Navi neu positionieren bei Resize NS + IE
	onresize=function(){location.reload();}


//-->

