
// Projektspezifische JS-Funktionen

function openPopup(url, ID) {
	switch(ID){
		case 4:
			parent.location.href = url;
			break;
		case 5:
			parent.window.opener.location.href = url;
			break;
		default:
			if (parseInt(ID,10) > 0) {
				window.open(url, "ePilotPopup"+ID, IstrListboxTargetPopupstyle[ID]);
			}	else {
				window.open(url);
			}
	}
}

function openContent(url,ID){
	switch(ID){
		case 4:
			parent.location.href = url;
			break;
		case 5:
			parent.location.href = url;
			break;
	}
}

function RunSearch(lngPopupMode) {

  var strLink = IstrPopupLink;
  var queryval = document.forms["suche"].elements["Z"].value;
  var ID = document.forms["suche"].elements["ID"].value;
  strLink += "/ID/" + ID + "/Z/" + queryval;
  document.location.href = strLink;
}


function hideshowdiv(divID) {
	var VState = document.getElementById(divID).style.visibility;

	//document.title = divID + " " + document.getElementById(divID).style.display;

	if (VState=="visible") {
		document.getElementById(divID).style.visibility = "hidden";
	} else {
		document.getElementById(divID).style.visibility = "visible";
	}

} //end function
/*
function hidediv(divID) {
	document.getElementById(divID).style.visibility = "hidden";
} //end function

function showdiv(divID) {
	document.getElementById(divID).style.visibility = "visible";
} //end function

function CloseAlleMenues(blnShowDiv) {

	if (!blnShowDiv) {
		showdiv("objectsearch");
	}
	closaAlleMenues();
}
*/

// Popup fuer den Lageplan
function openPopupLageplan(xkoordinate,ykoordinate){
	var url = "http://www.niedersachsennavigator.niedersachsen.de/cgi-bin/nn/n.pl?prj=wg_wesermarsch";
	url +=  "&amp;m_re=" + xkoordinate + "&amp;m_ho=" + ykoordinate;
	url +=  "&amp;s_re=" + xkoordinate + "&amp;s_ho=" + ykoordinate;
	url +=  "&amp;zoom=7";

	window.open(url, "Flash", "status=no,scrollbars=no,width=484,height=420");
}

function openPopupKarte(STRASSE,HAUSNUMMER,PLZ,ORT){
	var url = "http://link2.map24.com/?lid=2d1b1345&amp;maptype=CGI&amp;street0=";
	url +=  STRASSE + "+" + HAUSNUMMER;
	url +=  "&amp;zip0=" + PLZ + "&amp;city0=" + ORT;
	url +=  "&amp;country0=de&amp;description0=wohnbauwesermarsch&amp;lang=de";

	window.open(url, "Flash", "status=no,scrollbars=yes,resizable=yes,width=800,height=600");
}


function OpenPDF(url, title, popupID) {
	var link = "/htmltopdf/default.aspx?"
	link += "name=" + encodeURI(title);
	link += "&cnf=2";
	link += "&url=" + encodeURIComponent(url);

	openPopup(link, popupID, -1);
}

var activenav01index = 0;
var activenav01id = 0;
var nav02index = 0;



function MarkNav02(objectid, index) {

}


function RunImmoSearch() {
	// hier werden alle Werte selektiert
	// parentid saugen

	var folderid = FixID_mietobjekte;

	// Daten aus den Felder auf der Startseite bzw Folgeseite saugen

	var s1 = "";
	var s2 = "";
	var s3 = "";
	var s4 = "";
	var s5 = "";
	
	stadteil = window.document.AppartmentSuche.s1.value;
	wohnflaeche = window.document.AppartmentSuche.s2.value;
	haustyp = window.document.AppartmentSuche.s3.value;
	miete = window.document.AppartmentSuche.s4.value;

  // wbs = window.document.AppartmentSuche.s5.value;
	var strZ2 = "";

	if (haustyp != "") {
		haustyp = haustyp;
	}

  var wbs = "";
  if(window.document.AppartmentSuche.s5[0].checked == true)
    wbs = "ja"; 
  if(window.document.AppartmentSuche.s5[1].checked == true)
    wbs = "nein";
  
  strZ2 = wohnflaeche + ";" + haustyp + ";" + miete + ";" + wbs;
	
	// vorerst werden per get die Listen aufgerufen
	var link = "";
	link = IstrBaseLink + "/Z/" + stadteil + "/Z2/" + strZ2; // + "/Z3//Z4/"
	link += "/ID/" + folderid;

	location.href = link;
}



