﻿function roomselector(location) {
    //$.fancybox({overlayOpacity: 0.8, 'padding' : 0, 'href' : "/popup-pages.i#fb-roomslb" });
    $.fancybox({ overlayOpacity: 0.8, 'padding': 0, margin: 0, width: 825, height: 645, type: 'iframe', 'href': vDir + "/building.ashx?locid=" + location });
}

function emailvalidate() {

    var validEmail = /^[0-9a-zA-Z_][\w\.-]*[0-9a-zA-Z0-9_]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
    var QValidation = /^[0-9a-zA-Z_][\w\.-]*[a-zA-Z0-9_]@[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
    var Domains = $('#echfdAllowedDomains').val().toUpperCase(); ;
    Domains = Domains.split(';');
    var EmailAddress;
    var Extension;
    var NormalValdation = true;
    var validcusno = /^[0-9]{0,10}$/;
    var eclocid = $('#eclocation').val();
    var emailId = $('#ecemail').val();
    var custno = $('#eccustomerno').val();



    if (eclocid == null) eclocid = '';
    if (emailId == null) emailId = '';
    if (custno == null) custno = '';

    if ($('#ecemail').val().length == 0) {
        alert('Enter email address');
        $('#ecemail').focus();
        return;
    }
    else if ($('#ecemail').val().length > 0) {
        EmailAddress = $('#ecemail').val().toUpperCase(); ;
        Extension = EmailAddress.split('@')
        for (var i = 0; i < Domains.length; i++) {
            if (Domains[i] != '') {
                if (Extension[1] == Domains[i]) {
                    NormalValdation = false;
                    if (!QValidation.test(EmailAddress)) {
                        alert('Invalid email address');
                        $('#ecemail').focus();
                        return;
                    }
                }
            }
        }
        if (NormalValdation) {
            if (!validEmail.test($('#ecemail').val())) {
                alert('Invalid email address');
                $('#ecemail').focus();
                return;
            }
        }
    }
    else if (!validcusno.test($('#eccustomerno').val())) {
        alert('Invalid customer #');
        $('#eccustomerno').focus();
        return;
    }
    ecroomselector(eclocid, emailId, custno);
}

function submitRequest1() {
    alert('Test1');
}

function submitRequest() {    
    var validName = /^[0-9a-zA-Z\-\,._ \/][0-9a-zA-Z\-\,._\'' \/]{0,15}$/;
    var validCity = /^[a-zA-Z][0-9a-zA-Z\-\._ \/]{1,20}$/;
    var validEmail = /^[0-9a-zA-Z_][\w\.-]*[0-9a-zA-Z0-9_]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
    var QValidation = /^[0-9a-zA-Z_][\w\.-]*[a-zA-Z0-9_]@[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
    var Domains = $('#echfdAllowedDomains').val().toUpperCase(); ;
    Domains = Domains.split(';');
    var EmailAddress;
    var Extension;
    var NormalValdation = true;
    var q = true;
    var phoneseg3 = /^[0-9]{3}$/;
    var phoneseg4 = /^[0-9]{4}$/;
    var validZipcode = /^[0-9]{5}$/;
    var validAddress = /^[^\<\>]{1,128}$/;
    if ($('#email').val().length == 0) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Enter email address');
        $('#email').focus();
        return;
    }
    else if ($('#email').val().length > 0) {
        EmailAddress = $('#email').val().toUpperCase(); ;
        Extension = EmailAddress.split('@');
        for (var i = 0; i < Domains.length; i++) {
            if (Domains[i] != '') {
                if (Extension[1] == Domains[i]) {
                    NormalValdation = false;
                    if (!QValidation.test(EmailAddress)) {
                        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
                        alert('Invalid email address');
                        q = false;
                        $('#email').focus();
                        return;
                    }
                }
            }
        }
    }
    if (!q) {
        if (NormalValdation) {
            if (!validEmail.test($('#email').val())) {
                $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
                alert('Invalid email address');
                $('#email').focus();
                return;
            }
        }
    }
    else if ($.trim($("#ecfname").val()).length == 0) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Enter first name');
        $("#ecfname").focus();
        return;
    }
    else if (!validName.test($('#ecfname').val())) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid first name, Valid - alphanumeric with following special characters , - . _\' / and white space');
        $("#ecfname").focus();
        return;
    }
    else if ($.trim($("#eclname").val()).length == 0) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Enter last name');
        $("#eclname").focus();
        return;
    }
    else if (!validName.test($('#eclname').val())) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid last name, Valid - alphanumeric with following special characters , - . _ \'/ and white space');
        $("#eclname").focus();
        return;
    }
    //    else if ($("#ecaddress1").val().length == 0) {
    //        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
    //        alert('Enter home address');
    //        $("#ecaddress1").focus();
    //        return;
    //    }
    else if ($("#ecaddress1").val().length > 0 && !validAddress.test($('#ecaddress1').val())) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid address. Valid- alphanumeric and special characters except <,>');
        $("#ecaddress1").focus();
        return;
    }
    else if ($("#ecaddress2").val().length > 0 && !validAddress.test($('#ecaddress2').val())) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid address. Valid- alphanumeric and special characters except <,>');
        $("#ecaddress2").focus();
        return;
    }
    else if ($("#ecaddress1").val().length > 0 && $("#ecaddress1").val().length < 4) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid Address. Minimum 4 characters required');
        $("#ecaddress1").focus();
        return;
    }
    //    else if ($("#eccity").val().length == 0) {
    //        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
    //        alert('Enter city');
    //        $("#eccity").focus();
    //        return;
    //   }
    else if ($('#eccity').val().length > 0 && !validCity.test($('#eccity').val())) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid city. Valid - alphanumeric with following special characters, - . _ / and white space');
        $("#eccity").focus();
        return;
    }
    else if ($('#eccity').val().length > 0 && $("#eccity").val().length < 4) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid city. Minimum 4 characters required');
        $("#eccity").focus();
        return;
    }
    //    else if ($("#ecstateid").val() == 0) {
    //        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
    //        alert('Choose state code');
    //        $("#ecstateid").focus();
    //        return;
    //    }
    //    else if ($("#eczip").val().length == 0) {
    //        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
    //        alert('Enter zip code');
    //        $("#eczip").focus();
    //        return;
    //    }
    else if ($('#eczip').val().length > 0 && !validZipcode.test($('#eczip').val())) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid zip. Valid - numeric');
        $("#eczip").focus();
        return;
    }
    else if ($("#ecwaddress1").val().length > 0 && !validAddress.test($('#ecwaddress1').val())) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid address. Valid- alphanumeric and special characters except <,>');
        $("#ecwaddress1").focus();
        return;
    }
    else if ($("#ecwaddress1").val().length > 0 && $("#ecwaddress1").val().length < 4) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid Address. Minimum 4 characters required');
        $("#ecwaddress1").focus();
        return;
    }
    else if ($("#ecwaddress2").val().length > 0 && !validAddress.test($('#ecwaddress2').val())) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid address. Valid- alphanumeric and special characters except <,>');
        $("#ecwaddress2").focus();
        return;
    }
    else if ($('#ecwcity').val().length > 0 && !validCity.test($('#ecwcity').val())) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid city. Valid - alphanumeric with following special characters, - . _ / and white space');
        $("#ecwcity").focus();
        return;
    }
    else if ($('#ecwcity').val().length > 0 && $('#ecwcity').val().length < 4) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid city. Minimum 4 characters required');
        $("#ecwcity").focus();
        return;
    }
    else if ($('#ecwzip').val().length > 0 && !validZipcode.test($('#ecwzip').val())) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid zip. Valid - numeric');
        $("#ecwzip").focus();
        return;
    }
    else if ($("#ecphone1").val().length == 0) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Enter phone number');
        $("#ecphone1").focus();
        return;
    }
    else if ($('#ecphone1').val().length > 0 && !phoneseg3.test($('#ecphone1').val())) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid phone number');
        $("#ecphone1").focus();
        return;
    }
    else if ($("#ecphone2").val().length == 0) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Enter phone number');
        $("#ecphone2").focus();
        return;
    }
    else if ($('#ecphone2').val().length > 0 && !phoneseg3.test($('#ecphone2').val())) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid phone number');
        $("#ecphone2").focus();
        return;
    }
    else if ($("#ecphone3").val().length == 0) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Enter phone number');
        $("#ecphone3").focus();
        return;
    }
    else if ($('#ecphone3').val().length > 0 && !phoneseg4.test($('#ecphone3').val())) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Invalid phone number');
        $("#ecphone3").focus();
        return;
    }
    else if ($('#eceventtype').val() == 0) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Select event type');
        $("#eceventtype").focus();
        return;
    }
    else if ($('#ecmessage').val().length > 1000) {
        $('#imgCoorSubmit').removeAttr('disabled', 'disabled');
        alert('Maxmimum entries exceeded');
        $("#ecmessage").focus();
        return;
    }

    var paramObj = new Object();
    paramObj.locationid = $('#eclocationid').val();
    paramObj.email = $('#email').val();
    paramObj.ecfname = $('#ecfname').val();
    paramObj.eclname = $('#eclname').val();
    paramObj.ecaddress1 = $('#ecaddress1').val();
    paramObj.ecaddress2 = $('#ecaddress2').val();
    paramObj.eccity = $('#eccity').val();
    paramObj.ecstateid = $('#ecstateid').val();
    paramObj.eczip = $('#eczip').val();
    paramObj.ecwaddress1 = $('#ecwaddress1').val();
    paramObj.ecwaddress2 = $('#ecwaddress2').val();
    paramObj.ecwcity = $('#ecwcity').val();
    paramObj.ecwstateid = $('#ecwstateid').val();
    paramObj.ecwzip = $('#ecwzip').val();
    paramObj.ecphone = $('#ecphone1').val() + $('#ecphone2').val() + $('#ecphone3').val();
    paramObj.ecphonetypeid = $('#ecphonetypeid').val();
    paramObj.eceventtype = $('#eceventtype').val();
    paramObj.ecusage = $('#ecusage').val();
    paramObj.ecmessage = $('#ecmessage').val();
    paramObj.eccustnum = $('#eccustomerNum').val();
    paramObj.eccustcompany = $('#eccustcompany').val();
    paramObj.eccompanyemail = $('#eccompanyemail').val();
    paramObj.eccompanyphone = $('#eccompanyphone').val();
    paramObj.eccompanyphonetypeid = $('#eccompanyphonetypeid').val();

    $.post("ecresp.ashx?reqType=makeecrequest", paramObj, function (response, status, xhr) {
        if (response == "Success") {
            $.fancybox({ overlayOpacity: 0.8, 'padding': 0, 'href': vDir + "/popup-pages.ashx#fb-ecrsubmitted" });
            //alert('Event Coordinator request submitted successfully');
            //$.fancybox.close();
        }
        else
            alert(response.substr(6));
    });

    return false;
}

