function MenuAction(x,y,z,a) {
		document.cookie='pgc=' + x 
		document.cookie='mod=' + y
		document.cookie='mnu=' + z
		parent.navigate (a);
}

function showContact(){
    document.getElementById('contactoptions').style.display = "inline";
}

function showMoreSearch(){
    document.getElementById('moresearchoptions').style.display = "inline";
    document.getElementById('searchOptionLink').innerHTML = "<a class=slinklight href=\"javascript:offMoreSearch();\">&laquo Turn Off Search Options</a>";
    document.getElementById('moreoptions').value = "yes";
}

function offMoreSearch(){
    document.getElementById('moresearchoptions').style.display = "none";
    document.getElementById('searchOptionLink').innerHTML = "<a href=\"javascript:showMoreSearch();\" class=slinklight>&raquo More Search Options</a>";
    document.Search.moreoptions.value = "no";
}

function PPP_validate() {
	var i,p,q,nm,test,word,num,min,max,msg,errors='',args=PPP_validate.arguments;
	msg  = "____________________________________________________\n\n" ;
	msg += "The form was not submitted because of the following error(s).\n";
	msg += "Please correct these error(s) and re-submit.\n";
	msg += "____________________________________________________\n" ;
	for (i=0; i<(args.length-2); i+=3)	{
		test=args[i+2]; word=args[i]; val=MM_findObj(args[i]);
	    if (val) {
			nm=val.name;
			if ((val=val.value)!="") {
				if (test=='N') {
					num = parseFloat(val);
			        if (val!==''+num) errors+='- '+word+' must contain a number.\n';
					if (test.indexOf('inRange') != -1) {
						p=test.indexOf(':');
						min=test.substring(8,p);
						max=test.substring(p+1);
						if (num<min || max<num) errors+='- '+word+' must contain a number between '+min+' and '+max+'.\n';
					}
		  		}
				if (test=='E') {
					p=val.indexOf('@');
					if (p<1 || p==(val.length-1)) errors+='- '+word+' must contain a valid e-mail address.\n';
				}
			} else if ((val=val.value)!="") {
				if (test=='E') {
					errors+= '- '+word+' must contain a valid e-mail address.\n';
				}
				if (test=='R') {
					errors+= '- '+word+' is required.\n';
		  		}			
			    if (test=='N') {
					errors+= '- '+word+' must contain a number.\n';
				}
			}
		}
	}
	if (errors) {
		alert(msg+'\n'+errors);
	}
	document.MM_returnValue = (errors == '');
}

function MM_findObj(n, d) { //v3.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); return x;
}

function Adm_deletefile(x, z) {
	var msg
	msg  = "________Administration File Manager Console_________\n\n" ;
	msg += "Are you sure you wish to remove the following.\n";
	msg += x + ".\n";
	msg += "______________________________________________\n" ;
	var ans = confirm(msg);
	if (ans){
		alert ("The information will be removed.")
		document.MM_returnValue = true;
		parent.navigate('default.asp?id='+x+'&fd='+z);		
	} else {
		alert ("The information has not been removed.")
		document.MM_returnValue = false;
	}
}

