function helpPopup()
{
	var w=window.open("/help/frames.html","webhelp","width=600,height=432,top=100,left=100,status=no,menubar=no,toolbar=no,resizeable=no"); 
}


function localSubmit()
{
	var regVal = document.frmRegions.id.options.value;
	if(regVal != '')
	{
		document.frmRegions.submit();
	}
	else
	{
		return;
	}
	/*
	var stateVal=document.states.state.options.value;
	if ((stateVal!="")&&(stateVal!="United States")&&(stateVal!="Canada")&&(stateVal!="US Territories"))
	{
		document.states.submit();
	}
	else
	{
		return;
	}
	*/
}


//this function is used for the current event list component
function CalendarEventList2(EventDate)
{
	document.EventListCalendarFilters.StateDate.value=EventDate;
	document.EventListCalendarFilters.StartDate.value=EventDate;
	document.EventListCalendarFilters.EndDate.value=EventDate + " 23:59:59";
	
	document.EventListCalendarFilters.Category.value = '';
	document.EventListCalendarFilters.Organization.value = '';
	document.EventListCalendarFilters.UserGroup.value = '';
	document.EventListCalendarFilters.UserInterest.value = '';
	
	document.EventListCalendarFilters.submit();
}

function PhotoGalleryPopUp(ImageID,OriginalWidth)
{
	//this function will pop a new window for the photogallery component images
	var windowParameters;
	windowParameters = 'width=435,height=500,status=no,menubar=no,toolbar=no,scrollbar=no,directories=no,location=no,resizable=no,';
	var newWin = window.open("/photogallery_pop.aspx?resize=true&id="+ImageID+"&Width="+OriginalWidth,"Photogallery",windowParameters);
}

function CapWiz()
{
	//this function will pop a new window for the capwiz component
	// author: Brian Gomori
	var windowParameters;
	windowParameters = 'width=435,height=500,status=no,menubar=no,toolbar=no,scrollbar=no,directories=no,location=no,resizable=no,';
	var newWin = window.open("capwiz.html","CapWiz",windowParameters);
}

function popCampaignSurvey()
{
	//this function will pop a new window for the cfrd campaign survey
	// author: Brian Gomori
	var windowParameters;
	windowParameters = "width=790,height=550,status=no,menubar=no,toolbar=yes,scrollbars=yes,directories=no,location=no,resizable=yes";
	var newWin2 = window.open("/cfrd_forms/index.asp","",windowParameters);
}

var MM_contentVersion = 4;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}



function getFlashPlayer(flashID,fWidth,fHeight,imageID,iWidth,iHeight,iBorder, to, from, message)
{
	if ( MM_FlashCanPlay ) {
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
		document.write(' ID="'+flashID+'" WIDTH="'+fWidth+'" HEIGHT="'+fHeight+'" ALIGN="">');
		document.write(' <PARAM NAME=movie VALUE="/flashmovie.html?ID='+flashID+'&name='+escape(to)+'&mess='+escape(message)+'&from='+escape(from)+'"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#FFFFFF>  '); 
		document.write(' <EMBED src="/flashmovie.html?ID='+flashID+'&name='+escape(to)+'&mess='+escape(message)+'&from='+escape(from)+'" menu=false quality=high wmode=transparent bgcolor=#FFFFFF  ');
		document.write(' swLiveConnect=FALSE WIDTH="'+fWidth+'" HEIGHT="'+fHeight+'" NAME="flashcomp'+flashID+'" ALIGN=""');
		document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
		document.write(' </EMBED>');
		document.write(' </OBJECT>');
	} else{
	    document.write('<table><tr><td style="background-color:#ffffcc; border-color:dadada; border-width:1px; border-style:solid; font-family:Arial; font-weight:bold; font-size:11px; padding:5px;">You Either Have Javascript off or an old version of Macromedia\'s Flash Player. <a href="http://www.macromedia.com/go/getflashplayer" >Click here to get the latest Flash Player.</a></td></tr></table>');
		//document.write('<IMG SRC="/getImage.asp?id='+imageID+'" WIDTH="'+iWidth+'" HEIGHT="'+iHeight+'" BORDER="'+iBorder+'">');
	}
}


function adjustLayout()
{
	//get natural heights
	var lHeight = xHeight("linkList3");
	var cHeight = xHeight("supportingElements");
	var rHeight = xHeight("linkList4");
	
	var supportingElementsTag = "supportingElements";
	
	// On .Net Pages there is no supportingElements div (it is renamed by .Net)
	//check for regular pages
	if (cHeight <= 0)
	{
	    cHeight = xHeight("ctl00_ContentPlaceHolder1_supportingElements");	    
	    if (cHeight > 0)
	        supportingElementsTag = "ctl00_ContentPlaceHolder1_supportingElements";
	}
	//check for calendar page
	if (cHeight <= 0)
	{
	    cHeight = xHeight("ctl00_ContentPlaceHolder1_Mainpage1_supportingElements");
	    if (cHeight > 0)
            supportingElementsTag = "ctl00_ContentPlaceHolder1_Mainpage1_supportingElements";
	}
	//check for calendar landing page
	if (cHeight <= 0)
	{
	    cHeight = xHeight("ctl00_ContentPlaceHolder1_Landingpage1_supportingElements");
	    if (cHeight > 0)
            supportingElementsTag = "ctl00_ContentPlaceHolder1_Landingpage1_supportingElements";
	}	
	
	//find the max height
	var maxHeight = Math.max(lHeight,cHeight,rHeight);
	
	//assign max height to all columns
	xHeight("linkList3",maxHeight);
	xHeight(supportingElementsTag,maxHeight);
	xHeight("linkList4",maxHeight);
}

function pfpage(iArticleID, iPageIndex)
{
    var pfURL = '/page.html?ArticleID=' + iArticleID + '&page=' + iPageIndex + '&print=1';

    var pfWindow = window.open (pfURL, 'pf', 'menubar=yes,resizable=yes,scrollbars=yes,status=yes,width=640,height=450');
}

sfHover = function()
{
	if(document.getElementById("linkList1"))
	{
		var sfEls = document.getElementById("linkList1").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(document.getElementById("linkList2"))
	{
		var sfEls = document.getElementById("linkList2").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(document.getElementById("linkList3"))
	{
		var sfEls = document.getElementById("linkList3").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);
