// JavaScript Document

    J(document).ready(function(){ 
							      
							   
        J(".sf-menu").supersubs({ 
            minWidth:    13,  
            maxWidth:    27,   
            extraWidth:  2   
                               
        }).superfish({
			autoArrows:    true, 
			dropShadows:   false
		});  

	
	// FancyBox

				J.fn.getTitle = function() {
			var arr = J("a.fancybox");
			J.each(arr, function() {
				var title = J(this).children("img").attr("title");
				if (title == "") {title = J(this).attr("title")};
				J(this).attr('title',title);
			})
		}

		// Supported file extensions
		var thumbnails = 'a:has(img)[href$=".bmp"],a:has(img)[href$=".gif"],a:has(img)[href$=".jpg"],a:has(img)[href$=".jpeg"],a:has(img)[href$=".png"],a:has(img)[href$=".BMP"],a:has(img)[href$=".GIF"],a:has(img)[href$=".JPG"],a:has(img)[href$=".JPEG"],a:has(img)[href$=".PNG"]';

	
		J(thumbnails).addClass("fancybox").attr("rel","fancybox").getTitle();

		//J(thumbnails).addClass("fancybox").attr("rel","fancybox");

			J("a.fancybox").fancybox({
			'imageScale': true,
			'padding': 10,
			'zoomOpacity': true,
			'zoomSpeedIn': 500,
			'zoomSpeedOut': 500,
			'zoomSpeedChange': 300,
			'overlayShow': true,
			'overlayColor': "#666666",
			'overlayOpacity': 0.3,
			'enableEscapeButton': true,
			'showCloseButton': true,
			'hideOnOverlayClick': true,
			'hideOnContentClick': false,
			'frameWidth':  560,
			'frameHeight':  340,
			'callbackOnStart': null,
			'callbackOnShow': null,
			'callbackOnClose': null,
			'centerOnScroll': true,
			'title'			: this.title,
			'titlePosition'	:	'over'


		});
			
					J("a.iframe").fancybox({
		'hideOnContentClick': false,
		'width'				: 660,
		'height'			: '75%',
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
			
			
			J("a.youtube").click(function() {
	J.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			//'title'			: this.title,
			'width'			: 720,
			'height'		: 548,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			'wmode'			: 'transparent',
			'allowfullscreen'	: 'true'
			}
		});

	return false;
});
		
		

		}); // end document ready function
	

	
	
	//CUFON	 

	Cufon.replace('h1');
	Cufon.replace('#home_columns h2');
	Cufon.replace('#pagehead h2');
	Cufon.replace('#pagehead span');
	Cufon.replace('#step_icons li a', {
	hover: true
	});
	
	
	
