var menu_timer = null;
var menu_current = null;
var menu_clear = null;

function m_get( name ) { var node; if ( ! document.getElementById ) return -1; node = document.getElementById( name ); if (typeof( node ) == 'undefined' || node == null ) return -1; return node; }
function m_mark( name ) { var node; var parent; if ( ( node = m_get( name ) ) == -1 ) return; while (1) { node.navigationmark = name; parent = node.getAttribute( 'navigationparent' ); if ( parent == 0 ) break; if ( ( node = m_get( parent ) ) == -1 ) break; } }
function m_position( name, against, xo, xor, yo )
{ var node; var header; var edge; var width; var x,y; var xp, yp; if ( ( node = m_get( name ) ) == -1 ) return; if ( ( header = m_get( 'header' ) ) == -1 ) return; edge = findPosX( header ) + 771; xp = findPosX( against ); yp = findPosY( against ); x = xp + xo; y = yp + yo;

width = 130;

if ( x + width > edge )
{
  if ( xor != 0 )
  {
    x = xp + xor;
  }
  else
  {
    x = edge - width;
  }
}


node.style.left = x + 'px'; node.style.top = y + 'px'; }    

function mti( name, self, direction ) { m_position( name, self, -1, 0, 31 ); m_show( name ); }
function mto( name ) { m_timer( name ); }

function mdi( name ) { m_keep( name ); }
function mdo( name ) { m_timer( name ); }

function mii( name ) { m_show( name ); }

function mli( name, self ) { m_position( name, self, 130, -140, 0 ); m_show( name ); }
function mlo( name ) { m_timer( name ); }

function m_show( name ) { var node;  var parent; m_mark( name ); if ( menu_current == name ) menu_current = null; if ( menu_current != null ) m_visibility( menu_current, 'hidden', 0 ); m_visibility( name, 'visible', name ); menu_current= name; }
function m_visibility( name, state, value ) { var node; var parent; if ( menu_timer != null ) { clearTimeout( menu_timer ); menu_timer = null; } menu_clear = null; if ( ( node = m_get( name ) ) == -1 ) return; while (1) { if ( node.navigationmark != name ) break; node.style.visibility = state; node.navigationmark = value; parent = node.getAttribute( 'navigationparent' ); if ( parent == 0 ) break; if ( ( node = m_get( parent ) ) == -1 ) break; } }
function m_keep( name ) { if ( menu_clear == name ) { if ( menu_timer != null ) { clearTimeout( menu_timer ); menu_timer = null; } menu_clear = null; } }
function m_timer( name ) { var node; if ( ( node = m_get( name ) ) == -1 ) return; if ( node.navigationmark == name ) { if ( menu_timer != null ) { clearTimeout( menu_timer ); menu_timer = null; } menu_timer = setTimeout( 'm_visibility( ' + name + ', \'hidden\', 0 ); menu_clear = null;', 250); menu_clear = name; } }


function pl() { fl(); rl(); }

function fl()
{
  var i, frm, objects;

  if ( typeof( document.forms[0] ) != 'undefined' )
  {
    i = 0
    while ( typeof( document.forms[0].elements[i] ) != 'undefined' )
    {
      if ( document.forms[0].elements[i].type != 'hidden' )
      {
        if ( document.forms[0].elements[i].type == 'text' )
          document.forms[0].elements[i].focus();
        break;
      }

      i++;
    }

    if ( document.getElementsByTagName )
      for ( frm = 0; frm < document.forms.length; frm++ )
      {
        objects = document.forms[frm].getElementsByTagName('input');
        for ( i = 0; i < objects.length; i++ )
          if ( typeof( objects[i].src ) != 'undefined' )
            il( objects[i] );
      }
  }
}

function rl()
{
  var i, objects;
  
  if ( document.getElementsByTagName )
    objects = document.getElementsByTagName('img');
    for ( i = 0; i < objects.length; i++ )
      if ( typeof( objects[i].src ) != 'undefined' )
        il( objects[i] );
}

function il( object ) { if ( object.src.indexOf( '-normal' ) != -1 ) { object.nsrc = object.src; object.osrc = object.src.replace( '-normal', '-over' ); object.oimg = new Image; object.oimg.src = object.osrc; } }
function i0( name ) { var object; if ( document.getElementById ) if ( ( object = document.getElementById( name ) ) != null ) if ( object.nsrc != null ) object.src = object.nsrc; }
function i1( name ) { var object; if ( document.getElementById ) if ( ( object = document.getElementById( name ) ) != null ) if ( object.osrc != null ) object.src = object.osrc; }

