<!--
// --------------------------------------------------------------------
// Print the current page
// --------------------------------------------------------------------

	function printPage()
	{	window.print();	}


// --------------------------------------------------------------------
// MENU handling
// --------------------------------------------------------------------

	var total=1;
	var MenuArray = new Array();
	var tip=new Array;
	var current=getCurrState();


// --------------------------------------------------------------------
// MENU VALUES
// --------------------------------------------------------------------
	// Format: MenuArrayAdd(parent[true|false], menuText, level, URL [blank for nohref], toolTip[0=no tip])

	MenuArrayAdd(true,	"<b>Contact Us</b>",		0, "contactUs.htm", 5)
	

	MenuArrayAdd(true,	"<b>About Us</b>",		0, "aboutUs.htm", 1)
	MenuArrayAdd(false,	"Board",			1, "board.htm", 2)
	MenuArrayAdd(false,	"Mandate & Vision",		1, "mandateAndVision.htm", 3)
	MenuArrayAdd(false,	"History",			1, "history.htm", 4)
	MenuArrayAdd(true,	"Publications",			1, "publications.htm", 11)
		MenuArrayAdd(false,	"Annual Reports",		2, "annualReports.htm", 12)
		MenuArrayAdd(false,	"Board Minutes",		2, "boardMinutes.htm", 13)
	
	MenuArrayAdd(true,	"<b>Fieldwork</b>",	0, "fieldwork.htm", 6)
	MenuArrayAdd(false,	"Checklist",			1, "checkList.htm", 37)
	MenuArrayAdd(false,	"Legislation",			1, "legislation.htm", 31)
	MenuArrayAdd(false,	"Protected Areas",		1, "protAreas.htm", 36)	
	MenuArrayAdd(true,	"Logistics",			1, "logistics.htm", 33)
		MenuArrayAdd(false,	"Transportation",		2, "transportation.htm", 38)
		MenuArrayAdd(false,	"Accommodation",			2, "accommodation.htm", 38)
		MenuArrayAdd(false,	"Communication",		2, "communication.htm", 38)
		MenuArrayAdd(false,	"Field Equipment",		2, "fieldEquipment.htm", 38)
		MenuArrayAdd(false,	"Provision",			2, "provision.htm", 38)
		MenuArrayAdd(false,	"Workshops",			2, "workshops.htm", 38)	
		MenuArrayAdd(false,	"Maps",				2, "maps.htm", 38)
	MenuArrayAdd(false,	"Safety Measures",		1, "safety.htm", 34)
	MenuArrayAdd(false,	"Climate",			1, "climate.htm", 35)
	MenuArrayAdd(false,	"ObSaExchange",			1, "ObSaExchange.htm", 49)
	
	MenuArrayAdd(true,	"<b>Research</b>",		0, "research.htm", 46)
	MenuArrayAdd(true,	"Research Bases",		1, "researchBases.htm", 41)
		MenuArrayAdd(false,	"Ny-Ålesund",			2, "baseNyAA.htm", 44)
		MenuArrayAdd(false,	"Longyearbyen",			2, "baseLby.htm", 43)
		MenuArrayAdd(false,	"Barentsburg",			2, "baseBarentsburg.htm", 45)
		MenuArrayAdd(false,	"Hornsund",			2, "baseHornsund.htm", 42)	
		MenuArrayAdd(false,	"Kaffiøyra",			2, "http://www.home.umk.pl/~geopolar/stacja/english.htm", 54)
	MenuArrayAdd(false,	"SSF workshops",			1, "ssfworkshop.htm", 55)
	MenuArrayAdd(false,	"Seminars",			1, "seminars.htm", 47)
	MenuArrayAdd(false,	"Blogs",			1, "ArcticBlogs.htm", 51)
	MenuArrayAdd(false,	"RiS Reports",			1, "risReports.htm", 14)
	MenuArrayAdd(false,	"RiS Database",			1, "database.htm", 48)
	MenuArrayAdd(false,	"IPY in Svalbard",		1, "IPYinSvalbard.htm", 52)
	MenuArrayAdd(false,	"Cooperation N - IT",	1, "/hidden/Default.htm", 53)

	MenuArrayAdd(true,	"<b>Funding</b>",		0, "funding.htm", 50)

	MenuArrayAdd(true,	"<b>Events</b>",		0, "events.htm", 19)

	MenuArrayAdd(true,	"<b>Links",			0, "links.htm", 16)
	
	MenuArrayAdd(true,	"<b>News Archive</b>",		0, "newsArchive.htm", 15)
	
		
	

