﻿function CheckKeyEnter(e) { 
    var KeyID = (window.event) ? event.keyCode : e.keyCode;
    if (KeyID == 13) { 
      document.getElementById("btnG").focus(); 
    } 
}
function NewWindow(url)
{
    window.open(url,null, "height=600,width=800,status=yes,toolbar=no,menubar=no,location=no");
}

function validate()
{
    vStat = true;
    if(document.getElementById("ctl00_ByReligion").checked)
    {
        if(document.getElementById("ctl00_Religion1").value == "")
        {
            alert("No Religion selected.  Please select a religion from the dropdown list.")
            vStat = false;
         }
    }
    else if(document.getElementById("ctl00_BySubject").checked)
    {
        if(document.getElementById("ctl00_Subject1").value == "")
        {
            alert("No Subject selected.  Please select a subject from the dropdown list.")
            vStat = false;
         }
    }
    else if(document.getElementById("ctl00_ByAuthor").checked)
    {
        if(document.getElementById("ctl00_AuthorID").value == "")
        {
            alert("No Author selected.  Please select a author from the dropdown list.")
            vStat = false;
        }
    }
    else
        vStat = true;
        
    return vStat;
}

function Open_Detail(page) {
var height = 400;
var width = 600;
var option = "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,top=40,left=40,width=" + width +",height="+ height;
OpenWin = window.open(page, "CtrlWindow", option);
}

function getQueryVariable(variable) 
{ 
var query = window.location.search.substring(1); 
var vars = query.split("&"); 
for (var i=0;i<vars.length;i++) 
{ 
var pair = vars[i].split("="); 
if (pair[0] == variable) 
{ 
return pair[1]; 
} 
} 
}


