var browserVer = parseInt(navigator.appVersion);
	var lastActive ="";
	if (browserVer >=4 ) version = "n3";
	else version = "n2"

	if (version=="n3")
	{
		menu1on = new Image(); menu1on.src="images/menu01b.gif"; //About us
		menu1off = new Image(); menu1off.src="images/menu01a.gif";

		menu2on = new Image(); menu2on.src="images/menu02b.gif"; //Members
		menu2off = new Image(); menu2off.src="images/menu02a.gif";

		menu3on = new Image(); menu3on.src="images/menu03b.gif"; // Directors
		menu3off = new Image(); menu3off.src="images/menu03a.gif";

		menu4on = new Image(); menu4on.src="images/menu04b.gif"; // Sub Committees
		menu4off = new Image(); menu4off.src="images/menu04a.gif";

		menu5on = new Image(); menu5on.src="images/menu05b.gif"; //Secretariat
		menu5off = new Image(); menu5off.src="images/menu05a.gif";

		menu6on = new Image(); menu6on.src="images/menu06b.gif"; //Memorandum
		menu6off = new Image(); menu6off.src="images/menu06a.gif";

		menu7on = new Image(); menu7on.src="images/menu07b.gif"; // Accreditation
		menu7off = new Image(); menu7off.src="images/menu07a.gif";

		menu8on = new Image(); menu8on.src="images/menu08b.gif"; //Events
		menu8off = new Image(); menu8off.src="images/menu08a.gif";

		/*menu9on = new Image(); menu9on.src="images/menu09b.gif"; //Press Gallery
		menu9off = new Image(); menu9off.src="images/menu09a.gif";*/

		menu10on = new Image(); menu10on.src="images/enquiryb.jpg"; //Enquiry
		menu10off = new Image(); menu10off.src="images/enquirya.jpg";

		menu11on = new Image(); menu11on.src="images/contactb.jpg"; //Contact
		menu11off = new Image(); menu11off.src="images/contacta.jpg";

		menu12on = new Image(); menu12on.src="images/menu10b.gif"; //circulars
		menu12off = new Image(); menu12off.src="images/menu10a.gif";

		menu13on = new Image(); menu13on.src="images/menu13R.jpg"; //circulars
		menu13off = new Image(); menu13off.src="images/menu13.jpg";

		menu14on = new Image(); menu14on.src="images/pressgalleryb.jpg"; //circulars
		menu14off = new Image(); menu14off.src="images/pressgallerya.jpg";

	}
	function img_act(act)
	{
		if (lastActive != "") img_inact(lastActive);
		if (version == "n3")
		{
			imgOn = eval(act + "on.src");
			document [act].src = imgOn;
			lastActive = act;
		}
		return;
	}

	function img_inact(imgName)
	{
		if (version == "n3")
		{
			imgOff = eval(imgName + "off.src");
			document [imgName].src = imgOff;
		}
		return;
	}

//Textarea Limit
var ns6=document.getElementById&&!document.all

function restrictinput(maxlength,e,placeholder)
	{
		if (window.event&&event.srcElement.value.length>=maxlength)
	return false
		else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength)
			{
				var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
				if (pressedkey.test(String.fromCharCode(e.which)))
				e.stopPropagation()
			}
	}

function countlimit(maxlength,e,placeholder)
	{
		var lengthleft=window.event? maxlength-event.srcElement.value.length : maxlength-e.target.value.length
		var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
		if (window.event||e.target&&e.target==eval(placeholder))
			placeholderobj.innerHTML=lengthleft
	}


function displaylimit(theform,thelimit)
	{
		var limit_text='<table width="100%" border="0" cellpadding="1" cellspacing="0" align="center"><tr><td class="normal" width="4%"><span id="'+theform.toString()+'">'+thelimit+'</span></td><td class="smalltext">Characters remaining on your input limit</td></tr></table>'
		if (document.all||ns6)
			document.write(limit_text)
		if (document.all)
			{
				eval(theform).onkeypress=function()
					{ 
						return restrictinput(thelimit,event,theform)
					}
				eval(theform).onkeyup=function()
					{
				countlimit(thelimit,event,theform)
					}
			}
	else if (ns6)
	{
		document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 
		document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); 
	}
}