function changeSANAimage(item, src){

	item.src = src;

}


function changetreebutton(item, src){

	item.src = src;

}

function openurl(self)
{
	document.location.href = self.children(0).href;	
}


	function goVote2(PollID, blnSubmit,strHide)
		{
		var votedvalue;
		var voted;
		var votearr;
		var theForm;
		if(document.all){
			voted = document.all.voted;
			votedvalue = voted.value;
			votearr = document.all("pollanswer_" + PollID);
			theForm = document.forms("pollform_" + PollID);
		} else if (document.getElementsByName) {
		// NS 6.x
			voted = document.getElementsByName("voted")[0];
			votedvalue = voted.value;
			votearr = document.getElementsByName("pollanswer_" + PollID);
			theForm = document.forms["pollform_"+PollID];
			if(typeof(votedvalue)=="undefined" || votedvalue == null)
				votedvalue="";
			
		} else {
			return;
		}
		
		if(blnSubmit && votedvalue == ""){	
			theForm.submit();		
		}
		else
		{
			if (typeof(votearr) != "undefined") {
				for(i=0;i<votearr.length;i++){
					if(votearr[i].value == votedvalue){
						votearr[i].checked = true;
					} 
				}
			}		
			if (strHide == "show") {
				MakePollDenialVisible(PollID);
			}
		}
		
	}

	function MakePollDenialVisible(PollID)
		{
		var theDiv;
	
		if (document.all)
		{
			theDiv = document.all("pollmessage_" + PollID);	
		} else if (document.getElementsByName)  {
			theDiv = document.getElementsByName("pollmessage_" + PollID)[0];
		}
		if (typeof(theDiv) != "undefined" && theDiv != null)
		{
			theDiv.className = "pollmessageshow";
		}
	
	}

/*
Build a new Document Object Model by referring to elements in the original DOM.
*/

function init() {
	doc = document;
	ids = {};
	if (typeof doc.getElementsByTagName != 'undefined') {
		var divs = doc.getElementsByTagName('div');
		for (var i = 0; i < divs.length; i++) {
			if (divs[i].id != '') {
				ids[divs[i].id] = divs[i];
			}
		}
	}
	else if (typeof doc.layers != 'undefined') {
		for (var i = 0; i < doc.layers.length; i++) {
			if (doc.layers[i].id != '') {
				ids[doc.layers[i].id] = doc.layers[i];
				ids[doc.layers[i].id].style = doc.layers[i];
			}
		}
	}
	else if (doc.all) {
		for (var i = 0; i < doc.all.length; i++) {
			if (doc.all[i].id != '') {
				ids[doc.all[i].id] = doc.all[i];
			}
		}
	}
	ids_ready = 1;
}


function toggle(img, doc) {
	if (typeof doc == 'undefined') {
		doc = document;
	}
	var url = doc.images[img].src;
	//alert(url);
	var lead = url.substr(0, url.lastIndexOf('.') - 1);
	var state = url.substr(url.lastIndexOf('.') - 1, 1);
	var ext = url.substr(url.lastIndexOf('.'));
	state = Math.abs(parseInt(state) - 1);
	doc.images[img].src = lead + state + ext;
}

function prel(url) {
	var img = new Image();
	img.src = url;
	var lead = url.substr(0, url.lastIndexOf('.') - 1);
	var state = url.substr(url.lastIndexOf('.') - 1, 1);
	var ext = url.substr(url.lastIndexOf('.'));
	state = Math.abs(parseInt(state) - 1);
	url = lead + state + ext;
	img.src = url;
}

function init_mo(base, img) {
	for (var i = 0; i < img.length; i++) {
		prel(base + img[i]);
	}
}

function show(id,topcor,leftcor) {
	temp=id;
	if (typeof ids_ready != 'undefined') {
		for (p in ids) {
			if (typeof id != 'undefined') {
				if (id.indexOf('fold') != 0) {
					id = 'fold' + id;
					
				}
			}
			if (ids[p].id.indexOf('fold') == 0) {
				if (ids[p].id != id) {
					ids[p].style.visibility = "hidden";
					ids[p].style.zIndex = 1;
					}
				else{
//					alert(getAnchorPositionTest(temp).y)
					ids[p].style.top = getAnchorPosition(temp).y+topcor;
					ids[p].style.left = getAnchorPosition(temp).x+leftcor;
					ids[p].style.visibility = "visible";
					ids[p].style.zIndex = 1000;
					}
				}
			
		}
		if (typeof id != 'undefined') {
			ids['collect'].style.top = getAnchorPosition(temp).y-10+topcor;
			ids['collect'].style.left = getAnchorPosition(temp).x-29+leftcor;
			ids['collect'].style.visibility = "visible";
			ids['collect'].style.zIndex = 110;

		}
		else {
			ids['collect'].style.visibility = "hidden";
			ids['collect'].style.zIndex = 1;
		}
	}
}

