// JavaScript Document

var searchDDactive = false;
var curCSSidePoint = null;
var curCSBodyCopy = null;
var articleMinTop = 0;
var articleMinLeft = 0;
var curNewsPgHeight = 0;
var curNewsPgWidth = 0;
var curNewsItemOrigHeight = 0;
var curNewsItemOrigWidth = 0;

var jobMinTop = 0;
var jobMinLeft = 0;
var curJobPgHeight = 0;
var curJobPgWidth = 0;
var curJobItemOrigHeight = 0;
var curJobItemOrigWidth = 0;

var curNewsViewType = "recent";
var curArchivedNewsPage = 1;
var totalArchivedNewsPages = 0;
var origNewsPgHeight = 0;
var origNewsPgWidth = 0;
var curNewsPgScale = 100;

var bioPeopleToggle = "bios";
var bioTransComplete = true;

var curNewsArticle = null;
var newsFullViewMode = false;

var letsTalkInvalidCount = new Array();
var letsTalkFormIsValid = false;

var invalidNames = Array("blank", 
						 "none", 
						 "na", 
						 "yada", 
						 "mama", 
						 "dada", 
						 "daddy",
						 "asdasd", 
						 "qweqwe", 
						 "qwe",
						 "zxczxc", 
						 "qwerty", 
						 "asdf", 
						 "zxcv", 
						 "zxc",
						 "asd",
						 "something",
						 "Mr. T"
						 );




// this function determines whether the event is the equivalent of the microsoft
// mouseleave or mouseenter events.
function isMouseLeaveOrEnter(e, handler)
{		
	if (e.type != 'mouseout' && e.type != 'mouseover') return false;
	var reltg = e.relatedTarget ? e.relatedTarget :
	e.type == 'mouseout' ? e.toElement : e.fromElement;
	while (reltg && reltg != handler) reltg = reltg.parentNode;
	return (reltg != handler);
}




function isDefined(variable)
{
return (!(!( variable||false )))
}


function backToTop(){
	new Effect.ScrollTo($('pgTitleHolder'));
}







/*################################################################################
  ################################################################################
  CALL OUT TEXT DEFINITIONS
  ################################################################################
  ################################################################################*/
  
  var callOutText = new Array();
  
		callOutText["3_0_Experience"]	=	{title:null, text:"<a href='../experience/our_experience.jsp'>Who we are</a> and what we offer spring from our collective accomplishments.", link:""};
		callOutText["2_0_Services"]		=	{title:null, text:"See the <a href='../services/unique_service_offerings.jsp'>many ways we can help</a> your brand engage in more personal relationships.", link:"string"};
		callOutText["7_0_ContactUs"]	=	{title:null, text:"Phone, email, send us <br>a card or visit in person. <a href='../contact/contact_us_main.jsp'>You're always welcome.</a>", link:"string"};
		callOutText["5_0_NewsViews"]	=	{title:null, text:"<a href='../news/news_main.jsp'>Learn what's new and <br>hear our points of view.</a>", link:"string"};
		callOutText["2_2_LetsTalk"]		=	{title:null, text:"Want to dig deeper or have <br>a question? <a href='../services/lets_talk.jsp'>Talk to us.</a>", link:"string"};
		callOutText["3_1_CaseStudies"]	=	{title:null, text:"<a href='../experience/case_studies.jsp'>See our behavioral solutions in action.</a>", link:"string"};
		callOutText["3_3_Awards"]		=	{title:null, text:"Our work has <br>been honored for Creative Excellence and Results. <br><a href='../experience/awards.jsp'>See the awards given by our industry and by our peers.</a>", link:"string"};
		callOutText["4_1_OurApproach"]	=	{title:null, text:"It's not only what we do, but <a href='../dna/our_approach.jsp'>why we do it.</a>", link:"string"};
		callOutText["4_2_OurPrinciples"]=	{title:null, text:"<a href='../dna/our_principles.jsp'>Five keys to better relationships</a>", link:"string"};
		callOutText["4_3_OurPeople"]	=	{title:null, text:"Our greatest asset <br>rides the elevator every day. <a href='../dna/our_people.jsp'>Meet the people who make MicroMass work.</a>", link:"string"};
							  
  
/*################################################################################
  ################################################################################
  EOF CALL OUT TEXT DEFINITIONS
  ################################################################################
  ################################################################################*/


