<!--
/*
Script by RoBorg
RoBorg@geniusbug.com
http://javascript.geniusbug.com | http://www.roborg.co.uk
Please do not remove or edit this message
Please link to this website if you use this script!
*/



slideSpeed = 8;

last = "";
var nosub1;
var button2;
var button3;
var nosub5;
var nosub6;
var button7;
var nosub4;
var nosub8;
var nosub9;
var nosub10;
var nosub11;
var nosub12;
var nosub13;
var nosub14;
var cnt;
var last;

function initMenus()
{
	if(!document.getElementsByTagName) return;
	slider = new Array();
	var divs = document.getElementsByTagName('div');
	cnt = divs.length;
	for(var x=0; x<divs.length; x++)
	{
		divs[x].originalHeight = divs[x].offsetHeight;
		if(divs[x].className == 'menu') divs[x].speed = -1;
		if(divs[x].className == 'nosub1') {nosub1 = divs[x]; nosub1.exp = 0;}
		if(divs[x].className == 'button2') {button2 = divs[x]; button2.exp = 0;}
		if(divs[x].className == 'button3') {button3 = divs[x]; button3.exp = 0;}
		if(divs[x].className == 'nosub5') {nosub5 = divs[x]; nosub5.exp = 0;}
		if(divs[x].className == 'nosub6') {nosub6 = divs[x]; nosub6.exp = 0;}
		if(divs[x].className == 'button7') {button7 = divs[x]; button7.exp = 0;}
		if(divs[x].className == 'nosub4') {nosub4 = divs[x]; nosub4.exp = 0;}
		if(divs[x].className == 'nosub8') {nosub8 = divs[x]; nosub8.exp = 0;}
		if(divs[x].className == 'nosub9') {nosub9 = divs[x]; nosub9.exp = 0;}
		if(divs[x].className == 'nosub10') {nosub10 = divs[x]; nosub10.exp = 0;}
		if(divs[x].className == 'nosub12') {nosub12 = divs[x]; nosub12.exp = 0;}
		if(divs[x].className == 'nosub13') {nosub13 = divs[x]; nosub13.exp = 0;}
		if(divs[x].className == 'nosub14') {nosub14 = divs[x]; nosub14.exp = 0;}
		if(divs[x].className == 'nosub11') {nosub11 = divs[x]; nosub11.exp = 0;}
	}
	for(var x=0; x<divs.length; x++)
	{
		if(divs[x].className != 'menu') continue;
		divs[x].style.height = '1px';
		divs[x].style.display = 'none';
	}

	//nosub1.onclick = function() { check(this); swap(1,2);};
	nosub1.onmouseover = function() { swap(1,1);};
	nosub1.onmouseout = function() { swap(1,0);};
	//button2.onclick = function() { check(this); swap(2,2);};
	button2.onmouseover = function() { swap(2,1);};
	button2.onmouseout = function() { swap(2,0);};
	//button3.onclick = function() { check(this); swap(3,2);};
	button3.onmouseover = function() { swap(3,1);};
	button3.onmouseout = function() { swap(3,0);};
	//nosub5.onclick = function() { check(this); swap(5,2);};
	nosub5.onmouseover = function() { swap(5,1);};
	nosub5.onmouseout = function() { swap(5,0);};
	//nosub6.onclick = function() { check(this); swap(6,2);};
	nosub6.onmouseover = function() { swap(6,1);};
	nosub6.onmouseout = function() { swap(6,0);};
	//button7.onclick = function() { check(this); swap(7,2);};
	button7.onmouseover = function() { swap(7,1);};
	button7.onmouseout = function() { swap(7,0);}
	//nosub4.onclick = function() { check(this); swap(4,2);};
	nosub4.onmouseover = function() { swap(4,1);};
	nosub4.onmouseout = function() { swap(4,0);};
	//nosub8.onclick = function() { check(this); swap(8,2);};
	nosub8.onmouseover = function() { swap(8,1);};
	nosub8.onmouseout = function() { swap(8,0);}
	//nosub9.onclick = function() { check(this); swap(9,2);};
	nosub9.onmouseover = function() { swap(9,1);};
	nosub9.onmouseout = function() { swap(9,0);};
	//nosub10.onclick = function() { check(this); swap(10,2);};
	nosub10.onmouseover = function() { swap(10,1);};
	nosub10.onmouseout = function() { swap(10,0);};
	//nosub12.onclick = function() { check(this); swap(12,2);};
	nosub12.onmouseover = function() { swap(12,1);};
	nosub12.onmouseout = function() { swap(12,0);};
	//nosub13.onclick = function() { check(this); swap(13,2);};
	nosub13.onmouseover = function() { swap(13,1);};
	nosub13.onmouseout = function() { swap(13,0);};
	//nosub14.onclick = function() { check(this); swap(14,2);};
	nosub14.onmouseover = function() { swap(14,1);};
	nosub14.onmouseout = function() { swap(14,0);};
	//nosub11.onclick = function() { check(this); swap(11,1);};
	nosub11.onmouseover = function() { swap(11,1);};
	nosub11.onmouseout = function() { swap(11,0);};

	
}

