﻿var _URL = "http://www.tweetyourmail.com/";

function vrfytacnt() {

    $('#ctl00_mailContent_verify').val("true");
    document.forms[0].submit();
}

function AddMore() {

    $('#ctl00_mailContent_emls').append('<br><input type="text" id="fwdemail" name="fwdemail" runat="server" style="width: 200px; height: 15px;" />');
}

function deleml(x) {
    $('#demls' + x).remove();
}

function vldt() {

    var isvld = true;
    var vld = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/;

    var email = $('#ctl00_mailContent_email').val();

    if (!vld.test(email)) {
        isvld = false;
        $('#ctl00_mailContent_msg').append('Email is invalid');
    }

    if ($('#ctl00_mailContent_pwd1').val().length < 5) {
        isvld = false;
        $('#ctl00_mailContent_msg').append('<br/>Password should be atleast 5 characters');
    }


    if ($('#ctl00_mailContent_pwd1').val() != $('#ctl00_mailContent_pwd2').val()) {
        isvld = false;
        $('#ctl00_mailContent_msg').append('<br/>Passwords do not match');
    }

    if (isvld)
        document.forms[0].submit();

}

function srchtym() {
    var url = _URL + 'pages/search_results.aspx?search=' + document.getElementById("tymsrch").value;
    window.location.href = url;

}


function delmail(a) {
    $('#ctl00_mailContent_delmail').val(a);
    document.forms[0].submit();
}

function sendfdbck() {

    var vld = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/;
    var eml = $('#ctl00_mailContent_femail').val();
    if (!vld.test(eml)) {
        alert("Please enter a valid email address");
    }

    document.forms[0].submit();

}

function showsubj(a) { }