//{(	StyleX.js		some short functions used by many pages

function overy	// mouse over img																	//C1951
(){	   //=====	   --------------
	document.body.style.cursor = 'hand';
}
function downy	// mouse button down on shadow img													//c1951
(){	   //=====	   -------------------------------
	var o = event.srcElement;
	o.style.left = 0;
	o.style.top  = 0;
}
function outy	// mouse leaving shadow img															//c1951
(){	   //====	   ------------------------
	var o = event.srcElement;
	o.style.left = -2;
	o.style.top  = -2;
	document.body.style.cursor = 'default';															//C1951
}

function urlParam	// extract named parameter from URL after "?"
	   //========	   ------------------------------------------
(	sParam
){
	var i = location.search.indexOf( "?" );
	if( i >=0 ){
		var s = "&" +location.search.substr( i +1 ) +"&";
		if( (i = s.indexOf( "&" +sParam +"=" )) >=0 ){
			s = s.substr( i +1 +sParam.length +1 );
/*-------*/	return s.substr( 0, s.indexOf( "&" ) );
		}
	}
	return "";
}

function reportError
	   //===========
(	msg
,	url
,	line
){
	var str = "Err: " +msg +" on line: " +line
	+"\nURL: " +url  +
	"\nWeb: " +navigator.appName + " " + navigator.appName +" " +navigator.appVersion;
	document.errform.error.value = str;
	return true;
}
// window.onerror = reportError;

function errorHandler	// error event handler, primed via  window.onerror = errorHandler;
	   //============	   ---------------------------------------------------------------
(	message		// text-based error description
,	url			// url which exhibited the script error
,	line		// the line number being executed when the error occurred
){
	return confirm( message +"  URL=" +String( url ) + "  Line " +String( line )
					+" OK to skip default error handler" );
}


function NumberOr0		// string to number, return 0 if not numeric								//c1893
	   //=========		   -----------------------------------------
(	s
){
	if( s.length ==0 )
/*---*/	return 0;
	else{
		var x = Number( s );
		if( isNaN( x ) )																			//c1918
/*-------*/	return 0;
		else
/*-------*/	return x;
	}
}

String.prototype.trim=function	// remove leading and trailing whitespace							//C1903
(){			   //====			   --------------------------------------
    return this.replace(/^\s*|\s*$/g,'');	// ^=start of line  *= $=end of line  g=global
}

String.prototype.QtoT=function	// replace any ' with ~												//C1903
(){			   //====			   --------------------
    return this.replace(/'/g,"~");
}
String.prototype.TtoQ=function	// replace any ~ with '												//C1903
(){			   //====			   --------------------
    return this.replace(/~/g,/'/);
}

var	rowInBody = 0;	// used in calls to e.g. putField. Replaced with row number in copied rows.		//C1427	//C1805	//c1893
//)}