function onTableRollover()
{
	this.className = this.oClassName + 'Over';
}

function onTableRollout()
{
	this.className = this.oClassName;
}

function onTableClick()
{
	var aObj = ScanChildTags( this, 'a' );
	
	document.location.href = aObj.href;
}

function ScanChildTags( pObj, fTag )
{
	var rObj;
	
	for( var i = 0 ; i < pObj.childNodes.length; i++ )
	{
		var t = pObj.childNodes[i];
		
		if( t.tagName ){
			if( t.tagName.toLowerCase() == fTag ){
				rObj = t; 
				break;
			}
		}
		
		rObj = ScanChildTags( t, fTag );
	}
	
	return rObj;
}

function SetupTable(t)
{
	t.oClassName = t.className;
	t.onmouseover = onTableRollover;
	t.onmouseout = onTableRollout;
	t.onclick = onTableClick;
	
	t.onmouseover();
}

function photo(url)
{
	var xMax = screen.width, yMax = screen.height;
	var xOffset = (xMax - 550)/2, yOffset = (yMax - 500)/6;
	newwindow = window.open(url,'test','z-lock=yes,width=560,height=460,directories=no,location=no,menubar=no,scrollbars=Yes,status=no,toolbar=no,resizable=no,left='+xOffset+',top='+yOffset);
	newwindow.focus();
}

function closeWindow()
{ 
	parent.window.opener.focus();
	parent.window.close();
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

function FormatNumber( n, d ){
	n = n.toString();
	
	if( ! isNaN( n ) ){
		var i = n.lastIndexOf( '.' );
		var c = 0;
		
		if( i == -1 ){
			n += '.';
			c = d;
		}
		else{
			var l = i + 1 + d;
			
			n = n.length > l ? n.substring(0, l) : n;
			c = ( 1 + d ) - ( n.length - i );
		}
		
		for( var j = 0; j < c; j++ ){
			n += '0'
		}
	}
	else{
		n = 0;
	}
	
	return n;
}

function OnExTaxChanged( exFld ){
	var fldPrefix = exFld.id.substring( 0, exFld.id.indexOf('ExTax') );
	var inFld = exFld.form[fldPrefix + 'CostTbx'];
	
	if( inFld ){
		exFld.value = exFld.value.replace( /[^\d.]/ig, '' );
		inFld.value = exFld.value * 1.1;
	}
	
	inFld.value = FormatNumber( inFld.value, 2 );
}