function getAnchorPosition(anchorname) {
	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (document.getElementById) { use_gebi=true; }
	else if (document.all) { use_css=true; }
	else if (document.layers) { use_layers=true; }
	// Logic to find position
 	if (use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		//var o=document.getElementById(anchorname);
		//x=o.offsetLeft; y=o.offsetTop;
		}
	else if (use_gebi) {
		//var o=document.getElementById(anchorname);
//		alert(o.offsetLeft);
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		//x=o.offsetLeft; y=o.offsetTop;
		}
 	else if (use_css) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_layers) {
		var found=0;
		for (var i=0; i<document.anchors.length; i++) {
			if (document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
		}
	else {
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;
//	alert(x +' ' + y);
//	alert(coordinates.x);
//	alert(coordinates.y);
	return coordinates;
	
	}

// getAnchorWindowPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the window
function getAnchorWindowPosition(anchorname) {
	var coordinates=getAnchorPosition(anchorname);
	var x=0;
	var y=0;
	if (document.getElementById) {
		if (isNaN(window.screenX)) {
			x=coordinates.x-document.body.scrollLeft+window.screenLeft;
			y=coordinates.y-document.body.scrollTop+window.screenTop;
			}
		else {
			x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
			y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
			}
		}
	else if (document.all) {
		x=coordinates.x-document.body.scrollLeft+window.screenLeft;
		y=coordinates.y-document.body.scrollTop+window.screenTop;
		}
	else if (document.layers) {
		x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
		y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// Functions for IE to get position of an object
function AnchorPosition_getPageOffsetLeft (el) {
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
	}
function AnchorPosition_getWindowOffsetLeft (el) {
	return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
	}	
function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
	}
function AnchorPosition_getWindowOffsetTop (el) {
	return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
	}


//-->


/*
Build a new Document Object Model by referring to elements in the original DOM.
*/

function init() {
	doc = document;
	ids = {};
	if (typeof doc.getElementsByTagName != 'undefined') {
		var divs = doc.getElementsByTagName('div');
		for (var i = 0; i < divs.length; i++) {
			if (divs[i].id != '') {
				ids[divs[i].id] = divs[i];
			}
		}
	}
	else if (typeof doc.layers != 'undefined') {
		for (var i = 0; i < doc.layers.length; i++) {
			if (doc.layers[i].id != '') {
				ids[doc.layers[i].id] = doc.layers[i];
				ids[doc.layers[i].id].style = doc.layers[i];
			}
		}
	}
	else if (doc.all) {
		for (var i = 0; i < doc.all.length; i++) {
			if (doc.all[i].id != '') {
				ids[doc.all[i].id] = doc.all[i];
			}
		}
	}
	ids_ready = 1;
}

function show(id,topcor,leftcor) {
	temp=id;
	if (typeof ids_ready != 'undefined') {
		for (p in ids) {
			if (typeof id != 'undefined') {
				if (id.indexOf('fold') != 0) {
					id = 'fold' + id;
					
				}
			}
			if (ids[p].id.indexOf('fold') == 0) {
				if (ids[p].id != id) {
					ids[p].style.visibility = "hidden";
					ids[p].style.zIndex = 1;
					}
				else{
					
					
					ids[p].style.top = getAnchorPosition(temp).y+topcor;
					ids[p].style.left = getAnchorPosition(temp).x+leftcor;
					ids[p].style.visibility = "visible";
					ids[p].style.zIndex = 1000;
					}
				}
			
		}
		if (typeof id != 'undefined') {
			ids['collect'].style.top = getAnchorPosition(temp).y-10+topcor;
			ids['collect'].style.left = getAnchorPosition(temp).x-29+leftcor;
			ids['collect'].style.visibility = "visible";
			ids['collect'].style.zIndex = 110;

		}
		else {
			ids['collect'].style.visibility = "hidden";
			ids['collect'].style.zIndex = 1;
		}
	}
}

function toggle(img, doc) {
	if (typeof doc == 'undefined') {
		doc = document;
	}
	var url = doc.images[img].src;
	//alert(url);
	var lead = url.substr(0, url.lastIndexOf('.') - 1);
	var state = url.substr(url.lastIndexOf('.') - 1, 1);
	var ext = url.substr(url.lastIndexOf('.'));
	state = Math.abs(parseInt(state) - 1);
	doc.images[img].src = lead + state + ext;
}

function prel(url) {
	var img = new Image();
	img.src = url;
	var lead = url.substr(0, url.lastIndexOf('.') - 1);
	var state = url.substr(url.lastIndexOf('.') - 1, 1);
	var ext = url.substr(url.lastIndexOf('.'));
	state = Math.abs(parseInt(state) - 1);
	url = lead + state + ext;
	img.src = url;
}

function init_mo(base, img) {
	for (var i = 0; i < img.length; i++) {
		prel(base + img[i]);
	}
}

function getAnchorPosition(anchorname) {
	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (document.getElementById) { use_gebi=true; }
	else if (document.all) { use_css=true; }
	else if (document.layers) { use_layers=true; }
	// Logic to find position
 	if (use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_gebi) {
		var o=document.getElementById(anchorname);
		x=o.offsetLeft; y=o.offsetTop;
		}
 	else if (use_css) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_layers) {
		var found=0;
		for (var i=0; i<document.anchors.length; i++) {
			if (document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
		}
	else {
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;
//	alert(x +' ' + y);
//	alert(coordinates.x);
//	alert(coordinates.y);
	return coordinates;
	
	}

// getAnchorWindowPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the window
function getAnchorWindowPosition(anchorname) {
	var coordinates=getAnchorPosition(anchorname);
	var x=0;
	var y=0;
	if (document.getElementById) {
		if (isNaN(window.screenX)) {
			x=coordinates.x-document.body.scrollLeft+window.screenLeft;
			y=coordinates.y-document.body.scrollTop+window.screenTop;
			}
		else {
			x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
			y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
			}
		}
	else if (document.all) {
		x=coordinates.x-document.body.scrollLeft+window.screenLeft;
		y=coordinates.y-document.body.scrollTop+window.screenTop;
		}
	else if (document.layers) {
		x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
		y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// Functions for IE to get position of an object
function AnchorPosition_getPageOffsetLeft (el) {
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
	}
function AnchorPosition_getWindowOffsetLeft (el) {
	return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
	}	
function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
	}
function AnchorPosition_getWindowOffsetTop (el) {
	return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
	}


//-->

