/* Some standard use functions used on most pages */
/* Separating my javascripts from my HTML files    */
 
/*  -------------------------------------------------------------------
      Debug is only used as I can't find a good javascript debugger! 
    -------------------------------------------------------------------
*/
 
var debug = false;
function scrawl (something)
{
	if (debug)
	   document.write(" "+something);
}
/*  -------------------------------------------------------------------
      Make the first character in a string Upper case, i.e. string->String 
    -------------------------------------------------------------------
*/
function capitalize (string)
{
	 var first = string.slice(0,1); 
     return(first.toUpperCase()+string.slice(1));
}
   
/*  -------------------------------------------------------------------
	follow goes to the html path given in menuChooser
	This is used by the drop down Form menu for prime navigation
    -------------------------------------------------------------------
*/

function follow(placeToGoTo) 
{
   var newURL=document.getElementById(placeToGoTo).value;
   var hash = newURL.search("#");  // Check if a parameter is passed

   scrawl (newURL);
   if (hash < 0)  //  No parameters given
	{
	scrawl ("New URL"); 
	window.location=newURL;  // if URL is current, don't reload 
	}
   else
      if (document.URL.search(newURL.slice(0,hash)) < 0)  // new URL?	
	{	
	scrawl(newURL.slice(0,hash));
	window.location=newURL;  // Change the URL anyway, there may be parameters now
	}
      else	
	{
	window.location=newURL;  // Change the URL anyway, there are parameters now
	window.location.reload(); // Browsers 'optimize' by not reloading the current page
	}
}


/*  -------------------------------------------------------------------
      Swap Images is used to drive the thumbnail to full size mouseover 
    -------------------------------------------------------------------
*/

function swapImages(ImageName, NewImage)
{
	/* test to see if the browser understands rollovers
	   If it does swap one image for the other */
	   
	if (document.images)
	{
		document[ImageName].src = NewImage;
	}
}