function show_menu(e)
{
	if (!e) var e = window.event
	
		//document.getElementById('flash_content').onmouseover = banner_hand;
	//document.getElementById('flash_content').onmouseout = banner_default;
	
	target_class = (document.getElementById(this['target'] + '_top').className);
	if (target_class.search("active") < 0) {
		if (this['type'] == 'top') {
			document.getElementById(this['target']).className = 'menu_show';
		} else {

			if (this.className.search("first") >= 0) {

				this.style.backgroundImage = 'url(images/menu/item_top.gif)';
			} else {

				this.style.backgroundImage = 'url(images/menu/item.gif)';
			}

			document.getElementById(this['target']).className = 'menu_show';
		}
	} else {
		if (this['type'] == 'sub') {
			if (this.className != 'first' || this.className != 'first_active') {
				this.style.backgroundImage = 'url(images/menu/item_hover.gif)';
			}
		}
	}
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
}

function hide_menu(e)
{
	if (!e) var e = window.event

	target_class = (document.getElementById(this['target'] + '_top').className);
	if (target_class.search("active") < 0) {
		if (this['type'] == 'top') {
			if (this.className != 'first_active') {
				document.getElementById(this['target']).className = 'menu_hide';
			}
		} else {
			if (this.className.search("first") >= 0) {
				this.style.backgroundImage = 'url(images/menu/item_top.gif)';
			} else {
				this.style.backgroundImage = 'url(images/menu/item.gif)';
			}
			document.getElementById(this['target']).className = 'menu_hide';
		}
	} else {
		if (this['type'] == 'sub') {
			this.style.backgroundImage = 'none';
		}
	}
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
}

function set_link(e)
{
	if (!e) var e = window.event

	document.location = document.getElementById(this.id + "_link").href;
	
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
}

function build_menu(menu_arr,active_id) {

	for (i in menu_arr) {
		sub_nav_group = document.getElementById(menu_arr[i]);
		
		top_nav = document.getElementById(menu_arr[i] + '_top');

		if (document.getElementById(menu_arr[i]).id != active_id) {
			sub_nav_group.className = 'menu_hide';
		} else {
			sub_nav_group.className = 'menu_active';
		}

		for (sub_menu_i in prodesse_menu_val[i]) {
			sub_nav = document.getElementById(prodesse_menu_val[i][sub_menu_i]);

			sub_nav['type'] = 'sub';
			sub_nav['target'] = menu_arr[i];

			sub_nav.onmouseover = show_menu;
			sub_nav.onmouseout = hide_menu;
			sub_nav.onclick = set_link;
		}

		top_nav['target'] = menu_arr[i];
		top_nav['type'] = 'top';
		
		top_nav.onmouseover = show_menu;
		top_nav.onmouseout = hide_menu;
		top_nav.onclick = set_link;
	}

	document.getElementById(active_item + "_top").className =
	document.getElementById(active_item + "_top").className + "_active";
}




 function writeToDiv(whichDiv,whatText){
    if(document.getElementById){
      document.getElementById(whichDiv).innerHTML = whatText
    } else if(document.all){
      document.all(whichDiv).innerHTML = whatText
    } else if (document.layers){
      nsWriteToDivWidth = '100%'
      whatText = '<div id="nsRelativeFixDiv" style="position:absolute; left:0px; top:0px; width:'+nsWriteToDivWidth+'; height:1; z-index:1; visibility: visible;" class="textsmallprintbold">'+whatText+'</div>'
      eval('document.'+whichDiv+'.document.open()');
      eval('document.'+whichDiv+'.document.write(\''+whatText+'\')');
      eval('document.'+whichDiv+'.document.close()');
    }
  }
  
  function clearDefaultTextField(thisField,defaultText){
    if(thisField.value==defaultText){
      thisField.value='';
    }
  }

  newsAlertExists = ''
  pressReleaseAlertExists = ''
  presentationAlertExists = ''
  annualReportAlertExists = ''
  keyDatesAlertExists = ''
  
  
  function validateInput(){
    var theFormDetails = document.getElementById('theFormDetails')
    var theForm = document.getElementById('theForm') 
  
    if(theFormDetails.checkbox_news.checked || newsAlertExists){theForm.alerts_news.value = '~4962..RNS~' + theFormDetails.checkbox_news.checked + '~1'}
    if(theFormDetails.checkbox_press_release.checked || pressReleaseAlertExists){theForm.alerts_press_release.value = '~4962~' + theFormDetails.checkbox_press_release.checked + '~1'}
    if(theFormDetails.checkbox_presentation.checked || presentationAlertExists){theForm.alerts_presentation.value = '~4962~' + theFormDetails.checkbox_presentation.checked + '~1'}
    if(theFormDetails.checkbox_annual_report.checked || annualReportAlertExists){theForm.alerts_annual_report.value = '~4962~' + theFormDetails.checkbox_annual_report.checked + '~1'}

    alertsKeyDates = ''
 
    
    
    
    alertsKeyDates += '~4962.FIN.' + (theFormDetails.select_key_date_FIN.selectedIndex + 1) + '~' + theFormDetails.checkbox_key_date_FIN.checked + '~1'
    alertsKeyDates += ','
    alertsKeyDates += '~4962.AGM.' + (theFormDetails.select_key_date_AGM.selectedIndex + 1) + '~' + theFormDetails.checkbox_key_date_AGM.checked + '~1'

    if( theFormDetails.checkbox_key_date_FIN.checked || theFormDetails.checkbox_key_date_AGM.checked || keyDatesAlertExists){theForm.alerts_key_dates.value = alertsKeyDates}
    theForm.cancontact.value = theFormDetails.cancontact.checked   
    
    //**error checking
    
    errorMessage = ''
    
    if (theForm.email.value == ''|| theForm.email.value == 'Enter email address'){
      var label1 = document.getElementById('hi-lightemail');
      var input1 = document.getElementById('emailinput');
      
      label1.style.color = 'red';
      label1.style.fontWeight = 'bold';
      input1.focus();
      input1.style.backgroundColor = '#333';
      input1.style.color = 'white';
      alert ('* indicates a required field. \n \n  Please enter your email address.');
    } else if (theForm.firstname.value == ''|| theForm.firstname.value == 'Enter firstname'){
      var label2 = document.getElementById('hi-lightfirstname');
      var input2 = document.getElementById('firstname')
      
      label2.style.color = 'red';
      label2.style.fontWeight = 'bold';
      input2.focus();
      input2.style.backgroundColor = '#333';
      input2.style.color = 'white';
      alert ('* indicates a required field. \n \n  Please enter your first name.');
    } else if (theForm.lastname.value == ''|| theForm.lastname.value == 'Enter lastname'){
      var label3 = document.getElementById('hi-lightlastname');
      var input3 = document.getElementById('lastname')
      
      label3.style.color = 'red';
      label3.style.fontWeight = 'bold';
      input3.focus();
      input3.style.backgroundColor = '#333';
      input3.style.color = 'white';
      alert ('* indicates a required field. \n \n  Please enter your last name.');
    } else { 
      theForm.submit();
    }
     
  }
  
  function unRegister(){
    if(confirm("Are you sure you wish to unsubscribe")){
      self.location.href = "http://miranda.hemscott.com/servlet/HsSession?context=ir.xslalerts\x26path=users\x26service=deleteUserAndLogoff\x26client=prd\x26profileType=anonymous\x26hsid=172.20.0.26:E313FC5F4F3C88723D9BD236C65CC3CE"
    }
  }
  
  
  