function changeColor(color){
  var el=event.srcElement
  if (el.tagName=="INPUT"&&(el.type=="button"||el.type=="submit"||el.type=="reset"))
  event.srcElement.style.backgroundColor=color
}

// popup windows
var newwin = null;
function popup(url, wid, hi, scroll, name) {
  if (name != null) {
    if (url.indexOf("?")) {
      url += "&name="+name;
    } else {
      url += "?name="+name;
    }
  }
	new_spec = wid + "_" + hi + scroll;
	scrolling = scroll? "yes": "no";
	if (scroll && document.all && (navigator.userAgent.indexOf("Mac") > -1)) wid = wid+17;
	newwin=window.open(url,new_spec,"WIDTH=" + wid + ",HEIGHT=" + hi + ",scrollBars=" + scrolling + ",resizable=no,screenX=100,screenY=100,left=100,top=100");
	newwin.focus();
}


function openCenterWin(url,width,height, allow_scroll) {
  var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;

    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
  }
  if (allow_scroll) {
    str += ",scrollbars=yes";
  } else {
    str += ",scrollbars=no";
  }
  return window.open(url, 'inpas', str);
}

