
var bTestSite=false;
var sHttpPrefix="http://";

// establish test vs live site
if ((window.location.toString().toLowerCase().indexOf("minisage.com") > -1) || 
   (window.location.toString().toLowerCase().indexOf("3448aad2388c21be") > -1))  // sitelevel test ID
{
	bTestSite=true;
}
// establish http vs https
if (window.location.toString().toLowerCase().indexOf("https") > -1)
{
	sHttpPrefix = "https://";
}

var nSubMenuAdditionalWidthMedium = 150;   	//mfindlay
var nSubMenuAdditionalWidthWide = 200;    	//mfindlay

var nMenuWidth=190;				// width of menus to appear. Set to zero to ignore
var sBaseSite="";
var sNonSSLBaseSite="";

// If test site, just use 1 base site
if (bTestSite) 
{
	sBaseSite = sHttpPrefix + "cowell.minisage.com/";
	sNonSSLBaseSite = "http://" + "cowell.minisage.com/";
}
else
{
	sNonSSLBaseSite = "http://" + "www.shcowell.org/";
	
	// live site. If https mode, use safesecureweb address
	if (sHttpPrefix=="https://")
	{
		sBaseSite = sHttpPrefix + "www.shcowell.org/";
	}
	else
	{
		// non ssl mode, use normal address
		sBaseSite = sHttpPrefix + "www.shcowell.org/";
	}
} 

//****************************************************
// reloadCAPTCHA
//****************************************************
function reloadCAPTCHA() 
{
	document.getElementById('CAPTCHA').src=sBaseSite + 'include/CAPTCHA/CAPTCHA_image.asp?'+Date();
}

//********************
// TD Top nav onclick
//********************
function NavigateTo(sTarget)
{
	//window.location.href = sBaseSite + sTarget;
	window.location.href = sNonSSLBaseSite + sTarget;
	return true;
}


//var submenuTopOffset = "offset=5";  see iym for reference use in submenu flyouts
//var submenuLeftOffset = "offset=1";

// Fix for firefox Mac with Flash
fixMozillaZIndex=true;

// milonic
_menuCloseDelay=250;           	// The time delay for menus to remain visible on mouse out
_menuOpenDelay=50;             	// The time delay before menus open on mouse over
_subOffsetTop=4;             	// Sub menu top offset from bottom of image associated with it
_subOffsetLeft=0;            	// Sub menu left offset

// ABOUT US STYLE
with(siteMenuStyle=new mm_style()){
offcolor="#333333";				// normal (non-hover) text color  
offbgcolor="#E8DFBD";			// normal (non-hover) background color  
onbgcolor="#8579A8";			// hover background color  
oncolor="#FFFFFF";				// hover text color  
offclass="mmpadding";			// custom style attached to menu
onclass="mmpadding";			// custom style attached to menu
bordercolor="#A89C91";			// border color 
borderstyle="solid";
borderwidth=1;
fontfamily="Arial";				// font / font family
fontsize="11px";				// font size
fontstyle="normal";				// font style   
fontweight="bold";				// font weight (bold)   
//outfilter="Fade(duration=0.1)";
overfilter="Fade(duration=0.1);Alpha(opacity=90);Shadow(color='#777777', Direction=135, Strength=5)";
padding=2;						// menu item cell padding
pagebgcolor="#8579A8"; 			// this is the (non-hover) background color of the menu item last clicked 
pagecolor="#FFFFFF";  			// this is the (non-hover) text color of the menu item last clicked 
separatorcolor="#E8DFBD";		// separator color 
separatorsize="1";
subimage=sBaseSite + "menu/flyoutarrow.gif";
subimagepadding="2";
subimageposition="right";
}
//******************** GRANT MAKING ***********************************
with(milonic=new menuname("mmgrantmaking")){
//alwaysvisible=1;
//followscroll=1;
overflow="scroll";
style=siteMenuStyle;
itemwidth=190;  

top=-3;
left=15;
//aI("align=center;pointer=move;text=drag to move menu;type=dragable;url=#;");
aI("text=Grantmaking;url=" + sNonSSLBaseSite + "sections/grantmaking/grm_main.php;");
aI("text=Where We Fund;url=" + sNonSSLBaseSite + "sections/grantmaking/grm_wherewefund.php;");
aI("text=What We Fund;url=" + sNonSSLBaseSite + "sections/grantmaking/grm_whatwefund.php;");
}
	with(milonic=new menuname("GRANTMAKING_WHATWEFUND")){
	style=siteMenuStyle;
	//itemwidth += nSubMenuAdditionalWidthWide;
	aI("text=Family Resource Centers;url=" + sNonSSLBaseSite + "sections/grantmaking/grm_familyrc.php;");
	aI("text=K-12 Public Education;url=" + sNonSSLBaseSite + "sections/grantmaking/grm_k12.php;");
	aI("text=Youth Development;url=" + sNonSSLBaseSite + "sections/grantmaking/grm_youthdev.php;");
	aI("text=Affordable Housing;url=" + sNonSSLBaseSite + "sections/grantmaking/grm_housing.php;");
	aI("text=Responsive Grantmaking;url=" + sNonSSLBaseSite + "sections/grantmaking/grm_responsive.php;");
	}

