// functions: jumpto(),checkcommentform(),chkcomm2(),checktopic(),checkdiscuss(),chkedit(l),checkoption(),checkcurrent() + dreamweaver extras...

function jumpto(){			//	used for dropdown select link boxes

var url=document.dropdown.jump[document.dropdown.jump.selectedIndex].value;
if (url == ""){
	return false;
	}
document.location.href=url;
return true;
}

function chkmsg(){		// public comments form fields

/// alert("chkmsg");

field=document.addmsg.name;
resp = chkcomm2(field,"your name");
if(resp == false){return false};

// field=document.addmsg.email;
// resp = chkcomm2(field,"your email");
// if(resp == false){return false};

field=document.addmsg.comment;
resp = chkcomm2(field,"some comment");
if(resp == false){return false};

field=document.addmsg.hdg;
resp = chkcomm2(field,"a subject heading");
if(resp == false){return false};

return resp;
}

function chkcomm2(field,text){

///	alert ("value=" + field.value);

if((field.value.length == 0)
||(field.value == " ")){
	alert("You'll need to enter " + text + "...\n - thanks!");
	field.focus();
	return false;
	}

return true;
}

function checktopic(){		//	this is for the current topics
							// make sure all comment forms have the same name & fields
							// woops - the public is different now! class instead of email

if (document.forummsg.email.value.length == 0){
	if (document.forummsg.branch.value == "members"){
		alert ("You need to enter your email address\n- thanks.");
		document.forummsg.email.focus();
		return false;
		}
	};

if (document.forummsg.comment.value.length == 0){
	alert ("You haven't written any comments!");
	document.forummsg.comment.focus();
	return false;
	};

if (document.forummsg.name.value.length == 0){
	alert ("You haven't put your name!");
	document.forummsg.name.focus();
	return false;
	};

return true;
}

function checkdiscuss(){		//	this is for the discussion boards
							// make sure all forms have the same name & fields

if (document.discussionmsg.email.value.length == 0){
	alert ("You need to enter your email address\n- thanks.");
	document.discussionmsg.email.focus();
	return false;
	};

if (document.discussionmsg.body.value.length == 0){
	alert ("You haven't written any comments!");
	document.discussionmsg.comment.focus();
	return false;
	};

if (document.discussionmsg.name.value.length == 0){
	alert ("You haven't put your name!");
	document.discussionmsg.name.focus();
	return false;
	};

if (document.discussionmsg.subject.value.length == 0){
	alert ("You haven't put the subject!");
	document.discussionmsg.subject.focus();
	return false;
	};

return true;
}

//-------
function chkedit(l){		//	used in amend.notices.pl in admin

alert("rad.length=" + l);
l++;
for (i=1; i< l; i++){

	alert("i=" + i + " : val=" + document.pp.rad[i].value);
	
	if (document.pp.rad[i].checked){return true;}
	}
alert('You need to select an entry to edit!');
return false;
}

//----------
function checkoption(topic){
if (topic == ""){
	alert("You'll need to pick a valid item");
	return false;
	}
return true;
}

//-------------
function checkcurrent(choice1,choice2,choice3,choice4,choice5,choice6,choice7,choice8){

if (
		((choice1 == "")||(choice1 == null))
	&&((choice2 == "")||(choice2 == null))
	&&((choice3 == "")||(choice3 == null))
	&&((choice4 == "")||(choice4 == null))
	&&((choice5 == "")||(choice5 == null))
	&&((choice6 == "")||(choice6 == null))
	&&((choice7 == "")||(choice7 == null))
	&&((choice8 == "")||(choice8 == null))
	)
	{
	alert("You must select at least one topic");
	return false;
	}

var duplicate = "You have duplicate choices in your selection!";

if((choice1 > "")
&&	(
		(
			(choice1 == choice2)
		||	(choice1 == choice3)
		||	(choice1 == choice4)
		||	(choice1 == choice5)
		||	(choice1 == choice6)
		||	(choice1 == choice7)
		||	(choice1 == choice8)
		)
	)
){
	alert(duplicate);
	return false;
	}

if((choice2 > "")
&&	(
		(
			(choice2 == choice3)
		||	(choice2 == choice4)
		||	(choice2 == choice5)
		||	(choice2 == choice6)
		||	(choice2 == choice7)
		||	(choice2 == choice8)
		)
	)
){
	alert(duplicate);
	return false;
	}

if((choice3 > "")
&&	(
		(
			(choice3 == choice4)
		||	(choice3 == choice5)
		||	(choice3 == choice6)
		||	(choice3 == choice7)
		||	(choice3 == choice8)
		)
	)

){
	alert(duplicate);
	return false;
	}

if((choice4 > "")
&&	(
		(
			(choice4 == choice5)
		||	(choice4 == choice6)
		||	(choice4 == choice7)
		||	(choice4 == choice8)
		)
	)

){
	alert(duplicate);
	return false;
	}

if((choice5 > "")
&&	(
		(
			(choice5 == choice6)
		||	(choice5 == choice7)
		||	(choice5 == choice8)
		)
	)

){
	alert(duplicate);
	return false;
	}

if((choice6 > "")
&&	(
		(
			(choice6 == choice7)
		||	(choice6 == choice8)
		)
	)

){
	alert(duplicate);
	return false;
	}

if((choice7 > "")
&&	(
		(choice7 == choice8)	
	)

){
	alert(duplicate);
	return false;
	}

return true;
}

// - dreamweaver crap.....

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

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;
}

