﻿var RWF =  {};

RWF.Tools = {};

$(function ($) {

    $('.rwf_spellcheck').spellcheck({ events: 'keyup' });
    $('.rwf_datepicker, .form-date input').datepicker();
    $(".rwf_toggle").click(function () { $(this).next().toggle(); });
    $(".rwf_autopostback, .rwf_autopostback select").change(function () {
        RWF.CleanFields();
        $(this).closest("form").submit();
    });
    $(".form-submit-button").mousedown(function () { RWF.CleanFields() });

    _uacct = 'UA-219117-1';
    urchinTracker(_udl.pathname + '?utm_source=&utm_term=');
});  

RWF.CleanFields = function () {
    $(".form-currency input").each(function () {
        $(this).val($(this).val().replace(/[^\d]*/g, ""));
    });
    $(".form-percent input").each(function () {
        $(this).val($(this).val().replace(/[^\d]*/g, ""));
    });
}

RWF.LoadRightSideGoogleAd = function () {
    google_ad_client = "pub-6087295788033405";
    /* 120x600, created 10/25/10 */
    google_ad_slot = "3765874407";
    google_ad_width = 120;
    google_ad_height = 600;
}

RWF.LoadMediumGoogleAd1 = function () {
   google_ad_client = "ca-pub-6087295788033405";google_ad_slot = "5547365402";google_ad_width = 300;google_ad_height = 250;
}
RWF.LoadMediumGoogleAd2 = function () {
    google_ad_client = "ca-pub-6087295788033405";google_ad_slot = "9192142375";google_ad_width = 300;google_ad_height = 250;
}
RWF.Go_CLoans = function () {
    location.href = "http://www.c-loans.com/r.cgi?r=000630";
}
