    var ifr                 = null,
        resizeTimerId       = null,
        resizeTimerChkId    = null,
        resizeTimerCounter  = 0,
        debugMode           = false;
    function autoProSetdyniframeheight(iframe) {
      if (debugMode) alert('autoProSetdyniframeheight');
      resizeTimerCounter    = 0;
      autoProIFrameManagerSourceOnLoad();
    }
    function autoProSetIframe(iframe) {
      ifrkey                = Math.random();
      ifr                   = iframe;      
      frame                 = document.getElementById(iframe);
      if (frame!=null)
      frame.src             = frame.src+'&ifrkey='+ifrkey;     
    }
    function autoProIFrameManagerSourceOnLoad () {
      autoProIFrameManagerSourceTimeOutResize();
    }
    function autoProIFrameManagerSourceTimeOutResize() {
      if (debugMode) alert('autoProIFrameManagerSourceTimeOutResize/resizeTimerCounter:'+resizeTimerCounter);
      if (resizeTimerCounter<3) {
        resizeTimerId      = window.setTimeout("autoProIFrameMangerSourceResizeIframeHeigth()", 300);
        resizeTimerCounter++;
      }   
    }
    function autoProIFrameMangerSourceResizeIframeHeigth() {
      var ifrhchecked     = 'false';
      var checkObjScript  = document.getElementById('autoProScript2Resize');
      if (checkObjScript!=null) {
        var refMain       = document.documentElement;
        refMain.removeChild(checkObjScript);         
      }
      objScript           = document.createElement('SCRIPT');
      objScript.id        = 'autoProScript2Resize';
      var iframeheightsrc = 'http://boerse.autopro24.at/js/autopro24iframegetheight.php';
      iframeheightsrc     = iframeheightsrc+'?ifr='+ifr+'&ifrkey='+ifrkey;
      iframeheightsrc     = iframeheightsrc+'&u=1';
      iframeheightsrc     = iframeheightsrc+'&ifrb='+document.getElementById(ifr).frameBorder;
      iframeheightsrc     = iframeheightsrc+'&debugMode='+debugMode;
      objScript.src       = iframeheightsrc;
      document.documentElement.appendChild (objScript); 
      if (debugMode) alert('autoProIFrameMangerSourceResizeIframeHeigth loaded\n'+iframeheightsrc);    
    }
    function autoProCheckIframeHeight() {
      objScript           = document.createElement('SCRIPT');
      objScript.id        = 'autoProScript2ResizeCheck';
      var iframeheightsrc = 'http://boerse.autopro24.at/js/autopro24iframecheckheight.php';
      iframeheightsrc     = iframeheightsrc+'?ifr='+ifr+'&ifrkey='+ifrkey;
      iframeheightsrc     = iframeheightsrc+'&debugMode='+debugMode;
      objScript.src       = iframeheightsrc;
      document.documentElement.appendChild (objScript);
      if (debugMode) alert('autoProCheckIframeHeight ifrhchecked\n'+ifrhchecked);    
    }
    function autoProSetIframeParam(iframename) {
      var autoProID = 0;
      autoProID = autoProGetURLparameters('carid');        
      if (autoProID>0) {
        var iframe = document.getElementById(iframename);
        if (iframe)
          iframe.src = iframe.src+'&carid='+autoProID;            
      }
    }
    function autoProGetURLparameters(searchfield) {
      if (self.location.search.indexOf("=") == -1) {return;}
      var parameterArray = unescape(self.location.search).substring(1).split("&");
      for (var i=0;i<parameterArray.length;i++) {
        parameterArray[i] = parameterArray[i].split("=");
        if (parameterArray[i][0]==searchfield)
          return parameterArray[i][1];
      }
      return false;
    }     
    autoProSetIframe('iframeautopro');
    autoProSetIframeParam('iframeautopro');