function check(obj)
{

	if (obj == nosub1 && last == 1) {}
	if (obj == nosub1 && last != 1) {lock(nosub1); last = 1;}
	if (obj != nosub1) unlock(nosub1);
	
	if (obj == button2 && last == 2) {}
	if (obj == button2 && last != 2 && button2.exp == 0) {expand(button2); lock(button2); last = 2; button2.exp = 1;}
	if (obj != button2 && button2.exp == 1) {contract(button2); unlock(button2); button2.exp = 0;}
	
	if (obj == button3 && last == 3) {}
	if (obj == button3 && last != 3 && button3.exp == 0) {expand(button3); lock(button3); last = 3; button3.exp = 1;}
	if (obj != button3 && button3.exp == 1) {contract(button3); unlock(button3); button3.exp = 0;}

	if (obj == nosub5 && last == 5) {}
	if (obj == nosub5 && last != 5) {lock(nosub5); last = 5;}
	if (obj != nosub5) unlock(nosub5);

	if (obj == nosub6 && last == 6) {}
	if (obj == nosub6 && last != 6) {lock(nosub6); last = 6;}
	if (obj != nosub6) unlock(nosub6);
	
	if (obj == button7 && last == 7) {}
	if (obj == button7 && last != 7 && button7.exp == 0) {expand(button7); lock(button7); last = 7; button7.exp = 1;}
	if (obj != button7 && button7.exp == 1) {contract(button7); unlock(button7); button7.exp = 0;}


	if (obj == nosub4 && last == 4) {}
	if (obj == nosub4 && last != 4) {lock(nosub4); last = 4;}
	if (obj != nosub4) unlock(nosub4);
	

	if (obj == nosub8 && last == 8) {}
	if (obj == nosub8 && last != 8) {lock(nosub8); last = 8;}
	if (obj != nosub8) unlock(nosub8);
	

	if (obj == nosub9 && last == 9) {}
	if (obj == nosub9 && last != 9) {lock(nosub9); last = 9;}
	if (obj != nosub9) unlock(nosub9);
	

	if (obj == nosub10 && last == 10) {}
	if (obj == nosub10 && last != 10) {lock(nosub10); last = 10;}
	if (obj != nosub10) unlock(nosub10);
	

	if (obj == nosub12 && last == 12) {}
	if (obj == nosub12 && last != 12) {lock(nosub12); last = 12;}
	if (obj != nosub12) unlock(nosub12);
	

	if (obj == nosub13 && last == 13) {}
	if (obj == nosub13 && last != 13) {lock(nosub13); last = 13;}
	if (obj != nosub13) unlock(nosub13);
	
	
	if (obj == nosub14 && last == 14) {}
	if (obj == nosub14 && last != 14) {lock(nosub14); last = 14;}
	if (obj != nosub13) unlock(nosub13);
	
	
	if (obj == nosub11 && last == 11) {}
	if (obj == nosub11 && last != 11) {swap(11,0); last = 11;}
	
}
function lock(obj)
{
	switch(obj.className)
	{
		case 'nosub1':
			nosub1.onmouseover = function() { swap(1,2);};
			nosub1.onmouseout = function() { swap(1,2);};
			break;
			
		case 'button2':
			button2.onmouseover = function() {swap(2,2);};
			button2.onmouseout = function() {swap(2,2);};
			break;
			
		case 'button3':
			button3.onmouseover=function() {swap(3,2);};
			button3.onmouseout=function() {swap(3,2);};
			break;
			
		case 'nosub5':
			nosub5.onmouseover=function() {swap(5,2);};
			nosub5.onmouseout=function() {swap(5,2);};
			break;
			
		case 'nosub6':
			nosub6.onmouseover=function() {swap(6,2);};
			nosub6.onmouseout=function() {swap(6,2);};
			break;
		case 'button7':
			button7.onmouseover=function() {swap(7,2);};
			button7.onmouseout=function() {swap(7,2);};
			break;		
		case 'nosub4':
			nosub4.onmouseover=function() {swap(4,2);};
			nosub4.onmouseout=function() {swap(4,2);};
			break;
		case 'nosub8':
			nosub8.onmouseover=function() {swap(8,2);};
			nosub8.onmouseout=function() {swap(8,2);};
			break;
		case 'nosub9':
			nosub9.onmouseover=function() {swap(9,2);};
			nosub9.onmouseout=function() {swap(9,2);};
			break;
		case 'nosub10':
			nosub10.onmouseover=function() {swap(10,2);};
			nosub10.onmouseout=function() {swap(10,2);};
			break;
		case 'nosub12':
			nosub12.onmouseover=function() {swap(12,2);};
			nosub12.onmouseout=function() {swap(12,2);};
			break;
		case 'nosub13':
			nosub13.onmouseover=function() {swap(13,2);};
			nosub13.onmouseout=function() {swap(13,2);};
			break;
		case 'nosub14':
			nosub14.onmouseover=function() {swap(14,2);};
			nosub14.onmouseout=function() {swap(14,2);};
			break;
		case 'nosub11':
			nosub11.onmouseover=function() {swap(11,2);};
			nosub11.onmouseout=function() {swap(11,2);};
			break;
	}
}
function unlock(obj)
{
	switch(obj.className)
	{
		case 'nosub1':
			swap(1,0);
			nosub1.onmouseover=function() {swap(1,1);};
			nosub1.onmouseout=function() {swap(1,0);};
			break;
		case 'button2':
			swap(2,0);
			button2.onmouseover=function() {swap(2,1);};
			button2.onmouseout=function() {swap(2,0);};
			break;		
		case 'button3':
			swap(3,0);
			button3.onmouseover=function() {swap(3,1);};
			button3.onmouseout=function() {swap(3,0);};
			break;		
		case 'nosub5':
			swap(5,0);
			nosub5.onmouseover=function() {swap(5,1);};
			nosub5.onmouseout=function() {swap(5,0);};
			break;
		case 'nosub6':
			swap(6,0);
			nosub6.onmouseover=function() {swap(6,1);};
			nosub6.onmouseout=function() {swap(6,0);};
			break;
		case 'button7':
			swap(7,0);
			button7.onmouseover=function() {swap(7,1);};
			button7.onmouseout=function() {swap(7,0);};
			break;		
		case 'nosub4':
			swap(4,0);
			nosub4.onmouseover=function() {swap(4,1);};
			nosub4.onmouseout=function() {swap(4,0);};
			break;
		case 'nosub8':
			swap(8,0);
			nosub8.onmouseover=function() {swap(8,1);};
			nosub8.onmouseout=function() {swap(8,0);};
			break;
		case 'nosub9':
			swap(9,0);
			nosub9.onmouseover=function() {swap(9,1);};
			nosub9.onmouseout=function() {swap(9,0);};
			break;
		case 'nosub10':
			swap(10,0);
			nosub10.onmouseover=function() {swap(10,1);};
			nosub10.onmouseout=function() {swap(10,0);};
			break;
		case 'nosub12':
			swap(12,0);
			nosub12.onmouseover=function() {swap(12,1);};
			nosub12.onmouseout=function() {swap(12,0);};
			break;
		case 'nosub13':
			swap(13,0);
			nosub13.onmouseover=function() {swap(13,1);};
			nosub13.onmouseout=function() {swap(13,0);};
			break;
		case 'nosub14':
			swap(14,0);
			nosub14.onmouseover=function() {swap(14,1);};
			nosub14.onmouseout=function() {swap(14,0);};
			break;
		case 'nosub11':
			swap(11,0);
			nosub11.onmouseover=function() {swap(11,1);};
			nosub11.onmouseout=function() {swap(11,0);};
			break;
	}
}

