//initialise general counter variable for pagecurrent = 0;curlocation= "none";// directory switcherfunction showDir(elementID){	// is something open?	if (current != 0){		//close current		oldoff='switchoff_'+current;		oldon='switchon_'+current;		olddetails='details_'+current;		oldhead= 'head_'+current;				Element.hide(oldoff);		Element.show(oldon);				Element.addClassName(oldhead,'dir-head');		Element.removeClassName(oldhead,'dir-head-on');				Effect.BlindUp(olddetails, {			afterFinish:function(){				newoff='switchoff_'+elementID;				newon='switchon_'+elementID;				newdetails='details_'+elementID;				newhead = 'head_'+elementID;								Element.show(newoff);				Element.hide(newon);								Effect.BlindDown(newdetails,{afterFinish: function (){					Element.removeClassName(newhead,'dir-head');					Element.addClassName(newhead,'dir-head-on');					new Effect.ScrollTo(newhead);			}		});								current = elementID;			}		});			}else{		newoff='switchoff_'+elementID;		newon='switchon_'+elementID;		newdetails='details_'+elementID;		newhead = 'head_'+elementID;				Element.show(newoff);		Element.hide(newon);				Effect.BlindDown(newdetails,{afterFinish: function (){				Element.removeClassName(newhead,'dir-head');				Element.addClassName(newhead,'dir-head-on');					new Effect.ScrollTo(newhead);							}		});		current = elementID;	}}function hideDir(elementID){		newoff='switchoff_'+elementID;		newon='switchon_'+elementID;		newdetails='details_'+elementID;		newhead = 'head_'+elementID;				Element.show(newon);		Element.hide(newoff);				Element.removeClassName(newhead,'dir-head-on');		Element.addClassName(newhead,'dir-head');				Effect.BlindUp(newdetails);		current = 0;}function showCon(elementID){			newoff='switchoff_'+elementID;		newon='switchon_'+elementID;		newdetails='details_'+elementID;		newhead = 'head_'+elementID;				Element.show(newoff);		Element.hide(newon);		Element.removeClassName(newhead,'dir-head');		Element.addClassName(newhead,'dir-head-on');				Effect.BlindDown(newdetails);}function hideCon(elementID){		newoff='switchoff_'+elementID;		newon='switchon_'+elementID;		newdetails='details_'+elementID;		newhead = 'head_'+elementID;				Element.show(newon);		Element.hide(newoff);		Element.removeClassName(newhead,'dir-head-on');		Element.addClassName(newhead,'dir-head');				Effect.BlindUp(newdetails);}function openLoc(elementID){	if (curlocation != 'none' && curlocation != elementID){		Element.hide(curlocation);	}	Element.show(elementID);	curlocation= elementID;}function houseJump(){	var hotid= $F('house');	var url = "news.php?cmd=view&id="+hotid;	document.location = url;}function senateJump(){	var hotid= $F('senate');	var url = "news.php?cmd=view&id="+hotid;	document.location = url;}function conJump(){	var conid= $F('constituency');	var url = "constituencies.php?cmd=view&conid="+conid;	document.location = url;}function checkVoice(){	 var hasError='no';	 var errors ="<p>The following errors require correction in order to proceed:</p>\r\r<ul>"	 	if($F('name') == ''){		errors = errors + "<li>Your Name must be entered</li>\r";		$('name_check').innerHTML ='<img src="images/bad.gif" />';		hasError = 'yes';	}	if($F('title') == ''){		errors = errors + "<li>You must enter a subject or title</li>\r";		$('title_check').innerHTML ='<img src="images/bad.gif" />';		hasError = 'yes';	}		var email= $F('email');		if (!checkmail(email)){		errors = errors + "<li>Your Email Address is incorrect</li>\r";		$('email_check').innerHTML ='<img src="images/bad.gif" />';		hasError = 'yes';	} else{		$('email_check').innerHTML ='';	}		if($F('location') == ''){		errors = errors + "<li>You must be enter your location</li>\r";		$('location_check').innerHTML ='<img src="images/bad.gif" />';		hasError = 'yes';	}else{		$('location_check').innerHTML ='';	}		if($F('message') == ''){		errors = errors + "<li>You must enter a message</li>\r";		$('message_check').innerHTML ='<img src="images/bad.gif" />';		hasError = 'yes';	}else{		$('message_check').innerHTML ='';	}		if (hasError=='yes'){		$('errors').innerHTML = errors +"</ul>";		return false;	}		return true;}function partyHistory(toClose, toOpen){	new Effect.ScrollTo('container');	Effect.toggle(toClose, 'Blind',{		afterFinish:function(){			Effect.toggle(toOpen,'Blind');		}	});}function checkmail(str){var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/iif (filter.test(str))testresults=trueelse{testresults=false}return (testresults)}// MAIL A FRIENDfunction mailFriend(){	if($F('email') == ''){		alert("You must enter an email address to send the article to");		$('email').focus();		return false;	}else if($F('mymail') == ''){		alert("You must enter your own email address");		$('mymail').focus();		return false;	}		var pars = Form.serialize('newsmail');	var url = "mailfriend.php";		var doThis = new Ajax.Updater (		'mailform',		url,		{			method: 'post',			parameters: pars,			evalScripts: true			});}// addevent functionfunction addEvent(obj, evType, fn){  if (obj.addEventListener){    obj.addEventListener(evType, fn, false);    return true;  } else if (obj.attachEvent){    var r = obj.attachEvent("on"+evType, fn);    return r;  } else {    return false;  } }