// Global Variables
var bLoaded = false;

function Init_Load( ) {
	bLoaded = true;
}

function ChangeImage( strImageName, strNewImage )
{
	if ( bLoaded == true )
		document.images[strImageName].src = eval(strNewImage + ".src");
}

function CreateImage( strPath )
{
	//alert(strPath);
	var theImage = new Image();
	theImage.src = strPath;
	return theImage;
}

function DocumentObject( strObjectID, bWithStyle )
{
	if (bWithStyle)
	{
		if (document.getElementById) return (document.getElementById(strObjectID).style); 
		else if (document.all) return (document.all[strObjectID].style); 
		else if ((navigator.appName.indexOf('Netscape') != -1) && (parseInt(navigator.appVersion) == 4)) return (document.layers[strObjectID]); 
	}
	else
	{
		if (document.getElementById) return (document.getElementById(strObjectID)) ; 
		else if (document.all) return (document.all[strObjectID]); 
		else if ((navigator.appName.indexOf('Netscape') != -1) && (parseInt(navigator.appVersion) == 4)) return (document.layers[strObjectID]); 
	}
}

var strSelectedFeature = String( "" );
// Use when you don't have an initial default layer and you don't want the selected layer to disappear upon same 2nd click
function FeatureLayerNoDefault(strFeature)
{
		if ( strSelectedFeature != strFeature )
		{
            ChangeImage( strSelectedFeature, strSelectedFeature + '_off' );
            ChangeImage( strFeature, strFeature + '_on' );
			DocumentObject( 'feature_contents_' + strSelectedFeature, true ).display = "none";
			DocumentObject( 'feature_contents_' + strFeature, true ).display = "inline";
				
			strSelectedFeature = strFeature
		}
}

function FeatureOver( strFeature )
{
	if ( strFeature != strSelectedFeature )
	{
		ChangeImage( strFeature, strFeature + '_on' );
	}
	return;
}

function FeatureOut( strFeature )
{
	if ( strFeature != strSelectedFeature )
	{
		ChangeImage( strFeature, strFeature + '_off' );
	}
	return;
}

// Show Description Function
function getDescription( strDescription )
{
     // Show layers
     DocumentObject( 'description_' + strDescription, true ).display = "inline";
     DocumentObject( 'close_' + strDescription, true ).display = "inline";
     // Hide Click button
     DocumentObject( 'click_' + strDescription, true ).display = "none";
     // Change background color
     document.getElementById('table_' + strDescription ).style.backgroundColor = "#f3f6f1";
}
// Hide Description Function
function hideDescription( strDescription )
{
     // Show layers
     DocumentObject( 'description_' + strDescription, true ).display = "none";
     DocumentObject( 'close_' + strDescription, true ).display = "none";
     // Hide Click button
     DocumentObject( 'click_' + strDescription, true ).display = "inline";
     // Change background color
     document.getElementById('table_' + strDescription ).style.backgroundColor = "#ffffff";
}

function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
    return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}
