// JavaScript Document

// Aktuelle Hoehe holen
function getHeight() {
	var myWidth = 0, myHeight = 0;

	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	//return [ myWidth, myHeight ];
	return myHeight;
}



// div Hoehen per css Anpassung variabel setzen

// <![CDATA[
function changeProp(fontStyle) {
	
	myHeight = getHeight();
	
	if (fontStyle == "css/11.css") {
		var contentHeight = myHeight - 264 + "px";
		var spalteHeight = myHeight - 242 + "px";
		var textHeight = myHeight - 242 + "px";
	} else {
		var contentHeight = myHeight - 244 + "px";
		var spalteHeight = myHeight - 224 + "px";
		var textHeight = myHeight - 224 + "px";
	}
	
	with (document.getElementById("content")) {
		style.height = contentHeight;
	}
	with (document.getElementById("spalte")) {
		style.height = spalteHeight;
	}
	with (document.getElementById("text")) {
		style.height = textHeight;
	}
}
// ]]>





function checkForm() {
	err = ''
        if (document.forms[0].name.value == 'Name' || document.forms[0].name.value == '')		{ err = 'Name\n' }
        if (document.forms[0].mail.value == 'E-Mail' || document.forms[0].mail.value == '')			{ err = err + 'E-Mail\n' }
        if (document.forms[0].kommentar.value == 'Nachricht' || document.forms[0].kommentar.value == '')			{ err = err + 'Nachricht\n' }
                                                                                               
	    if (err == '') { return true; }
        else alert(unescape('Das Formular ist nicht vollst%E4ndig ausgef%FCllt.\nZur Kontaktaufnahme brauche ich\nmindestens folgende Angabe(n):\n \n' + err));   
        return false;                                                 
} 

/* focus auf textfelder */
function field_cleaner(field, defaultvalue){
	if(field.value == defaultvalue){
		field.value = "";
	}
}

function field_setter(field, defaultvalue){
	if(field.value == ""){
		field.value = defaultvalue;
	}
}