
function getObjectByID(Objid) {
    var ns4 = document.layers;
    var ns6 = document.getElementById && !document.all;
    var ie4 = document.all;
    if (ns4) {
        return eval('document.' + Objid)
    }
    if (ns6) {
        return document.getElementById(Objid);
    }
    if (ie4) {
        return document.all(Objid);
    }
    return null
}

function SetText(objid, msg, fg, bg) {
    var ns4 = document.layers;
    var ns6 = document.getElementById && !document.all;
    var ie4 = document.all;
    if (!fg) fg = "#ff0000";
    if (!bg) bg = "#FFFFFF";

    var content = msg;
    if (ns4) {
        objItm = eval('document.' + objid)
        objItm.document.write(content);
        objItm.document.close();
        objItm.visibility = "visible";
    }
    if (ns6) {
        document.getElementById(objid).innerHTML = content;
    }
    if (ie4) {
        document.all(objid).innerHTML = content;
    }
}

function checkKey(b1, e) {
    if (e.keyCode == 13) {
        document.getElementById(b1).click();
        return false;
    }
}


function checkselection() {
    if (document.getElementById("radiobtn1").checked == false && document.getElementById("radiobtn2").checked == false) {
        alert('Please select Yes / No to cast your vote.');
        return false;
    }
}

function check_field() {
    if (document.getElementById("txtEmail").value == "") {
        alert('Please Enter Email id');
        document.getElementById("txtEmail").focus();
        return false;
    }

    if (!checkEmailnew(document.getElementById("txtEmail").value)) {
        alert('Please Enter Valid Email id.');
        document.getElementById("txtEmail").focus();
        return false;
    }
}

function check_field1() {
    if (document.getElementById("txtFirstName").value == "") {
        alert('Please Enter Name');
        document.getElementById("txtFirstName").focus();
        return false;
    }
    if (document.getElementById("txtFirstName").value == "Name") {
        alert('Please Enter Name');
        document.getElementById("txtFirstName").focus();
        return false;
    }
    if (document.getElementById("txtEmail").value == "") {
        alert('Please Enter Email id');
        document.getElementById("txtEmail").focus();
        return false;
    }
    if (document.getElementById("txtEmail").value == "Email ID") {
        alert('Please Enter Email id');
        document.getElementById("txtEmail").focus();
        return false;
    }

    if (!checkEmailnew(document.getElementById("txtEmail").value)) {
        alert('Please Enter Valid Email id .');
        document.getElementById("txtEmail").focus();
        return false;
    }
}

function checkEmailnew(myForm) {

    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm)) {
        return (true)
    }
    return false;
}

function clearText(boxId) {
    txtBox = document.getElementById(boxId);
    if (txtBox.value == "Name") {
        txtBox.value = ""
    }     
}

function filltxt(boxId) {
    txtBox = document.getElementById(boxId);    
    if (txtBox.value == "") {
        txtBox.value = "Name"
    }    
}
function clearText1(boxId) {
    txtBox = document.getElementById(boxId);
    if (txtBox.value == "Email ID") {
        txtBox.value = ""
    }     
}

function filltxt1(boxId) {
    txtBox = document.getElementById(boxId);    
    if (txtBox.value == "") {
        txtBox.value = "Email ID"
    }
}


//-------------------------Change Casting Image------------------------------
function changeimage(itemno) {
    document.getElementById("imgcastingcall").src = images[itemno];
}
//-------------------------Change Casting Image------------------------------

