function popUp(w) {
  popWin = open(w,"Search","width=400,height=400,resizable=1,scrollbars=1")
  popWin.focus() // brings the new window to the front
  return false;
}

function popUpLg(w) {
  popWin = open(w,"Review","width=900,height=600,resizable=1,scrollbars=1")
  popWin.focus() // brings the new window to the front
  return false;
}

function popUpTarget(target,url,w,h) {
  if (w == 0) {
    popWin = open(url,target,"resizable=1,scrollbars=1");
  } else {
    popWin = open(url,target,"width="+w+",height="+h+",resizable=1,scrollbars=1");
  }
  popWin.focus() // brings the new window to the front
  return false;
}

function event_description(url) {
    popUpTarget('EventDesc', url, 400, 280);
    return false;
}

function hideemail(name,user,domain,subject,display) {
  if (display == null || display == '') {
    if (name == '') {
      display = user + '@' + domain;
    } else {
      display = name;
    }
  }

  if (subject != '') {
    subject = '?subject=' + subject;
  }
  document.write('<a href="mailto:' + name + ' <' + user + '@' + domain + 
    '>' + subject + '">' + display + '</a>');
}

function initButton(image,up,over,down,url) {
  image.onmouseover = function () { image.src = over; };
  image.onmouseup = function () { image.src = over; };
  image.onmousedown = function () { image.src = down; };
  image.onmouseout = function () { image.src = up; };
  image.onclick = function () { document.location = url; };
}

function moveFooterToBottom() {

 elem = document.getElementById("footerImg");
/*
obj = eval(elem.style);
var temp = "";
for (x in obj)
temp += x + ": " + obj[x] + "<br>";
//alert (temp);
document.write(temp);
*/
  if(elem.offsetTop+elem.offsetHeight < window.innerHeight) {
     elem.style.position = "absolute";
     pos = window.innerHeight - elem.offsetHeight;
     elem.style.top = pos + "px";
  }
}

function noEnterSubmit (field, event) {
  var keyCode = event.keyCode ? event.keyCode : event.which ?  event.which : event.charCode;

  if (keyCode == 13) {
      var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();

	return false;
     } else {
        return true;
     }
}

//Removes checks from all radio controls in group
// radios - radio control group
function uncheckRadios(radios) {
  for(i=0; i < radios.length; i++)
    radios[i].checked=false;
}

function unCheck(checkboxes) {
  for(i=0; i < checkboxes.length; i++) {
      test=document.getElementsByName(checkboxes[i])[0].checked=false;
  }
}

//inspect an object
function inspect(obj) {
  //ret = prompt ("Enter object", "document");
  //obj = eval(ret);
  var temp = "";
  for (x in obj)
     temp += x + ": " + obj[x] + "<br>\n";
  newwin = window.open('','');
  newwin.document.write(temp);
}

function openVideo(url,winname) {
	topWin = 0;
	leftWin = 0;
	props="scrollbars=no,status=no,width=760,height=432,top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=no";
	var myTrans = window.open(url,winname,props);
	myTrans.focus();
}
