/**
 * @author mike
 */
  
  // show iframe
  function showIframe(id) {
    // show shader
    var shader  = Ext.get('shader');
    var height  = getWindowHeight();
    shader.setHeight(height).show();
    shader.on('click', hideIframe, this, {
      single: true,
      delay: 100
    });
    // show iframe
    var iframe = Ext.get('iframe');
    // get code
    iframe.update('<iframe src="http://home.mobile.de/home/fahrzeuge-hallocar.html" height="750" width="100%"></iframe>');
    iframe.show();
  } 
  
  function hideIframe() {
    var shader = Ext.get('shader');
    shader.hide();
    var iframe = Ext.get('iframe');
    iframe.update('');
    iframe.hide();
  } 
  
  
  
  // recommend
  function recommend() {
    el = Ext.get('recomend-container');
    //el.setLeft( (Ext.lib.Dom.getViewWidth()/2) +200 );
    if(!el.isDisplayed()) {
      el.slideIn('t', {
        easing: 'bounceOut',
        duration: 1
      });
    } else {
      el.slideOut('t', {
        duration: .5,
        remove: false,
        useDisplay: true
      });
    }
  }
  
  // sendRecommendForm
  function sendRecommendForm() {
    var f = document.forms['recommend-form'];
    var p = {
      action:   'sendForm',
      snd_name: f.elements['snd[name]'].value,
      snd_mail: f.elements['snd[mail]'].value,
      rec_name: f.elements['rec[name]'].value,
      rec_mail: f.elements['rec[mail]'].value,
      url:      document.location.href,
      title:    document.title
    };
    Ext.Ajax.request({
      url: 'plugin/form/recommend',
      success: function(o, s, r) {
        Ext.get('recommend-container-state').update('<strong>Vielen Dank!</strong>');
        window.setTimeout(recommend, 2000);
      },
      failure: function() {
        alert('Es ist ein Fehler aufgetreten. Bitte füllen Sie alle Felder aus!');
      },
      params: p
    });
    return false;

  
  }
  
  // bookmark
  function addNet(url,titel){
    if((typeof window.sidebar=="object") && (typeof window.sidebar.addPanel=="function")) {
      window.sidebar.addPanel(titel,url,"");
    } else {
      alert("Bitte fügen Sie die Seite manuell zu Ihren Lesezeichen hinzu!");
    }
  }
  function bookmark(){
    var url = window.location.href, t = document.title, ap = navigator.appName;
    if(ap=="Microsoft Internet Explorer") {
      window.external.AddFavorite(url,t);
    } else {
      if(ap=="Netscape") {
        addNet(url,t);
      } else {
        alert("Mit ihren Browser ist kein Lesezeichen über Javascript möglich.\nBitte legen sie das Lesezeichnen manuel an.\nURL:"+url);
      }
    }
  }
  
  // print
  function printview() {
    window.print();
  }
  
  
  // open window
  function openWindow(url, name, options) {
    window.open(url, name, options);
  }
  
  // get window height
  function getWindowHeight() {	
  	var yScroll;
  	if (window.innerHeight && window.scrollMaxY) {
      yScroll = window.innerHeight + window.scrollMaxY + 1;
  	} else if (document.body.scrollHeight > document.body.offsetHeight){
      yScroll = document.body.scrollHeight;
  	} else {
      yScroll = document.getElementsByTagName("html").item(0).offsetHeight;
  		yScroll = (yScroll < document.body.offsetHeight) ? document.body.offsetHeight : yScroll;
  	}
    return yScroll;
  }
  
  
  