 function siteSpecificOnload()
 {
     expandableMenu();
 }
 
 

   function writeSharePrice()
    {
      if(prices)
      {
        document.write('<p style="font-size: 1.1em; margin-bottom: 8px; font-weight: bold;"><strong>'+prices+'p</strong></p>')
        if (change <= 0)
        {
          document.write('<p style="font-size: 0.8em; margin-bottom: 8px; font-weight: bold;">Change ' +change+'p</p>')
        }
        else
        {
          document.write('<p style="font-size: 0.8em; margin-bottom: 8px; font-weight: bold;">Change +'+change+'p</p>')
        }
          document.writeln('<p style="font-size: 0.7em; margin-bottom: 8px;">at ' + hour + ':' + min + ' on ' + day + '/' + theMonth + '/' + year + '')
      }
      else
      {
        document.write('&#160;')
      }
      document.write('<p style="font-size: 0.7em;"><a href="/servlet/HsPublic?context=ir.access.jsp&amp;ir_client_id=3839&amp;ir_option=PRICES_DELAYED&amp;transform=mrs_lse_prices" style="text-decoration: none;" title="Link: Detailed share price.">More Information...</a></p>');    }
      
      /* for download centre */
      
      function doSubmit() {
        var fromDay =  document.PRICES.startday.options[document.PRICES.startday.options.selectedIndex].value;
        var fromMonth = document.PRICES.startmonth.options[document.PRICES.startmonth.options.selectedIndex].value;
        var fromYear =  document.PRICES.startyear.options[document.PRICES.startyear.options.selectedIndex].value;
        var toDay = document.PRICES.finishday.options[document.PRICES.finishday.options.selectedIndex].value;
        var toMonth = document.PRICES.finishmonth.options[document.PRICES.finishmonth.options.selectedIndex].value;
        var toYear = document.PRICES.finishyear.options[document.PRICES.finishyear.options.selectedIndex].value;
      
        var firstDate = new Date();
        var startDate = new Date();
        var endDate = new Date();
        var localDate = new Date();
      
        firstDate.setDate(22);
        firstDate.setMonth(11);
        firstDate.setFullYear(1999);
      
        startDate.setDate(fromDay);
        startDate.setMonth(fromMonth-1);
        startDate.setFullYear(fromYear);
      
        endDate.setDate(toDay);
        endDate.setMonth(toMonth-1);
        endDate.setFullYear(toYear);
      
      
        if (startDate < firstDate){
          alert('Please check the dates selected. Start date cannot be before the 22nd of the December 1999');
        }
        else if (startDate > endDate){
          alert('Please check the dates selected. Start date cannot be after end date');
        }
        else if (endDate > localDate){
          alert('Please check the dates selected. End date cannot be in the future');
        }
        else{
          top.location.href= "http://miranda.hemscott.com/servlet/HsPublic?context=ir.access&ir_client_id=3839&ir_option=CSVDOWNLOAD&fromDate="+fromDay+"-"+fromMonth+"-"+fromYear+"&toDate="+toDay+"-"+toMonth+"-"+toYear+"&transform=single"
        }
   }
   
 /*
    * menuExpandable.js - implements an expandable menu based on a HTML list
    * Author: Dave Lindquist (http://www.gazingus.org)
    */
    
function expandableMenu() {
    
    initializeMenu("financialinfoMenu", "financialinfoActuator");
    initializeMenu("shareinfoMenu", "shareinfoActuator");
    initializeMenu("brokerMenu", "brokerActuator");
    initializeMenu("shareholderMenu", "shareholderActuator");
    }


if (!document.getElementById)
    document.getElementById = function() { return null; }

function initializeMenu(menuId, actuatorId) {
    var menu = document.getElementById(menuId);
    var actuator = document.getElementById(actuatorId);

    if (menu == null || actuator == null) return;

    //actuator.parentNode.style.listStyleImage = "url(/images/plus.gif)";
    actuator.onclick = function() {
        var display = menu.style.display;
        /*this.parentNode.style.listStyleImage =
            (display == "block") ? "url(/images/plus.gif)" : "url(/images/minus.gif)";
        menu.style.listStyleImage = "url(/images/square.gif)";*/
        menu.style.display = (display == "block") ? "none" : "block";

        return false;
    }
    menu.style.display = "none";
}

 
    
//--- search functions ----------------------------------  
function replaceQuotes(keyword){
  keyword = keyword.replace(/"/,'\'');
  if(keyword.indexOf('\"') != -1){
      keyword = replaceQuotes(keyword)
  }
  return keyword;
}


function runSearch(keyword) {
         
        if (keyword=='' || keyword=='Search >>' || keyword=='Enter phrase or keyword here') {
          alert("Please enter a word or phrase");
		  document.getElementById('search_text').value="";
		  document.getElementById('search_text').focus();
          }
        else {
          var SearchURL = "/servlet/HsPublic?context=ir.access.jsp&ir_client_id=3839&ir_option=HTML_SEARCH&keys=default";
          SearchURL = SearchURL + "&queryString=" + keyword + "&start=1";
          
          location.href = SearchURL;
          }
    }

//--- jump menu functions ----------------------------------  

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

