﻿var regRules = 
{
    '.regSuccessful' : function (element)
    {
        Dialog.alert(element.innerHTML, 
             {windowParameters: {width:400, height:155}, okLabel: "OK", 
              ok:function(win) {location.href="http://www.marsys.com"; return true;}});
    },
    
    '#termsPrinter' : function (element)
    {
        element.onclick = function ()
        {
            window.open("Terms.htm", "", "width=800,status=no,toolbar=no,menubar=no,location=no,scrollbars =yes");
        }
        
        element.onmouseover = function ()
        {
            element.style.cursor = "pointer";
        }
        
        element.onmouseout = function ()
        {
            element.style.cursor = "default";
        }
    }
}

Behaviour.register (regRules);

function validateTerms (source, args)
{
    if (!$("chkAgree").checked)
    {
        $("chkAgree").focus();
        $("chkAgree").className = "highlightInvalid";
        args.IsValid = false;
    }
}