var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function EingabeTab(eingabe,laenge,taste) {
if (isNN) return true;
var nottab = [0,8,9,16,17,18,37,38,39,40,46];
if(eingabe.value.length >= laenge && !instr(nottab,taste.keyCode)) {
eingabe.value = eingabe.value.slice(0, laenge);
eingabe.form[getIndex(eingabe)+1 % eingabe.form.length].focus();
}
function instr(arr, ele) {
var found = false, index = 0;
	while(!found && index < arr.length)
    if(arr[index] == ele) found = true;
    else index++;
return found;
}
function getIndex(eingabe) {
var index = -1, i = 0, found = false;
while (i < eingabe.form.length && index == -1)
    if (eingabe.form[i] == eingabe) index = i;
    else i++;
return index;
}
return true;
}

function zeHs(hid) {
document.formzEH.haustyp.value = hid;
document.formzEH.from.value = 1;
document.formzEH.submit();
}
function zEHd(p1,p2){
document.formzEH.action = 'index.asp?ats=se';
document.formzEH.hid.value = p1;
document.formzEH.Zimmer_IDs.value = p2;
document.formzEH.submit();
}
function zEHb(p1,p2,p3){
if (p3==1)
{ document.formzEH.action = 'index.asp?ats=b1'; }
else
{ document.formzEH.action = 'index.asp?ats=s'; }
if (p1) {document.formzEH.wohnung.value = 'buch' + p1;}
if (p2) {document.formzEH.hid.value = p2;}
document.formzEH.submit();
}
function zEHn(p1){
document.formzEH.action = 'index.asp?ats=sh';
if (p1) {document.formzEH.from.value = p1;}
document.formzEH.submit();
}
function zEGn(p1){
document.formzEG.action = 'index.asp?ats=sg2';
if (p1) {document.formzEG.from.value = p1;}
document.formzEG.submit();
}

function f_preisedet(seite)
{
F_preisdet = window.open(seite,"Selection","width=450,height=400,scrollbars=no");
}
function f_ortdet(seite)
{
F_ortdet = window.open("index.asp?ats=oi&oid=" + seite,"Selection","width=700,height=500,scrollbars=yes");
}
function f_fotosgastst(gid)
{
F_fotosgastst = window.open("fotos_gastst.asp?gid=" + gid,"Selection","width=700,height=500,scrollbars=yes");
}


function buche_wohnung_he(d_zid){
document.formzEH.wohnung.value = "buch" + d_zid
document.formzEH.submit()
}
function f_fotos(zid)
{
F_fotos = window.open("index.asp?ats=fo&zid=" + zid,"Selection","width=650,height=700,scrollbars=yes");
}
function f_fotos2(zid)
{
F_fotos2 = window.open("index.asp?ats=fo&hid=" + zid,"Selection","width=650,height=700,scrollbars=yes");
}
function f_beleg(zid,monat)
{
F_beleg = window.open("index.asp?ats=be&mon=" + monat + "&zid=" + zid,"Selection","toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,WIDTH=680,HEIGHT=300,TOP=0");
}
function f_preisedet(seite)
{
F_preisdet = window.open(seite,"Selection","width=450,height=400,scrollbars=no");
}
//function f_ortdet(seite)
//{
//F_ortdet = window.open("ort_detail.asp?oid=" + seite,"Selection","width=700,height=500,scrollbars=yes");
//}

//aus Buchung01
function b1_submit(){
 var s1=''
 var versand=''
 if (document.b1frm.elements['Name'].value =='' ) 
 { s1=s1 + '\nName' } 
 if (document.b1frm.elements['Vorname'].value == '')
 { s1=s1 + '\nVorname' } 
 if (document.b1frm.elements['Strasse'].value == '')
 { s1=s1 + '\nStraße' } 
 if (document.b1frm.elements['PLZ']. value== '')
 { s1=s1 + '\nPLZ' } 
 if (document.b1frm.elements['Ort']. value== '')
 { s1=s1 + '\nOrt' } 
 if (document.b1frm.elements['Telefon']. value== '')
 { s1=s1 + '\nTelefon' } 
 if (document.b1frm.elements['email']. value== '')
 { s1=s1 + '\ne-Mail' } 
 if(s1!=''){
   s1='Bitte ergänzen Sie folgende Angaben:\n' + s1
   alert(s1)
   }
 else {
   document.b1frm.submit() }
}

//aus Buchung02
function b2_submit(hid){
 if (document.b2frm.elements['c_agb'].checked != true){
   s1='Zur Durchführung der Buchung müssen Sie die AGBs akzeptieren.'
   alert(s1)
   }
 else {
   document.b2frm.submit() 
 }
}
function f_agb(zid)
{
F_agb = window.open("agb.html","Selection","width=500,scrollbars=yes");
}

var http_request = false;

function xmlhttpPost(strURL, strSubmit, strResultFunc) {
// If IE7, Mozilla, Safari, etc: Use native object
if (window.XMLHttpRequest) {
  var xmlHttpReq = new XMLHttpRequest();
  if (http_request.overrideMimeType) {
    http_request.overrideMimeType('text/xml');
    }
}
// IE
else if (window.ActiveXObject) {
  //xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
  xmlHttpReq = new ActiveXObject("MSXML2.XMLHTTP");
}

xmlHttpReq.open('POST', strURL, true);
xmlHttpReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlHttpReq.onreadystatechange = function() {
	  if (xmlHttpReq.readyState == 4) {
	          eval(strResultFunc + '(xmlHttpReq.responseText);');
	  }
	}
xmlHttpReq.send(strSubmit);
}

function BA(p) {
var strURL = 'ajBannerA.asp?p='+p;
var strSubmit = '';
var strResultFunc = 'BA2';
	strSubmit = "";
	xmlhttpPost(strURL,strSubmit,strResultFunc);
	setTimeout("BA(" + p + ")",15000)
}

function BA2(text) {
	document.getElementById('BannerA').innerHTML = text;
}
