var $j = jQuery.noConflict();
$j(document).ready(function() {
		$j("a:has(.size-medium)").fancybox();
		$j("a:has(.size-large)").fancybox();
		$j("a:has(.size-thumbnail)").fancybox();
		$j(".gallery a").fancybox();
		$j('a[rel^="fanxybox"]').fancybox();
		$j(".youtube").click(function() {
		$j.fancybox({
				'padding'		: 0,
				'autoScale'		: false,
				'transitionIn'	: 'face',
				'transitionOut'	: 'fade',
				'titleShow'			: false,
				'width'		: 680,
				'height'		: 495,
				'href'	 : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/') + '&fs=1&autoplay=1',
				'type'			: 'swf',
				'swf'			: {
					 'wmode'		: 'transparent',
					'allowfullscreen'	: 'true'
				}
			});
	
			return false;
		});
		$j('input[title]').each(function() {
			if($j(this).val() === '') {
				$j(this).val($j(this).attr('title'));	
			}
	
			$j(this).focus(function() {
				if($j(this).val() == $j(this).attr('title')) {
					$j(this).val('').addClass('focused');	
				}
			});
	
			$j(this).blur(function() {
				if($j(this).val() === '') {
					$j(this).val($j(this).attr('title')).removeClass('focused');	
				}
			});
		});
		imagecount = $j('#rotator img').size();
		if(imagecount < 6){
			$j('.navi').click(function(){
				return false;
			});
			
		}
		$j('#rotatorcontent').cycle({ 
			fx: 'fade',
			timeout: 8000,
			speed:  1500,
			startingSlide: 3,
			prev:   '#navigate-right', 
			next:   '#navigate-left'
			//after:   onAfter 
		});
});