function closeRequest() {
    //parent.$.fancybox.close
}


function validatePhotoForm() {
    var validName = /^[0-9a-zA-Z][0-9a-zA-Z\-\._,\'' \/]{0,31}$/;
    var validEmail = /^[0-9a-zA-Z_][\w\.-]*[0-9a-zA-Z0-9_]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
    var QValidation = /^[0-9a-zA-Z_][\w\.-]*[a-zA-Z0-9_]@[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
    var Domains = $('#echfdAllowedDomains').val().toUpperCase();
    Domains = Domains.split(';');
    var EmailAddress;
    var Extension;
    var NormalValdation = true;
    var q = true;
    var ext, ext2, ext3;
    if ($('#photofile').val().length > 0) ext = $('#photofile').val().split('.').pop().toLowerCase();
    if ($('#photofile2').val().length > 0) ext2 = $('#photofile2').val().split('.').pop().toLowerCase();
    if ($('#photofile3').val().length > 0) ext3 = $('#photofile3').val().split('.').pop().toLowerCase();
    if ($('#name').val().length == 0) {
        q = false;
        alert('Enter your name');
        $('#name').focus();
    }
    else if (!validName.test($('#name').val())) {
        q = false;
        alert('Invalid Name, Valid - alphanumeric with following special characters , - . _\' / and white space');
        $('#name').focus();
    }
    else if ($('#email').val().length == 0) {
        q = false;
        alert('Enter email address');
        $('#email').focus();
    }
    else if ($('#email').val().length > 0) {
        EmailAddress = $('#email').val().toUpperCase();
        Extension = EmailAddress.split('@');
        for (var i = 0; i < Domains.length; i++) {
            if (Domains[i] != '') {
                if (Extension[1] == Domains[i]) {
                    NormalValdation = false;
                    if (!QValidation.test(EmailAddress)) {                        
                        alert('Invalid email address');
                        q = false;
                        $('#email').focus();
                        return;
                    }
                }
            }
        }
        if (NormalValdation) {
            if (!validEmail.test($('#email').val())) {
                alert('Invalid email address');
                q = false;
                $('#email').focus();
            }
        }
    }
    if (q) {
        if ($('#eventno').val().length == 0) {
            alert('Enter event #');
            $('#eventno').focus();
        }
        else if (ext != null && $.inArray(ext, ['gif', 'png', 'jpg', 'jpeg']) == -1) {
            alert('Invalid format. Valid format - JPEG, GIF, PNG');
            $('#photofile').focus();
        }
        else if (ext2 != null && $.inArray(ext2, ['gif', 'png', 'jpg', 'jpeg']) == -1) {
            alert('Invalid format. Valid format - JPEG, GIF, PNG');
            $('#photofile2').focus();
        }
        else if (ext3 != null && $.inArray(ext3, ['gif', 'png', 'jpg', 'jpeg']) == -1) {
            alert('Invalid format. Valid format - JPEG, GIF, PNG');
            $('#photofile3').focus();
        }
        else if ($('#photofile').val().length == 0 && $('#photofile2').val().length == 0 && $('#photofile3').val().length == 0) {
            alert('Upload at least one photo');
            $('#photofile').focus();
        }
        else if ($('#comments').val().length > 1000) {
            alert('Maximum characters exceeded.');
            $('#comments').focus();
        }
        else if ($('#terms:checked').length == 0) {
            alert('Cannot send photos without agreeing to the terms and conditions');
            $('#terms').focus();
        }
        else {
            if ($('#hdfBtnDisable').val() == '') {
                $('#hdfBtnDisable').val('temp');
                var paramObj = new Object();
                paramObj.email = $('#email').val();
                paramObj.eventno = $('#eventno').val();
                $('#name').focus();
                $.post("sendusphotos.ashx?reqType=validateeventNo", paramObj, function (response, status, xhr) {
                    if (response == "CANCELLED") {
                        $('#hdfBtnDisable').val('');
                        alert('Invalid event #');
                    }
                    else if (response == "MATCHED") {
                        $('#frmphotos').submit();
                    }
                    else if (response == "MATCHED2") {
                        $('#hdfBtnDisable').val('');
                        alert('Event is not yet occurred');
                    }
                    else if (response == "NOTMATCHED") {
                        $('#hdfBtnDisable').val('');
                        alert('Invalid event #');
                    }
                    else if (response == "NOTMATCHED2") {
                        $('#hdfBtnDisable').val('');
                        alert('Event is not yet occurred');
                    }
                    else {
                        $('#hdfBtnDisable').val('');
                        alert('Error occured:' + response)
                    }
                });
            }
        }
    }
}

function validDate(inp) {
    var validFormat = /^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/;
    if (!validFormat.test(inp)) return false;
    var mmpart = parseInt(inp.substr(0, 2), 10);
    var ddpart = parseInt(inp.substr(3, 2), 10);
    var yypart = parseInt(inp.substr(6, 2), 10);
    if (mmpart < 0 || mmpart > 12) return false;
    if (ddpart < 0 || ddpart > 31) return false;
    var newdate = new Date(2000 + yypart, mmpart - 1, ddpart);
    return 2000 + yypart == newdate.getFullYear() && mmpart - 1 == newdate.getMonth() && ddpart == newdate.getDate();
}

function submitcontact() {
    var validName = /^[0-9a-zA-Z][0-9a-zA-Z\-\,._\'' \/]{0,31}$/;
    var validEmail = /^[0-9a-zA-Z_][\w\.-]*[0-9a-zA-Z0-9_]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
    var validPhone = /^[0-9]{10}$/;
    var QValidation = /^[0-9a-zA-Z_][\w\.-]*[a-zA-Z0-9_]@[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
    var Domains = $('#echfdAllowedDomains').val().toUpperCase();
    Domains = Domains.split(';');
    var EmailAddress;
    var Extension;
    var NormalValdation = true;
    var q = true;
    if ($('#name').val().length == 0) {
        alert('Enter your name');
        q = false;
        $('#name').focus();
    }
    else if (!validName.test($('#name').val())) {
        alert('Invalid name, Valid - alphanumeric with following special characters , - . _ \' / and white space');
        q = false;
        $('#name').focus();
    }
    else if ($('#phone').val().length == 0) {
        alert('Enter phone number');
        q = false;
        $('#phone').focus();
    }
    else if (!validPhone.test($('#phone').val())) {
        alert('Invalid phone number, Valid – numeric. Example : 6379999901');
        q = false;
        $('#phone').focus();
    }
    else if ($('#email').val().length == 0) {
        alert('Enter email address');
        q = false;
        $('#email').focus();
    }
    else if ($('#email').val().length > 0) {
        EmailAddress = $('#email').val().toUpperCase(); ;
        Extension = EmailAddress.split('@');
        for (var i = 0; i < Domains.length; i++) {
            if (Domains[i] != '') {
                if (Extension[1] == Domains[i]) {
                    NormalValdation = false;
                    if (!QValidation.test(EmailAddress)) {
                        alert('Invalid email address');
                        q = false;
                        $('#email').focus();
                        return;
                    }
                }
            }
        }
        if (NormalValdation) {
            if (!validEmail.test($('#email').val())) {
                alert('Invalid email address');
                q = false;
                $('#email').focus();
            }
        }
    }
    if (q) {
        if ($('#eventdate').val().length > 0 && !validDate($('#eventdate').val())) {
            alert('Invalid date');
            $('#eventdate').focus();
        }
        else if ($('#eventdate').val().length == 0) {
            alert('Select event date');
            $('#eventdate').focus();
        }
        else if ($('#ctlocation').val() == 0) {
            alert('Choose the location');
            $('#ctlocation').focus();
        }
        else if ($('#subject').val().length == 0) {
            alert('Enter subject');
            $('#subject').focus();
        }
        else if ($('#comments').val().length == 0) {
            alert('Enter message');
            $('#comments').focus();
        }
        else if ($('#comments').val().length > 1000) {
            alert('Maximum characters exceeded.');
            $('#comments').focus();
        }
        else {
            $('#imgSubmit').attr('disabled', 'disabled');
            var paramObj = new Object();
            paramObj.name = $('#name').val();
            paramObj.phone = $('#phone').val();
            paramObj.email = $('#email').val();
            paramObj.eventdate = $('#eventdate').val();
            paramObj.subject = $('#subject').val();
            paramObj.comments = $('#comments').val();
            paramObj.locationid = $('#ctlocation').val();
            $.post("contactusresp.ashx?reqType=contactus", paramObj, function (response, status, xhr) {
                if (response == "Success") {
                    $.fancybox({ overlayOpacity: 0.8, 'padding': 0, 'href': vDir + "/popup-pages.ashx#fb-contactussubmitted" });
                    //$.fancybox.close();
                }
            });
        }
    }
}

function updateHoliday(locationId, callback) {
    if (locationId == null) return;
    $.post(vDir + "/jsonresp.ashx?reqType=listholidays&locationId=" + locationId, null, function (response, status, xhr) {
        if (holiDays == null)
            holiDays = new Array();
        var idx = -1;
        for (var i = 0; i < holiDays.length; i++) {
            if (holiDays[i].locationId == locationId) {
                idx = i;
                break;
            }
        }
        if (idx < 0) {
            holiDays[holiDays.length] = new Object();
            idx = holiDays.length - 1;
        }
        holiDays[idx].locationId = locationId
        holiDays[idx].isSundayHoliday = response.IsSundayHoliday;
        holiDays[idx].maxmmddyyyy = response.maxmmddyyyy;
        holiDays[idx].holidaymmddyyy = response.holidaymmddyyy;
        holiDays[idx].firstDate = response.firstDate;
        if (callback != null) callback();

    }, "json");
}

function getholidays(locationid) {
    if (holiDays == null) return null;
    for (var i = 0; i < holiDays.length; i++) {
        if (holiDays[i].locationId == locationid) {
            return holiDays[i];
        }
    }
    return null;
}

function dayFound(holidays, date) {
    var yyyy = date.getFullYear();
    var mm = date.getMonth() + 1;
    var dd = date.getDate();
    for (var i = 0; i < holidays.length; i++) {
        if (holidays[i][0] == mm && holidays[i][1] == dd && holidays[i][2] == yyyy) return true;
    }
    return false;
}


function showhideusdate() {
    $('#date2').datepicker('show');
}

function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regexS = "[\\?&]" + name + "=([^&#]*)";
    var regex = new RegExp(regexS);
    var results = regex.exec(window.location.href);
    if (results == null)
        return "";
    else
        return decodeURIComponent(results[1].replace(/\+/g, " "));
} 
