function printpage() {
  self.print();
}

function getWindowHeight() {
    var windowHeight = 0;
    if (typeof(window.innerHeight) == 'number') {
        windowHeight = window.innerHeight;
    }
    else {
        if (document.documentElement && document.documentElement.clientHeight) {
            windowHeight = document.documentElement.clientHeight;
        }
        else {
            if (document.body && document.body.clientHeight) {
                windowHeight = document.body.clientHeight;
            }
        }
    }
    return windowHeight;
}
function setFooter() {
    if (document.getElementById) {
        var windowHeight = getWindowHeight();
        if (windowHeight > 0) {
            var contentHeight = document.getElementById('dropshadow').offsetHeight;
            var footerElement = document.getElementById('footerdrop');
            var fillerElement = document.getElementById('filler');
            var footerHeight  = footerElement.offsetHeight;
            if (windowHeight - (contentHeight + footerHeight) >= 0) {
                footerElement.style.position = 'relative';
                fillerElement.style.height = (windowHeight - (contentHeight + footerHeight)) + 'px';
                //footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
            }
            else {
                footerElement.style.position = 'static';
            }
        }
    }
}
window.onload = function() {
    setFooter();
}
window.onresize = function() {
    setFooter();
}


//IE nav rollovers

function navover(){
startList("rightnav");           // initialise 1st level nav
}

function startList(pass_id){
var the_id=pass_id;
if (document.all&&document.getElementById) {
navRoot = document.getElementById(pass_id);
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}


function navexpand(){
var nav = document.getElementById("navigation").childNodes[0].childNodes;

alert(nav.length);
}

function expand(name) {

  var nav = document.getElementById("navigation").childNodes[0].childNodes;
  if (nav.length == 0) nav = document.getElementById("navigation").childNodes[1].childNodes;
  for (var i = 0; i < nav.length; i++) {
    if (nav[i].className != null && nav[i].className.indexOf("item") > -1) {
      if (nav[i].className.indexOf(name) > - 1) nav[i].style.display="block";
        else nav[i].style.display="none";
    }
  }
}

function expandinvest(name) {

  var nav = document.getElementById("navigation").childNodes[0].childNodes;
  if (nav.length == 0) nav = document.getElementById("navigation").childNodes[1].childNodes;
  for (var i = 0; i < nav.length; i++) {
    if (nav[i].className != null && nav[i].className.indexOf("item") > -1) {
      if ((nav[i].className.indexOf(name) > - 1) || (nav[i].className.indexOf("invest_section") > - 1)) nav[i].style.display="block";
        else nav[i].style.display="none";
    }
  }
}

function condense(name) {

  var nav = document.getElementById("navigation").childNodes[0].childNodes;
  if (nav.length == 0) nav = document.getElementById("navigation").childNodes[1].childNodes;
  for (var i = 0; i < nav.length; i++) {
    if (nav[i].className != null && nav[i].className.indexOf("item") > -1) {
      if (nav[i].className.indexOf(name) > - 1) nav[i].style.display="none";
        else nav[i].style.display="none";
    }
  }
}


function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
       if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {anchor.target = "_blank"; 
       } else if(anchor.getAttribute("href") && anchor.getAttribute("rel") == "thiswindow")anchor.target = "_top";
 } 
} 

function discWin(page){
    OpenWin = this.open(page, "Disclaimer", "toolbar=no,menubar=no,height=500,width=500,location=no,scrollbars=yes,resizable=no,status=no,left=100,top=100");
    }
    

function remove(s, t) {
   i = s.indexOf(t);
   r = "";
   if (i == -1) return s;
   r += s.substring(0,i) + remove(s.substring(i + t.length), t);
   return r;
   }    
   
function amps(){

var a="&";

return a;
}


function goToLink()
{
var list = document.getElementById('qlinks').search;
if (list.options[list.selectedIndex].value != "doNothing")
{
    window.location=list.options[list.selectedIndex].value;
}
}

function goToPress()
{
var list = document.getElementById('plinks').years;
if (list.options[list.selectedIndex].value != "doNothing")
{
    window.location=list.options[list.selectedIndex].value;
}
}  
