$(document).ready( function()
{
   FX.nav.init(sec);
   $("div._trans").pngFix();
});

FX = {};

FX.nav = {
   init: function(sec)
   {
      FX.rollover.preload('.ro');
	  this.sec = sec;

	  $('.ro').each(function(){	FX.nav.showactiv($(this).parent()); });
     
      $(".ro").hover(
         function () { $(this).attr( 'src', FX.rollover.newimage($(this).attr('src')) ); },
         function () { $(this).attr( 'src', FX.rollover.oldimage($(this).attr('src')) ); }
      );
   },
   
   showactiv: function( src )
   {
	   	if(src.attr('href').indexOf(this.sec) != -1){
			var activ = src.children('img');
			activ.removeClass('ro');
			activ.attr( 'src', FX.rollover.newimage(activ.attr('src')) );
		}
   }   
};

FX.home = {
   init: function()
   {
	  	/*$('map#cover area').tooltip({ 
			track: true, 
			delay: 0, 
			showURL: false, 
			showBody: " - ", 
			fade: 250
		}); */
		$('#zitatTicker').vTicker({
		   speed: 500,
		   pause: 5000,
		   showItems: 1
		});
   },
   trailerEnv: {
	   skin: '',
	   src: '',
	   height: '',
	   width: ''
	},
   trailer: function()
   {
		var params = {};
		params.play = "true";
		params.loop = "false";
		params.quality = "best";
		params.scale = "noscale";
		params.devicefont = "true";
		params.seamlesstabbing = "true";
		params.swliveconnect = "true";
		params.allowfullscreen = "false";
		params.allowscriptaccess = "sameDomain";
		params.allownetworking = "all";
		params.bgcolor = "#000000"
		params.wmode = "transparent";
		
		var attributes = {};
		attributes.id = "trailer";
		attributes.align = "top";
		swfobject.embedSWF("media/swf/videoObj.swf", "trailer", this.trailerEnv.width, this.trailerEnv.height, "9.0.0", "media/swf/expressInstall.swf", this.trailerEnv, params, attributes);				
		swfobject.createCSS("#trailer","outline:none");
   }
};

FX.pix = {
   init: function()
   {
      FX.rollover.preload('.pixslide');
	  
      $('.pixslide').hover(
         function () { $(this).attr( 'src', FX.rollover.newimage($(this).attr('src')) ); },
         function () { $(this).attr( 'src', FX.rollover.oldimage($(this).attr('src')) ); }
      );
	  $("a[rel='pixgroup']").colorbox({transition:"fade"});

   }
};
FX.win = {
   message: function(str)
   {
		if(str != null){
			$('#content').block({ 
                message: '<h1>'+str+'</h1>', 
				timeout: 3000
            }); 
		}
   }   
};


FX.rollover = {
	preload: function(sel)
   {
      $(window).bind('load', function() {
         $(sel).each( function( key, elm ) { $('<img>').attr( 'src', FX.rollover.newimage( $(this).attr('src') ) ); });
      });
   },
	newimage: function( src )
   {
	  return src.replace(/_off\./, '_on.');
   },

   oldimage: function( src )
   {
      return src.replace(/_on\./, '_off.');
   }	
}

function NewWindow(theURL,winName,features) {
	var newX = (screen.availWidth - 351) / 2;
	var newY = (screen.availHeight - 434) / 2;
	
 	var nW = window.open(theURL,winName,features);	
	if (nW) {
		nW.moveTo(newX, newY);
		nW.focus();
		return false;
	} else {
		return true;
	}
}

