/*
Owner: Alert Communcations Limited
DocType: Javascript
Version: 1.0

Notice: This file should always be used when integrating to the Alert Web Publisher
        or above as a number of functions that the publisher is using within the 
        content are present within this file. The file is split into two sections:
        Section 1:
            A number of methods which are used within the publisher editor are written 
            in section one. Therefore these methods should not be modified under any 
            circumstances unless the publisher editor is not modified.
            
        Section 2:
            Section two is intended to add methods that are used by a particular project.
            Therefore if one requires to add one or more new javascript methods for a 
            particular project, these should be added in this section.
*/

/* Section One - Do not modify */

function SendEmail(email1,email2,email3,subject) { 
    parent.location = 'mailto:' + email1 + '@' + email2 + '.' + email3 + '?subject=' + subject;
}


function PopupMsgNewWebsite(msg, url, target) {

    var where_to= confirm(msg);

    if (where_to== true)
    {
        if (target == '_self')
        {
            window.location=url;
        }else{
            window.open(url);
        }
    }
}

/* End of Section One */

/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */

/* Section Two - Add your custom javasript here */
function ValidateEmptyText(source, arguments){
    if (arguments.Value == '')
        arguments.IsValid = false;
    else
        arguments.IsValid = true;
}

function ValidateEmail(source,arguments){
    var reg = new RegExp("\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
       
    if (reg.test(arguments.Value) == true){
        arguments.IsValid = true;
    }else{
        arguments.IsValid = false;
    }
}

/* End of Section Two */