

<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
  
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
	MM_swapImgRestore();

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
   
  // currentBtn = a[0];
   
   if(origPageArray[0] == 'btn1'){
		var obj = x=MM_findObj('btn_desc');
		 
		var str = "";
		var count = 0;
		var idx = parseInt((a[0]).substring(3)) -1;
		
		obj.innerHTML = descList[idx][1];
		obj.style.marginLeft = descList[idx][0];
   }
   
   hideDivider(a[0]);
}
///
function showSub(pBtn){
	
	if(pBtn == "sm_links2"){
		//download prospectus link
		alert("New Prospectus available early 2008!");
		
		MM_findObj(pBtn).src = "../images/nav/dl_prospectus_n.png";
	}else{
		var idx = parseInt((pBtn).substring(3)) -1;
		
		var obj = MM_findObj('btn_desc');
		obj.innerHTML = descList[idx][2];
		obj.style.marginLeft = descList[idx][0];
		
		currentBtn = pBtn
		subIsShowing = true;
	}
}

function showCurrentPage(pBtn, pSrc, pSub){
	
	//MM_findObj(pBtn).src = pSrc;
	
	origPageArray = [pBtn, pSrc, pSub];
	MM_swapImage(pBtn,'',pSrc,1); 
	showSub(pBtn);
	
	if(pSub != null){
		var obj = MM_findObj(pSub);
		obj.style.color = "#FFFFFF";//"#bf0000";
		obj.style.textDecoration = "underline";
	}
	subIsShowing = false;
	
	hideDivider(pBtn);
	
}

function revertCurrentPage(pBtn){
	if(currentBtn != pBtn && subIsShowing == false){
		showCurrentPage(origPageArray[0], origPageArray[1], origPageArray[2]);
	}
	//showAllDividers();
	hideDivider(pBtn);
}

function hideDivider(pBtn){

   //hide dividers
   var aSplit =  pBtn.split("btn");
   var btnNum = parseInt(aSplit[1]);
   
   if(btnNum >0){
	   
	   var div0 = MM_findObj("divider_"+ String(btnNum-1));
	   
	   if(btnNum == 8){
		div0 = MM_findObj("divider_"+ String(btnNum-2));   
	   }
	   
	   var div1 = MM_findObj("divider_"+ String(btnNum));
	   /*
	   div0.style.display = "none";
	   div1.style.display = "none";
	   */
	   if(div0){
	   	div0.setAttribute("src", "../images/dot.png");
	   }
	   if(div1){
	   	div1.setAttribute("src", "../images/dot.png");
	   }
	     
		for(var i=1; i<10; i++){
		   var div2 = MM_findObj("divider_"+ String(i));
		   if(div2 != undefined){
			   if(div2 != div0 && div2 != div1){
				 div2.src = "../images/nav/divider.png";
			   }
		   }
		}
   }
}
function showAllDividers(){
	//show dividers
	for(var i=1; i<10; i++){
	   var div0 = MM_findObj("divider_"+ String(i));
	   if(div0 != undefined){
  		 div0.src = "../images/nav/divider.png";
	   }
	}
}

function changeScroll(pObj){
	var obj = MM_findObj(pObj);
	if(obj.style.overflow == 'hidden'){
		obj.style.overflow = 'auto';
	}else{
		obj.style.overflow = 'hidden';	
	}
}


// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = mouseMover;

function mouseMover(e){
	//var obj = MM_findObj('btn_desc');
	//obj.innerHTML = e.pageY; 
	
	if (IE) var e = window.event;
	if(IE){
		
        posX = window.event.x+document.body.scrollLeft;
        posY = window.event.y+document.body.scrollTop;		
	}else{
		if (e.pageX || e.pageY) 	{
			posX = e.pageX;
			posY = e.pageY;
		}
		else if (e.clientX || e.clientY) 	{
			posX = e.clientX + document.body.scrollLeft
				+ document.documentElement.scrollLeft;
			posY = e.clientY + document.body.scrollTop
				+ document.documentElement.scrollTop;
		}
	}
	if(posY != undefined){
		if((posY > 164  || posY < 90 ) && currentBtn != origPageArray[0]){
			subIsShowing = false;
			revertCurrentPage('');
		}
	}
}

function noScroll(){
	curScrollObj = null;
	scrollSpeed = 3;
}

function scrollContentBy(pObj, mag){
	var obj = MM_findObj(pObj);
	var scrollNum;
	var speed = scrollSpeed;
	
	if(obj.style.marginTop == ""){
		scrollNum = mag*speed;
	}else{
		//scrollNum = parseInt((obj.style.top).split("px")[0]) + (mag * speed);
		scrollNum = parseInt((obj.style.marginTop).split("px")[0]) + (mag * speed);
	}
	
	if(scrollNum > 130 - obj.scrollHeight  && scrollNum < 20){
		//obj.style.top = String(scrollNum) + "px";
		obj.style.marginTop = String(scrollNum) + "px";
	}
	
	//(MM_findObj('arrow_padder')).innerHTML = obj.scrollHeight + ":"+ scrollNum;
	
	if(curScrollObj == pObj && curScrollmag == mag){
		setTimeout("scrollContentBy('"+ pObj+"', "+ mag +");", 100);
	}
	
}

