// watermarking text boxes
$(document).ready(function () {    
    if($('#s')) {
        // Define what happens when the textbox comes under focus
        // Remove the watermark class and clear the box
        $("#s").focus(function () {
            $(this).filter(function () {
                // We only want this to apply if there's not
                // something actually entered
                return $(this).val() == "" || $(this).val() == "Search..."
            }).removeClass("s").val("");
        });
        // Define what happens when the textbox loses focus
        // Add the watermark class and default text
        $("#s").blur(function () {
            $(this).filter(function () {
                // We only want this to apply if there's not
                // something actually entered
                return $(this).val() == ""
            }).addClass("inputWatermark").val("Search...");
        });   
        $('#searchform').submit(function() {
            var searchVal2 = $('#s').val();
            if(searchVal2 == '' || searchVal2 == 'Search...') {
                alert('Please enter search keywords');
                $('#s').focus();
                return false;
            }
        });
    }   
    $('#listMainNav li:last').addClass("listItemLast");
    var arr = $('#menu-footer-navigations li:last').html().split('<span>|</span>');
    $('#menu-footer-navigations li:last').html(arr[0]);
	
	
    // Overlays on bio thumbnails
    $(".photo-holder div.bio-thumb-overlay").css({ opacity: 0.0 });

    $(".photo-holder").mouseenter(function () {
        $(this).find("div.bio-thumb-overlay").fadeTo(100, 1.0);
    }).mouseleave(function () {
        $(this).find("div.bio-thumb-overlay").fadeTo(100, 0.0);
    });

    // Rollovers on maps
    $(".contact-map-holder img.contact-img_1").css({ opacity: 0.0 });

    $(".contact-map-holder a").mouseenter(function () {
        $(this).parent().find("img.contact-img_1").fadeTo(100, 1.0);
    }).mouseleave(function () {
        $(this).parent().find("img.contact-img_1").fadeTo(100, 0.0);
    });
});
