
	
  
function getNewRequest(replacer){
  request = self.location.href;
  temp = /page.html/;  
  newRequest = request.replace(temp,replacer);
  if (request == newRequest) {
      newRequest = request + "/deutsch/" + replacer;
  }
  return newRequest;
}

	
 function MM_openBrWindow(theURL,winName,features) {
        winName = winName.replace(/[^A-Z,0-9]/gi, '');
  		x = window.open(theURL,winName,features);
  		x.focus();
	}
 

	
  
	zoomStatus=0;
	function zoom(){
	        if (!document.all){
	        alert("Leider steht diese Funktion nur Benutzern des Internet Explorers zur Verfügung.");
	        return;
	        }
	        if (zoomStatus==0){
	                document.all.tags('body')[0].style.setAttribute('zoom','125%','false');
	                zoomStatus=1;
	        }
	        else{
	                document.all.tags('body')[0].style.setAttribute('zoom','100%','false');
	                zoomStatus=0;
	        }

	}


	
  
    function mailTo(){
        var myUrl = escape(parent.location.href);
        parent.location.href="mailto:Ihre%20Kontaktadresse?subject=Link-Tipp&body=Dieser%20Link%20wird%20Ihnen%20empfohlen:%20%20" + myUrl;
}

	
  
function printView(){
        printRequest = getNewRequest("print.html");
        MM_openBrWindow(printRequest,'druckAnsicht','scrollbars=yes,width=600,height=420');
}


	
    function fastSearch2 (path) {
    //if wenn kein Suchbegriff, dann keine Suche
    if (document.fastsearch.searchValue.value=="") {
       return;
    }
    else {
        // Suchstring basteln
        document.fastsearch.action ="/de/"+path+"?conquest-searchquery-is-query=true&format=long&conquest-searchquery="
            + "metadata:(" + document.fastsearch.searchValue.value + ")^4 "
            + "url:(" + document.fastsearch.searchValue.value + ")^3 "
            + "title:(" + document.fastsearch.searchValue.value + ")^2 "
            + "contents:(" + document.fastsearch.searchValue.value +")";
       // abschickern
       document.fastsearch.submit();
    }
}

  
	

    function toggle(id) {
      if (document.getElementById(id).style.display == "none") {
        document.getElementById(id).style.display="";
      } else {
        document.getElementById(id).style.display="none";
      }
    }


	
  
	
