<!--
function submitenter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
   myfield.form.submit();
   return false;
   }
else
   return true;
}

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window2=window.open(href, windowname, 'left=100,top=60,width=760,height=480,scrollbars=no,resizable=no,dependent=yes');
window2.focus();
return false;
}

function publist(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window2=window.open(href, windowname, 'left=500,top=160,width=400,height=450,scrollbars=yes,resizable=yes,dependent=yes');
window2.focus();
return false;
}

function bigpopup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window3=window.open(href, windowname, 'left=20,top=60,width=800,height=500,scrollbars=yes,resizable=yes,location=yes,status=yes');
window3.focus();
return false;
}

function topmenu(pagename)
{
str = String(window.location);
if (str.search(pagename)!= -1){
document.write('<td align="center" width="33%" bgcolor="#00CCFF">');
}
else{
document.write('<td align="center" width="33%" bgcolor="#0099CC">');
}

}

function checkinput(myform) {

if(myform.elements[0].value == 'None'){
alert("Please enter your name");
return false;
}
if(myform.elements[0].value == ''){
alert("Please enter your name");
return false;
}

if(myform.elements[3].value == ''){
alert("Please enter the name of your organisation");
return false;
}

if(myform.elements[5].value == ''){
alert("Please enter your telephone number");
return false;
}

if(myform.elements[7].value == ''){
alert("Please enter your e-mail address");
return false;
}


if(myform.elements[9].value == ''){
alert("Please enter your address");
return false;
}



if(myform.elements[14].value == ''){
alert("Please enter the number of users");
return false;
}

if(myform.elements[18].value > ''){

  if(myform.elements[21].value == ''){
  alert("Please enter the name of the billing organisation");
  return false;
  }

if(myform.elements[23].value == ''){
alert("Please enter the billing telephone number");
return false;
}

if(myform.elements[25].value == ''){
alert("Please enter the billing e-mail address");
return false;
}


if(myform.elements[26].value == ''){
alert("Please enter billing address");
return false;
}

}


return true;

}


function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break; 
}
return null;
}  

function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}

function auto_show_name() {
if(GetCookie("hparam") != null)
{
document.write("<font class='bt'><font color='red'>You are currently logged in to Irish Books in Print.");
document.write(" Click <a href='../cgi-bin/login.exe?search=1&h=" + GetCookie('hparam') + "'>here</a> to go back in</font>");
document.write("<br><br>");
}
}

function set_name(form) {
var expdate = new Date ();
expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 31));
var username = form.nameinput.value
if (username != "") {
SetCookie ("hparam", username, expdate);
window.history.go(0);
}
else alert("Geez, at least enter something, entering nothing will cause an error.");
}

//-->

