// JavaScript Document

/* ********************************************************************************************
 * Allgemeine Funktionen
 ******************************************************************************************* */
  // Angepasst von Böhler Jürgen, DBNET Böhler und Groß OEG
	// Original Version //4.01
	// iFrame Unterstützung integriert
	function MM_findObj(n, d) { //v4.02
		var p,i,x;  if(!d) d=document; 
		if((p=n.indexOf("?"))>0&&(parent.frames.length||document.frames.length)) {
			d=parent.frames[n.substring(p+1)]; 
			if(!d){d=document.frames[n.substring(p+1)];}
			n=n.substring(0,p);d.document;
		}
		if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		if(!x && d.getElementById) x=d.getElementById(n);
		return x;
	}
	
	
	function dnSubmit(pfrm) {
		var frm = null;
		frm = MM_findObj(pfrm) ;
		if (frm) {
			frm.onsubmit();
			frm.submit();
		} else {
			alert('Daten konnten nicht aktualisiert werden!');
		}
	}

	
	function popupImage(fileID){
		x=window.open("popupImage.php?fileID="+fileID,"RADIO","width=440,height=400,top=0,left=0,resizable=no,scrollbars=no,menubar=no,toolbar=no,status=no,location=no")
	}
	
	function popupPhotoGallery(photoGalleryID){
		x=window.open("popupPhotoGallery.php?photoGalleryID="+photoGalleryID,"RADIO","width=440,height=400,top=0,left=0,resizable=no,scrollbars=no,menubar=no,toolbar=no,status=no,location=no")
	}
	
	function ImageOnOver(imgLand) {
		var imgMap=MM_findObj('Map');
		imgMap.src="/_images/karten/"+imgLand;
	}
	
	function ImageOnClick(imgLand) {
		var imgMap=MM_findObj('Map');
		var ObjSel=MM_findObj('cboCountryID');
		ObjSel.value=1;
		imgMap.src="/_images/karten/"+imgLand;
		aktivL=imgLand
		switch (imgLand) {
			case "vlbg.gif": 
				document.location.href = "reference.php?cboCountryID=1&stateID=1";
				break;
			case "tirol.gif": 
				document.location.href = "reference.php?cboCountryID=1&stateID=2";
				break;
			case "sbg.gif": 
				document.location.href = "reference.php?cboCountryID=1&stateID=3";
				break;
			case "kntn.gif": 
				document.location.href = "reference.php?cboCountryID=1&stateID=4";
				break;
			case "stmk.gif": 
				document.location.href = "reference.php?cboCountryID=1&stateID=5";
				break;
			case "oberoe.gif": 
				document.location.href = "reference.php?cboCountryID=1&stateID=6";
				break;
			case "bg.gif": 
				document.location.href = "reference.php?cboCountryID=1&stateID=8";
				break;
			case "noe.gif": 
				document.location.href = "reference.php?cboCountryID=1&stateID=7";
				break;
			case "wien.gif": 
				document.location.href = "reference.php?cboCountryID=1&stateID=9";
				break;
			case "de.gif": 
				document.location.href = "reference.php?cboCountryID=46";
				break;
			case "ch.gif": 
				document.location.href = "reference.php?cboCountryID=184";
				break;
			default: 
				document.location.href = "reference.php?cboCountryID=1";
		}
	}

	function ImageOnOut() {
		var imgMap=MM_findObj('Map');
		imgMap.src="/_images/karten/"+aktivL;
	}
	
	function DB_SelectLand() {
		var ObjSel=MM_findObj('cboCountryID');
		switch (ObjSel.value) {
			case "1": 
				document.location.href = "reference.php?cboCountryID="+ObjSel.value;
				break;
			case "46": 
				document.location.href = "reference.php?cboCountryID="+ObjSel.value;
				break;
			case "184": 
				document.location.href = "reference.php?cboCountryID="+ObjSel.value;
				break;
			default: 
				document.location.href = "reference.php?cboCountryID=1";
		} 
	}
	
	function DB_Sendpage() {
		mail_str = "mailto:?subject=Artikel aus der Homepage von RTC - www.rtc.at - " + document.title;
		mail_str += "&body=Hier ist die Adresse: " + location.href; 
		location.href = mail_str;
	}
	
	function DB_PrintPage() {
		if (window.print) {
			window.print();
		}
	}