function swap(but,n)
{
	ns1on = "images/WWSI-big-side1-on.gif";
	ns1off = "images/WWSI-big-side1-off.gif";
	ns1set = "images/WWSI-big-side1-set.gif";
	but2on = "images/WWSI-big-side2-on.gif";
	but2off = "images/WWSI-big-side2-off.gif";
	but2set = "images/WWSI-big-side2-set.gif";
	but3on = "images/WWSI-big-side3-on.gif";
	but3off = "images/WWSI-big-side3-off.gif";
	but3set = "images/WWSI-big-side3-set.gif";
	ns5on = "images/WWSI-big-side5-on.gif";
	ns5off = "images/WWSI-big-side5-off.gif";
	ns5set = "images/WWSI-big-side5-set.gif";
	ns6on = "images/WWSI-big-side6-on.gif";
	ns6off = "images/WWSI-big-side6-off.gif";
	ns6set = "images/WWSI-big-side6-set.gif";
	but7on = "images/WWSI-big-side7-on.gif";
	but7off = "images/WWSI-big-side7-off.gif";
	but7set = "images/WWSI-big-side7-set.gif";
	ns4on = "images/WWSI-big-side4-on.gif";
	ns4off = "images/WWSI-big-side4-off.gif";
	ns4set = "images/WWSI-big-side4-set.gif";
	ns8on = "images/WWSI-big-side8-on.gif";
	ns8off = "images/WWSI-big-side8-off.gif";
	ns8set = "images/WWSI-big-side8-set.gif";
	ns9on = "images/WWSI-big-side9-on.gif";
	ns9off = "images/WWSI-big-side9-off.gif";
	ns9set = "images/WWSI-big-side9-set.gif";
	ns10on = "images/WWSI-big-side10-on.gif";
	ns10off = "images/WWSI-big-side10-off.gif";
	ns10set = "images/WWSI-big-side10-set.gif";
	ns12on = "images/WWSI-big-side12-on.gif";
	ns12off = "images/WWSI-big-side12-off.gif";
	ns12set = "images/WWSI-big-side12-set.gif";
	ns13on = "images/WWSI-big-side13-on.gif";
	ns13off = "images/WWSI-big-side13-off.gif";
	ns13set = "images/WWSI-big-side13-set.gif";
	ns14on = "images/WWSI-big-side14-on.gif";
	ns14off = "images/WWSI-big-side14-off.gif";
	ns14set = "images/WWSI-big-side14-set.gif";
	ns11on = "images/WWSI-big-side11-on.gif";
	ns11off = "images/WWSI-big-side11-off.gif";
	
	switch(but)
	{
		case 1:
			switch(n)
			{
				case 0:
					document.nosub1.src = ns1off;
					break;
				case 1:
					document.nosub1.src = ns1on;
					break;
				case 2:
					document.nosub1.src = ns1set;
					break;
			}
			break;
		case 2:
			switch(n)
			{
				case 0:
					document.button2.src = but2off;
					break;
				case 1:
					document.button2.src = but2on;
					break;
				case 2:
					document.button2.src = but2set;
					break;
			}
			break;
		case 3:
			switch(n)
			{
				case 0:
					document.button3.src = but3off;
					break;
				case 1:
					document.button3.src = but3on;
					break;
				case 2:
					document.button3.src = but3set;
					break;
			}
			break;
		case 5:
			switch(n)
			{
				case 0:
					document.nosub5.src = ns5off;
					break;
				case 1:
					document.nosub5.src = ns5on;
					break;
				case 2:
					document.nosub5.src = ns5set;
					break;
			}
			break;
		case 6:
			switch(n)
			{
				case 0:
					document.nosub6.src = ns6off;
					break;
				case 1:
					document.nosub6.src = ns6on;
					break;
				case 2:
					document.nosub6.src = ns6set;
					break;
			}
			break;
		case 7:
			switch(n)
			{
				case 0:
					document.button7.src = but7off;
					break;
				case 1:
					document.button7.src = but7on;
					break;
				case 2:
					document.button7.src = but7set;
					break;
			}
			break;
		case 4:
			switch(n)
			{
				case 0:
					document.nosub4.src = ns4off;
					break;
				case 1:
					document.nosub4.src = ns4on;
					break;
				case 2:
					document.nosub4.src = ns4set;
					break;
			}
			break;
		case 8:
			switch(n)
			{
				case 0:
					document.nosub8.src = ns8off;
					break;
				case 1:
					document.nosub8.src = ns8on;
					break;
				case 2:
					document.nosub8.src = ns8set;
					break;
			}
			break;
		case 9:
			switch(n)
			{
				case 0:
					document.nosub9.src = ns9off;
					break;
				case 1:
					document.nosub9.src = ns9on;
					break;
				case 2:
					document.nosub9.src = ns9set;
					break;
			}
			break;
		case 10:
			switch(n)
			{
				case 0:
					document.nosub10.src = ns10off;
					break;
				case 1:
					document.nosub10.src = ns10on;
					break;
				case 2:
					document.nosub10.src = ns10set;
					break;
			}
			break;
		case 12:
			switch(n)
			{
				case 0:
					document.nosub12.src = ns12off;
					break;
				case 1:
					document.nosub12.src = ns12on;
					break;
				case 2:
					document.nosub12.src = ns12set;
					break;
			}
			break;
		case 13:
			switch(n)
			{
				case 0:
					document.nosub13.src = ns13off;
					break;
				case 1:
					document.nosub13.src = ns13on;
					break;
				case 2:
					document.nosub13.src = ns13set;
					break;
			}
			break;
		case 14:
			switch(n)
			{
				case 0:
					document.nosub14.src = ns14off;
					break;
				case 1:
					document.nosub14.src = ns14on;
					break;
				case 2:
					document.nosub14.src = ns14set;
					break;
			}
			break;
		case 11:
			switch(n)
			{
				case 0:
					document.nosub11.src = ns11off;
					break;
				case 1:
					document.nosub11.src = ns11on;
					break;
				case 2:
					document.nosub11.src = ns11set;
					break;
			}
			break;
			
	}
}
			
	

