//--------------------------


// email hider--This script is to kill any spambot in its tracks
function returnEmail(username, domain) {
					var formattedEmail = username+"@"+domain;
					window.location.href = "mailto:"+formattedEmail+"?subject=";
				}
// ~~~~~~~EXAMPLE~~~~~~~<a href="javascript:returnEmail('name', 'domain.com');" title="Click to email">

// ~~~~~~~~~~~~~~~~~rollovers
function setupRollovers() {
if (!document.getElementsByTagName)
return;
var all_links = document.getElementsByTagName('a');
for (var i = 0; i < all_links.length; i++) {
var link = all_links[i];
if (link.className &&
(' ' + link.className + ' ').indexOf(' rollover ') != -1)
{
if (link.childNodes &&
link.childNodes.length == 1 &&
link.childNodes[0].nodeName.toLowerCase() == 'img') {
link.onmouseover = mouseover;
link.onmouseout = mouseout;
}
}
}
}
function findTarget(e)
{
/* Begin the DOM events part, which you */
/* can ignore for now if it's confusing */
var target;
if (window.event && window.event.srcElement)
target = window.event.srcElement;
else if (e && e.target)
target = e.target;
if (!target)
return null;
while (target != document.body &&
target.nodeName.toLowerCase() != 'a')
target = target.parentNode;
if (target.nodeName.toLowerCase() != 'a')
return null;
return target;
}
function mouseover(e) {
var target = findTarget(e);
if (!target) return;
// the only child node of the a-tag in target will be an img-tag
var img_tag = target.childNodes[0];
// Take the "src", which names an image called "something.ext",
// Make it point to "something_over.ext"
// This is done with a regular expression
img_tag.src = img_tag.src.replace(/(\.[^.]+)$/, '-over$1');
}
function mouseout(e) {
var target = findTarget(e);
if (!target) return;
// the only child node of the a-tag in target will be an img-tag
var img_tag = target.childNodes[0];
// Take the "src", which names an image as "something_over.ext",
// Make it point to "something.ext"
// This is done with a regular expression
img_tag.src = img_tag.src.replace(/-over(\.[^.]+)$/, '$1');
}
// When the page loads, set up the rollovers
window.onload = function() {
	setupRollovers();
	}
	
	
function rollOutSub(tabID, setWidth, topPos, leftPos){
	if(document.getElementById('subNavAboutUs')){
		document.getElementById('subNavAboutUs').style.display = 'none';
	}
	if(document.getElementById('subNavOurWork')){
		document.getElementById('subNavOurWork').style.display = 'none';
	}
	if(document.getElementById('subNavLeadershipSocieties')){
		document.getElementById('subNavLeadershipSocieties').style.display = 'none';
	}
	if(document.getElementById('subNavYoungLeadersUnited')){
		document.getElementById('subNavYoungLeadersUnited').style.display = 'none';
	}
	if(document.getElementById('subNavGive')){
		document.getElementById('subNavGive').style.display = 'none';
	}
	if(document.getElementById('subNavAdvocate')){
		document.getElementById('subNavAdvocate').style.display = 'none';
	}
	if(document.getElementById('subNavVolunteer')){
		document.getElementById('subNavVolunteer').style.display = 'none';
	}
	if(document.getElementById('subNavFinancialInfoPolicies')){
		document.getElementById('subNavFinancialInfoPolicies').style.display = 'none';
	}
	if(document.getElementById('subNavPriorityIssues')){
		document.getElementById('subNavPriorityIssues').style.display = 'none';
	}
	if(document.getElementById('subNavFinancialStability')){
		document.getElementById('subNavFinancialStability').style.display = 'none';
	}
	if(document.getElementById('subNavHeadlines')){
		document.getElementById('subNavHeadlines').style.display = 'none';	
	}
	
	if(tabID == 'AboutUs' || tabID == 'FinancialInfoPolicies'){
		document.getElementById('subNavAboutUs').style.width = '210px';
		document.getElementById('subNavAboutUs').style.display = 'block';	
		if(tabID == 'FinancialInfoPolicies'){
			document.getElementById('subNavFinancialInfoPolicies').style.width = '120px';
			document.getElementById('subNavFinancialInfoPolicies').style.display = 'block';
			document.getElementById('subNavFinancialInfoPolicies').style.top = '134px';
			document.getElementById('subNavFinancialInfoPolicies').style.left = '210px';
		}
	}else if(tabID == 'OurWork' || tabID == 'PriorityIssues' || tabID == 'FinancialStability'){
		document.getElementById('subNavOurWork').style.width = '130px';
		document.getElementById('subNavOurWork').style.display = 'block';
		if(tabID == 'PriorityIssues' || tabID == 'FinancialStability'){
			document.getElementById('subNavPriorityIssues').style.width = '200px';
			document.getElementById('subNavPriorityIssues').style.display = 'block';
			document.getElementById('subNavPriorityIssues').style.top = '26px';
			document.getElementById('subNavPriorityIssues').style.left = '130px';
			if(tabID == 'FinancialStability'){
				document.getElementById('subNavFinancialStability').style.width = '200px';
				document.getElementById('subNavFinancialStability').style.display = 'block';
				document.getElementById('subNavFinancialStability').style.top = '26px';
				document.getElementById('subNavFinancialStability').style.left = '200px';
			}
		}
	}else if(tabID == 'LeadershipSocieties' || tabID == 'YoungLeadersUnited'){
		document.getElementById('subNavLeadershipSocieties').style.width = '260px';
		document.getElementById('subNavLeadershipSocieties').style.display = 'block';
		if(tabID == 'YoungLeadersUnited'){
			document.getElementById('subNavYoungLeadersUnited').style.width = '160px';
			document.getElementById('subNavYoungLeadersUnited').style.display = 'block';
			//document.getElementById('subNavYoungLeadersUnited').style.top = '188px';
			document.getElementById('subNavYoungLeadersUnited').style.top = '161px';
			document.getElementById('subNavYoungLeadersUnited').style.left = '260px';
		}
	}else if(tabID == 'Give'){
		document.getElementById('subNavGive').style.width = '200px';
		document.getElementById('subNavGive').style.display = 'block';	
	}else if(tabID == 'Advocate'){
		document.getElementById('subNavAdvocate').style.width = '180px';
		document.getElementById('subNavAdvocate').style.display = 'block';	
	}else if(tabID == 'Volunteer'){
		document.getElementById('subNavVolunteer').style.width = '180px';
		document.getElementById('subNavVolunteer').style.display = 'block';	
	}else if(tabID == 'Headlines'){
		document.getElementById('subNavHeadlines').style.width = '250px';
		document.getElementById('subNavHeadlines').style.display = 'block';
	}
	
}
