$(document).ready(function(){
	$(".lightbox").lightbox();
	$("#formonline").validate();


	$(".boxcategory").hover(function() { //On hover...

		var thumbOver = $(this).find("IMG").attr("src"); //Get image url and assign it to 'thumbOver'

		//Set a background image(thumbOver) on the <a> tag - Set position to bottom
		$(this).find("A.pic").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});

		//Animate the image to 0 opacity (fade it out)
		$(this).find("SPAN").stop().fadeTo('fast', 0 , function() {
			$(this).hide() //Hide the image after fade
		});
	} , function() { //on hover out...
		//Fade the image to full opacity 
		$(this).find("SPAN").stop().fadeTo('fast', 1).show();
	});


});



$(window).bind("load", function() { 

       var footerHeight = 0,
           footerTop = 0,
           $footer = $("#footercontainer");

       positionFooter();


       function positionFooter() {

                footerHeight = $footer.height();
                footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";

               if ( ($(document.body).height()+footerHeight) < $(window).height() + 100 ) {
                   $footer.css({
                        position: "absolute",
						left: "0px",
						top: footerTop
                   })
               } else {
                   $footer.css({
                        position: "static"
                   })
               }
       }

       $(window)
               .scroll(positionFooter)
               .resize(positionFooter)

});
