function swap_img(x) {
    //var smallpic = eval('pic'+x);
	var smallpic = document.getElementById('pic'+x).src;
    var i1 = smallpic.search(/f=/);
    var j1 = smallpic.search(/&/);
    smallpicname = smallpic.substring(i1+2,j1);
    smallURL = "getimage.php?f=" + smallpicname + "&w=300&h=225";
     
  	var bigpic = document.getElementById("bigPic").src;
    var i2 = bigpic.search(/f=/);
    var j2 = bigpic.search(/&/);
    bigpicname = bigpic.substring(i2+2,j2);
    bigURL = "getimage.php?f=" + bigpicname + "&w=74&h=56";

    if (smallpicname != "images/no_image.jpg") {
      document.getElementById("bigPic").src = smallURL;
      eval('pic'+x).src = bigURL;			
    }
}
function popUp(){	  	
  	var bigpic = document.getElementById("bigPic").src;
    var i2 = bigpic.search(/f=/);
    var j2 = bigpic.search(/&/);
    bigpicname = bigpic.substring(i2+2,j2);
    //bigURL = "getimage.php?f=" + bigpicname + "&w=800&h=600&q=100";
    bigURL = "popImage.php?f=" + bigpicname + "&w=800&h=600&q=100";
	
    if (bigpicname != "images/no_image.jpg") {
      w1=window.open(bigURL,"Autoexpress","toolbar=no,location=0,directories=no,status=no, menubar=0,scrollbars=yes,resizable=1,width=850,height=650");
   	  w1.focus();
   	}
}

function ChangeColor(tableCell, highLight, bgcolour)
{
if (highLight)
{
  tableCell.style.backgroundColor = '#dcfac9';
  //tableCell.style.border = "1px solid #000000";
}
else
{
  tableCell.style.backgroundColor = bgcolour;
  //tableCell.style.border = "none";
}
}

function DoNav(aEvent,theUrl)
{
	var targ
 	var e = aEvent ? aEvent : window.event; // browser competibility
	if (e.target) targ = e.target
	else if (e.srcElement) targ = e.srcElement
	if (targ.nodeType == 3) // defeat Safari bug
	   targ = targ.parentNode
	var tname
	tname=targ.name
	if (tname == undefined) {
			window.location.href = theUrl;
	} else {
		if (tname.substr(0,8) != "camImage") {
			window.location.href = theUrl;
		}
	}
}
