		var hdlnTypes = new Array( "News", "Events");
		var hdlnInterval;
		var hdlnTime = 5000;
		
		var hdlnIndex = 0;
		var hdlns = new Array();

		function setHdLns()
		{
			if ( document.getElementById("hdlnBar") != null)
			{
			addHdLn( new Headline( "Anti-pylon groups fundraising event", "newsevents.html#e2", 0));
			addHdLn( new Headline( "National Grid drop-in swamped by strength of numbers against pylon plans", "newsevents.html#n6", 0));
			addHdLn( new Headline( "Radio 4 'You and Yours' item - A debate between CPRE and National Grid about the proposed expansion of power lines around the country.", "newsevents.html#n5", 0));
/*			addHdLn( new Headline( "SOV call for demonstration at the last Drop-in session on Saturday 3rd July", "newsevents.html#e1", 0));
			addHdLn( new Headline( "Drop-in sessions dates for the next round of National Grid Consultation", "newsevents.html#n3", 0));

			addHdLn( new Headline( "Infrastructure Planning Commission (IPC) is to be abolished", "newsevents.html#n2", 0));

			addHdLn( new Headline( "", "", 0));
*/
			}
}
		
		function addHdLn( hdln)
		{
			hdlns[ hdlns.length] = hdln;
		}
		
		function Headline( text, link, type)
		{
			this.text = text;
			this.type = type;
			this.link = link;
			
			this.getText = function () { return "<span id='hdlnText'>" + this.text + "</span>"; };
			this.getType = function () { return "<span id='hdlnType'>" + hdlnTypes[this.type] + "</span>";};
			this.getNextAnc = function () { return "<a href='javascript:next();'>next</a>";};
			this.getReadLnk = function() { if ( link == "") {return "";} else {return "<a href='" + link + "'>read</a><br/>";}};
			this.getIt = function () {
				return ( this.getText());
			};
			this.getTitle = function () { return (this.getType() + this.getNextAnc() + this.getReadLnk());};
		}
		
		function getDays()
		{
			myDate=new Date(); 
			today=Date.parse(myDate); 

			dDate = new Date();
			dDate.setFullYear(2010,6,23);
			dd = Date.parse(dDate.toString()); 
			daysToDDay=Math.round((dd-today)/(1000*60*60*24));
			if ( daysToDDay < 0)
			{
				daysToDDay = 0;
			}
			document.write( daysToDDay);
		}
		
		$(document).ready( function() {
				setHdLns();
				showHdln();
				hdlnInterval = setInterval( "showHdln()", hdlnTime);
				getMemberNums();
		});
		
		function chngImg()
		{
			if ( document.getElementById( "iWH").className == "iWHs")
			{
				document.getElementById( "iWH").className = "iWHl"
				document.getElementById( "iWH").src = "images/mapFull.png";
				document.getElementById( "zoom").innerHTML = "zoom out";
			}
			else
			{
				document.getElementById( "iWH").className = "iWHs"
				document.getElementById( "iWH").src = "images/mapSmall.png";
				document.getElementById( "zoom").innerHTML = "zoom in";
			}
		}
		
		function showHdln()
		{
			document.getElementById("hdlnTitle").innerHTML = hdlns[hdlnIndex].getTitle();
			document.getElementById("hdln").innerHTML = hdlns[hdlnIndex].getIt();
			if ( ++hdlnIndex >= hdlns.length)
			{
				hdlnIndex = 0;
			}
		}
		
		function next()
		{
			clearInterval(hdlnInterval);
			showHdln();
			hdlnInterval = setInterval( "showHdln()", hdlnTime);
		}
		
		var audioFolder = "";
		
		function embedPlayer(MP3title,MP3URL,id) { 
		   // Get Operating System 
		   var isWin = navigator.userAgent.toLowerCase().indexOf("windows") != -1;
		   if (isWin) { // Use MIME type application/x-mplayer2
			  visitorOS="Windows";
		   } else { // Use MIME type audio/mpeg, audio/x-wav, etc.
			  visitorOS="Other";
		   }
		
		   var audioURL = audioFolder + MP3URL;
		   var objTypeTag = "application/x-mplayer2"; // The MIME type to load the WMP plugin in non-IE browsers on Windows
		   if (visitorOS != "Windows") { objTypeTag = "audio/mpeg"}; // The MIME type for Macs and Linux 
		  
		   document.writeln("<div>");
		   //document.writeln("<strong style='font-size:18px; position:relative; top:-28px'>" + MP3title + "&nbsp;</strong>");  // Adjust font style to taste
		   document.writeln("<object width='00' height='0'>"); // Width is the WMP minimum. Height = 45 (WMP controls) + 24 (WMP status bar) 
		   document.writeln("<param name='type' value='" + objTypeTag + "'>");
		   document.writeln("<param name='src' value='" + audioURL + "'>");
		   document.writeln("<param name='autostart' value='0'>");
		   document.writeln("<param name='showcontrols' value='0'>");
		   document.writeln("<param name='showstatusbar' value='0'>");
		   var s = "<embed src ='" + audioURL + "' id='" + id + "' type='" + objTypeTag + "' autoplay='false' width='0' height='0' controller='0' showstatusbar='0' bgcolor='#ffffff' enablejavascript='true'></embed>";
		   document.writeln(s); 
		   
		   // Firefox and Opera Win require both autostart and autoplay
		   document.writeln("</object>");
		   document.writeln("</div>");
		   //document.close(); // Finalizes the document
		}
		
		function EvalSound( soundobj)
		{
			var thissound =  document.getElementById(soundobj);
			if ( thissound != null)
			{
				try
				{
					thissound.Play();
				}
				catch (e)
				{
					// replay by reloading!! yuk but at least it works for FF etc.
					window.location.reload(false);
				}
			}
		}
		

