// JavaScript Document

//fader
    /*$(".album .thumb, category").fadeTo("400", 1.0); // This sets the opacity of the thumbs to fade down to 30% when the page loads
	$(".album .thumb, .category").hover(function(){
	    $(this).fadeTo("400", 0.6); // This should set the opacity to 100% on hover
	},function(){
	    $(this).fadeTo("400",1.0); // This should set the opacity back to 30% on mouseout
	});
    */

function doSearch(it, def){ if(it.value == def) it.value = ''; else document.getElementById('searchForm').submit(); }
function postSearch(it, def){ if(it.value != def && it.value != '') document.getElementById('searchForm').submit(); }
function undoSearch(it, def){ if(it.value == '') it.value = def;}


$(document).ready(function (){
    $(".social2").hover(
        function () {         
            $(".slide").slideDown("slow");
        },
        function () {              
            setTimeout(function(){ $(".slide").slideUp("slow"); }, 3000);
        }
    );

    $(".fancybox").fancybox({
        'transitionIn'   : 'elastic',
        'transitionOut'  : 'elastic',
        'speedIn'        : 600, 
        'speedOut'       : 200, 
        'overlayShow'    : true ,
        'title'          : this.title, 
        'titlePosition'  : 'over',
        'onComplete'     : function() {
            $("#fancybox-wrap").hover(function() {
                $("#fancybox-title").fadeIn('slow');
            }, function() {
                $("#fancybox-title").fadeOut('slow');
            });
        }
    });     
    $(".preview, .iframe, [href$='.pdf']").fancybox({
        'width'        : '80%',
        'height'       : '90%',
        'autoScale'    : true,
        'transitionIn' : 'elastic',
        'transitionOut': 'elastic',
        'type'         : 'iframe'});    
    $('.menu ul').droppy();
});