function toggle(obj)
{
	//obj.className = (obj.className == 'button')?'pressedButton':'button';
	while(obj.nextSibling && (obj.className != 'menu')) obj = obj.nextSibling;
	
	obj.speed = -1 * obj.speed;
	if(obj.slideTimer) return;	//Already moving
	var x = slider.length;
	slider[x] = obj;
	slide(x);
}
function expand(obj)
{
	//obj.className = (obj.className == 'button')?'pressedButton':'button';
	while(obj.nextSibling && (obj.className != 'menu')) obj = obj.nextSibling;
	
	obj.speed = 1;
	if(obj.slideTimer) return;	//Already moving
	var x = slider.length;
	slider[x] = obj;
	slide(x);
	//obj.speed = -1;
}
function contract(obj)
{
	//obj.className = (obj.className == 'button')?'pressedButton':'button';
	while(obj.nextSibling && (obj.className != 'menu')) obj = obj.nextSibling;
	
	obj.speed = -1;
	if(obj.slideTimer) return;	//Already moving
	var x = slider.length;
	slider[x] = obj;
	slide(x);
	//obj.speed = 1;
}



function slide(x)
{
	var obj = slider[x];
	if(obj.style.display != 'block') obj.style.display = 'block';
	var height = obj.offsetHeight + obj.speed * slideSpeed;
	var targetHeight = getChildrensHeights(obj);

	if(height > targetHeight)
	{
		obj.style.height = targetHeight + 'px';
		obj.slideTimer = false;
		resizeParents(obj, 0);
		return;
	}
	
	if(height <= 1)
	{
		obj.style.height = '1px';
		obj.style.display = 'none';
		obj.slideTimer = false;
		resizeParents(obj, 0);
		return;
	}
	
	obj.style.height = height + 'px';
	obj.slideTimer = setTimeout('slide(' + x + ');', 50);
	resizeParents(obj, targetHeight - height);
}



