
/***** Neha Mehta *****/
/***** 04 November '08 *****/
// Function for pop-up links where-ever 
// a pop-up page is called for dynamicaly created
// pages using template 7


function Open(URL)
{
    var settings = 'width=642px,height=438px,top=0px,left=0px,scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
window.open(URL,'EXL',settings);
return;
}


function OpenDocument(strURL) {
   
    var settings = 'width=600px,height=600px,top=35%,left=45%,scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
    window.open(strURL, 'EXL', settings);

}
function OpenWebinar(URL) {
    var settings = 'width=620px,height=650px,top=0px,left=200px,scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
    window.open(URL, 'Webinar', settings);
    return;
    }

function OpenWebinar_45(URL) {
    var settings = 'width=985px,height=760px,top=0px,left=0px,scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
    window.open(URL, 'Webinar', settings);
    return;
}

function MM_openBrWindow(theURL, winName, features) {
    window.open(theURL, winName, features);
}


var listdivid = "";

function ShowList(divid) {
    if (listdivid != "" && listdivid != divid) {
        document.getElementById(listdivid).style.display = "none";
    }
    listdivid = divid;
    if (document.getElementById(listdivid).style.display == "none") {
        document.getElementById(listdivid).style.display = "block";

        document.getElementById(listdivid).focus();
    }
    else {
        document.getElementById(listdivid).style.display = "none";

    }
}


function ShowListData(listid, txtid) {
//    var cnt = document.getElementById(listid).selectedIndex;
//    var Text = document.getElementById(listid).options[cnt].value;
//    var TextValue = document.getElementById(listid).options[cnt].innerHTML;
//    //alert(document.getElementById(txtid).readOnly);
//  //document.getElementById(txtid).readOnly = false;
//        //alert(document.getElementById(txtid).readOnly);
//    //document.getElementById(txtid).value = TextValue;
    //       // document.getElementById(txtid).contentEditable = true;
    document.getElementById(listdivid).style.display = "none";

}
    function ValidateForm() {
       var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;

       if (document.getElementById("txtVertical").value == "") {
           alert('Please select industry');
           ShowList('divVertical');
           return false;

       }
       else if (document.getElementById("txtEmail").value == "") {
       alert("Please enter E-mail");
       document.getElementById("txtEmail").focus();
       return false;
       }
       else if (!RegEmail.test(document.getElementById("txtEmail").value)) {
               alert("Please enter valid E-mail");
               document.getElementById("txtEmail").focus();
               return false;
           }
         else if (!validateEmail(document.getElementById("txtEmail").value)) {
           alert("Please enter your valid company e-mail id");
           document.getElementById("txtEmail").focus();
               return false;
           }
return true;
    }

function validateEmail(Email) {

    var fileTypes = ["yahoo", "yahoo.co", "gmail", "hotmail", "rediffmail", "lycos"];
    var ext = Email.substring(Email.lastIndexOf("@") + 1, Email.lastIndexOf(".")).toLowerCase();
    flag = true;
    var len = fileTypes.length;
    for (var i = 0; i < len; i++) {
        if (fileTypes[i] == ext) {
            flag = false;
            break;
        }
    }
    if (flag == false)
    { return false; }
    return true;

}
