function swapMenu (sImage, itemName, state) {
	with (document) {
		sImage.src = ('images/buttons/' + itemName + state + '.gif');
	}
}

function button (buttonID, suffix) {
	buttonID.className = 'button' + suffix;
}


function openWindow (htmlSrc) {
  var width = 420;
  var height = 450;
  var winLeft =(screen.width - width) / 2;
  var winUp = (screen.height - height) / 2;
  var centre = ',screenX='+winLeft+',screenY='+winUp+',left='+winLeft+',top='+winUp;
    win=window.open(htmlSrc, "WaterX1", 'scrollbars=yes,width='+width+',height='+height+centre);
    win.focus ();
}

function openWindow2 (htmlSrc) {
  var width = 480;
  var height = 200;
  var winLeft =(screen.width - width) / 2;
  var winUp = (screen.height - height) / 2;
  var centre = ',screenX='+winLeft+',screenY='+winUp+',left='+winLeft+',top='+winUp;
    win=window.open(htmlSrc, "WaterX2", 'scrollbars=no,width='+width+',height='+height+centre);
    win.focus ();
}


function openCustomWindow (theURL,winName,features,popW,popH) { //v2.0
  var winLeft = (screen.width - popW) / 2;
  var winUp = (screen.height - popH) / 2;
  var center = 'width='+popW+',height='+popH+',left='+winLeft+',screenX='+winLeft+',top='+winUp+',screenY='+winUp;

  var win = window.open(theURL,winName,features+','+center);
  win.focus();
}

function showReport (area) {
  openCustomWindow('http://www.waterexchange.com.au/cgi-bin/zonetrade/z.cgi?action=showreport&areas='+area, 'Report', 'scrollbars=yes', 780, 500);
}

