var localhtml = (new String( document.location )).substr(0,5)=="file:"
//window.top.setpage=true

function browser()
{
	var version, ofs

	this.IsNS = false
	this.IsNS6 = false
	this.IsMoz = false
	this.IsIE = false
	this.IsIE4 = false
	this.IsIE6 = false
	this.IsOther = false

	ofs = navigator.userAgent.indexOf( "Opera" )
	if ( ofs != -1 )
		{
		this.IsOther = true
		return
		}

	if  ( navigator.appName == "Netscape" )
		{
		version = parseInt( navigator.appVersion )
		if ( version < 5.0 )
			this.IsNS =  true
		else
			this.IsNS6 = true
		return
		}
	
	if ( navigator.appName == "Microsoft Internet Explorer" )
		{
		ofs = navigator.userAgent.indexOf( "MSIE" )
		version = parseInt( navigator.userAgent.substr( ofs+4 ) )
		if ( version >= 5 )
			{
			this.IsIE =  true
			if ( version >= 6 )
				this.IsIE6 = true
			}
		else
			this.IsIE4 = true
		return 
		}

	this.IsMoz = navigator.appName == "Mozilla"
	this.IsOther = ! this.IsMoz
}

var CurBrowser = new browser() ;

function ShortDate4( dte )
	{
	var yr = dte.getYear() ;
	if ( yr < 1900 )
		yr+=1900 ;
	return( dte.getDate()+"/"+(dte.getMonth()+1)+"/"+yr )
	}

function DocModified()
	{
	if ( ! CurBrowser.IsIE )
		return( "" ) ;
	var td = new Date(  this.document.fileModifiedDate ) ;
	return( ShortDate4( td ) ) ;
	}

function DocFilename( doc )
	{
	return( doc.location.href.substring( doc.location.href.lastIndexOf( "/" ) + 1 ) )
	}

//var curX = 0 ;
//var curY = 0 ;
//
//function mousetrack( evnt )
//	{
//	if ( CurBrowser.IsIE || CurBrowser.IsIE4 )
//		{
//		curX = event.offsetX ;
//		curY = event.offsetY ;
//		}
//	else
//		{
//		curX = evnt.layerX ;
//		curY = evnt.layerY ;
//		}
//	}

function InitPage()
	{
	if ( ! (CurBrowser.IsNS || CurBrowser.IsIE4) )
	{
		var obs = document.getElementsByName('nfm') ;
		for ( i = 0 ; i < obs.length ; i++ )
			obs[i].style.display=top.frames.length?'none':'block'
	}

//	if ( CurBrowser.IsMoz || CurBrowser.IsNS )
//		document.captureEvents( Event.MOUSEMOVE ) ;
//	document.onmousemove = mousetrack ;

	if ( document.title.search( 'Menu' ) == -1 )
		window.top.document.title=document.title;

//	if ( window.top.setpage )
//		window.top.mlastpage = new String( document.location )
	}

function extlink_local( lnktxt, lnkurl, lnknme, brk, blnktarg )
	{
	if ( brk==undefined) brk = false
	if ( blnktarg==undefined) blnktarg = false
	if ( lnknme != undefined ) document.write( "<a name="+lnknme+"></a>" )

	if ( localhtml )
		{
		document.write( lnktxt )
		document.write( brk ? "<br />" : " " )
		if ( (lnkurl != undefined) && (lnkurl != null) && (lnkurl != "") )
			document.write( "("+lnkurl+")" )
		}
	else if ( (lnkurl != undefined) && (lnkurl != null) && (lnkurl != "") )
		{
		document.write( "<a" )
		if ( blnktarg ) document.write( " target='_blank'" )
		document.write( " href="+lnkurl+">"+lnktxt+"</a>" )
		}
	else
		document.write( lnktxt )
	}

function ck_defined( ck )
{
// do it this way for IE4 where undefined is undefined, but will be returned in expression below
cks = "-" + ck + "-" ;
return( cks != "-undefined-" ) ;
}

function web_mail( web, mail1, mail2 )
{
if ( ck_defined( web ) && (web != "") )
	{
	document.write( "Website : " )
	document.write( localhtml ? web : "<a href=" + web + ">"+web+"</a>" )
	document.write( "<br />" )
	}

if ( ck_defined( mail1 ) && (mail1 != "") && ck_defined( mail2 ) && (mail2 != "") )
	{
	document.write( localhtml ? "Email :" + mail1 + "@" + mail2 : "<a href='mailto:"+mail1 + "@" + mail2 +"' style='color:#A52A2A'>Email</a>" )
	document.write( "<br />" )
	}
}
