	
	
	jQuery(function($) {
		
		$('a.externalLink, a.external').attr('target', '_blank');
		
		if($('#HomeSlider').length) HomeSlider();
		if($('#HomeCategories').length) HomeCategories();
		
	});
	
	/**
	 * HomeSlider
	 */
	function HomeSlider(){
		swfPath = baseDir  + 'modules/homeslider/homeslider.swf';
		var date = new Date();
		var flashvars = {};
		var params = {wmode:'#000000', flashvars:'xml=' + baseDir  + 'modules/homeslider/img/homeslider.xml?t='+date.getTime()};
		var attributes = {  };
		swfobject.embedSWF(swfPath, 'HomeSlider', "750", "329", "8.0.0", null, flashvars, params, attributes);
	}	
	
	/**
	 * HomeCategories
	 */
	function HomeCategories() {
		
		
		$('.HomeSubCategories .ProductImage:hidden').fadeTo(0,0).css({display:'block'});
		$('.HomeSubCategories .ProductImage-1').addClass('visible').fadeTo(0,1);
		
		$('.HomeSubCategories li a').hoverIntent({
			over:function() {
				if(!$(this).parent().find('.ProductImage.visible').length && $(this).parent().find('.ProductImage').length) {
					$(this).parent().parent().find('.ProductImage.visible').fadeTo(100, 0).removeClass('visible');
					$(this).parent().find('.ProductImage').fadeTo(100,1).addClass('visible');
				}
			},
			out:function() {
				
			}
		});
		
	}
	
