$(document).ready(function() { 
    
    $(document).pngFix(); // Activate PNG fix in all images that load on document ready
    
    // This fixes the popup bg png in IE6
    $('#ctl00_tbName').focus(function() {
		    $(document).pngFix();
		});
    $('#ctl00_tbEmail').focus(function() {
		    $(document).pngFix();
		});
    $('#ctl00_tbComments').focus(function() {
		    $(document).pngFix();
		});
    
        
    // These are use to scroll and show the contact us area
    $("span.contactus_map").click(function(){
        if ($("div#contact_drop_contain").is(".cdc_tall")) {
            $("html, body").animate({scrollTop:0}, 600);
            $("#contact_drop").fadeOut(600);
            $("#contact_drop_contain").removeClass("cdc_tall")
        } else {
            $("#contact_drop_contain").addClass("cdc_tall")
            $("#contact_drop").fadeIn(600);
            $("html, body").animate({scrollTop:490}, 1600);
        }
        return false;
    });
    $(".contact_link").click(function(){
        if ($("div#contact_drop_contain").is(".cdc_tall")) {
            $("html, body").animate({scrollTop:0}, 600);
            $("#contact_drop").fadeOut(600);
            $("#contact_drop_contain").removeClass("cdc_tall")
        } else {
            $("#contact_drop_contain").addClass("cdc_tall")
            $("#contact_drop").fadeIn(600);
            $("html, body").animate({scrollTop:490}, 1600);
        }
        return false;
    });
    
    $("span.contact_link").mouseover(function(){
        $("span.contact_link").addClass("hovered");
    });
    $("span.contact_link").mouseout(function(){
        $("span.contact_link").removeClass("hovered");
    });

    // Opactity fix for the modal popup    
    $('.modalBackground').css('opacity',0.5)
     
});