/**
* image: image object
*/ 
function mouseOver(image, name) {
  	var source = image.src;
  	if (name) {
  		image.src = name;
  	} else {
		source = source.replace(".gif", "-hilite.gif");
  		image.src = source.replace(".jpeg", "-hilite.jpeg");
	}	
	
}

function mouseOut(image, name) {
  	var source = image.src;
  	if (name) {
		image.src = name;
  	} else {
		source = source.replace("-hilite.gif", ".gif");
  		image.src = source.replace("-hilite.jpeg", ".jpeg");
	}
}

function showhide(name, show) {
	var obj = document.getElementById(name).style;

	if (show) {
		obj.visibility = 'visible';
	} else {
		obj.visibility = 'hidden';
	}
}

function show(name) {
	showhide(name, true);
}

function hide(name) {
	showhide(name, false);
}

function getObj(name) {
	if (document.getElementById) {
	  	this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
	} else if (document.all) {
		this.obj = document.all[name];
		this.style = document.all[name].style;
	} else if (document.layers) {
	   	this.obj = document.layers[name];
   		this.style = document.layers[name];
	}
}

function openPicture(url, width, height) {
	var features = "";

	if (width) {
		features += "width=" + width;
	}
	if (height) {
		features += ",height=" + height;
	}

	var win = window.open('/display_image.php?img=' + url, 'pic', features);
	win.resizeTo(width, height);
}

function checkEmail(email){
	var str = email;
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/

	if (filter.test(str)) {
		testresults = true;
	} else {
		testresults = false;
	}
	return (testresults);
}