//******************** HOW TO APPLY ***********************************
with(milonic=new menuname("mmapply")){
//alwaysvisible=1;
//followscroll=1;
overflow="scroll";
style=siteMenuStyle;
itemwidth=210;  

top=-3;
left=15;
//aI("align=center;pointer=move;text=drag to move menu;type=dragable;url=#;");
aI("text=How to Apply;url=" + sNonSSLBaseSite + "sections/apply/apply_main.php;");
aI("text=Working With Cowell;url=" + sNonSSLBaseSite + "sections/apply/apply_workingwcowell.php;");
aI("text=Funding Criteria;url=" + sNonSSLBaseSite + "sections/apply/apply_fundingcriteria.php;");
aI("text=Where We Fund;url=" + sNonSSLBaseSite + "sections/apply/apply_wherewefund.php;");
aI("text=What We Fund;url=" + sNonSSLBaseSite + "sections/apply/apply_whatwefund.php;");
aI("text=What We Do Not Fund;url=" + sNonSSLBaseSite + "sections/apply/apply_whatwedonotfund.php;");
aI("showmenu=APPLY_SITEVISIT;text=Application Process;url=" + sNonSSLBaseSite + "sections/apply/apply_applicationprocess.php;");
}
	with(milonic=new menuname("APPLY_SITEVISIT")){
	style=siteMenuStyle;
	//itemwidth += nSubMenuAdditionalWidthWide;
	aI("text=Site Visit;url=" + sNonSSLBaseSite + "sections/apply/apply_initialsitevisit.php;");
	}

//******************** GRANTS IN ACTION ***********************************
with(milonic=new menuname("mmgrantsinaction")){
//alwaysvisible=1;
//followscroll=1;
overflow="scroll";
style=siteMenuStyle;
itemwidth=210;  

top=-3;
left=15;
//aI("align=center;pointer=move;text=drag to move menu;type=dragable;url=#;");
aI("text=Grants Database;url=" + sNonSSLBaseSite + "sections/grantsinaction/gra_database.php;");
aI("showmenu=GRANTSINACTION_CASESTUDIES;text=Results &amp; Evaluation;url=" + sNonSSLBaseSite + "sections/grantsinaction/gra_results.php;");
}
	with(milonic=new menuname("GRANTSINACTION_CASESTUDIES")){
	style=siteMenuStyle;
	//itemwidth += nSubMenuAdditionalWidthWide;
	aI("text=Overview;url=" + sNonSSLBaseSite + "sections/grantsinaction/gra_results.php;");
	aI("text=Lessons Learned;url=" + sNonSSLBaseSite + "sections/grantsinaction/gra_lessons_learned.php;");
	aI("text=Case Study: Kings Beach;url=" + sNonSSLBaseSite + "sections/grantsinaction/gra_kings.php;");
	aI("text=Case Study: North Richmond;url=" + sNonSSLBaseSite + "sections/grantsinaction/gra_richmond.php;");
	}