function getChildrensHeights(obj)
{
	if(!obj.firstChild) return 0;
	if(!obj.tagName.match(/div/i)) return 0;

	var height = 0;
	tmp = obj;
	obj = obj.firstChild;
	do height += getChildrensHeights(obj);
	while(obj = obj.nextSibling);
	
	if(height == 0) height = tmp.offsetHeight;
	
	return height;
}



function resizeParents(obj, diff)
{
	if(obj.className == 'menuContainer') return;
	obj = obj.parentNode;
	height = getChildrensHeights(obj) - diff;
	obj.style.height = height + 'px';
	resizeParents(obj, diff);
}

function setmen()
{
	page = top.right.location.href;
	parsed = page.split('/');
	page = parsed[parsed.length - 1];
	parsed = page.split('.');
	page = parsed[0];
	//alert(page);
	if (page == "Profile") {check(nosub1); swap(1,2);}
	if (page == "strwd") {check(button2); swap(2,2);}
	if (page == "bridges") {check(button3); swap(3,2);}
	if (page == "domes") {check(nosub5); swap(5,2);}
	if (page == "shelters") {check(nosub6); swap(6,2);}
	if (page == "field") {check(button7); swap(7,2);}
	if (page == "repair") {check(nosub4); swap(4,2);}
	if (page == "sales") {check(nosub8); swap(8,2);}
	if (page == "events") {check(nosub9); swap(9,2);}
	if (page == "press") {check(nosub10); swap(10,2);}
	if (page == "whitepapers") {check(nosub12); swap(12,2);}
	if (page == "media") {check(nosub13); swap(13,2);}
	if (page == "blog") {check(nosub14); swap(14,2);}
	if (page == "home") {check(nosub11); }
}
//-->
