$(document).ready(function(){

	$('.post .text IMG').each(function(){
		var a = 0;
        if ( $(this).width() > 700 ) { a =  0 - ( ( $(this).width() - 700 )/2 ) };
		
		 $(this).css("left", a )
})
	
	
	
$('#slider').waitForImages(function() {

   $("#slidetabs").tabs("#slider .images > div.item", {effect: 'fade', rotate: true, fadeOutSpeed: "slow", fadeInSpeed: "slow"}).slideshow({autoplay: true, clickable: false, interval: 5000});

});
	
	
		$('input[type="text"], TEXTAREA').focus(function() {
        if (this.value == this.defaultValue){
        	this.value = '';
    	}
        if(this.value != this.defaultValue){
	    	this.select();
        }
    });
    $('input[type="text"], TEXTAREA').blur(function() {
        if (this.value == ''){
        	this.value = this.defaultValue;
    	}
    });
	

$(".page-numbers:contains('1')").addClass('noborder');
	
	
$("a.youtube").click(function() {
                 $.fancybox({
                  'padding'             : 0,
                  'autoScale'   : false,
				  'onStart'		: function() { $("#slidetabs").data("slideshow").stop(); },
				  'onClosed'		: function() { $("#slidetabs").data("slideshow").play(); },
                  'transitionIn'        : 'none',
                  'transitionOut'       : 'none',
                  'title'               : this.title,
                  'width'               : 680,
                  'height'              : 495,
                  'href'                : this.href = this.href.replace(new RegExp("watch\\?v=", "i"), 'v/') + '&autoplay=1',
                  'type'                : 'swf',    // <--add a comma here
                  'swf'                 : {'allowfullscreen':'true', 'wmode':'transparent'}
                  });
                 return false;

            });
			
$("a.vimeo").click(function() {
                 $.fancybox({
                  'padding'             : 0,
                  'autoScale'   : false,
				  'onStart'		: function() { $("#slidetabs").data("slideshow").stop(); },
				  'onClosed'		: function() { $("#slidetabs").data("slideshow").play(); },
                  'transitionIn'        : 'none',
                  'transitionOut'       : 'none',
                  'title'               : this.title,
                  'width'               : 680,
                  'height'              : 495,
                  'href'                : this.href.replace(new RegExp("([0-9])","i"),'moogaloop.swf?clip_id=$1') + '&autoplay=1',
                  'type'                : 'swf',    // <--add a comma here
                  'swf'                 : {'allowfullscreen':'true', 'wmode':'transparent'}
                  });
                 return false;

            });
	
});
