<!--
function MM_findObj(n, d) { //v4.0
 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
 d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
 if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_validateForm() {//v4.0
 var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
 for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
 if (val) { nm=val.name; if ((val=val.value)!="") {
 if (test.indexOf('isEmail')!=-1) {
 var ri = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/,rv = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
 if (!(!ri.test(val) && rv.test(val))) errors+='- '+nm+' must contain an e-mail address.\n';
 } else if (test!='R') {
 if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
 if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
 min=test.substring(8,p); max=test.substring(p+1);
 if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
 } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
 } if (errors) alert('The following error(s) occurred:\n'+errors);
 document.MM_returnValue = (errors == '');
}
 
function FC_validateFormEx(){//v4.0
 var a=FC_validateFormEx.arguments,d=-1,e='',f,g,h=-1,i,l,m,N,p,q,s=0,t,u,V,x,y;
 for (i=0;i<(a.length-2);i+=3){
 t=a[i+2];V=MM_findObj(a[i]);
 if (V){
 N=V.name; 
 if ((V=V.value)!=""){
 if (t.indexOf('isEmail')!=-1){
 f=/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;g=/^\s*.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)\s*$/;
 if (!(!f.test(V) && g.test(V))) e+='- '+N+' must contain a valid e-mail address.\n';
 }else if (t.indexOf('isDate')!=-1){
 f=/^\s*(\d{1,2})[-\/\.](\d{1,2})[-\/\.](\d{4})/;
 if ((x=f.exec(V))!=null){
 p=t.indexOf(':');q=t.substring(p+1);
 if (q=='uk') {d=x[1];m=x[2];q='dd/mm/yyyy';}
 else {d=x[2];m=x[1];q='mm/dd/yyyy';}
 y=x[3];
 }
 if (!(m>0&&m<13&&d>0&&((d<32&&(m==1||m==3||m==5||m==7||m==8||m==10||m==12))||(d<31&&(m==4||m==6||m==9||m==11))||(m==2&&(y%4==0?(d<30):(d<29))))))
 e+='- '+N+' must contain a valid date - '+q+'.\n';
 }else if (t.indexOf('isTime')!=-1){
 f=/^\s*(\d{1,2}):(\d{2}):(\d{2})\s*$/;
 g=/^\s*(\d{1,2}):(\d{2})\s*$/;
 if ((x=f.exec(V))!=null){h=x[1];m=x[2];s=x[3];}
 else if ((x=g.exec(V))!=null){h=x[1];m=x[2];}
 if (!(h>=0&&h<24&&m>=0&&m<60&&s>=0&&s<60))
 e+='- '+N+' must contain a 24hr clock time - hh:mm or hh:mm:ss.\n';
 }else if (t.indexOf('isRegex')!=-1){
 p=t.indexOf(':');q=t.substr(p+1,1);f=new RegExp(unescape(t.substring(p+3)),q=='i'?q:'');
 if (!f.test(V)) e+='- '+N+' - Invalid input: "'+V+'".\n';
 }else if (t!='R'){
 if (isNaN(V)) e+='- '+N+' must contain a number.\n';
	 else{
 V=parseFloat(V);	 
 if (t.indexOf('inRange')!=-1){
 p=t.indexOf(':');l=t.substring(8,p);u=t.substring(p+1);
 if (V<l || u<V) e+='- '+N+' must contain a number between '+l+' and '+u+'.\n';
 }}}}else if (t.charAt(0)=='R') e += '- '+N+' is required.\n';
 }}
 if (e) alert('The following error(s) occurred:\n'+e);
 document.MM_returnValue=(e=='');
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
 window.open(theURL,winName,features);
 
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
 if (restore) selObj.selectedIndex=0;
}

function My_jumpMenu(targ,selObj,restore){ //v3.0
 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
 if (restore) selObj.selectedIndex=0;
}

function addfav() 
{
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) { 
		document.write('<a class="menu" href="javascript:window.external.AddFavorite("http://www.corfunet.com","Resource Centre for Corfu");" onMouseOver= " window.status= '); 
		document.write("'Add site to Favorites!'; return true "); 
		document.write('"onMouseOut= " window.status='); 
		document.write("' '; return true "); 
		document.write('">Add site to Favorites!</a>'); 
	}
	else 
	{ 
		var msg = "<span class=\"menu\">Add site to Favorites!"; 
		
		if(navigator.appName == "Netscape") msg += " (CTRL-D)"; 
		msg += "</span>"; document.write(msg); 
	}
}

function imagePopup(imageURL,winName,imgTitle)
{
	var	url_args;
	
	url_args = 'img=' + imageURL;
	
	if (imgTitle.length > 0)
	{
		url_args += '&title=' + escape(imgTitle);
	}
	
	window.open('/misc/image_popup.php?'+url_args, winName, 'width=650,height=480,toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,resizable=0');
	
}

function MM_goToURL() { //v3.0
 var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
 for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_callJS(jsStr) { //v2.0
 return eval(jsStr)
}

//Removes any spaces at the beginning or end of the string

function stripSpaces(theStr) {
 if (!theStr) theStr = ""; //ensure its not null
 theStr = theStr.replace(/^\s*/,""); //strip leading
 theStr = theStr.replace(/\s+$/,""); //strip trailing
 return theStr;
}


//-->