
//### leave a blank space at the top. It breaks if you don't. Stop asking why.

function columnBalancer(){
	var cb_left;
	var cb_mid;
	var cb_right;

	if(document.getElementById('cb_left')){
		cb_left = document.getElementById('cb_left');
		}//end if
		
	if(document.getElementById('cb_mid')){
		cb_mid = document.getElementById('cb_mid');
		}//end if
		
	if(document.getElementById('cb_right')){
		cb_right = document.getElementById('cb_right');
		}//end if

	if(document.getElementById('cb_wide')){
		cb_mid = document.getElementById('cb_wide');
		cb_right = document.getElementById('cb_wide');//kind of a hack
		}//end if

	var x = 0;
	if(cb_left.clientHeight > x){
		x = cb_left.clientHeight;
		}
	if(cb_mid.clientHeight > x){
		x = cb_mid.clientHeight;
		}
	if(cb_right.clientHeight > x){
		x = cb_right.clientHeight;
		}
/*
	cb_left.style.height = x + "px";
	cb_mid.style.height = x + "px";
	cb_right.style.height = x + "px";
*/
/*	cb_left.style.height = x + "px";
	cb_mid.clientHeight = x + "px";
	cb_right.clientHeight = x + "px";
*/
	$('#cb_left').height(x);
	$('#cb_mid').height(x);
	$('#cb_right').height(x);

	}//end func


function homeModBalancer(){
	var x = 0;
	//find the tallest module
	for(i=0; i< home_mod_refs.length; i++){
		if(x < document.getElementById('mod_' + home_mod_refs[i]).clientHeight){
			x = document.getElementById('mod_' + home_mod_refs[i]).clientHeight;
			}//end if x
		}//end for i
	// make all the modules this tall
	for(i=0; i< home_mod_refs.length; i++){
		document.getElementById('mod_' + home_mod_refs[i]).style.height = x + 'px';
		}//end for i
	}//end func


var top_secs = new Array('Client_Services','Job_Seekers','Industries', 'About_Us');//used for navPulldownBalancer() and NavHandler() and the new jQuery nav handler funcs.
var width_nums = new Array();


// ### VISUAL STUFF ###########################################################

// ### Begin jQuery Pulldown manipulators


function jQ_navOver(event){
	jQ_navClear();
	$('#over_' + event.target.id).fadeIn(400);
	$('#nav_' + event.target.id).fadeIn(400);
	$('#nav_flush').show();
	}//end func


function jQ_about_us_navOver(event){
	jQ_navClear();
	$('#over_' + $(event.target).attr('class')).fadeIn(400);
	$('#nav_' + $(event.target).attr('class')).fadeIn(400);
	$('#nav_flush').show();
	}//end func


function jQ_navFlush(){
	$('#nav_flush').hide();
	jQ_navClear();
	}//end func

function jQ_navClear(){
	resetT2butn();
	$('.sub_pulldown_div').fadeOut(100);
	$('.pulldown_div').fadeOut(100);
	for(i=0; i< eval(top_secs.length-1); i++){
		$('#over_' + top_secs[i]).fadeOut(100);
		$('#nav_' + top_secs[i]).fadeOut(100);
		}//end for i
	$('#over_About_Us').fadeOut(100);
	}//end func

function IE6_IE7_home_fix_1(event){
	jQ_navClear();
	$('#over_' + event.target.id).fadeIn(400);
	$('#nav_' + event.target.id).fadeIn(400);
	$('#nav_flush').show();
	$('#home_main_pic').html('<img src="flash_assets/home_superheroes_5.jpg">');
	}//end func

function IE6_IE7_home_fix_2(event){
	$('#nav_flush').hide();
	jQ_navClear();
	$('#home_main_pic').html('<object width="760" height="237"><param name="Slideshow" value="overture_home_anim_2.swf"><param name="wmode" value="opaque"><embed src="overture_home_anim_2.swf" width="760" height="237" wmode="opaque"></embed></object>');
	}//end func



var sp_subnavs = new Array();
var sp_cores = new Array();
var sp_butns = new Array();
var currentT2Butn;
var currentT3Subnav;

function subnavParser(){
//$('#dev_div').text('subnavParser');
	var x = 0;
	$('div[id^="subnav_"]').each(function(){
		sp_subnavs[x] = $(this).prop("id");
		sp_cores[x] = sp_subnavs[x].replace(/subnav_/, "");
		sp_butns[x] = sp_subnavs[x].replace(/subnav_/, "butn_");
		$('#'+sp_butns[x]).unbind();//to get rid of the hoverIntent subnavHide
		$('#'+sp_butns[x]+':not(:has(a))').hover(jQ_medBlueOver, jQ_medBlueOut);
		$('#'+sp_butns[x]+':has(a)').hover(jQ_linkOrangeOver, jQ_linkOrangeOut);
		$('#'+sp_butns[x]).bind('mouseenter', subnavShow);
		x++;
		});//end each()func
	}//end func



