/**
* JavaScript
*
* @author	Sebastian Müller <sebastian produktivbuero de>
* @date		03/02/2007
*/

$(document).ready(function(){
  /*
  var $ie = false;
  jQuery.each(jQuery.browser, function(i, val) {
    if (i=="msie")
      $ie = val;
  });
  
  if ($ie)
    $(document).ready(function() {  });
  */
  $('a.modal').colorbox({width:'790px', height:'80%', iframe:true, opacity:0.7, href:$(this).attr('href'), close:'Fenster schließen'});
  $('a.movietrailer').colorbox({width:'790px', height:'480px', iframe:true, opacity:0.7, href:$(this).attr('href'), close:'Fenster schließen'});
  
  $('.slidehidden').slideUp(10).prev('h3').toggleClass('slidehidden');
  $('.movieslider h3').click(function () {
      $(this).toggleClass('slidehidden').next('.slide').slideToggle('slow');
    });
});

/** ************************************************************************
* Versendet die Angaben des Newsletter
*
* @param	$action  auszuführende Aktion
***************************************************************************/
function sendIndividualForm(action){
 if(action == 'newsletter'){
   myWin = openWin('MyWindow','',650,400);
   document.newsletterform.action = 'http://newsletter.x-verleih.de/newsletter/user_register.php';
   document.newsletterform.target = 'MyWindow';
   document.newsletterform.submit();
 }
};

function openWin(winName,dieUrl,width,height){
  win = window.open(dieUrl,winName,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+width+',height='+height);
  win.moveTo((screen.width/2)-(width/2),(screen.height/2)-(height/2));
}


/** ************************************************************************
* Öffnet ein Popupfenster
*
* @param	$url  Zieladresse
* @param	$width  Fensterbreite
* @param	$height  Fensterhöhe
* @return	-
* @author	Sebastian Müller
* @date		12/04/2007
***************************************************************************/

function popup(url, width, height) {
	myWindow = window.open(url,'popup','width=' + width + ', height=' + height + ', toolbar=no,location=no,status=no,menubar=no,resizable=yes,top=0,left=0');
};


/** ************************************************************************
* Positioniert das aktuelle Fenster
*
* @return	-
* @author	Sebastian Müller
* @date		07/02/2008
***************************************************************************/

function positionWindow() {
  self.resizeTo(screen.availWidth, screen.availHeight);
  self.moveTo(0,0);
  self.focus();
};
