// JavaScript Document




function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function P7_StyleLoader(tS) { //v1.2 by PVII
 var tH='',tDoc='',tA='<LIN'+'K REL="stylesheet" HREF=',tB=' TYPE="text/css">';
 if(document.getElementsByTagName){var bb=document.getElementsByTagName("LINK");
 if(bb) {for(var k=0;k<bb.length;k++){if(bb[k].rel.toLowerCase()=="stylesheet"){
 var h=bb[k].href,x=h.lastIndexOf("/");if(x>0){tH=h.substring(0,x+1);}
 bb[k].disabled=true;tDoc=tA+'"'+ tH + tS + '"' +tB;
 document.write(tDoc);break;}}}}
}

/* THE FOLLOWING JAVASCRIPT CODE COPYRIGHT OUTCROP GROUP & OUTCROP INTERACTIVE 2004 */
function linkDown(){

	
url=location.toString(); 	/*Turns URL into a string*/

if(url.search("home") != -1){			/*searches the url string for a match*/ 
	document.getElementById("home").className = "on";
	}
	else if(url.search("whats_new") != -1){
	document.getElementById("whatsNew").className = "on";
	}
	else if(url.search("about") != -1){
	document.getElementById("about").className = "on";
	}
	else if(url.search("voluntary_sector") != -1){
	document.getElementById("voluntary").className = "on";
	//document.getElementById("lands").style.display = "block";
	}
	else if(url.search("resources") != -1){
	document.getElementById("resources").className = "on";
	}
	else if(url.search("events") != -1){
	document.getElementById("events").className = "on";
	}
	else if(url.search("research") != -1){
	document.getElementById("research").className = "on";
	}
	else if(url.search("feedback") != -1){
	document.getElementById("feedback").className = "on";
	}
	else if(url.search("connected") != -1){
	document.getElementById("connected").className = "on";
	}
	else if(url.search("contact") != -1){
	document.getElementById("contact").className = "on";
	}
	else if(url.search("site_map") != -1){
	document.getElementById("sitemap").className = "on";
	}
}

  // this function is needed to work around 
  // a bug in IE related to element attributes
  function hasClass(obj) {
     var result = false;
     if (obj.getAttributeNode("class") != null) {
         result = obj.getAttributeNode("class").value;
     }
     return result;
  }   
  
function stripe(){
 // the flag we'll use to keep track of whether the current row is odd or even
 var even = false;    
 // if arguments are provided to specify the colours of the even & odd rows, then use the them;
 // otherwise use the following defaults:
 var evenColor = arguments[1] ? arguments[1] : "#fff";
 var oddColor = arguments[2] ? arguments[2] : "#F2EAD0";
	
 if (document.getElementById && document.createTextNode){
 //get all tables in document 
   var tables=document.getElementsByTagName('table');
 //loop through all tables  
   for (var i=0;i<tables.length;i++) {
      //select those with class name "ruler"
	  if(tables[i].className=='stripe'){
    	//get rows from table with class "stripe"
     	var trs=tables[i].getElementsByTagName('tr');
     		//loop through all rows
			for(var j=0;j<trs.length;j++){
     			//select each row
	 			var mytr = trs[j];
				//don't apply to tbody or tfoot				
       			if(mytr.parentNode.nodeName=='TBODY' && mytr.parentNode.nodeName!='TFOOT'){
					//set background colour of alternating rows
		 			mytr.style.backgroundColor = even ? evenColor : oddColor;
					even =  ! even; // flip from odd to even, or vice-versa
				
       				//apply mouseover and change background colour
       				//mytr.onmouseover=function(){this.style.backgroundColor = "#9CCBED";}
       				//onmouseout reset even/odd rows by calling main function
					//mytr.onmouseout=function(){stripe();}
       			}
	 
	 		}

	}
	
  }
  
 }
 
}




