// Begin jQuery scripts
// --------------------------------
$(document).ready(function() {

	
	// Optional message for form fields
    // --------------------------------
    $(".OptionalInput").each(function() {
        $(this).val($(this).attr("title"));
        $(this).css({ color: "#999999" });
    });

    $(".OptionalInput").focus(function() {
        if ($(this).val() == $(this).attr("title")) {
            $(this).val("");
            $(this).css({ color: "#666666" });
        }

    }).blur(function() {
        if ($(this).val() == "") {
            $(this).val($(this).attr("title"));
            $(this).css({ color: "#999999" });
        }
    });
    
    
    // Listing hover effects
    // --------------------------------
    $(".Listing .Name").children("a").hover(function() { 
    	$(this).parent().prev(".Image").addClass("ON"); 
    },function () {
    	$(this).parent().prev(".Image").removeClass("ON");
    });
    
    $(".Listing .Image").hover(function() { 
    	$(this).next().find("a").addClass("ON"); 
    },function () {
    	$(this).next().find("a").removeClass("ON");
    });
    
    
    // Related hover effects
    // --------------------------------
    $(".Related").children("a").hover(function() { 
    	$(this).parent().addClass("ON");
    	$(this).nextAll("a").first().addClass("ON");
    },function () {
    	$(this).parent().removeClass("ON");
    	$(this).nextAll("a").first().removeClass("ON");
    });
    
    
    // BAM Link style in Footer
    // --------------------------------
    $("span.BAM a").hover(function () {
    	$("span.BAM").addClass("ON");
	},function () {
		$("span.BAM").removeClass("ON");
	});
    
});