function scrollContent(pObj, mag){
	curScrollObj = pObj;
	curScrollmag = mag;
	scrollContentBy(pObj, mag);
}

function scrollContentTo(pObj, pos){
	var obj = MM_findObj(pObj);
	
	obj.style.top = pos + "px";
	
}

function subClick(pLoc, anchorPos){

	var anchorContainer = MM_findObj("sub_anchar_nav");
	var str = "";
	for(var i=0; i<anchorContainer.childNodes.length; i++){
		var theId = anchorContainer.childNodes[i].id;
	
		if(theId != undefined){
			str += "<br/>"+ i + ":"+ theId;
			changeAnchorColor(theId, "rgb(28, 83, 83)"); //green
			MM_findObj(theId).style.textDecoration = "none";
		}
	}
	//MM_findObj("course_scroll_content").innerHTML = str;//anchorContainer.childNodes[1].id;
	
	var theAnchor = String(document.location).split("#")[1];
	changeAnchorColor(pLoc, "rgb(191, 0, 0)");// red
	
	MM_findObj(pLoc).style.textDecoration = "underline";
	
	/*
	var subAnchorName = pLoc;
	if(subAnchorName.substring(0,4) == "sub_"){
		subAnchorName = subAnchorName.split("sub_")[1];	
	}
	var coord = getAnchorPosition('programme_structure');
	var containerCoord = getAnchorPosition('scroll_container');
	var newCoord = (-1 * coord.y) - 130;
	alert(pLoc + ":"+ coord.y+ ": newCoord: "+ newCoord);
	*/
	scrollContentTo('course_scroll_content',  -1 * anchorPos);
	//document.location =  document.location + "#" + pLoc;
	
}
function initSub(pLoc){
	if(String(document.location).split("#").length > 1){
		var len = String(document.location).split("#").length;
		var theAnchor = "sub_" + String(document.location).split("#")[1];
		MM_findObj(theAnchor).onclick();
	}else{
		subClick(pLoc, 0);
	}
}

function changeAnchorColor(pAnchor, pCol){
	var theAnchor = pAnchor;
	//
	
	var anchorHead = MM_findObj(theAnchor);
	anchorHead.style.color = pCol;
	//anchorHead.style.fontWeight = "bold";
}

//student testimonials
function linkClicked(obj){
	/*
	MM_findObj('one_year').style.color = "#1c5353";
	MM_findObj('one_year').style.textDecoration = "none";
	MM_findObj('the_14_weeks').style.color = "#1c5353";
	MM_findObj('the_14_weeks').style.textDecoration = "none";
	MM_findObj('three_weeks').style.color = "#1c5353";
	MM_findObj('three_weeks').style.textDecoration = "none";
	
	MM_findObj(obj).style.textDecoration = "underline";
	MM_findObj(obj).style.color = "#bf0000";
	
	MM_findObj('course_scroll_content').style.position = "relative";
		
	MM_findObj('course_scroll_content').style.top = "0px";
		
	if(obj == "three_weeks"){
		MM_findObj('course_scroll_content').style.top = "-1830px";
	}else if(obj == "the_14_weeks"){
		MM_findObj('course_scroll_content').style.top = "-1580px";
	}else{
		MM_findObj('course_scroll_content').style.top = "0px";
	}
	*/
}

var curScrollObj;
var curScrollmag;
var scrollSpeed = 3;

var currentBtn;
var origPageArray = [];
var subIsShowing = false;
var descList = [['10px',
				 '',
				 ''],
				
				['10px',
				 ' ',
				 '<a href="../eco/recycling.html" id="sub1" >Recycling</a>  |   <a href="../eco/power.html" id="sub2" >Power</a>  |   <a href="../eco/h20.html" id="sub3" >H20</a>   |   <a href="../eco/green_stuff.html" id="sub4" >Green Stuff</a>   |  <a href="../eco/natural_way.html" id="sub5" >Natural Way</a>   |  <a href="../eco/green_champions.html" id="sub6" > Green Champions</a>   |  <a href="../eco/focus_groups.html" id="sub7" >Focus Groups</a>   |  <a href="../eco/awards.html" id="sub8" >Awards</a>'],
				
				['10px',
				 ' ',
				 '<a href="../nature_wildlife/birds.html" id="sub1" >Birds</a> | <a id="sub2" href="../nature_wildlife/fish.html" >Fish</a> | <a href="../nature_wildlife/amphibians.html" id="sub3" >Amphibians</a> | <a href="../nature_wildlife/hedgehogs.html" id="sub4" >Hedgehogs</a>'],
				
				['10px', 
				 ' ',
				 '<a href="../community/volunteering.html" id="sub1">Volunteering</a> | <a href="../community/education.html" id="sub2">Education</a> | <a href="../community/trust.html" id="sub3">Chiswick Park Trust</a> | <a href="../community/fundraising.html" id="sub4">Fundraising Events</a> | <a href="../community/charity.html" id="sub5">Who We Support</a>'],
				
				['10px', 
				 ' ', 
				 ''],
				
				];


//-->


