/**
 * Snepo fancybox JS
 *
 * Here we provide an AJAX implementation for the contact form, with a normal POST fallback
 */
$(function() {
  
  $('a.snepo_fancybox').each(function() {
    $( this ).fancybox({
      titlePosition: 'over',
      transitionIn: 'fade',
      transitionOut: 'fade',
      centerOnScroll: true
    });
  });
  
  
   $('a.snepo_fancybox_swf').each(function() {
   		var width = $( this ).find( '.snepo_swf_width' ).val();
    	var height = $( this ).find( '.snepo_swf_height' ).val();
	   $( this ).colorbox({
		   'iframe':true,
		   'href':this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
		   'innerWidth':width,
		   'innerHeight':height,
		   'left' : 60,
		   onLoad:function(){ $('#cboxContent').css('padding','0'); $('#cboxTitle').hide(); $('#cboxLoadedContent').css('border','1px solid #7D7D7D');},
		   onComplete:function(){$('#cboxTitle').hide();$('#cboxLoadedContent').css('border','1px solid #7D7D7D');}
	   });
  });
});


