var $j = jQuery.noConflict();
$j(document).ready(function(){
							
	$j('input#ajaxSearch_submit').click($j.fn.fancybox.close);
	$j("a.fancyEmail").click(function () { 
      closeSearch();
    });
					
	$j("#menu ul").lavaLamp({ fx: "backout", speed: 700 });	
	
	$j('#mycarousel').jcarousel({
		vertical: true,
		scroll: 1
	});
	$j("a.fancyEmail").fancybox({ 'frameWidth': 380, 'frameHeight': 500 }); 
	//$j("a.fancy").fancybox({ 'hideOnContentClick': false }); 
	$j("a.popup").fancybox({ 'hideOnContentClick': false });

	
	$j('#slideshow').cycle({ 
		fx:     'fade', 
		speed:   2000, 
		timeout: 5000, 
		requeueTimeout: 0,
		before:  onBefore, 
		after:   onAfter 
	 });
	
	function onBefore() { 
		$j('#output').animate({ 
			height: "0",
			opacity: 0.
      	}, 600 );

		$j('#output').html(""); 
		
	} 
	function onAfter() { 
		$j('#output').animate({ 
			height: "15px",
			opacity: 0.9
      	}, 600 );
		$j('#output').append('<h2>' + this.title + '</h2>'); 
	}
	
	/*--------File upload----*/
	$j("input[type=file]").filestyle({ 
		 image: "assets/templates/sammon/images/file.gif",
		 imageheight : 20,
		 imagewidth : 90
	 });
	
	/*------------------------*/
	
	var menuBoxSize = $j('#subMenu').height(); 
	var contentSize = $j('#content').height();
	
	if (menuBoxSize > contentSize) {
			$j('#content').height(menuBoxSize-11);
	}

	
	/*--------------------------*/
	$j('#content ul.reflect_archive li:first').css('margin-left','0');
	$j('#content ul.reflect_archive li:last').css('border-right','none');
	
	
}); //Close document.ready

$j(window).bind("load", function() {
    //-----------  Preload images for slideshows
	$j('#loading').hide();
	$j('#slideshowWrapper').fadeIn('slow');
});