function puo( url ) { var win = null; win = window.open( url, 'offsite', 'height=500,width=800,location=yes,resizable=yes,menubar=yes,status=yes,scrollbars=yes,toolbar=yes' ); //if ( win ) win.focus();
return false; }

function findPosX(obj) { var curleft = 0; if (obj.offsetParent) { while (obj.offsetParent) { curleft += obj.offsetLeft; obj = obj.offsetParent; } } else if (obj.x) curleft += obj.x; return curleft; }
function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop; obj = obj.offsetParent; } } else if (obj.y) curtop += obj.y; return curtop; }


// Flash 

var FlashActiveX;
var FlashActiveXVersion;

function FlashOK( version )
{
  if (navigator.plugins && navigator.plugins.length > 0)
  {
 	  if (navigator.plugins["Shockwave Flash"])
	{
	  var words = navigator.plugins["Shockwave Flash"].description.split(" ");

		for (var i = 0; i < words.length; ++i)
  	  {
		if (isNaN(parseInt(words[i])))
	   		continue;

	 		if ( parseInt(words[i]) >= version )
	 		{
	 		  return true;
	 		}
	  }
	}
  }
  else if ( FlashActiveX != null)
  {
	if ( FlashActiveX )
	{
	  return FlashActiveXVersion >= version;
	}
  }

  return false;
}


if ( navigator.userAgent.indexOf("MSIE") != -1 )
{
  if ( ! ( ( navigator.appVersion.indexOf("Mac") != -1 ) && ( parseInt(navigator.appVersion) == 3) ) )
  {
	document.writeln('<script language="VBScript">');
	document.writeln('Private i, x');

	document.writeln('On Error Resume Next');

	document.writeln('FlashActiveX = False');
	document.writeln('FlashActiveXVersion = 0');

	document.writeln('For i = 12 To 2 Step -1');

	document.writeln('  Set x = CreateObject("ShockwaveFlash.ShockwaveFlash." & i)');

	document.writeln('  If IsObject(x) Then');
	document.writeln('	FlashActiveX = True');
	document.writeln('	FlashActiveXVersion = i');
	document.writeln('	Exit For');
	document.writeln('  End If');

	document.writeln('Next');

	document.write('</scr');
	document.writeln('ipt>');

  }
}

function pu( url, w, h ) { window.open( url, "popup", "width=" + w + ",height=" + h + ",scrollbars=yes,directories=no,toolbar=no,status=no,menubar=no,location=no,resizable=no"); return false; }

function fm (v,f,w,h,i,a)
{
	if ( FlashOK(v) )
	{
		document.write( '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' + w + '" height="' + h + '" id="' + i + '" align="middle">' );
		document.write( '  <param name="allowScriptAccess" value="always" />' );
		document.write( '  <param name="movie" value="' + f + '" /><param name="quality" value="high" />' );
		document.write( '  <embed src="' + f + '" quality="high" wmode="transparent" width="' + w + '" height="' + h + '" name="' + i + '" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' );
		document.write( '</object>' );
	}
	else
	{
		document.write( a );
	}
}




/*tabs*/

	
	function addClass(toDelete,toAdd, div){
	
		if ( div.className ) //if div already has a class
		{
			var arrList = div.className.split(' ');	//split the classes up with a comma and put in array

			 // get uppercase class for comparison purposes
			var strUpper = toDelete.toUpperCase();
			
			 // find all instances of odd and even and remove them
			 for ( var x = 0; x < arrList.length; x++ )
			{
				if ( arrList[x].toUpperCase() == strUpper )
				{
				   arrList.splice(x, 1);
				   x--;
				}
			}
			arrList[arrList.length] = toAdd; //add class onto the end of the array

			div.className = arrList.join(' '); //join the class array back together and apply to class
		}
		else //if the class doesn't already have a class then just apply class
		{
			div.className = toAdd;
		}
	}
	
	var activeTab = 1;
	function openTab(tabId) {
	
	// reset old tab and content
		addClass("tabContentActive", "tabContent", document.getElementById("tabContent"+activeTab)); //reset the old content to non active
		document.getElementById("tabLink"+activeTab).className = "tabLink";
	
		// set new tab and content
	
		addClass("tabContent", "tabContentActive", document.getElementById("tabContent"+tabId));//make the new content active
		//document.getElementById("tab"+tabId).src = "/template/" + "tab"+tabId + "-active.gif";
		document.getElementById("tabLink"+tabId).className = "tabLinkActive";
		activeTab = tabId;

	}