var DHTML=0, DOM=0, MS=0, NS=0, OP=0;

function DHTML_init(){
	if(window.opera){OP=1;}
	if(document.getElementById){DHTML=1;DOM=1;	}
	if(document.all && !OP){DHTML=1;MS=1;	}
	if(window.netscape && window.screen && !DOM && !OP){DHTML=1;NS=1;}
}

function oID(ID){
	if(DOM){if(typeof document.getElementById(ID)=='object')return(document.getElementById(ID)); else return(void(0));
	}else if(MS){if(typeof document.all[ID]=='object')return(document.all[ID]);else return(void(0));
	}else if(NS){if(typeof document[ID]=='object')return(document[ID]);else return(void(0));}
}
function oName(p2){
	if(DOM){if(typeof document.getElementsByName(p2)=="object")return(document.getElementsByName(p2)[0]);	else return(void(0));
	}else if(MS){if(typeof document[p2]=="object")return(document[p2]);	else return(void(0));
	}else if(NS){if(typeof document[p2]=="object")return(document[p2]);	else return(void(0));}
}

DHTML_init();

function checkme(alternative){
}

function IMGsrc(ID,Img){
	oID(ID).src=Img;
}
function hide(ID){
	oID(ID).style.visibility="hidden";
}
function show(ID){
	oID(ID).style.visibility="visible";
}

function hideIF(ID){
	oID(ID).style.visibility="hidden";
}
function showIF(ID){
	oID(ID).style.visibility="visible";
}
function showFlip(ID){
	if(oID(ID).style.visibility=="visible"){
		oID(ID).style.visibility="hidden";
	}else{
		oID(ID).style.visibility="visible";
	}
}

function LoadIFrame(target,file){
//	if(window.opera){
	if(1==2){
		oID('Atarget').target=target;
		oID('Atarget').href=file;
		oID('Atarget').click();
	}else{
		oID(target).src=file;
	}
}

function oWIN(){
	this.Width;
	this.Height;
	this.init=_oWIN_init;
	this.resize2min=_oWIN_resize2min;
}

function _oWIN_init(){
	if(document.all){
		this.Width=document.all.bodyId.offsetWidth;
		this.Height=document.all.bodyId.offsetHeight;
	}else{
		this.Width=window.innerWidth;
		this.Height=window.innerHeight;
	}
	if(typeof this.Width=="string")this.Width=parseInt(this.Width);
	if(typeof this.Height=="string")this.Width=parseInt(this.Width);
}

function _oWIN_resize2min(minWidth,minHeight){
	if(this.Width < minWidth){
		window.resizeBy(minWidth-this.Width,0);
	}
	if(this.Height<minHeight){
		window.resizeBy(0,minHeight-this.Height);
	}
	this.init();
}

function myLoad(){
	parent.ShowCont();
	this.focus();
}

function LoadContent(Hier,params){
	if(typeof params == 'undefined')params="";
	parent.iFContent_Load(Hier,params);
}

function Galerie(Name,Bild){
	oID(Name).src="Galerien/"+Name+"/"+Bild;
}

function checkInputKontakt(){
	return true;
}


function checkInputBes() {
	var strError = "";
	var logError = false;
	
	if (window.document.myForm.LastnameL.value == "") {
		strError = strError + "Name \n";
		logError = true;
	}
	if (window.document.myForm.StreetNrL.value == "") {
		strError = strError + "Strasse, Nr \n";
		logError = true;
	}
	if (window.document.myForm.ZIPCityL.value == "") {
		strError = strError + "PLZ, Ort \n";
		logError = true;
	}

	if (window.document.myForm.EmailL.value == "") {
		window.document.myForm.EmailL.value = "info@teufelhof.com";
	}
		
	if (window.document.myForm.EmailL.value.indexOf("@") == -1) {
		window.document.myForm.EmailL.value = "info@teufelhof.com";
	}

	if (logError == true) {
		alert("Um Ihre Anfrage bearbeiten zu koennen bitten wir Sie, folgende Felder auszufuellen: \n" + strError);
		return false;
	} else {
		return true;
	}
}

function checkInputGes() {
	var strError = "";
	var logError = false;
	if (window.document.Geschenkguts.LastnameR.value == "") {
		strError = strError + "Name \n";
		logError = true;
	}
	if (window.document.Geschenkguts.StreetNrR.value == "") {
		strError = strError + "Strasse, Nr \n";
		logError = true;
	}
	if (window.document.Geschenkguts.ZIPCityR.value == "") {
		strError = strError + "PLZ, Ort \n";
		logError = true;
	}

	if (window.document.Geschenkguts.EmailR.value == "") {
		window.document.Geschenkguts.EmailR.value = "info@teufelhof.com";
	}
		
	if (window.document.Geschenkguts.EmailR.value.indexOf("@") == -1) {
		window.document.Geschenkguts.EmailR.value = "info@teufelhof.com";
	}

	if (logError == true) {
		alert("Um Ihre Anfrage bearbeiten zu koennen bitten wir Sie, folgende Felder auszufuellen: \n" + strError);
		return false;
	} else {
		return true;
	}
}

function checkInputRes() {
	var strError = "";
	var logError = false;
	
	if (window.document.Reservation.Lastname.value == "") {
		strError = strError + "Name \n";
		logError = true;
	}
	if (window.document.Reservation.StreetNr.value == "") {
		strError = strError + "Strasse, Nr \n";
		logError = true;
	}
	if (window.document.Reservation.ZIPCity.value == "") {
		strError = strError + "PLZ, Ort \n";
		logError = true;
	}

	if (window.document.Reservation.Email.value == "") {
		window.document.Reservation.Email.value = "info@teufelhof.com";
	}
		
	if (window.document.Reservation.Email.value.indexOf("@") == -1) {
		window.document.Reservation.Email.value = "info@teufelhof.com";
	}

	if (logError == true) {
		alert("Um Ihre Anfrage bearbeiten zu koennen bitten wir Sie, folgende Felder auszufuellen: \n" + strError);
		return false;
	} else {
		return true;
	}

}

