﻿function CheckValidations() {
    var FirstName = document.getElementById("ctl00_ContentPlaceHolder1_TxtFirstName");   
    var Telephone = document.getElementById("ctl00_ContentPlaceHolder1_TxtTelephone");
    var ReTelephone = document.getElementById("ctl00_ContentPlaceHolder1_TxtReTelephone");  
    var DDL = document.getElementById('ctl00_ContentPlaceHolder1_DDLTimeToCall');
    var num = DDL.selectedIndex;
    var value = DDL.options[num].value;
    var coll = '';
    if (FirstName.value == 'Name') {
        coll = '\nPlease enter Name';
    }  
    if (Telephone.value == 'Telephone') {
        coll += '\nPlease enter Telephone';
    }
    if (ReTelephone.value == 'Confirm Telephone') {
        coll += '\nPlease enter Confirm Telephone';
    }  
    if (value == 0) {
        coll += '\nPlease select Time to call';
    }
    if (Telephone.value != 'Telephone' && ReTelephone.value != 'Confirm Telephone') {
        if (Telephone.value != ReTelephone.value) {
            coll += '\nPlease enter same number';
        }
    }
    if (coll != '') {
        alert(coll);
        return false;
    }
    else {
        return true;
    }
}
function OpenWindow(PageId) {
    var w = 700;
    var h = 580;
    w += 32;
    h += 96;
    wleft = (screen.width - w) / 2;
    wtop = (screen.height - h) / 2;
    if (wleft < 0) {
        w = screen.width;
        wleft = 0;
    }
    if (wtop < 0) {
        h = screen.height;
        wtop = 0;
    }
    var win = window.open("PrinterFriendly.aspx?PageId=" + PageId,
                "ContentWin",
                'width=' + w + ', height=' + h + ', ' +
                'left=' + wleft + ', top=' + wtop + ', ' +
                'location=no, menubar=no, ' +
                'status=no, toolbar=no, scrollbars=yes, resizable=no');
    // Just in case width and height are ignored
    win.resizeTo(w, h);
    // Just in case left and top are ignored
    win.moveTo(wleft, wtop);
    win.focus();}

function openFreeCallBackWindow() {
    var Obj = dhtmlmodal.open('newagebox', 'div', 'modalPopUp', 'REQUEST A FREE CALL BACK', 'width=260px,height=320px,left=325px,top=130px,resize=0,scrolling=0,background=transparent');
}

function ClosePopUp() {
    window.location.href = 'index.aspx';
    return false;
    }
function opendiv() {

    var k = document.getElementById("divsecond");
    if (k.style.display == 'block') {
        $('#divsecond').hide('slow');
    }
    else {
        $('#divsecond').show('slow');
    }
}
function openFirstdiv() {

    var k = document.getElementById("divfirst");
    if (k.style.display == 'block') {
        $('#divfirst').hide('slow');
    }
    else {
        $('#divfirst').show('slow');
    }
}
function openThirddiv() {

    var k = document.getElementById("divthird");
    if (k.style.display == 'block') {
        $('#divthird').hide('slow');
    }
    else {
        $('#divthird').show('slow');
    }
}
function openForthdiv() {
    var k = document.getElementById("divforth");
    if (k.style.display == 'block') {
        $('#divforth').hide('slow');
    }
    else {
        $('#divforth').show('slow');
    }
}


function CallBackPopUP() {
    $('#tblReqCallBack').show();
    $('#tblMsg').hide();  
    if ($('#modalPopUpCallBack').css('display') == "none") {
        $('#modalPopUpCallBack').slideDown('slow');
    }
    else {
        $('#modalPopUpCallBack').slideUp('slow');
    }
}
function CallBackPopUPMsg() {   
    $('#modalPopUpCallBack').show();
  $('#tblReqCallBack').hide();
   $('#tblMsg').show();
    $('#trprocessing').hide();
}
function CallBackPopUPProcessing() {
    $('#tblReqCallBack').hide();
    $('#tblMsg').show();
    $('#LblCallBackMsg').text("");
   
   
}
function ClosePopUpCallBack() {   
    $('#modalPopUpCallBack').slideUp('slow');
    return false;
}
function ClosePopUpMsg() {
    $('#modalPopUp1').slideUp('slow');
    return false;
}


function CheckWeddingValidations() {
    var FirstName = document.getElementById("TxtFirstName");
    var Telephone = document.getElementById("TxtTelephone");
    var ReTelephone = document.getElementById("TxtReTelephone");
    var DDL = document.getElementById('DDLTimeToCall');
    var num = DDL.selectedIndex;
    var value = DDL.options[num].value;
    var coll = '';
    if (FirstName.value == 'Name') {
        coll = '\nPlease enter Name';
    }
    if (Telephone.value == 'Telephone') {
        coll += '\nPlease enter Telephone';
    }
    if (ReTelephone.value == 'Confirm Telephone') {
        coll += '\nPlease enter Confirm Telephone';
    }
    if (value == 0) {
        coll += '\nPlease select Time to call';
    }
    if (Telephone.value != 'Telephone' && ReTelephone.value != 'Confirm Telephone') {
        if (Telephone.value != ReTelephone.value) {
            coll += '\nPlease enter same number';
        }
    }
    if (coll != '') {
        alert(coll);
        return false;
    }
    else {
        CallBackPopUPProcessing();
        return true;
    }
}
