﻿
$(window).load(function () {
    if (!$.browser.msie) {
        $('#footer').corner('8px');
        /* $('#signUpInfo').corner('8px'); */
        $(".sectionHeaderContent").corner('tl bl 4px');

    }
    $(".rounded4").corner('4px');
    $("#newsLetterEmailAddress").watermark();
    $(".rolloverButton").mouseover(function () {
        $(this).attr('src', $(this).attr('src').replace('.png', '_hover.png')); 
    }).mouseout(function(){
        $(this).attr('src', $(this).attr('src').replace('_hover', '')); 
        });

});

function addToMailingList() {
    if ($('#newsLetterEmailAddress').val().length > 0 && $('#newsLetterEmailAddress').val() != "Enter your email address") {
        $.post('/Shared/SignUpForNewsLetter', { emailAddress: $('#newsLetterEmailAddress').val() });
        $('#PreSignup').fadeOut('slow', function () {
            $('#postSignup').fadeIn('slow');
        });
    }

}

$(function () {
    //Initialization
    $('#newsLetterThanksTable').hide(); //the thank you text for adding youe email address to the news letter

    $.ajaxSetup({
        cache: false
    });

    //Applies "waterMarkOn" style to all elements denoted with "waterMark" Class and assigns
    //custom attribute entry (compliance battle ensues)
    $(".waterMark").each(function (index) {
        if ($(this).val() == '') {
            $(this).addClass("watermarkOn");
            $(this).val($(this).attr("sav"));
        }
        $(this).focus(function () { if ($(this).hasClass("watermarkOn")) { $(this).val(''); $(this).removeClass("watermarkOn"); } });


        $(this).blur(function () {
            if ($(this).val() == '') {
                $(this).addClass("watermarkOn");
                $(this).val($(this).attr("sav"));
                $(this).focus(function () { $(this).val(''); $(this).removeClass("watermarkOn"); });
            }
        });
    })

    $("#intelligent-list li").hover(function () {
        var currentFeature = $(this).attr("class");
        var currentFeature = "." + currentFeature
        $("#intelligent-list li").attr("id", "");
        $(this).attr("id", "highlight");

        $(".highlight-list li").hide();
        $(".highlight-list li" + currentFeature).show();
    });


});

/* google analytics */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-16599555-1']);
_gaq.push(['_trackPageview']);

(function () {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