function checkOnSearch() {
             //if wenn kein Suchbegriff, dann keine Suche
            if (document.search.words.value=="") {
       	   return;
            }
            else {
                      // Suchstring basteln
                      document.search.action ="/deutsch/Universit%E4tsklinikum/searchresult.html?format=" +
                        document.search.format.options[document.search.format.selectedIndex].value +
                       "&conquest-searchquery=url:(" + document.search.words.value + ")^3 title:(" +
                        document.search.words.value + ")^2 contents:(" + document.search.words.value +")" +
                        " AND language:" + document.search.s_language.options[document.search.s_language.selectedIndex].value;
                        // wenn Suche auf Seiten mit bestimmtem Template eingeschränkt werden soll, Suchstring ergänzen
        if  (document.search.template.options[document.search.template.selectedIndex].value !="") {
              document.search.action += " AND template:" + document.search.template.options[document.search.template.selectedIndex].value;
           }
            // abschickern
            document.search.submit();
            }
}



	
        
        
            function berechnen() {
                var bmi;
                var weight = document.getElementById('bmi_weight').value;
                var height = document.getElementById('bmi_height').value;
                var output = document.getElementById('bmi_output');
                var errorwvar ='';
                var errorhvar ='';
                var errorw = document.getElementById('bmi_errorw');
                var errorh = document.getElementById('bmi_errorh');
                
                
               
                if (weight < 10 || weight > 200) { errorwvar = errorw.innerHTML = "Falsches Gewicht."; }
                else if(weight.search(/^\d/)){ errorwvar = errorw.innerHTML = "Keine Zahl."; }
                else{errorw.innerHTML = " ";}
                
                if (height < 50 || height > 250) {errorhvar = errorh.innerHTML = "Falsche Größe."; }
                else if (height.search(/^\d/)){errorhvar = errorh.innerHTML = "Keine Zahl."; }
                else{errorh.innerHTML = " ";}
                
                if (errorwvar!='' || errorhvar!=''){return;}
                
                errorw.innerHTML = " ";
                errorh.innerHTML = " ";
                
                bmi = Math.round(Math.round(weight) / (Math.pow((Math.round(height)/100),2)));
                
                
                
                output.innerHTML = bmi;
                return;
            }
        
        
    
	
        
        // Our global state
    var gLocalSearch;
    var gMap;
    var gSelectedResults = [];
    var gCurrentResults = [];
    var gSearchForm;

    // Create our "tiny" marker icon
    if (typeof GIcon != 'undefined') {
      var gSmallIcon = new GIcon();
      gSmallIcon.image = "http://labs.google.com/ridefinder/images/mm_20_yellow.png";
      gSmallIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
      gSmallIcon.iconSize = new GSize(12, 20);
      gSmallIcon.shadowSize = new GSize(22, 20);
      gSmallIcon.iconAnchor = new GPoint(6, 20);
      gSmallIcon.infoWindowAnchor = new GPoint(5, 1);
    }
    // Set up the map and the local searcher.
    function OnLoad() {

      // Initialize the map
      gMap = new GMap(document.getElementById("map"));
      gMap.addControl(new GSmallMapControl());
      gMap.addControl(new GMapTypeControl());
      gMap.setCenter(new GLatLng(49.45052,11.08048), 13);

      // Initialize the local searcher
      gLocalSearch = new GlocalSearch();
      gLocalSearch.setResultSetSize(google.search.Search.LARGE_RESULTSET);
      gLocalSearch.setSearchCompleteCallback(null, OnLocalSearch);

      // Execute the initial search
    }

    function doSearch() {
      var zip = document.getElementById("zipInput").value;
      var cat = document.getElementById("catInput").value;
      gLocalSearch.setCenterPoint(zip.search(/deutschland|germany/i)>-1 ? zip : zip+" germany");
      //gLocalSearch.execute(cat);
      gLocalSearch.execute(cat + " in \"" + zip + "\"");  
    }

    // Called when Local Search results are returned, we clear the old
    // results and load the new ones.
    function OnLocalSearch() {
      if (!gLocalSearch.results) return;
      var searchWell = document.getElementById("searchwell");

      // Clear the map and the old search well
      searchWell.innerHTML = "";
      for (var i = 0; i < gCurrentResults.length; i++) {
        if (!gCurrentResults[i].selected()) {
          gMap.removeOverlay(gCurrentResults[i].marker());
        }
      }

      gCurrentResults = [];
      for (var i = 0; i < gLocalSearch.results.length; i++) {
        gCurrentResults.push(new LocalResult(gLocalSearch.results[i]));
      }

      var attribution = gLocalSearch.getAttribution();
      if (attribution) {
        document.getElementById("searchwell").appendChild(attribution);
      }

      // move the map to the first result
      var first = gLocalSearch.results[0];
      gMap.recenterOrPanToLatLng(new GPoint(parseFloat(first.lng), parseFloat(first.lat)));

    }
    
    function centerMapOnResult(lat, lng) {
        gMap.recenterOrPanToLatLng(new GPoint(parseFloat(lng), parseFloat(lat)));
    }

    // Cancel the form submission, executing an AJAX Search API search.
    function CaptureForm(searchForm) {
      gLocalSearch.execute(searchForm.input.value);
      return false;
    }



    // A class representing a single Local Search result returned by the
    // Google AJAX Search API.
    function LocalResult(result) {
      this.result_ = result;
      this.resultNode_ = this.unselectedHtml();
      document.getElementById("searchwell").appendChild(this.resultNode_);
      gMap.addOverlay(this.marker(gSmallIcon));
    }

    // Returns the GMap marker for this result, creating it with the given
    // icon if it has not already been created.
    LocalResult.prototype.marker = function(opt_icon) {
      if (this.marker_) return this.marker_;
      var marker = new GMarker(new GLatLng(parseFloat(this.result_.lat),
                                         parseFloat(this.result_.lng)),
                               opt_icon);
      GEvent.bind(marker, "click", this, function() {
        marker.openInfoWindow(this.selected() ? this.selectedHtml() :
                                                this.unselectedHtml());
      });
      this.marker_ = marker;
      return marker;
    }

    // "Saves" this result if it has not already been saved
    LocalResult.prototype.select = function() {
      if (!this.selected()) {
        this.selected_ = true;

        // Remove the old marker and add the new marker
        gMap.removeOverlay(this.marker());
        this.marker_ = null;
        gMap.addOverlay(this.marker(G_DEFAULT_ICON));

        // Add our result to the saved set
        document.getElementById("selected").appendChild(this.selectedHtml());

        // Remove the old search result from the search well
        this.resultNode_.parentNode.removeChild(this.resultNode_);
      }
    }

    // Returns the HTML we display for a result before it has been "saved"
    LocalResult.prototype.unselectedHtml = function() {
      var container = document.createElement("div");
      container.className = "unselected";
      container.appendChild(this.result_.html.cloneNode(true));
      var saveDiv = document.createElement("div");
      saveDiv.className = "select";
      var that = this;
      var a = document.createElement("a");
      a.appendChild(document.createTextNode("Zeige auf der Karte"));
      a.href = "#map";
      a.onclick = function(){centerMapOnResult(that.result_.lat, that.result_.lng); that.marker_.openInfoWindow(that.selected() ? that.selectedHtml() :
                                                that.selectedHtml()); };
      saveDiv.appendChild(a);
      //saveDiv.innerHTML = "<a href='javascript:centerMapOnResult("+this.result_.lat+","+this.result_.lng+" );'>Zeige auf der Karte</a>";
      //GEvent.bindDom(saveDiv, "click", this, function() {
        //gMap.closeInfoWindow();
        //this.select();
        //gSelectedResults.push(this);
      //});
      container.appendChild(saveDiv);
      return container;
    }

    // Returns the HTML we display for a result after it has been "saved"
    LocalResult.prototype.selectedHtml = function() {
      return this.result_.html.cloneNode(true);
    }

    // Returns true if this result is currently "saved"
    LocalResult.prototype.selected = function() {
      return this.selected_;
    }

    GSearch.setOnLoadCallback(OnLoad);
        
    
	
      
      function checkOrderCheckboxes() {
        if(document.getElementById('bestellcenter_cd_order').checked == false && 
           document.getElementById('bestellcenter_dvd_order').checked == false && 
           document.getElementById('bestellcenter_dvd_order_pl').checked == false &&
           document.getElementById('bestellcenter_dvd_order_ru').checked == false &&
           document.getElementById('bestellcenter_dvd_order_tr').checked == false &&
           document.getElementById('sprach_order').checked == false &&
           document.getElementById('diabetes_order').checked == false) {
          alert('Bitte wählen Sie eine Bestellung aus!');
        } else if(document.getElementById('bestellcenter_disclaimer').checked == false) {
          alert('Bitte akzeptieren Sie die Datenschutzgrundsätze!');
        } else {
          document.orderForm.submit();
        }
      }
      
    

