
var win= null;
function popUp(mypage,myname,w,h,scroll){ 
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+1+',';
      settings +='left='+1+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable=yes';
  win=window.open(mypage,myname,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function switchInfo( theInfo )
{
	var replaceStr = "'";
	var theInfo2 = theInfo.replace(/}}/g,"'");
	document.getElementById("equipInfo").innerHTML = theInfo2;
}

function switchHeads( num, theMax )
{
	for( var i = 1; i <= theMax; i++ )
	{
		document.getElementById("leader" + i + "BW").style.display = 'block';
		document.getElementById("leader" + i + "Color").style.display = 'none';
	}
	document.getElementById("leader" + num + "BW").style.display = 'none';
	document.getElementById("leader" + num + "Color").style.display = 'block';
	//document.getElementById("theBio").innerHTML = "<BR>" + theBio;
}

function locationToggle( theID )
{
	var theIDs = new Array('fontanaID','tulsaID','dallasID','houstonID','laredoID','masuryID');
	
	for( i = 0; i < 6; i++ )
	{
		document.getElementById( theIDs[i] ).style.display = 'none';
	}
	document.getElementById( theID ).style.display = 'block';
}

function toggleCareers( num, theMax )
{
	for( var i = 0; i <= theMax; i++ )
	{
		document.getElementById('div' + i).style.display = 'none';
	}
	document.getElementById('div' + num).style.display = 'block';
}

function switchLogos( num, theMax )
{
	for( var i = 1; i <= theMax; i++ )
	{
		document.getElementById("partner" + i + "BW").style.display = 'block';
		document.getElementById("partner" + i + "Color").style.display = 'none';
	}
	document.getElementById("partner" + num + "BW").style.display = 'none';
	document.getElementById("partner" + num + "Color").style.display = 'block';
	//document.getElementById("theBio").innerHTML = "<BR>" + theBio;
}


/*	Form Validation Object
	-------------------------------------
	Author: Ronald Timoshenko
	Version: 0.6 (Updated 8 March 2007)
*/

var form = {
	requireClass : "require",
	invalidFields : null,
	init : function(){
		if (!document.getElementsByTagName) return;
		var forms = document.getElementsByTagName("form");
		for (var i=0; i<forms.length; i++){
			forms[i].onsubmit = function(){
				return form.validate(this);
			}
		}
		this.text_toggle();
	},
	validate : function(formObj){
		form.invalidFields = 0;
		for (var i=0; i<formObj.length; i++){
			var field = formObj[i];
			var fieldClass = String(field.className);
			if (fieldClass.indexOf(form.requireClass) != -1){
				if (field.value == 0 || field.value == ""){
					form.invalidFields++;
				}
			}
		}
		if(form.invalidFields != 0){
			alert("There are still " + form.invalidFields + " empty fields.");
			return false;
		} else {
			return true;
		}
	},
	text_toggle : function(toggleClass_str) {
		if (!document.getElementsByTagName) return;
		var inputs = document.getElementsByTagName("input");
		for (var i=0; i<inputs.length; i++){
			var field = inputs[i];
			var fieldClass = String(field.className);
			if (fieldClass.indexOf(toggleClass_str) != -1){
				field.defaultValue = field.value;
				field.onfocus = function() {
					if (this.value == this.defaultValue) {
						this.value = "";
					}
				}
			}
		}
	}
};





/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

//////////////////////////////////////////////////////////////////
// qTip - CSS Tool Tips - by Craig Erskine
// http://qrayg.com | http://solardreamstudios.com
//
// Inspired by code from Travis Beckham
// http://www.squidfingers.com | http://www.podlob.com
//
// Modified by Ronald Timoshenko (06 June 2006)
//////////////////////////////////////////////////////////////////





var tooltip = {
	
	/* Variables
	------------------------------------------------ */
	
	name : "qTip",
	offsetX : -30, //This is qTip's X offset//
	offsetY : 25, //This is qTip's Y offset//
	tip : null,
	
	/* Functions
	------------------------------------------------ */
	
	init : function () {
		var tipNameSpaceURI = "http://www.w3.org/1999/xhtml";
		if(!tipContainerID){ var tipContainerID = "qTip";}
	
		if(!tipContainer) {
		  tipContainer = document.createElementNS ? document.createElementNS(tipNameSpaceURI, "div") : document.createElement("div");
			tipContainer.setAttribute("id", tipContainerID);
		  document.getElementsByTagName("body").item(0).appendChild(tipContainer);
		}
	
		if (!document.getElementById) return;
		tooltip.tip = document.getElementById (tooltip.name);
		if (tooltip.tip) document.onmousemove = function (evt) {tooltip.move (evt)};
	
		var tipContainer = document.getElementById(tipContainerID);
	
		var a, sTitle;
		var anchors = document.getElementsByTagName ("a"); //Which tag do you want to qTip-ize? Keep it lowercase!//
	
		for (var i = 0; i < anchors.length; i ++) {
			a = anchors[i];
			sTitle = a.getAttribute("title");
			if(sTitle) {
				a.setAttribute("tiptitle", sTitle);
				a.removeAttribute("title");
				a.onmouseover = function() {tooltip.show(this.getAttribute('tiptitle'))};
				a.onmouseout = function() {tooltip.hide()};
			}
		}
	},
	move : function (evt) {
		var x=0, y=0;
		if (document.all) {//IE
			x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
			y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
			x += window.event.clientX;
			y += window.event.clientY;
			
		} else {//Good Browsers
			x = evt.pageX;
			y = evt.pageY;
		}
		tooltip.tip.style.left = (x + tooltip.offsetX) + "px";
		tooltip.tip.style.top = (y + tooltip.offsetY) + "px";
	},
	show : function (text) {
		if (!tooltip.tip) return;
		tooltip.tip.innerHTML = text;
		tooltip.tip.style.display = "block";
	},
	hide : function () {
		if (!tooltip.tip) return;
		tooltip.tip.innerHTML = "";
		tooltip.tip.style.display = "none";
	}
}

/* -------------------------------------------------------------
	Event Listeners
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
if (window.addEventListener){
	window.addEventListener("load", tooltip.init, false);
} else if (document.addEventListener) {
	document.addEventListener("load", tooltip.init, false);
} else if (window.attachEvent) {
	window.attachEvent("onload", tooltip.init);
} else if (typeof window.onload == "function") {
	window.onload = function(){
		tooltip.init();
	};
} else {
	window.onload = tooltip.init;
}


