ie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ));
ns4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4 ));

var mac = navigator.appVersion.lastIndexOf("Macintosh"); // Abfrage fuer Mac mit IE
if (mac != -1){
if (ns4) // Abfrage fuer Mac mit NS
document.write("<link rel=stylesheet href=/stylens_mac.css type=text/css>");
if (ie4) // Abfrage fuer Mac mit IE
document.write("<link rel=stylesheet href=/style_mac.css type=text/css>");
}
else{
if (ns4) // Abfrage fuer PC mit NS
document.write("<link rel=stylesheet href=/stylens.css type=text/css>");
if (ie4) // Abfrage fuer PC mit IE
document.write("<link rel=stylesheet href=/style.css type=text/css>");
}

//-- Hotel popup fenster

function popup(){
var win = window.open("/hotelbuchung/index.html","hotel","toolbar=no,menubar=no,resizable=yes,scrollbars=yes,top=10,left=10,width=665,height=500");
}

//-- Hotelbuchung

function buchen(objekt){

pop = window.open(objekt,'buchung','status=yes,scrollbars=yes,width=685,height=500');

 if (pop != null) {
                if (pop.opener == null) {
                        pop.opener = self;
                        }
                pop.location.href = suche;
				  setTimeout("if (pop) pop.focus();",10);
}
}

//pfeil bewegung

ok	= document.images;
			if (ok) 
			{
				on		= new Image(); 
				on.src	= "/pics/pfeil.gif"; 
				off		= new Image(); 
				off.src	= "/pics/null.gif";
			}
			
			function an(n) 
			{
				if (ok) 
				{
					document[n].src	= eval("on.src");
				}
			}
		
			function aus(n)
			{
				if (ok) 
				{
					document[n].src	= eval("off.src");
				}
			}

function reload(){
window.opener.location.href = "../../guestbook";
setTimeout(window.close, 1000);
}


// check ob richtige begriffe eingageben sind

function keinleerzeichen(str) {
var out = "", flag = 0;
for (i = 0; i < str.length; i++) {
if (str.charAt(i) != " ") {
out += str.charAt(i);
flag = 0;
}
else {
if(flag == 0) {
out += "+";
flag = 1;
      }
   }
}
return out;
}

function chk()
{
 if(document.zielsuche.suche.value == "")
  {
 alert("Geben Sie einen Begriff ein!");
   return false;
  }
}
// Radio button für Auflösung-umschaltung

ie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ));
ns3 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 ));

if (ns3 || ie4) {
preload();
}

function preload() {

    bilder = new Array();
    bilder[0] = "/pics/checked.gif";
    bilder[1] = "/pics/unchecked.gif";
    
    im = new Array();
for (var i = 0; i < bilder.length; i++){
       im[i] = new Image();
       im[i].src = bilder[i];

        }
        
}

function radiobutton(num1,imgname1) {
  if (ns3 || ie4) {
        
        imgname1.src = im[num1].src;        
  }
}




//-- Modi umschalten
mode = 1;
function umschalten(input) {
mode = input;
}


//-- frame main auswahl

function openframe(seite) {
if (!seite ==""){
//top.headline.location.href = headline
top.location.href = seite;
}
}

//-- Card auswahl

function cardeingabe(seite) {
weiter = "/e-cards/index.php3?full=1&in=1"+seite;
window.location.href = weiter;
}

//-- main auswahl

function openpage(seite) {
if (!seite ==""){
window.location.href = seite;
}
}

//-- popup wetter

function wetterpopup(region){

wetter = "/" + region;

wetterpop = window.open(wetter,"wetter","toolbar=no,status=yes,menubar=no,resizable=no,scrollbars=yes,top=10,left=10,width=524,height=570");

 if (wetterpop != null) {
                if (wetterpop.opener == null) {
                        wetterpop.opener = self;
                        }
                wetterpop.location.href = wetter;
				  setTimeout("if (wetterpop) wetterpop.focus();",10);
}
}

//-- popup Teaser

function teaserpopup(teaser){

seite = "/impressum/" + teaser;

teaserpop = window.open(seite,"teaser","toolbar=no,status=yes,menubar=no,resizable=no,scrollbars=yes,width=540,height=500");

 if (teaserpop != null) {
                if (teaserpop.opener == null) {
                        teaserpop.opener = self;
                        }
                teaserpop.location.href = seite;
				  setTimeout("if (teaserpop) teaserpop.focus();",10);
}
}
//-- popup e-card

function epopup(card){

showcard = card;

cardpop = window.open(showcard,"frage","toolbar=no,status=yes,menubar=no,resizable=no,scrollbars=no,top=10,left=10,width=665,height=460");

 if (cardpop != null) {
                if (cardpop.opener == null) {
                        cardpop.opener = self;
                        }
                cardpop.location.href = showcard;
				  setTimeout("if (cardpop) cardpop.focus();",10);
}
}

//-- popup suche

