function maxkarte(id) {
	window.open('index.php?lia_page=maxkarte&id='+id,'Detailkarte','width=600,height=500,menubar=no,scrollbars=no,toolbar=no,status=no,resizable=yes');
}

function reisezeiten() {
	window.open('index.php?lia_page=reisezeiten','Reisezeiten','width=500,height=380,menubar=no,scrollbars=no,toolbar=no,status=no,resizable=yes');
}
	
function neuesFenster(formul){
	var alles = document.getElementById(formul);
	var uebstr = '';
	for(var i=0;i<alles.length;i++){
		if(alles.elements[i].type != "hidden" && alles.elements[i].type != "submit"){		
			uebstr += alles.elements[i].name;
			uebstr += "="+alles.elements[i].value+"&";
		}
	}
	uebstr = uebstr.substring(0,uebstr.lastIndexOf("&"));	
	window.open(alles.url.value+"?"+uebstr);
	return false;
}

function popup_links() {
  if (!document.getElementsByTagName) return;
  var anchors = document.getElementsByTagName("a");
  for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
    if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "popup") {
      	anchor.target='_blank';
	    anchor.title = (anchor.title != "") ? anchor.title+" [&ouml;ffnet in Popup-Fenster]" : anchor.getAttribute("href")+" [&ouml;ffnet in Popup-Fenster]";
	    anchor.className = (anchor.className != '') ? anchor.className+' popup' : 'popup';
	  }
  }
}

$().ready(function() {
	$("#sel_appartment").change( function() {
		var str = "";
		$("#sel_appartment option:selected").each(function () {
            id = $(this).attr("value");
            if ($(this).hasClass("garage")){
            	$("#garage").show();
            } else {
            	$("#garage").hide();
            }
            
            if ($(this).hasClass("tiefgarage")){
            	$("#tiefgarage").show();
            } else {
            	$("#tiefgarage").hide();
            }
            
            if ($(this).hasClass("waeschepaket")){
            	$("#waeschepaket").show();
            } else {
            	$("#waeschepaket").hide();
            }
            
        });
		if ($("#preisDiv").css("display") == "block") {
			$("#preisDiv").hide();
		} else {
			$("#preisDiv").show();
		}	
	});
});