var netscape4 = (document.layers);
var netscape6 = (document.getElementById && !document.all);
var internetExplorer4 = (document.all && !document.getElementById);
var internetExplorer5 = (document.all && document.getElementById);

var colours=  new Array("NONE", "black", "red", "brightGreen", "pink", "yellow", "darkBlue", "darkGreen", "darkOrange", "blue", "green");
var menuItem= new Array("none", "\r Home", "Current News", "Housing for Health Process", "Housing for Health principles", "The current programs" ,"R&D projects", "Nepal", "The National Team", "About Healthabitat", "Managers' Paddock", "test area");
var menuLoad= new Array("none", "homeContent.htm", "newsContent.htm", "process/processTest.htm", "principlesContent.htm", "currentPrograms.htm", "RandD/rd.html", "nepal/nepalPlusStages.htm", "team/nationalTeam.htm", "about.htm", "passwordCode.html", "paddockGate.html");

function xx(num){
var divStr='';
//var divStr= '<a class="nav" href="' + menuLoad[num] + '" target=mainFrame>';
var menuItemHeight = 45 *1; 
var toppx = 5 + menuItemHeight * (num - 1);
	divStr= divStr + '<div id="Menu'+ num + '" class=menuItem style=" top: ' + toppx + 'px">'; 
  	divStr= divStr + '<a class="nav" href="' + menuLoad[num] +'" target="mainFrame">';
	divStr= divStr + '<img border=0 src="images/NewImages/' + colours[num] + 'Square.gif" width= "' + menuItemHeight + '" height="' + menuItemHeight +'" align="left">';
	divStr= divStr  + menuItem[num] + '</div></a>';
  	return divStr;
}


function xourUnLoad(){	
	opener.document.bgColor = "#d8cbeb"	;
	}
	
function menuOver(num){

//document.getElementById("Menu" + num).style.width = 511;
}
function menuClick(num){
	document.getElementById("Menu" + num).bgColor = "yellow"	;
	document.getElementById("Menu" + num).style="text-decoration:bold";
	// style="text-decoration:bold";
}
function menuOut(num){
}
function myLoadBody(){	}

function showLogoText(toShow){
//used for rollover on about page}
if (toShow== "show"){document.getElementById(blackLogoText).style.visibility = "visible";}
else {document.getElementById(toShow).style.visibility = "hidden";};
}// showLogoText

// <num> is the vertical number of this item in the menu, counting from 1
// this goes when new 9squares put in with titles under square
var titles = new Array("n0", "washing people","washing clothes", "n3", "n4", "n5","n6", "nn7","n8", "n9");
function setupDiv(num){
//----------------------
//principles page has an image made up of 9 squares.  When a square is hovered over a green square appears to highlight it.  
// it can be clicked and a small window pops up to explain image.
// each green square is calle 'Layer...x' where ... are the numbers 1 to 9
// <num> is the square identifier, starting at 1 and counting to 9 in row order
	if (num==1 || num==2 || num==3){toppx=70};
	if (num==4 || num==5 || num==6){toppx=190};
	if (num==7 || num==8 || num==9){toppx=304};
	
	if (num==1 || num==4 || num==7){leftpx=37};
	if (num==2 || num==5 || num==8){leftpx=155};
	if (num==3 || num==6 || num==9){leftpx=276};
	
var madeStr= '<div id = Layer' + num + 'x class=note style ="left:' + leftpx + 'px; top: ' + toppx + 'px "></div>';//<h2>' + titles[num] +'</h2></div>';
	return madeStr;
} //setupDiv
var small_window = null; // identifier of current pop-up window from principles page
function open_win(num){
var popupW = "smallB" + num + ".htm";
	if (small_window && small_window.open) small_window.close(); //closes any popup window previously opened by this routine
	small_window= window.open(popupW,"_blank","toolbar=no, location=no, titlebar=no,  directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no,width=350, height=640, left=700, top=100");
	hideBox(num);	
}





function xmoveBox(num) {
//changed to work with one moving box - it will make other page fail
var toShow = "Layer1x";
var toppx, leftpx;
 	if (num==1 || num==2 || num==3){toppx=70};
	if (num==4 || num==5 || num==6){toppx=190};
	if (num==7 || num==8 || num==9){toppx=304};
	
	if (num==1 || num==4 || num==7){leftpx=37};
	if (num==2 || num==5 || num==8){leftpx=155};
	if (num==3 || num==6 || num==9){leftpx=274};
return;
	document.getElementById(toShow).style.visibility = "visible";
	document.getElementById(toShow).style.left = leftpx;
	document.getElementById(toShow).style.top = toppx;

}

function hideBox(boxNum){
var toHide = "Layer" + boxNum + "x";
	document.getElementById(toHide).style.visibility = "hidden";
}
function xstartSlides() {
	setTimeout("nextSlide(2)",1000);
	
}
function xnextSlide(picNum){

	if(!(picNum== "7")) {document.getElementById("pic" + picNum).style.visibility="visible"};
	document.getElementById("words" + picNum).style.visibility="visible";
	
	if (picNum== "2") {setTimeout("nextSlide(3)", 1000)};
	if (picNum== "3") {setTimeout("nextSlide(4)", 1000)};
	if (picNum== "4") {setTimeout("nextSlide(5)", 1000)};
	if (picNum== "5") {setTimeout("nextSlide(6)", 1000)};
	if (picNum== "6") {setTimeout("nextSlide(7)", 1000)};
}