function popupsuche(menusuche){

suche = "/"+menusuche;

pop = window.open(suche,'fulltext','status=yes,scrollbars=yes,width=685,height=500');

 if (pop != null) {
                if (pop.opener == null) {
                        pop.opener = self;
                        }
                pop.location.href = suche;
				  setTimeout("if (pop) pop.focus();",10);
}
}

///-- popup fenster

function popupfenster(menu){

lowversion = "/popups/"+menu+".html";
highversion = "/popups/"+menu+"high"+".html";

 if (mode == "1"){
pop = window.open(lowversion,'fulltext','status=yes,scrollbars=yes,width=685,height=510');

 if (pop != null) {
                if (pop.opener == null) {
                        pop.opener = self;
                        }
                pop.location.href = lowversion;
				  setTimeout("if (pop) pop.focus();",10);
}
}
else
{
if (mode == "2"){
popitup = window.open(highversion,'fulltext','status=yes,scrollbars=yes,width=685,height=510');
 if (popitup != null) {
                if (popitup.opener == null) {
                        popitup.opener = self;
                        }
                popitup.location.href = highversion;
				  setTimeout("if (popitup) popitup.focus();",10);
}
}
}
}


//-- mosaic pictures

//   var imgloaded = 0;
   var count = 0;
   var bild1;
   var bild2;
   var bild3;
   
function show() {

zfall=Math.round(Math.random()*5)+1;
if (zfall == 1)
{

VISUAL = new Array(); 
VISUAL[0] = new Image();
VISUAL[0].src = "/pics/1.jpg";
VISUAL[1] = new Image();
VISUAL[1].src = "/pics/2.jpg";
VISUAL[2] = new Image();
VISUAL[2].src = "/pics/3.jpg";
VISUAL[3] = new Image();
VISUAL[3].src = "/pics/4.jpg";
}

if (zfall == 2)
{ 
VISUAL = new Array(); 
VISUAL[0] = new Image();
VISUAL[0].src = "/pics/7.jpg";
VISUAL[1] = new Image();
VISUAL[1].src = "/pics/8.jpg";
VISUAL[2] = new Image();
VISUAL[2].src = "/pics/9.jpg";
VISUAL[3] = new Image();
VISUAL[3].src = "/pics/10.jpg";

}
  
if (zfall == 3)
{ 

VISUAL = new Array(); 
VISUAL[0] = new Image();
VISUAL[0].src = "/pics/13.jpg";
VISUAL[1] = new Image();
VISUAL[1].src = "/pics/14.jpg";
VISUAL[2] = new Image();
VISUAL[2].src = "/pics/15.jpg";
VISUAL[3] = new Image();
VISUAL[3].src = "/pics/16.jpg";
}

if (zfall == 4)
{ 
VISUAL = new Array(); 
VISUAL[0] = new Image();
VISUAL[0].src = "/pics/19.jpg";
VISUAL[1] = new Image();
VISUAL[1].src = "/pics/20.jpg";
VISUAL[2] = new Image();
VISUAL[2].src = "/pics/21.jpg";
VISUAL[3] = new Image();
VISUAL[3].src = "/pics/22.jpg";
  }

if (zfall == 5)
{ 
VISUAL = new Array(); 
VISUAL[0] = new Image();
VISUAL[0].src = "/pics/25.jpg";
VISUAL[1] = new Image();
VISUAL[1].src = "/pics/26.jpg";
VISUAL[2] = new Image();
VISUAL[2].src = "/pics/27.jpg";
VISUAL[3] = new Image();
VISUAL[3].src = "/pics/28.jpg";
  }

if (zfall == 6)
{ 
VISUAL = new Array(); 
VISUAL[0] = new Image();
VISUAL[0].src = "/pics/5.jpg";
VISUAL[1] = new Image();
VISUAL[1].src = "/pics/17.jpg";
VISUAL[2] = new Image();
VISUAL[2].src = "/pics/11.jpg";
VISUAL[3] = new Image();
VISUAL[3].src = "/pics/23.jpg";
  }
 
		document.images['P' + count].src = VISUAL[count].src
		count ++;
		timer = setTimeout ("show()", 1000);
		if (count > 3) count=0;

}

function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}

// strip characters => gegen HTML Tags
function stringFilter (input) {
s = input.value;
filteredValues = "<>/";     // Characters stripped out
var i;
var returnString = "";
for (i = 0; i < s.length; i++) {  // Search through string and append to unfiltered values to returnString.
var c = s.charAt(i);
if (filteredValues.indexOf(c) == -1) returnString += c;
}
input.value = returnString;
}

function Del(Word) {
a = Word.indexOf("<");
b = Word.indexOf(">");
len = Word.length;
c = Word.substring(0, a);
if(b == -1)
b = a;
d = Word.substring((b + 1), len);
Word = c + d;
tagCheck = Word.indexOf("<");
if(tagCheck != -1)
Word = Del(Word);
return Word;
}
function Check(eingabe) {

ToCheck = eingabe.value;
Checked = Del(ToCheck);
eingabe.value = Checked;
return true;
}