// --------------------------------------------------------------------
// ToolTip-messages
// --------------------------------------------------------------------

	tip[0] =""
	tip[1] ="Read about SSF"
	tip[2] ="SSF's board members"
	tip[3] ="What is our mandate and vision?"
	tip[4] ="SSF's history"
	tip[5]="How to contact us"
	
	tip[6] ="Information for scientists in planning and carrying out research projects in Svalbard "
	
	tip[11]="SSF's publications and reports "
	tip[12]="SSF's annual reports as PDF-files "
	tip[13]="Minutes of the SSF board meetings as PDF-files "
	tip[14]="Research in Svalbard (RiS) annual reports "
	
	tip[15]="SSF's News Archive "
	tip[16]="Useful links "
	tip[17]="Go to Home page "
	tip[19]="Events Calendar "

	tip[31]="Laws and regulations for Svalbard "
	tip[33]="What to get and where to find logistics in Svalbard "
	tip[34]="Precaution you should consider before carrying out field work in Svalbard  "
	tip[35]="Climate and weather "
	tip[36]="An overview of protected areas in Svalbard "
	tip[37]="Check list for carrying out fieldwork in Svalbard "
	tip[38]="What to get and where to find it "
	tip[39]="Public services "
	
	tip[41]="Research bases at Svalbard "
	tip[42]="Short description of Hornsund research base "
	tip[43]="Short description of Longyearbyen research base "
	tip[44]="Short description of Ny-Ålesund research base "
	tip[45]="Short description of Barentsburg research base "
	tip[46]="Information about research basses and scientific activities in Svalbard"
	tip[47]="Talks held at seminars in Svalbard"
	tip[48]="Research in Svalbard Database"
	tip[49]="Observation and Sample Exchange Forum"
	tip[50]="Funding opportunities"
	tip[51]="Blogs from rersearchers in Svalbard"
	tip[52]="IPY in Svalbard"
	tip[53]="Password protected"
	tip[54]="External link to Kaffiøyra research base"
	tip[55]="Information about workshops organized by SSF"

// --------------------------------------------------------------------
// Add an entry to the MenuArray
// --------------------------------------------------------------------

	function MenuArrayAdd(parent, menuText, level, URL, toolTip) 
	{	MenuArray[total] = new Object;
		MenuArray[total].parent = parent
		MenuArray[total].menuText = menuText
		MenuArray[total].URL = URL
		MenuArray[total].level = level
		MenuArray[total].toolTip = toolTip
		total++	
	}


// --------------------------------------------------------------------
// Get current COOKIE setting
// --------------------------------------------------------------------

	function getCurrState() 
	{	var label = "ssf="
		var labelLen = label.length
		var cLen = document.cookie.length
		var i = 0
		while (i < cLen) 
		{	var j = i + labelLen
			if (document.cookie.substring(i,j) == label) 
			{	var cEnd = document.cookie.indexOf(";",j)
				if (cEnd == -1) 
				{	cEnd = document.cookie.length 	}
				return unescape(document.cookie.substring(j,cEnd))		
			}
			i++		
		}
		return ""	
	}


// --------------------------------------------------------------------
// Record current settings in COOKIE
// --------------------------------------------------------------------

	function setCurrState(setting) 
	{	var expire = new Date();
		expire.setTime(expire.getTime() + ( 1*24*60*60*1000 ) ); // expire in 1 day		
		document.cookie = "ssf=" + escape(setting) + "; expires=" + expire.toGMTString();	
	}
		

// --------------------------------------------------------------------
// Return padded spaces (in multiples of 5) according to level
// --------------------------------------------------------------------

	function pad(n) 
	{	var result = ""
		for (var i = 1; i <= n; i++) 
		{	if (n > 1)
			{ result += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp" 	}
			else
			{ result += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" 	}
		}
		return result		
	}


// --------------------------------------------------------------------
// If menuItem is a parent (submenu), toggle the menu	
// --------------------------------------------------------------------

	function updateMenu(p)
	{	if (MenuArray[p].parent)
		{	toggle(p)
		}
	}


// --------------------------------------------------------------------
// Toggles an outline parent entry, storing new value in the cookie
// --------------------------------------------------------------------

	function toggle(n) 
	{	if (n != 0) 
		{	var newString = ""
			var expanded = current.substring(n-1,n)	// of clicked item
			newString += current.substring(0,n-1)
			newString += expanded ^ 1					// Bitwise XOR clicked item
			newString += current.substring(n,current.length)
			setCurrState(newString)						// write new state back to cookie
		}	

//			var i
//			for (i = 1; i < n; i++) 
//			{	newString += "0" 	}
//			var expanded = current.substring(n-1,n)	// of clicked item
//			newString += expanded ^ 1					// Bitwise XOR clicked item
//			for (i = n+1; i < current.length+1; i++) 
//			{	newString += "0" 	}
//			setCurrState(newString)						// write new state back to cookie
//		}	
	}


// end -->