function subnavShow(event){
//$('#dev_div').text('subnavShow: '+ $(this).attr("id") + " | " + $(this).attr("class") +' | ' + event.timeStamp);

	resetT2butn();

	$(this).unbind('mouseenter', subnavShow);
	$(this).addClass('butn_is_showing_subnav');

	var this_subnav = $(this).attr("id").replace(/butn_/, "subnav_");

/*	$(this).next('.sub_pulldown_div').css("top", $(this).offset().top - $(this).parent().offset().top + "px");
	$(this).next('.sub_pulldown_div').addClass('sub_is_visible');
	$(this).next('.sub_pulldown_div').fadeIn(200);
*/	$('#'+this_subnav).css("top", $(this).offset().top - $(this).parent().offset().top + "px");
	$('#'+this_subnav).addClass('sub_is_visible');
	$('#'+this_subnav).fadeIn(200);

	}//end func


function subnavHide(event){
//$('#dev_div').text('subnavHide' + $(event.target).attr('id'));
	resetT2butn();
	$('.sub_pulldown_div').fadeOut(200);
	}//end func


function subnavOver(event){
//$('#dev_div').text('subnavOver');
	$('.butn_is_showing_subnav').addClass("medium_blue");
	}//end func

function subnavOut(event){
//$('#dev_div').text('subnavOut');
	resetT2butn();
	}//end func

function resetT2butn(){//this resets a button that produces a subnav.
	$('.butn_is_showing_subnav').bind('mouseenter', subnavShow);
	$('.butn_is_showing_subnav').removeClass("medium_blue");
	$('.butn_is_showing_subnav').removeClass('butn_is_showing_subnav');

	$('.sub_is_visible').fadeOut(100);
	$('.sub_is_visible').removeClass('sub_is_visible');
	}//end func


function jQ_linkOrangeOver(event){
	$(this).addClass('link_orange');
	}//end func

function jQ_linkOrangeOut(event){
	$(this).removeClass('link_orange');
	}//end func

function jQ_medBlueOver(event){
	$(this).addClass('medium_blue');
	}//end func

function jQ_medBlueOut(event){
	$(this).removeClass('medium_blue');
	}//end func

function jQ_darkBlueOver(event){
	$(this).addClass('dark_blue');
	}//end func

function jQ_darkBlueOut(event){
	$(this).removeClass('dark_blue');
	}//end func

function jQ_veryDarkBlueOver(event){
	$(this).addClass('very_dark_blue');
	}//end func

function jQ_veryDarkBlueOut(event){
	$(this).removeClass('very_dark_blue');
	}//end func


function nothing(){
	//just nothing, to fool jQuery hover().
	}//end func

// ## End PULLDOWNS ########################


function Expando(which){
	var fred = document.getElementById(which);
	if(fred.style.display == "block"){
		fred.style.display = "none";
	} else {
		fred.style.display = "block";
		}//end if else
	}//end func

function divRollOver(which){//for the Mods on the right
	document.getElementById(which).style.backgroundColor = '#ff9';
	}

function divRollOut(which, what){//for the Mods on the right
	document.getElementById(which).style.backgroundColor = '#' + what;
	}

function InTune_expando(which){
	if($('#expando_'+which+'_link').text() == "expand all"){
		$('div[id^="InTune_sub_'+which+'_"]').show();
		$('#expando_'+which+'_link').text("collapse all");
		$('#expando_'+which+'_carat').attr("src", "common_pix/green_carat_up.png");
		$('div[id^="InTune_'+which+'_"]').children().children('.InTune_carat').attr("src", "common_pix/green_carat_down.png");		
		//$('#cb_left').height("auto");
		$('#cb_left').height($('#cb_wide').height());
	} else {
		$('div[id^="InTune_sub_'+which+'_"]').hide();
		$('#expando_'+which+'_link').text("expand all");
		$('#expando_'+which+'_carat').attr("src", "common_pix/green_carat_down.png");
		$('div[id^="InTune_'+which+'_"]').children().children('.InTune_carat').attr("src", "common_pix/green_carat_right.png");		
		//$('#cb_left').height("auto");
		$('#cb_left').height($('#cb_wide').height());
		}//end if else	
	}//end func

// ### NAVIGATION #############################################################

// mouseover functions by Lindsay Dolph

var NavButtons = new Array(); 
//specific NavButtons defined in "php_includes/page_setup.php" to maintain button state

