sfHover = function() {
	if (document.getElementById("nav"))
	{
		var sfEls = document.getElementById("nav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);

function formSubmit(param_formName)
{
	eval('document.'+ param_formName +'.submit();');
}

function setIcon(param_IconName, param_IconFolder)
{
	document.getElementById('ContentIconImgName_Box').innerHTML = "<img src='"+ param_IconFolder + param_IconName +"' />";
	document.getElementById('ContentIconImgName').value = param_IconName;
}

function articleType(param_formName)
{
	if(param_formName.ArticleType.options[param_formName.ArticleType.selectedIndex].value=="NewsArticle")
	{
		document.getElementById("ContentType_Id").value = 2;
		document.getElementById("SitePage_Id").value = 3;
	}
	else if(param_formName.ArticleType.options[param_formName.ArticleType.selectedIndex].value=="CommitteeMeeting")
	{
		document.getElementById("ContentType_Id").value = 6;
		document.getElementById("SitePage_Id").value = 4;
	}

}

function disp_confirm(param_formName)
{
	var r=confirm("Are you sure you want to perfrom the delete action");
	if (r==true)
	  {
	  	eval('document.'+ param_formName +'.submit();');
	  }
}

function deactivate_confirm(param_formName)
{
	var r=confirm("Are you sure you want to deactivate all members");
	if (r==true)
	  {
	  	eval('document.'+ param_formName +'.submit();');
	  }
}

function callWin(url,w,h)
{
	width=w;
	height=h;

	LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
	win = window.open(url, "codapopup", "height="+height+", width="+width+", left="+LeftPosition+",top="+TopPosition+",toolbar=1,location=0,directories=0,status=1,menuBar=0,scrollBars=1,resizable=1");
	win.focus();
}

function formSubmitFilePick(param_File_Id)
{
	document.getElementById('File_Id').value = param_File_Id;
	formtoSubmit = document.getElementById('FormFilePicker');
	formtoSubmit.submit();
}

function checkanswers(fieldname, fieldnumber)
{
	var infoProvided = true;
	var questionfieldname;
	for(i=1; i<=fieldnumber; i++) {
		questionfieldname = fieldname + i;
		if(document.getElementById(questionfieldname).value=='') {
			infoProvided = false;
		}
	}

	if(!infoProvided) {
		return confirm('You have not provided any answers to the optional questions at the end of this form.\n\nIf you would like to continue and submit this form without answering these questions, press OK, if not, press Cancel.');
	} else {
		return true;
	}
}