// Theme Name: bootcamp
// Theme URI: http://cxbc-prod-coregdb.cyberplex.com/
// Description: Bootcamp Theme
// Version: 1.0
// Author: Andrew Hilts
// Author URI: http://ahilts.com
// Tags: bootcamp

function roll_over(id){
	id_l = id.length;
	over_check = id.substr(id_l-4, id_l);
	dup_check = id.substr(0,1);
	if(dup_check == "f"){
		fid = id.substr(1, id_l);
		newImage = "http://www.bootcampmedia.com/wp-content/themes/bootcamp/images/"+fid+"_over.png";
	} else {
		newImage = "http://www.bootcampmedia.com/wp-content/themes/bootcamp/images/"+id+"_over.png";
	}
	if(over_check != "over"){
		document.getElementById(id).src = newImage;	
	} 
}
function roll_out(id){
	id_l = id.length;
	over_check = id.substr(id_l-4, id_l);
	if(dup_check == "f"){
		fid = id.substr(1, id_l);
		newImage = "http://www.bootcampmedia.com/wp-content/themes/bootcamp/images/"+fid+".png";
	} else {
		newImage = "http://www.bootcampmedia.com/wp-content/themes/bootcamp/images/"+id+".png";
	}
	if(over_check != "over"){
		document.getElementById(id).src = newImage;
	}
}

var allHTMLTags = new Array();
function getElementByClass(theTitle, theClass) {
//Create Array of All HTML Tags
var allHTMLTags=document.getElementsByTagName("*");
//Loop through all tags using a for loop
	for (i=0; i<allHTMLTags.length; i++) {
	//Get all tags with the specified class name.
		if (allHTMLTags[i].className==theClass) {
	
		atag = allHTMLTags[i].innerHTML;
		linklength = atag.length;
		// get <a>
		startlink = atag.indexOf('">');
		// get </a>
		endlink = atag.indexOf('</');
		startHtml = atag.substr(0,startlink+2);
		startHtml_1 = startHtml.substr(0,2);
		startHtml_2 = startHtml.substr(2, startHtml.length);
		startHtml_rollover = ' onMouseOver="javascript:roll_over(\'nav_'+theTitle+'\');" onMouseOut="javascript:roll_out(\'nav_'+theTitle+'\');"';
		startHtml = startHtml_1+startHtml_rollover+startHtml_2;
		endHtml = atag.substr(endlink, linklength); 
		newlink = startHtml+'<img id="nav_'+theTitle+'" src="http://www.bootcampmedia.com/wp-content/themes/bootcamp/images/nav_'+theTitle+'.png" border="0">'+endHtml;
		//alert(newlink);
		allHTMLTags[i].innerHTML = newlink;
		}
	}
}
