<!--

function imgOn( img, name, id, next, last ) {
	img.src = http_root + "images/nav_" + name + "_over.gif";
	var div_pre = document.getElementById("divider_" + (id - 1));
	if( div_pre ) {
		name = (last) ? "both" : "R";
		div_pre.src = http_root + "images/nav_mid_01_" + name + "_over.gif";
	}
	var div_post = document.getElementById("divider_" + id);
	if( div_post ) {
		name = (next) ? "both" : "L";
		div_post.src = http_root + "images/nav_mid_01_" + name + "_over.gif";
	}
}
function imgOff( img, name, id, next, last ) {
	img.src = http_root + "images/nav_" + name + ".gif";
	var div_pre = document.getElementById("divider_" + (id - 1));
	if( div_pre ) {
		name = (last) ? "_L_over" : "";
		div_pre.src = http_root + "images/nav_mid_01" + name + ".gif";
	}
	var div_post = document.getElementById("divider_" + id);
	if( div_post ) {
		name = (next) ? "_R_over" : "";
		div_post.src = http_root + "images/nav_mid_01" + name + ".gif";
	}
}

var popup = null;
function show( item, id )
{
	if (id > 0)
	{
		try {
			if ( popup.closed || !popup.opener) popup = null;
		}
		catch ( e ) {
			popup = null;
		}
		var exists = popup;
		if (popup) popup.focus();
		var position = "";
		if (!exists)
		{
			var x = 50 /*window.outerWidth - 430*/; if (x < 0) x = 0;
			var y = (window.outerHeight - 550)/2; if (y < 0) y = 0;
			if (isNaN(x)||isNaN(y)) // W3C non-compartible IE
			{
				var x = window.screenLeft +50; if (x < 0) x = 0;
				var y = (window.screen.availHeight - 550)/2; if (y < 0) y = 0;
			}
			position = ",left="+x+",top="+y;
		}
		popup = window.open( item+'.php?id=' + id, 'wpt_itemdetails', "width=400,height=550,resizable=yes,scrollbars=yes,toolbar=no,dependent" + position );
	}
	else
	{
		alert ('Sorry, cannot show detailes for this ' + item );
	}
}

function trim(text){
	if (typeof(text)=="undefined"){
		return "";
	}
	else if (text==null){
		return "";
	}
	else {
		return text.replace(/^\s+/,"").replace(/\s+$/,"");
	}
}

function isempty( o )
{
	o.value = trim( o.value );
	return o.value.length == 0;
}

function isValidEmail(email) {       
	var re = /^\s*[-\w]+(\.[-\w]+)*@([-\w]+\.)+[-\w]+\s*$/;
	return re.test(email);
}
function isValidCurrency(strCheck){
	var s = trim( strCheck );
	var re = /^\$?(\+|-)?\$?(\d+(,\d{3})*)?\.?\d*$/;
	var res = re.test(s);
	if ( res && arguments.length > 1)
	{
		re = /(,)/g;
		var s = s.replace( re, "" );
		re = /($)/g;
		var s = s.replace( re, "" );
		var f = parseFloat( s );
		if ( f < arguments[1] ) res = false;
		if ( arguments.legth > 2 && f > arguments[2] ) res = false;
	}
	return res;
}
function isValidNumber(strCheck){

	var s = trim( strCheck );
	var re = /^(\+|-)?(\d+(,\d{3})*)?\.?\d*$/;
	var res = re.test(s);
	if ( res && arguments.length > 1)
	{
		re = /(,)/g;
		var s = s.replace( re, "" );
		var f = parseFloat( s );
		if ( f < arguments[1] ) res = false;
		if ( arguments.legth > 2 && f > arguments[2] ) res = false;
	}
	return res;
}
function isDigits( str ) {
	var re = /^\d+$/;
	return re.test( str );
}
function isValidDate( month, day, year )
{
	if ((month==4 || month==6 || month==9 || month==11) && day > 30) return false;
	if (month==2)
	{
		var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
		if (day > 29 || (day==29 && !isleap)) return false;
	}
	return true;
}
function isValidPassword( str )
{
	var re = /^\S{6,255}$/;
	return re.test( str );
}
function doAction( form, action )
{
	var a = document.forms[form].elements['action'];
	if (a) a.value = action;
	document.forms[form].submit();
}

function forgotPassword( el, action )
{
	if ( isempty( el ))
	{
		alert("Please enter your email.");
		return false;
	}
	else 
	{
		el.form.action = action;
		return true;
	}
}

-->