function NavButton(off, hover, clicked) {
	this['default'] = new Image ();
	this['default'].src = off;
	this['hover'] = new Image ();
	this['hover'].src = hover;
	this['up'] = new Image ();
	this['up'].src = clicked;
	}

var which_mo = 'down';

function RollOver(which){ 
	document.getElementById(which).src = NavButtons[which]['hover'].src; 
	} 

function RollOut(which){ 
	document.getElementById(which).src = NavButtons[which]['default'].src; 
	}

function ModRollOver(which){ 
	which.src = NavButtons['mod_bot_more']['hover'].src; 
	} 

function ModRollOut(which){ 
	which.src = NavButtons['mod_bot_more']['default'].src; 
	}

/*


June 4 2011


function subnavShow(event){
	for(i=0; i< sp_butns.length; i++){
		if(sp_butns[i] == $(this).attr("id")){	
			//$('#'+sp_subnavs[i]).show();
			$('#'+sp_subnavs[i]).fadeIn(200);
			$('#'+sp_subnavs[i]).css("top", $(this).offset().top - $(this).parent().offset().top + "px");
//			$('#'+sp_butns[i]).unbind('mouseenter', subnavShow);
//			$(this).addClass('butn_haz_subnav');
			}//end if
		}//end for
	}//end func













// May 31, 2011: BELOW IS ALL PRE-jQUERY STUFF...

//####################### ARCHIVED 5/20/11 at 11:14pm

// ### great for debugging, DO NOT DELETE #######################
function dumpProps(obj, parent) {
   // Go through all the properties of the passed-in object 
   for (var i in obj) {
      // if a parent (2nd parameter) was passed in, then use that to 
      // build the message. Message includes i (the object's property name) 
      // then the object's property value on a new line 
      if (parent) { var msg = parent + "." + i + "\n" + obj[i]; } else { var msg = i + "\n" + obj[i]; }
      // Display the message. If the user clicks "OK", then continue. If they 
      // click "CANCEL" then quit this level of recursion 
      if (!confirm(msg)) { return; }
      // If this property (i) is an object, then recursively process the object 
      if (typeof obj[i] == "object") { 
         if (parent) { dumpProps(obj[i], parent + "." + i); } else { dumpProps(obj[i], i); }
		  }//ednd if
	   }//end for
	}//end func

// ### great for debugging, DO NOT DELETE #######################
function targetFinder(e) {
	var targ;
	if(!e){ 
		var e = window.event;
		}
	if(e.target){
		targ = e.target;
	} else if (e.srcElement){
		targ = e.srcElement;
		}
	if (targ.nodeType == 3){ // defeat Safari bug
		targ = targ.parentNode;
		}//end if

	//dumpProps(targ);
//	return targ.parentNode.parentNode.className;
	return targ.mousible;
	}//end func

//### very cool MouseTracker. works great!
*/
/*
var isIE = document.all?true:false;
if (!isIE) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getMousePosition;
var _x;
var _y;

function getMousePosition(e) {
	if (!isIE) {
		_x = e.pageX;
		_y = e.pageY;
		}
	if (isIE) {
		_x = event.clientX + document.body.scrollLeft;
		_y = event.clientY + document.body.scrollTop;
		}
	//document.exf1.x.value=_x;
	//document.exf1.y.value=_y;
//	document.getElementById('data_div').innerHTML = "x: "+ _x + ", y: " + _y;
	return true;
	}//end func
*/



/*
//################### ARCHIVED 5/18/11 at 12:50pm

var popTimerId_1 = 0;
var global_which;

function NavHandler(which, event){
	if(event.type == 'mouseover'){
		if(setTimeout(popTimerId_1)){
			clearTimeout(popTimerId_1);
			}
		for(i=0; i< top_secs.length; i++){//flush the other navs
			if(top_secs[i] != which){
				document.getElementById(top_secs[i]).src = NavButtons[top_secs[i]]['default'].src; 
				document.getElementById('nav_'+top_secs[i]).style.display='none';	
				}//end if
			}//end for i
		document.getElementById(which).src = NavButtons[which]['hover'].src; 
		document.getElementById('nav_'+which).style.display='block';
		
	} else {
		global_which = which;
		popTimerId_1 = setTimeout("NavOut()", 500);
		//document.getElementById(which).src = NavButtons[which]['default'].src; 
		//document.getElementById('nav_'+which).style.display='none';			
		}//end if else			
	}//end func

function NavOut(){
	document.getElementById(global_which).src = NavButtons[global_which]['default'].src; 
	document.getElementById('nav_'+global_which).style.display='none';			
	}//end func

*/
