
  /*
   * Opens a popup with the specified URL
   */
  function popup(URL, title, w, h) {
    window.open(URL, title, 'width='+w+',height='+h+'locationbar=no,resizable=no,toolbar=no,scrollbars=no,left='+(Math.round((screen.width-w)/2))+',top='+(Math.round((screen.height-h)/2)));	 
  }

  /*
   * Opens a scrollable popup with the specified URL
   */
  function scrollablePopup(URL, title, w, h) {
    window.open(URL, title, 'width='+w+',height='+h+'locationbar=no,resizable=no,toolbar=no,scrollbars=yes,left='+(Math.round((screen.width-w)/2))+',top='+(Math.round((screen.height-h)/2)));	 
  }
  
  /*
   * Opens the specified calculator
   */
  function calculator(type) {

    //the ip address of the old asuro platform
    var oldIP = "secure.asuro.de";
    var width = 600;
    var height = 700;
        
    switch (type) {
      
      case "KV":
	 pageTracker._trackPageview('/rechner/kv');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&verstyp=kv&page=rechner/kv1";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break; 
      
      case "GKV":
        pageTracker._trackPageview('/rechner/gkv');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&verstyp=gkv&page=rechner/gkv1";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break; 
                
      case "BU":  
        pageTracker._trackPageview('/rechner/bu');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&verstyp=bu&page=rechner/bu1";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;
        
      case "PHV":  
        pageTracker._trackPageview('/rechner/phv');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&verstyp=phv&page=rechner/phv1";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;
      
      case "UV":  
        pageTracker._trackPageview('/rechner/uv');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&page=rechner/uv1&verstyp=uv";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;
      
      case "ZV":  
        pageTracker._trackPageview('/rechner/zv');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&page=rechner/zv1&verstyp=zv";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;        

      case "RLV":  
        pageTracker._trackPageview('/rechner/rlv');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&page=rechner/rlv1&verstyp=rlv";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;   
        
      case "AV":
        pageTracker._trackPageview('/rechner/av');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&page=rechner/avcheck1&verstyp=avcheck";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;       
          
      case "RVSOFORT":
        pageTracker._trackPageview('/rechner/rvsofort');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&page=rechner/rvsofort1&verstyp=rvsofort";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;  

      case "KFZ":
        pageTracker._trackPageview('/rechner/kfz');
        calculatorUrl = "https://www.einsurance.de/einsurance/doEntry.do?pid=auto&b2bid=48&cpid=asuro";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;

      case "RS":
        pageTracker._trackPageview('/rechner/rs');
        calculatorUrl = "https://"+oldIP+"/versicherungsvergleich/rechtsschutzversicherung/pop_v1511.jsp";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;

    }
  }
  
  /*
   * Opens the specified calculator
   */
  function offer(type) {

    //the ip address of the old asuro platform
    var oldIP = "secure.asuro.de";
    var width = 600;
    var height = 700;
        
    switch (type) {
      
      case "KV":
        pageTracker._trackPageview('/angebot/kv');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&verstyp=kv&page=rechner/persang1&nologin=1";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break; 
      
      case "GKV":
        pageTracker._trackPageview('/angebot/gkv');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&verstyp=gkv&page=rechner/persang1&nologin=1";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break; 
                
      case "BU":  
        pageTracker._trackPageview('/angebot/bu');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&verstyp=bu&page=rechner/persang1&nologin=1";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;
        
      case "PHV":  
        pageTracker._trackPageview('/angebot/phv');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&verstyp=phv&page=rechner/persang1&nologin=1";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;
      
      case "UV":  
        pageTracker._trackPageview('/angebot/uv');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&page=rechner/persang1&nologin=1";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;
      
      case "ZV":  
        pageTracker._trackPageview('/angebot/zv');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&page=rechner/persang1&verstyp=zv&nologin=1";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;        

      case "RLV":  
        pageTracker._trackPageview('/angebot/rlv');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&page=rechner/persang1&verstyp=rlv&nologin=1";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;   

      case "AV":
        pageTracker._trackPageview('/angebot/av');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&page=rechner/persang1&verstyp=av&nologin=1";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break; 

      case "RVSOFORT":
        upageTracker._trackPageview('/angebot/rvsofort');
        calculatorUrl = "https://"+oldIP+"/armstrong/asuro/dispatch.jsp?suppressLayout=true&page=rechner/persang1&verstyp=rvsofort&nologin=1";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break; 

      case "RIESTER":
        pageTracker._trackPageview('/angebot/riester');
        calculatorUrl = "https://"+oldIP+"/forms/ang1.jsp?verstyp=riester";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;

      case "RUERUP":
        pageTracker._trackPageview('/angebot/ruerup');
        calculatorUrl = "https://"+oldIP+"/forms/ang1.jsp?verstyp=ruerup";
        scrollablePopup(calculatorUrl , 'calculator', width, height);
        break;
    }
  }

