/***************************
Javascript for the drop down menu in the red box.
This script allows one or several links
to open in a new window.

Created by Joe Crawford - October 2002
http://artlung.com/lab/scripting/dropdown-only-some-new-window/
***************************/


function parseNavigation(ob) {
toBeBrokenDown = ob.options[ob.selectedIndex].value.split("|");

targetWindow = toBeBrokenDown[0];
targetURL    = toBeBrokenDown[1];

	if (targetWindow!=='') {
	// if a new Window name is specified, then it will
	// open in a new Window.
	window.open(targetURL,targetWindow,'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=800,height=600');
	// if we open a new window, then we have to re-set
	// the select box to the first option
	// which should have no value
	ob.selectedIndex = 0;
		} else {
	// or else it will open in the current window		
	window.open(targetURL,'_top')
	}
}



//2009-11-13: SK: Adding function to retrieve email.


/*
	id: 		refers to id of the span element.
	start: 		refers to the start of the email address till the @ symbol
	emailSubject: 	email subject

*/

function SetPrivacyEmail(id, start, emailSubject)
{
var str = document.getElementById(id).innerHTML; 
if (str.indexOf("@") == -1)
{

var emailarray=[64,108,101,120,105,115,110,101,120,105,115,46,99,111,109,46,97,117] //encrypted form of "AT lexisnexis.com.au"
var email='' //variable for encrypted email 
for (var i=0; i<emailarray.length; i++)
 	email+= String.fromCharCode(emailarray[i])

document.getElementById(id).innerHTML = '<a href="mailto:'+start+email+'?subject='+emailSubject+'">' + start + email + '</a>';
document.getElementById(id).title = "Click to email";
document.location = "mailto:"+start+email + "?subject=" + emailSubject;
}
} 

