/// <reference path="jquery-1.2.6.min-vsdoc.js" />
$(document).ready(function() {

    $(".topUrl").click(function() {
        if ($(this).css("font-style") == "italic") {
            $(this).val("");
            $(this).css("color", "#000");
            $(this).css("font-style", "normal");
            $("#go").removeAttr("disabled");
        } else {
            $(this).select();
        }

    });

    $(".topUrl").keypress(function() {
        $(".topUrl").removeClass("error");
    });

    $("#go").click(function() {
        var url = $(".topUrl").val();

        if (url != "") {
            $("#topForm").submit();
        } else {
            $(".topUrl").addClass("error");
        }
    });

});

function WriteEmail() {

    coded = "v9aR@TRm7RyWZ.TR.AW"
    key = "vwsqpPlxo8TaE2AYtmWV7ZMK6n3RIXCGJe4hB5FLrHQi9j1SzUOd0cfbDuNygk"
    shift = coded.length
    link = ""
    for (i = 0; i < coded.length; i++) {
        if (key.indexOf(coded.charAt(i)) == -1) {
            ltr = coded.charAt(i)
            link += (ltr)
        } else {
            ltr = (key.indexOf(coded.charAt(i)) - shift + key.length) % key.length
            link += (key.charAt(ltr))
        }
    }
    document.write("<a href='mailto:" + link + "'>Contact Us</a>")

}

function resetResults() {
    $(".row").css("cssText", "border-width: 1px;");
    $(".row").css("width", "850px");
    $(".ruleInformation").hide();
}

function getRandomKey() {
    return String((new Date()).getTime()).replace(/\D/gi, '');
}