var ns4=document.layers?1:0
var ie4=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0

offsettop = 100;

var xspace;
var xtop;
function makeStatic() {
	if (ie4) pmenu.style.pixelTop=document.body.scrollTop+offsettop;
	else if (ns6) document.getElementById("pmenu").style.top=window.pageYOffset+offsettop;
	else if (ns4) eval( document.pmenu.top=eval(window.pageYOffset+offsettop) );
	setTimeout( "makeStatic()", 0 );
}

function makemenu(){
	if (ns6||ie4||ns4) makeStatic()
}

//window.onload=makemenu

function replace( txt , wo , wn ) {
	nwtxt = "" + txt; // temporary holder
	while ( nwtxt.indexOf( wo ) > -1 ) {
		pos = nwtxt.indexOf( wo );
		nwtxt = "" + ( nwtxt.substring( 0, pos ) + wn + nwtxt.substring( ( pos + wo.length ), nwtxt.length ) );
	}
	return nwtxt;
}

function isEmail(email) {
	invalidChars = " /:,;"
	if (email == "") { return (false); }
	for (i=0; i < invalidChars.length; i++) {
		badChar = invalidChars.charAt(i)
		if (email.indexOf(badChar,0) != -1) { return (false);	 }
	}
	atPos = email.indexOf("@", 1)
	if (atPos == -1) {return (false);}
	if (email.indexOf("@", atPos + 1) != -1) { return (false); }
	periodPos = email.indexOf(".", atPos)
	if (periodPos == -1) {	return (false);}
	if (periodPos + 3 > email.length) {	return (false);}
	return (true);
}

//---------------------------------------------------------------------------------------------------------------------------------------
function menuover( tbe, sb ) {
	tbe.cursor = "pointer";
	tbe.backgroundColor = "#3A4774";
	if (sb != "") {
		if (ie4) document.all( sb ).style.display = "block";
		else if (ns6) document.getElementById( sb ).style.display = "block";
	}
}
function menuout( tbe, sb ) {
	tbe.backgroundColor = "";
	if (sb != "") {
		if (ie4) document.all( sb ).style.display = "none";
		else if (ns6) document.getElementById( sb ).style.display = "none";
	}
}
function oppg( lk , wn ) {
	if ( wn == "" ) window.location = lk;
	else window.open( lk );
}

function openpx( p, wn, w, h, r, s ) {
	var PX, PY
	if ( PX == null ) PX=Math.ceil( ( window.screen.width-w ) / 2 );
	if ( PY == null ) PY=Math.ceil( ( window.screen.height-h ) / 2 );

	var wnew = window.open( p , wn ,"resizable="+r+",toolbar=0,directories=0,menubar=0,scrollbars="+s+",status=1,width=" + w + ",height=" + h );

	if ( ! wnew.opener ) wnew.opener = self;
	wnew.moveTo( Math.ceil( PX ), Math.ceil( PY ) )
	wnew.focus();
}
//---------------------------------------------------------------------------------------------------------------------------------------