function injectCallout(coArray, txtColor){
	
	var callOutOutput = "";
        callOutOutput += "<div class='sideBarCalloutBox'>";
        callOutOutput += "<img id='sub_callout_top_accent' src='../../images/spacer.gif' width='153' height='9' class='sub_callout_top_accent' alt='topAccent' />";
		
		for(var i = 0; i< coArray.length; i++){
			callOutOutput += "<div class='sideBarCalloutContent_"+txtColor+"'>"+coArray[i].text+"</div>";
			if(coArray.length > 1 && i<coArray.length-1){
				callOutOutput += "<img src='../../images/callout_separator.gif' width='3' height='3' alt='•' class='calloutSeparator'/>";
			}
		}
		
        callOutOutput += "<img id='sub_callout_bottom_accent' src='../../images/spacer.gif' width='153' height='10' class='sub_callout_bottom_accent' alt='topAccent' />";
        callOutOutput += "&nbsp;</div>";
		
		new Insertion.Bottom('sideBar', callOutOutput);
}


function changeLetsTalkPerson(strPerson, rButton){
	rButton.checked = "true";	
	
	if(currentPerson != null){
		$(currentPerson+'_img').hide();	
		$(currentPerson+'_quote').hide();	
	}
		currentPerson = strPerson;
		if(currentPerson != null){
			$('stage1warning').fade({duration:0.25});	
		}
		
		
		$(strPerson+'_img').show();	
		$(strPerson+'_quote').show();	
}


function advanceLetsTalk(stageNum, fromStageNum){
			
			switch(stageNum){
				case 2:
					if(currentPerson == null){
						$('stage1warning').appear({duration:0.25});	
					}else{
						$('stage1warning').fade({duration:0.25});
						$('lets_talk_stage_'+fromStageNum).hide();
						$('lets_talk_stage_2').show();
					}
					break;
				case 3:
					if($F('myMessage') == ""){
						$('stage2warning').appear({duration:0.25});
					}else{
						$('stage2warning').fade({duration:0.25});
						$('lets_talk_stage_'+fromStageNum).hide();
						$('lets_talk_stage_3').show();
					}
					break;
				case 4:
					$('lets_talk_stage_'+fromStageNum).hide();
					$('lets_talk_stage_4').show();
					break;
			}
	
}


//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// OUR PEOPLE NAVIGATION
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
function changeBio(intBio){
		if(bioPeopleToggle != "bios"){
			new Effect.Parallel(
								[
								 new Effect.Appear('bioDisplay', {sync:true}),
								 new Effect.Fade('employeeDisplay', {sync:true})
								 ]
								,{
									duration:0.5,
									beforeStart:function(){
										bioPeopleToggle = "bios";
										new Effect.Fade($('bio'+curBio), {duration:0.5});
										$('bioLink'+curBio).morph('color:#bec1c3; cursor:pointer', {duration:0.5});
										
										new Effect.Appear($('bio'+intBio), {duration:0.5});
										$('bioLink'+intBio).morph('color:#b4c621; cursor:pointer', {duration:0.5});
										curBio = intBio;
									}
								}
								);
		}else{
			if(bioTransComplete){
				if(curBio != intBio){
					new Effect.Parallel(
										[
										 new Effect.Fade($('bio'+curBio), {from:1, to:0}),
										 new Effect.Appear($('bio'+intBio), {from:0, to:1})
										 ],
										{
											duration:0.5,
											beforeStart:function(){
												bioTransComplete = false;
												$('bioLink'+curBio).setStyle({color:'#bec1c3', cursor:'pointer'});
												$('bioLink'+intBio).setStyle({color:'#b4c621', cursor:'pointer'});
											},
											afterFinish:function(){
												bioTransComplete = true;	
												curBio = intBio;
											}
										}
										);
				}else{
					new Effect.Appear($('bio'+intBio), {to:1, afterFinish:function(){ curBio = intBio; }});
				}
			}
			//new Effect.Fade($('bio'+curBio), {duration:0.5});
			//$('bioLink'+curBio).morph('color:#bec1c3; cursor:pointer', {duration:0.5});
			
			//new Effect.Appear($('bio'+intBio), {duration:0.5});
			//$('bioLink'+intBio).morph('color:#b4c621; cursor:pointer', {duration:0.5});
		}
}


