var serviceWin;
var urljump;
var strsermon;
var serviceWin;
var thisurl;

  
function checkTerm()
{
  var str = document.frmkeyword.term.value;
  if (str == "Keyword Search" || str == "keyword search" || str == "Keyword" || str == "keyword")
  {
    alert("Please enter a keyword");
    //document.frmkeyword.term.value = "";
    //document.frmkeyword.term.focus();
  }
  else
  {
    document.frmkeyword.submit();
  }
}

function openServiceWindow(type,qs)
{
  if(type == "sponsor")
  {
    urljump = "donations.asp";
  }
  else if(type == "problem")
  {
    urljump = "routemail.asp";
  }
  else if(type == "emailsermon")
  {
    urljump = "emailsermon.asp";
  }
  else if(type == "order")
  {
    urljump = "buy.asp";
  }
  else if (type=="checkout")
  {
    urljump = "checkout.asp";
  }
  else if (type=="orderPayPal") 
  {
    urljump = "buypaypal.asp"
  }
  else
  {
    urljump = "index.asp";
  }
  
  serviceWin = window.open(urljump+"?"+qs,"servwin","scrollbars=yes,resizable=no,width=500,height=475,menu=no,status=no,address=no");
  serviceWin.focus();
}

function openRvWindow(link) 
{
  var rvWin = window.open("ah.asp?l=" + link,"ahwin","scrollbars=no,resizable=no,width=200,height=270,menu=no,status=no,address=no");
  rvWin.focus();
}

function openSendSermonWindow(title,churchid,id)
{
  strsermon = escape(title);
  thisurl = "emailsermon.asp?ser=" + strsermon + "&id=" + id + "&churchid=" + churchid;

  var emailWin = window.open(thisurl,"servwin","scrollbars=yes,resizable=no,width=500,height=375,menu=no,status=no,address=no");
  emailWin.focus();
}

function openOrderWindow(title)
{
  strsermon = escape(title);
  thisurl = "order.asp?ser=" + strsermon;

  var orderWin = window.open(thisurl,"servwin","scrollbars=yes,resizable=no,width=500,height=475,menu=no,status=no,address=no");
  orderWin.focus();
}