// VS Menu template - HEADER
//
// Author: Samuli Gröhn / Visual Systems
// Date: 19th Oct 2001
//
// Updated: 24th Oct 2001 - Minor bugfix to spawnHide function / Samuli Gröhn

// Declare variables
var bPageReady = false; // is page loaded?
var objElement = 0; // handle to open dropdown menu
var nTimerID = -1; // handle to timer that tries to close the menu when it expires
var nTimerRate = 150; // how long it does take the timer to expire, milliseconds
var d = document;  // just a variable to make shorter code
var IE4 = d.all && !d.getElementById ? true : false; // this browser
var IE5 = d.all && d.getElementById ? true : false; // that browser
var NS4 = d.layers ? true : false;
var NS6 = d.getElementById && !d.all ? true : false;

// InitMenu()
//
// Function: This function enables the dropdown menus. Run this function in
// onload property of body tag.
function InitMenu()
{
	bPageReady = true;

	// Täpän alustukset - siirretty init2.js -tiedostosta 
	if (document.layers || document.getElementById && !document.all || opera) {
		alustaAikavali();
		testScroll();
	}
	init(-16);
	window.onscroll = init;
	document.body.onload = init;
	self.onresize = init;
	return true;
}

// Function pointers, lookup these functions in vsmenu.js
function pShow(a,b){if(bPageReady)show(a,b);return false;}
function pSpawnHide(a){if(bPageReady)spawnHide(a);}

function avaa_kaavio2003() {
	var width = 780;
	var height = 430;
	if (screen.width && screen.width > 1000) {
		width = 980;
		height = 650;
	}
	win = window.open('/teema/kaavio2003_kesa.html','','width=' + width + ',height=' + height + ',scrollbars=yes,resizable=yes');
}

function avaa_kaavio(url) {
	var width = 780;
	var height = 430;
	if (screen.width && screen.width > 1000) {
		width = 980;
		height = 680;
	}
	win = window.open(url,'','width=' + width + ',height=' + height + ',scrollbars=yes,resizable=yes');
}

