function getBookmark() {
  var address = top.document.location.href;
  var bookmark="";
  var index = address.indexOf("#")+1;
  if (index > 0) {
    bookmark = address.substring(index);
  }
  return bookmark;
}

function jumpBookmark() {
  var bookmark = getBookmark();
  if (bookmark.length > 0) {
    document.location.hash = bookmark;
  }
}

//Gets a parameter value from the url
function getParameter(parName) {
  var parValue="";
  var index = location.href.indexOf("?")+1;
  if (index > 0) {
    var params = location.href.substring(index);
    index = params.indexOf(parName)+parName.length+1;
    if (index > 0) {
      var value = params.substring(index);
      index = value.indexOf("?");
      if (index > 0) {
        parValue = value.substring(0, index);
      } else {
        parValue = value;
      }
    }
  }
  return parValue;
}

function check_frames()
{
  if (window==top) {
    var currentURL = top.location.href;   
    top.location.href = './index.html'+'?main='+currentURL;
  }
}

function check_target()
{
  var menu = getParameter('menu');
  if (menu.length>0) {
    top.frames.menu.location.href = './leftmenu.html';
  }
  var page = getParameter('main');
  if (page.length>0) {
    top.frames.main.location.href = page;
  }
}


function HighlightMainMenu(menuItem) 
{
  HighlightMainMenuByName(menuItem.id);
}

function HighlightMainMenuByName(menuName) 
{
  var divs = top.banner.document.all.tags('A');  
  for (var d = 0; d < divs.length; d++) {
    if (divs[d].id != menuName) {
      divs[d].style.fontWeight = "";
      divs[d].style.color = "";
    } else {
      divs[d].style.fontWeight = "bold";
      divs[d].style.color = "#C6D639";
    }
  }      
}

function HighlightSubMenu(menuItem) 
{
  HighlightSubMenuByName(menuItem.id);
}

function HighlightSubMenuByName(menuName) 
{
  var divs = top.menu.document.all.tags('A');
  for (var d = 0; d < divs.length; d++) {
    if (divs[d].id != menuName) {
      divs[d].style.fontWeight = "";
      divs[d].style.color = "";
    } else {
      divs[d].style.fontWeight = "bold";
      //divs[d].style.color = "#007161";
      divs[d].style.color = "#ffffff";
    }
  }      
}

// Copyright 2001 Idocs.com      
// Distribute this script freely, but keep this notice in place

// backlink object initializer
function backlink() {
	this.text = 'Back';
	this.type = 'link';
	this.write = backlink_write;
	this.form = true;
}


// write method
function backlink_write() {
	if (! window.history) return;
	if (window.history.length == 0)return;

	this.type = this.type.toLowerCase();
	if (this.type == 'button') {
		if (this.form)
			document.write('<FORM>');
		document.write('<INPUT TYPE=BUTTON onClick="history.back(-1)" VALUE="', this.text, '"');
		if (this.otheratts) document.write(' ', this.otheratts);
		document.write('>');
		if (this.form)document.write('<\/FORM>');
	} else {
		document.write('<A HREF="javascript:history.back(-1)"');
		if (this.otheratts)
			document.write(' ', this.otheratts);
		document.write('>');
		if (this.type == 'image' || this.type == 'img') {
			document.write('<IMG SRC="', this.src, '" ALT="', this.text, '"');
			if (this.width) document.write(' WIDTH=', this.width);
			if (this.height) document.write(' HEIGHT=', this.height);
			if (this.otherimgatts) document.write(' ', this.otherimgatts);
			document.write(' BORDER=0>');
		}
		else
			document.write(this.text);
		document.write('<\/A>');
	}
}

