/*#####################################################
	INFOS ZU DIESER DATEI
	
letzte Änderung: fha, 16.12.2008

######################################################*/

var hdi24PopupDefaultContent = null;
var hdi24PopupTarifrechner = null;
var hdi24PopupMiniPopup = null;

/* Wenn Parameter 'left' und 'top' nicht angegeben werden, so wird die Standard-Position (fuer ein neues Fenster) des Browsers verwendet. */
/*
var leftMargin = 10;
var topMargin = 10;
var defaultOptions = ",left="+leftMargin+",top="+topMargin+",menubar=no,toolbar=no,scrollbars=yes,resizable=no,dependent=no";
*/
var defaultOptions = "menubar=no,toolbar=no,scrollbars=yes,resizable=yes,dependent=no";

var windowNameDefaultTarif = "tarifrechner";
var windowNameDefaultContent = "hdi24";
var windowNameMiniPopup = "minipopup";

function doRadioListOpenTarifrechner() {
	for(i=0;i<document.form_rechner.auswahl.length;++i){
		var auswahl = document.form_rechner.auswahl;
		if(auswahl[i].checked == true) {
			var auswahlValue = auswahl[i].value;
			openPopupTarifrechnerFixSize(auswahlValue);
		}
	}
}

function openPopupDefaultContent(contentURL){
	var w = 708;
	var h = 530;
	openPopup(hdi24PopupDefaultContent, contentURL, windowNameDefaultContent, "width="+w+",height="+h+defaultOptions);
}

function openPopupDefaultContentWide(contentURL){
	var w = 750;
	var h = 530;
	openPopup(hdi24PopupDefaultContent, contentURL, windowNameDefaultContent, "width="+w+",height="+h+defaultOptions);
}

function openPopupTarifrechnerFixSize(contentURL){
	var w = 730;
	var h = 600;
	openPopup(hdi24PopupTarifrechner, contentURL, windowNameDefaultTarif, "width="+w+",height="+h+defaultOptions);
}

function openMiniPopup(contentURL) { 
	openPopup(hdi24PopupMiniPopup, contentURL, windowNameMiniPopup, "width=460px,height=300px,left=600px,top=400px");
} 

function openPopup(popupWindow,contentURL,windowName,pOptions){
	if(popupWindow == null){
		popupWindow = window.open(contentURL, windowName, pOptions);
	} else if(popupWindow.closed != true){
			popupWindow.close();
			popupWindow = window.open(contentURL, windowName, pOptions);
		} else{
			popupWindow = window.open(contentURL, windowName, pOptions);
		}
	
	popupWindow.focus();
}

function countMax(target, max){
	if (target.value.length > max) {
		target.value = target.value.substring(0,max);
		alert("Es dürfen nicht mehr als  " + max + "  Zeichen eingegeben werden!");
	}
}

// Funktionen zum Oeffnen von Grafiken als PopUp-Fenster
function imagePopup(imageSource) {
	var imagePopup=window.open("","imagePopup","width=100,height=100,left=25,top=25,status=no,resizable=no,scrollbars=no");
	imagePopup.document.open();
	imagePopup.document.write("<html>\n");
	imagePopup.document.write("<head><title>-</title>\n");
	imagePopup.document.write("	<script type='text/javascript'>\n");
	imagePopup.document.write("	<!--\n");
	imagePopup.document.write("	function init(){\n");
	imagePopup.document.write("		var hoehe = document.image.height;\n");
	imagePopup.document.write("		var breite = document.image.width + 10;\n");
	imagePopup.document.write("		(breite > screen.width || hoehe > screen.height) ? top.resizeTo(screen.width-100,screen.height-100) : top.resizeTo(breite,hoehe);\n");
	imagePopup.document.write("	}\n");
	imagePopup.document.write("	-->\n");
	imagePopup.document.write("	<\/script>\n");
	imagePopup.document.write("</head>\n");
	imagePopup.document.write("<body onLoad='javascript:init();' style='background-color:#ffffff; margin:0;'>\n");
	imagePopup.document.write("	<img src='"+imageSource+"' name='image' style='border:0px;'/>\n");
	imagePopup.document.write("</body>\n");
	imagePopup.document.write("</html>\n");
	imagePopup.document.close();
	imagePopup.focus();
}
// Ende
// Variables Popup, Zusaetzlich Parameter "location", "menubar", "status" und "toolbar" übergeben 
function popup12(adresse, name, breite, hoehe, top, left, resizable, scrollbars, location, menubar, status, toolbar) {
	fenster = null;
	var para = "width="+breite+",height="+hoehe+",top="+top+",left="+left+",resizable="+resizable+",scrollbars="+scrollbars+",location="+location+",menubar="+menubar+",status="+status+",toolbar="+toolbar;
	fenster=window.open(adresse,name,para);
	fenster.focus();
}

function submitDropDown(ddBox){
		var form = ddBox.form;
		form.submit();
}