//******************** GRANTEE RESOURCES ***********************************
with(milonic=new menuname("mmgranteeresources")){
//alwaysvisible=1;
//followscroll=1;
overflow="scroll";
style=siteMenuStyle;
itemwidth=210;  

top=-3;
left=15;
//aI("align=center;pointer=move;text=drag to move menu;type=dragable;url=#;");
aI("showmenu=GRANTEE_RESOURCES_LEADERSHIP;text=Leadership Development;url=" + sNonSSLBaseSite + "sections/granteeresources/grr_leadership_dev.php;");
aI("text=Nonprofit Sector;url=" + sNonSSLBaseSite + "sections/granteeresources/grr_nonprofit_resources.php;");
aI("text=Family Resource Centers;url=" + sNonSSLBaseSite + "sections/grantmaking/grm_familyrc_resources.php;");
aI("text=K-12 Education;url=" + sNonSSLBaseSite + "sections/grantmaking/grm_k12_resources.php;");
aI("text=Youth Development;url=" + sNonSSLBaseSite + "sections/grantmaking/grm_youthdev_resources.php;");
aI("text=Affordable Housing;url=" + sNonSSLBaseSite + "sections/grantmaking/grm_housing_resources.php;");
}

	with(milonic=new menuname("GRANTEE_RESOURCES_LEADERSHIP")){
	style=siteMenuStyle;
	//itemwidth += nSubMenuAdditionalWidthWide;
	aI("text=Overview;url=" + sNonSSLBaseSite + "sections/granteeresources/grr_leadership_dev.php;");
	aI("text=Leadership Grants;url=" + sNonSSLBaseSite + "sections/granteeresources/grr_ld_grants.php;");
	aI("text=Convenings;url=" + sNonSSLBaseSite + "sections/granteeresources/grr_ld_convenings.php;");
	aI("text=Resources;url=" + sNonSSLBaseSite + "sections/granteeresources/grr_ld_resources.php;");
	}

//******************** WHO WE ARE ***********************************
with(milonic=new menuname("mmwhoweare")){
//alwaysvisible=1;
//followscroll=1;
overflow="scroll";
style=siteMenuStyle;
itemwidth=210;  

top=-3;
left=15;
//aI("align=center;pointer=move;text=drag to move menu;type=dragable;url=#;");
aI("text=Who We Are;url=" + sNonSSLBaseSite + "sections/whoweare/wwa_main.php;");
aI("showmenu=WHOWEARE_OUR_PHILOSOPHY;text=Our Philosophy;pointer=default;");
aI("showmenu=WHOWEARE_OUR_TEAM;text=Our Team;pointer=default;");
aI("text=Our Legacy;url=" + sNonSSLBaseSite + "sections/whoweare/wwa_legacy.php;");
aI("text=Financial Information;url=" + sNonSSLBaseSite + "sections/whoweare/wwa_financial.php;");
}
	with(milonic=new menuname("WHOWEARE_OUR_PHILOSOPHY")){
	style=siteMenuStyle;
	//itemwidth += nSubMenuAdditionalWidthWide;
	aI("text=President's Letter;url=" + sNonSSLBaseSite + "sections/whoweare/wwa_prezletter.php;");
	aI("text=Mission, Vision, Values;url=" + sNonSSLBaseSite + "sections/whoweare/wwa_mission.php;");
	aI("text=Theory of Change;url=" + sNonSSLBaseSite + "sections/whoweare/wwa_change.php;");
	aI("text=Guiding Principles;url=" + sNonSSLBaseSite + "sections/whoweare/wwa_principles.php;");
	}

	with(milonic=new menuname("WHOWEARE_OUR_TEAM")){
	style=siteMenuStyle;
	//itemwidth += nSubMenuAdditionalWidthWide;
	aI("text=Board of Directors;url=" + sNonSSLBaseSite + "sections/whoweare/wwa_board.php;");
	aI("text=Cowell Staff;url=" + sNonSSLBaseSite + "sections/whoweare/wwa_staff.php;");
	}


//******************** NEWS & INFORMATION ***********************************
with(milonic=new menuname("mmnews")){
//alwaysvisible=1;
//followscroll=1;
overflow="scroll";
style=siteMenuStyle;
itemwidth=210;  

top=-3;
left=15;
//aI("align=center;pointer=move;text=drag to move menu;type=dragable;url=#;");
aI("text=What's New;url=" + sNonSSLBaseSite + "sections/newsandinfo/news_whatsnew.php;");
aI("text=Links &amp; Resources;url=" + sNonSSLBaseSite + "sections/newsandinfo/news_links.php;");
aI("text=Results &amp; Evaluation;url=" + sNonSSLBaseSite + "sections/grantsinaction/gra_results.php;");
}

//drawMenus();  will do this in main body so we don't lose the page background (milonic bug)