function changePeopleDisplay(strDisplay){
			bioPeopleToggle = "people";
			new Effect.Parallel(
								[
								 new Effect.Fade('bioDisplay', {sync:true}),
								 new Effect.Appear('employeeDisplay', {sync:true})
								 ]
								,{
									duration:0.5
								}
								);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// EOF OUR PEOPLE NAVIGATION
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////


function myUrlEncode(str) {
	var result = "";
	var i = 0;

	for (i=0; i < str.length; i++) {
		result = result + "%";
		result = result + "0123456789ABCDEF".charAt((str.charCodeAt(i)/16)&0x0F);
		result = result + "0123456789ABCDEF".charAt((str.charCodeAt(i)/1)&0x0F);
	}
	return result;
}




function sendEmailTo(strEmail){
	window.location = "mailto:"+strEmail;	
}




function checkNameAgainstList(strName){
	var returnVal = false;
	$R(0, invalidNames.length, true).each(function(value){ if(strName == invalidNames[value]) returnVal = true; });	
	return returnVal;
}


function validateField(valType, strToValidate){
	var fieldInvalid = false;
	if(strToValidate.length == 1) console.warn(valType.id+" is invalid");
	
	if( strToValidate.length > 0){
		switch(valType.id){
			case 'firstName':
				if(checkNameAgainstList(strToValidate.toLowerCase())){
					//console.warn("This name is invalid: "+strToValidate);
					fieldInvalid = true;
				}
				break;
				
			case 'lastName':
				if(checkNameAgainstList(strToValidate.toLowerCase())){
					//console.warn("This name is invalid: "+strToValidate);
					fieldInvalid = true;
				}
				break;
				
			case 'company':
				if(checkNameAgainstList(strToValidate.toLowerCase())){
					//console.warn("This name is invalid: "+strToValidate);
					fieldInvalid = true;
				}
				break;
				
			case 'title':
				if(checkNameAgainstList(strToValidate.toLowerCase())){
					//console.warn("This name is invalid: "+strToValidate);
					fieldInvalid = true;
				}
				break;
				
			case 'email':
				if( !strToValidate.include('@') || strToValidate.toArray().grep('@').length > 1 ){
					//console.warn(valType.id+" is invalid: "+strToValidate+" as it doesn't contain a @ in it.");
					fieldInvalid = true;
				}
				if( !strToValidate.include('.') || strToValidate.toArray().grep('.').length == 0){
					//console.warn(valType.id+" is invalid: "+strToValidate+" as it doesn't contain a '.' in it.");
					fieldInvalid = true;
				}
				
				$R(0, invalidNames.length, true).each(function(value){ if(strToValidate.toLowerCase().include(invalidNames[value])) fieldInvalid = true;  } );
				//THIS COUNTS THE NUMBER OF '@' THERE ARE IN THE EMAIL
				//if( ) fieldInvalid = true; /*console.warn(valType.id+" contains to many '@'s. There are currently "+strToValidate.toArray().grep('@').length+" in the address.");*/
				//if() fieldInvalid = true;
				break;
		}
		letsTalkInvalidCount[valType.alt] = fieldInvalid.toString();
		
		if( fieldInvalid == true && $(valType.id).className != "lets_talk_txt_field_warn" ){ $(valType.id).morph('lets_talk_txt_field_warn', {duration:0.25, afterFinish:function(){ $(valType.id).className = "lets_talk_txt_field_warn"; }}); }
		if( fieldInvalid == false && $(valType.id).className != "lets_talk_txt_field_good"){ $(valType.id).morph('lets_talk_txt_field_good', {duration:0.25, afterFinish:function(){ $(valType.id).className = "lets_talk_txt_field_good"; }});}
	}
	
	if(letsTalkInvalidCount.grep("true").length>0){ letsTalkFormIsValid = false; }else{ letsTalkFormIsValid = true; };
	
}


function submitLetsTalk(fData){
	console.info(fData);
	if(letsTalkFormIsValid){
		alert("SUBMITTING THE FORM");	
	}else{
		alert("FORM IS NOT VALID");	
	}
}






//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// NEWS PAGINATION
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
function changeArticleDisplay(strNewsList){
	
	$('newsPgLink_'+curArchivedNewsPage).setStyle({textDecoration: 'none'});
	
	switch(strNewsList){
		case "archived":
		curNewsViewType = "archived";
		curArchivedNewsPage = 1;
		$('newsPgLink_'+curArchivedNewsPage).setStyle({textDecoration: 'underline'});
		//$('newsPgControls').show();
		$('newsControls').show();
								 $('staticNewsListing').hide();
								 $('newsArchive_pg_1').show();
			/*new Effect.Parallel(
								[
								// new Effect.Scale('newsPgBody', ( $('newsArchive_pg_1').getHeight()/($('staticNewsListing').getHeight() - $('newsHdr').getHeight()))*100, {  scaleMode:{ originalHeight:origNewsPgHeight, originalWidth:origNewsPgWidth}, scaleContent:false, scaleX:false, sync:true, queue:'front'}),
								 new Effect.Scale('newsPgBody', ( $('newsArchive_pg_1').getHeight()/origNewsPgHeight)*100, {  scaleMode:{ originalHeight:origNewsPgHeight, originalWidth:origNewsPgWidth}, scaleContent:false, scaleX:false, sync:true, queue:'front'}),
								 new Effect.Fade('staticNewsListing', {sync:true, queue:'end'}),
								 new Effect.Appear('newsArchive_pg_1', {sync:true, delay:0.5, queue:'end'})
								 ],
								{duration:0.5}
								);
			curNewsPgScale = ($('newsArchive_pg_1').getHeight()/($('staticNewsListing').getHeight() - $('newsHdr').getHeight()))*100;*/
			//new Effect.SlideLeftIn('staticNewsListing', { afterFinish:function(){ console.info("Sliding archived in");  } });
			//new Effect.SlideDown('newsArchive_pg_1');
			break;
			
		case "recent":
		curNewsViewType = "recent";
		$('newsControls').hide();
								 $('newsArchive_pg_'+curArchivedNewsPage).hide();
								 $('staticNewsListing').show();
			/*new Effect.Parallel(
								[
								 //new Effect.Scale('newsPgBody', ( ($('staticNewsListing').getHeight() - $('newsHdr').getHeight())/$('newsArchive_pg_1').getHeight())*100, { scaleMode:{ originalHeight:origNewsPgHeight, originalWidth:origNewsPgWidth}, scaleContent:false, scaleX:false, sync:true, queue:'front'}),
								 new Effect.Scale('newsPgBody', ( origNewsPgHeight/$('newsArchive_pg_1').getHeight())*100, { scaleMode:{ originalHeight:origNewsPgHeight, originalWidth:origNewsPgWidth}, scaleContent:false, scaleX:false, sync:true, queue:'front'}),
								 new Effect.Fade('newsArchive_pg_'+curArchivedNewsPage, {sync:true, queue:'end'}),
								 new Effect.Appear('staticNewsListing', {sync:true, delay:0.5, queue:'end'})
								 ],
								{duration:0.5}
								);
			curNewsPgScale = ( ($('staticNewsListing').getHeight() - $('newsHdr').getHeight())/$('newsArchive_pg_1').getHeight())*100;*/
			curArchivedNewsPage = 1;
			break;
	}
			if(curArchivedNewsPage == 1){
				$('newsPrevControl').setStyle({color:'#d9d9db'});
			}
			if(curArchivedNewsPage > 1){
				$('newsPrevControl').setStyle({color:'#43b7c8'});
			}
			backToArticleListing();
}


function newsPageChange(intNewsPage){
	$('newsPgLink_'+curArchivedNewsPage).setStyle({textDecoration: 'none'});
	 $('newsArchive_pg_'+(curArchivedNewsPage)).hide();
	 curArchivedNewsPage = intNewsPage;
	$('newsPgLink_'+curArchivedNewsPage).setStyle({textDecoration: 'underline'});
	 $('newsArchive_pg_'+(curArchivedNewsPage)).show();
	
			if(curArchivedNewsPage == 1){
				$('newsPrevControl').setStyle({color:'#d9d9db'});
			}
			if(curArchivedNewsPage > 1){
				$('newsPrevControl').setStyle({color:'#43b7c8'});
			}
			if(curArchivedNewsPage == archivePgCount){
				$('newsNextControl').setStyle({color:'#d9d9db'});
			}
			if(curArchivedNewsPage < archivePgCount){
				$('newsNextControl').setStyle({color:'#43b7c8'});
			}
}

function newsPageNextPrev(strDirection, archivePgCount){
	
	$('newsPgLink_'+curArchivedNewsPage).setStyle({textDecoration: 'none'});
	
	switch(strDirection){
		case "prev":
			if(curArchivedNewsPage!=1){
									 $('newsArchive_pg_'+(curArchivedNewsPage)).hide();
									 $('newsArchive_pg_'+(curArchivedNewsPage-1)).show();
				curArchivedNewsPage--;
			}
			break;
			
		case "next":
			if(curArchivedNewsPage < archivePgCount){
									 $('newsArchive_pg_'+(curArchivedNewsPage)).hide();
									 $('newsArchive_pg_'+(curArchivedNewsPage+1)).show();
				curArchivedNewsPage++;
			}
			break;
	}
	$('newsPgLink_'+curArchivedNewsPage).setStyle({textDecoration: 'underline'});
			if(curArchivedNewsPage == 1){
				$('newsPrevControl').setStyle({color:'#d9d9db'});
			}
			if(curArchivedNewsPage > 1){
				$('newsPrevControl').setStyle({color:'#43b7c8'});
			}
			if(curArchivedNewsPage == archivePgCount){
				$('newsNextControl').setStyle({color:'#d9d9db'});
			}
			if(curArchivedNewsPage < archivePgCount){
				$('newsNextControl').setStyle({color:'#43b7c8'});
			}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// EOF NEWS PAGINATION
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// NEWS READING FUNCTIONLITY
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
function viewFullArticle(articleID){
	curNewsArticle = articleID;
	newsFullViewMode = true;
	
	$('acrobatItem').hide();
	$('newsHdr').hide();
	if(curNewsViewType == "archived") $('newsControls').hide();
	
	if( $('newsPgBody').getHeight() != curNewsPgHeight ){
		curNewsPgHeight = $('newsPgBody').getHeight();
		curNewsPgWidth = $('newsPgBody').getWidth();
	}
	
	
			articleMintop = $('newsItem_'+articleID).positionedOffset().top;
			articleMinLeft = $('newsItem_'+articleID).positionedOffset().left;
			
			new Insertion.After($('backButton'), '<div id="curNewsItem" class="newsItemFull">'+ $('newsItem_'+articleID).innerHTML +'</div>' );
			curNewsItemOrigHeight = $('curNewsItem').getHeight();
			curNewsItemOrigWidth = $('curNewsItem').getWidth();
			$('backButton').show();
			
			
			if(curNewsViewType == "recent") $('staticNewsListing').hide();
			if(curNewsViewType == "archived")  $('archivedNewsListing').hide();
			$$('#curNewsItem .item')[0].hide();
			
			new Effect.ScrollTo( $('curNewsItem') );
			new Insertion.Before($$('#curNewsItem .item')[0], "<div id='curNewsArticleBody' class='newsArticleBody'>"+getPICode("../../")+"</div>");
			
			getNewsArticleBody(articleID);
	
}

function backToArticleListing(){
	newsFullViewMode = false;
	$('acrobatItem').show();
			$('backButton').hide();
	$('newsHdr').show();
	if(curNewsViewType == "archived"){
		$('newsControls').show();
		$('archivedNewsListing').show();
	}else{
		$('staticNewsListing').show();
	}
	
			if($('curNewsItem') != null) $('curNewsItem').hide();
			new Effect.ScrollTo($('newsItem_'+curNewsArticle), { afterFinish:function(){
					new Effect.Highlight( $('newsItem_'+curNewsArticle), {startcolor:'#c2cd23', endcolor:'#FFFFFF', duration:1, delay:0.1});
					if($('curNewsItem') != null) $('curNewsItem').remove();
																				 } } );
}


function getNewsArticleBody(articleID){
	$('pi').appear({duration:0.25});
	new Ajax.Updater(
					 'curNewsArticleBody',
					 '../../system/getDBContent.jsp',
					 {
						asynchronous:true,
						method:'post',
						postBody:"type=news&nid="+articleID						
					 });	
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// EOF NEWS READING FUNCTIONLITY
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////





/*function fullListingCallback(artID){
	$('curNewsItem').setStyle({ top:'0px' });
}*/



function downloadPDF(strPDF){
	myTempWindow = window.open("../../downloads/documents/docDloader.jsp?path=%2fdownloads%2fdocuments%2f&filename="+strPDF,'','left=10000,screenX=10000');
	t = setTimeout("myTempWindow.close()",1000);
}





//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// JOB READING FUNCTIONLITY
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
function viewFullJob(jobID, jobTitle){
	
	if( $('jobsPgBody').getHeight() != curJobPgHeight ){
		curJobPgHeight = $('jobsPgBody').getHeight();
		curJobPgWidth = $('jobsPgBody').getWidth();
	}
	
	
			jobMintop = $('jobItem_'+jobID).positionedOffset().top;
			jobMinLeft = $('jobItem_'+jobID).positionedOffset().left;
			
	
			new Insertion.After($('backButton'), '<div id="curJobItem" class="jobItem">'+ $('jobItem_'+jobID).innerHTML +'</div>' );
			curJobItemOrigHeight = $('curJobItem').getHeight();
			curJobItemOrigWidth = $('curJobItem').getWidth();
			$('backButton').show();
			
			
			$('staticjobsListing').hide();
			$$('#curJobItem .item')[0].hide();
			
			new Effect.ScrollTo( $('curJobItem') );
			new Insertion.Before($$('#curJobItem .item')[0], "<div id='curJobArticleBody' class='jobArticleBody'>"+getPICode("../../")+"</div>");
			
			getJobArticleBody(jobID);
}


function getJobArticleBody(jobID){
	$('pi').appear({duration:0.25});
	new Ajax.Updater(
					 'curJobArticleBody',
					 '../../system/getDBContent.jsp',
					 {
						asynchronous:true,
						method:'post',
						postBody:"type=job&jid="+jobID,
						onSuccess:function(){ $('pi').fade({duration:0.25}); }/*,
						onFailure:function(){ $('curJobArticleBody').innerHTML("There was an error in retrieving this job. Please try again later.");  }*/
						
					 });	
}


function backToJobListing(jobID){
			$('backButton').hide();
			$('staticjobsListing').show();
			$('curJobItem').hide();
			new Effect.ScrollTo($('jobItem_'+jobID), { afterFinish:function(){
					new Effect.Highlight( $('jobItem_'+jobID), {startcolor:'#c2cd23', endcolor:'#FFFFFF', duration:1, delay:0.1});
																				 } } );
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// EOF JOB READING FUNCTIONLITY
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////



function doNav(navDiv, subPgDir){
	//$(navDiv+"ddContainer").toggle('slide');
	$(navDiv+"ddContainer").toggle();
	
	
	if($(navDiv+"Container").className == "navItemContainer"){
		$(navDiv+"Container").className = "navItemContainerOver";
	}else{
		$(navDiv+"Container").className = "navItemContainer";
	}
}

function subNavGoTo(urlLink){
	//alert("This doesn't go anywhere yet.\n"+urlLink);
	//console.log(urlLink);
	window.location = urlLink;
}



function printerFriendlyPage(){
	window.print();
	//window.open(window.location+"?printYes=yes", "printWindow", "status=0, toolbar=0, location=0, menubar=0, directories=0, resizable=1, scrollbars=0, height=792, width=612");
	//window.location = window.location+"?printYes=yes";
}


function closeSearchDD(){
	if(searchDDactive){
		$('searchResults').toggle();
		//new Effect.SlideUp($('searchResults'), {duration:0.5, transition:Effect.Transitions.exponential});
		searchDDactive = false;
	}
}


function doHPsearch(){
	
	if(!searchDDactive){
		$('searchResults').toggle();
		//new Effect.SlideDown($('searchResults'), {duration:0.5, transition:Effect.Transitions.exponential});	
		searchDDactive = true;
	}
	
	
	
}


function navRO(item){
	if(item.className.split("-") == item.className){
		item.className = item.className+"-over";
	}else{
		item.className = item.className.split("-")[0];
	}
}



function changeCaseStudyContent(str, bcStr, arrayID, leftDim){
	var leftDimValue = leftDim;
	var delay = 0;
	
	if( (curCSSidePoint != null) && (curCSSidePoint != str) ){ 
		delay = 0.5; 
		new Effect.Fade( $(curCSSidePoint), { to:0, duration:delay} ); 
		new Effect.Fade( $(curCSBodyCopy), { to:0, duration:delay} ); 
	}
	
	if(str != curCSSidePoint){
		$('bcTitle').replace("<div id='bcTitle' class='hdr'>"+$(bcStr+"_hdr").innerHTML+"</div>");
		$('header').setStyle({ marginLeft:0 });
		new Effect.Appear( $(str), { to:1, delay:delay+0.1, duration:0.5 });
		new Effect.Appear( $(bcStr), { to:1, delay:delay+0.1, duration:0.5 });
		curCSSidePoint = str;
		curCSBodyCopy = bcStr;
	}
}




function getPICode(strDir){
	var PIcode = "";
	
	PIcode += "<div id='pi' style='display:none'>";
	PIcode += "<img src='"+strDir+"images/progress_indicator.gif' id='piImage' alt='progressIndicator' border=0 />";
	PIcode += "</div>";
	
	return PIcode;
}


