
$(document).ready(function() {
	var C = {
		titlePosition : 'over'
	};
	$(".gallery a").fancybox(C);
	$('a[target="_fancybox"]').fancybox(C);
	$('a.media').media();
	
	$('.tpl-kader a').each(function()
			   {
			     if(!$('#'+$(this).attr('rel')).text()) return false;
			      // Create image content using websnapr thumbnail service
			      var content = $('#'+$(this).attr('rel')).html();
			      
			      // Setup the tooltip with the content
			      $(this).qtip(
			      {
			         content: content,
			         position: {
			             corner: {
			                tooltip: 'bottomMiddle',
			                target: 'topMiddle'
			             }
			          },
			           style: {
			              border: {
			                 width: 1,
			                 radius: 8
			              },
			              padding: 5, 
			              textAlign: 'center',
			              tip: true, // Give it a speech bubble tip with automatic corner detection
			              name: 'dark' // Style it according to the preset 'cream' style
			           }
			      });
	});
	
	
	
	if($('.mainMedia .slider img').length>1) {
	    $('.mainMedia .slider').cycle({
			  fx: 'fade',
			  pager:  '.mainMedia .pager'
			 });
	}
	// ie7-hack
	if ($.browser.msie && $.browser.version.substr(0,1)==7) {
		$('ul').each(function() {
			$(this).css({
				'margin-left' : '-'+$(this).parent().width()
			})
		});
	}
	 $('marquee').marquee('pointer').mouseover(function () {
         $(this).trigger('stop');
     }).mouseout(function () {
         $(this).trigger('start');
     }).mousemove(function (event) {
         if ($(this).data('drag') == true) {
             this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
         }
     }).mousedown(function (event) {
         $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
     }).mouseup(function () {
         $(this).data('drag', false);
     });
	 
	//Cufon.replace('.cu',{});
	//Cufon.now();


});
