
function openDialog(id, intWidth, intHeight, bStatus, bAdresse, bMenue, bSchaltflaechen, bResizeable, bScrollbars){

	/* BESCHREIBUNG

	1. ?ffnet ein Dialogfenster mit den angegebenen Parametern

	*/

	

	var url = "popup.aspx?id=" + id;

	window.open(url, null, "left=100, top=100, height=" + intHeight + ", width=" + intWidth + ", status=" + bStatus + ", scrollbars=" + bScrollbars + ", resizable=" + bResizeable + ", toolbar=" + bSchaltflaechen + ", menubar=" + bMenue + ", location=" + bAdresse + "");

}





function calculate(){

	

	var intNewPrice = 0;

	var strNewPrice = "";

	var kalkInput = document.getElementsByTagName("INPUT");

	var intBasePrice = parseInt(document.getElementById("FontBasePrice").innerHTML, 10);

	var fontPriceDisplay = document.getElementById("FontPriceDisplay");

		

	for(i = 0; i <= kalkInput.length - 1; i++){

	

		if(kalkInput[i].checked == true){			

			intNewPrice += parseInt(kalkInput[i].value, 10);

			//alert(intNewPrice);

		}

	}

			

	if(intNewPrice == 0){

		intNewPrice = intBasePrice;

	}

	//else{

	//	intNewPrice += intBasePrice;		

	//}

	

	strNewPrice = intNewPrice.toString();

	

	if(strNewPrice.length >= 4 ){

	

		var ind1 = strNewPrice.substring(0, strNewPrice.length - 3);

		var ind2 = strNewPrice.substring(strNewPrice.length - 3);

		strNewPrice = ind1 + "." + ind2;

		

	}

	

	fontPriceDisplay.innerHTML = strNewPrice + " &euro;";

}





function setCarportMode(){

	

	var ch_carportschopf = document.getElementById("ch_carportschopf");

	var ch_carportterrasse = document.getElementById("ch_carportterrasse");

	

	if(ch_carportschopf){

	

		if(ch_carportschopf.disabled){		

			ch_carportschopf.disabled = false;

		}

		else{

			ch_carportschopf.checked = false;

			ch_carportschopf.disabled = true;

		}

	}

	

	if(ch_carportterrasse){

	

		if(ch_carportterrasse.disabled){

			ch_carportterrasse.disabled = false;

		}

		else{

			ch_carportterrasse.checked = false;

			ch_carportterrasse.disabled = true;

		}

	}

}





function setContentHeight(){

	

	var tablePageNav = document.getElementById("TablePageNav");

	

	if(!tablePageNav){

	

		var tdContent = document.getElementById("TdContent");

		var divScrolling = document.getElementById("DivScrolling");

		

		tdContent.style.height = "468px";

		divScrolling.style.height = "463px";

				

	}

}





function showSubNavigation(nr){

	

	var divSubNav, fontSubNavCnt, posT, posL;

		

	posT = ((112 + 5) * nr) + 5;

	posL = 5 + 110;

		

	for(i=1; i<=4; i++){

	

		divSubNav = document.getElementById("DivSubNavigation" + i);

	

		if(divSubNav){

			

			if(i == nr){				

			

				fontSubNavCnt = document.getElementById("FontSubNavCnt" + i).innerHTML;

				

				divSubNav.style.visibility = "visible";

				divSubNav.style.position = 'absolute';

				divSubNav.style.top = posT + 'px';

				divSubNav.style.left = posL + 'px';

				divSubNav.style.width = "98px";

				divSubNav.style.height = (fontSubNavCnt * 15) + "px"				

				

			}

			else{

			

				divSubNav.style.visibility = "hidden";

				divSubNav.style.width = "1px";

				divSubNav.style.height = "1px";

				

			}			

		}	

	}	

}





function hideSubNavigation(){



	var divSubNav;



	for(i=1; i<=4; i++){

	

		divSubNav = document.getElementById("DivSubNavigation" + i);

	

		if(divSubNav){		

			

			divSubNav.style.visibility = "hidden";

			divSubNav.style.width = "1px";

			divSubNav.style.height = "1px";

							

		}	

	}	

}





function showKalk(){

	

	var iSelect = document.getElementById("kalkHaus");

	

	if(iSelect.selectedIndex >= 0){

		var loc = "preiskalkulator.aspx?cid=" + iSelect.options(iSelect.selectedIndex).value;

		document.location.href = loc;

	}

	else{

		alert("Waehlen Sie bitte zuerst ein Systemhaus");

	}	

}





function checkLoginForm(){

	var strBenutzer = document.getElementById("iBenutzer").value;

	var strPasswort = document.getElementById("iPasswort").value;

	var form = document.getElementById("fLogin");

	

	if((strBenutzer == "")||(strPasswort == "")){

		alert("Bitte fuellen Sie alle Felder aus");

	}

	else{

		form.submit();

	}

}