//	Common Javascript - Copyright (C) 2003-2009 Charles A Upsdell, All Rights Reserved; www.upsdell.com


function myInsertPhoto ( sPhoto, id )
{
$name = 'myInsertPhoto';
if ( sPhoto === undefined )
	$name.alert( '', 'photo name missing' );
id = id || 'ins_enlargement';
var o = getElement( id );
if ( o == null )
	return( true );
var sHTML = '<img src="' + sPhoto + '" />';
o.innerHTML = sHTML;
return( false );
}


// Mark anchor specifified in hash
function myMarkAnchor ( )
{
var o;
if ( ((window.location.href.indexOf("archive.htm") != -1)
   )
  && (window.location.hash != '') )
  {
	var sHash = window.location.hash.substr(1);
	if ( (o = document.anchors[sHash]) != null )
	  {
		o.style.color = '#090';
	  }
	else if ( (o = getElement(sHash)) != null )
	  {
		o.style.color = '#090';
	  }
  }
}


//	OnUnload Function
function myOnUnload( oPageStyle )
  {
	oPageStyle.saveActiveStylesheet();
  }


function startList ( id_list )
{
if ( myBrowser.isIE && (myBrowser.version.comp('7')<0) )
  {
	for ( var i = 0; i < arguments.length; ++i )
	  {
		var id = arguments[i];
		navRoot = document.getElementById(id);
		if ( navRoot == null )
			continue;
		for ( var j = 0; j < navRoot.childNodes.length; ++j )
		  {
			node = navRoot.childNodes[j];
			if (node.nodeName=="LI")
			  {
				node.onmouseover=function() { this.className+=" over"; }
				node.onmouseout=function() { this.className=this.className.replace(" over", ""); }
			  }
		  }
	  }
  }
}


// Scroll to an anchor; return false
function myScrollToAnchor ( id )
{
id = id || window.location.hash;
if ( id.indexOf('#') == 0 )
	id = id.substring(1);
var o = getElement( id );
if ( o )
  {
	if ( (typeof(o.offsetTop) !== typeof(nosuchvalue)) && (typeof(window.scrollTo) !== typeof(noSuchFunction)) )
	  {
		var x = 0;
		var y = 0;
		while ( o )
		  {
			x += o.offsetLeft;
			y += o.offsetTop;
			o = o.offsetParent;
		  }
		window.scrollTo( x, y );
	  }
	else
		window.location.replace( '#' + id );
  }
return( false );
}


// Scroll to a position, defaulting to top of page; return false if done
function myScrollTo ( left, top )
{
left = left || 0;
top = top || 0;
var value = true;
if ( typeof(window.scrollTo) !== typeof(noSuchFunction) )
  {
 	window.scrollTo( left, top );
	value = false;
  }
return( value );
}


//	Init

var myBrowser = new cBrowser();
if ( (typeof(myBrowser)=='object') && ((myBrowser.isIE && (myBrowser.version.comp('5')>=0)) || myBrowser.isG || myBrowser.isK || (myBrowser.isO && (myBrowser.version.comp('7')>=0))) )
	; // browser is modern
else if ( (typeof(myBrowser)!='object') || myBrowser.isIE || myBrowser.isN || myBrowser.isO )
	alert( 'Sorry, this site is not designed for ancient browsers' );




