// BEGIN CUFON HEADER REPLACEMENT

Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('h3');
Cufon.replace('#core #title');
//Cufon.replace('#navInside a');

// END CUFON HEADER REPLACEMENT

// PLACE FLASH OBJECTS 
swfobject.registerObject("flashNav", "8.0.0");


  $(document).ready(function() {	// Core Values Swap Animation
	function coreValues(tabID,contentID) {

		if ($(".coreContent").is(":animated") ) {
		} 
		else {
	  
		  var tabName = "#"+tabID
		  var contentName = "#"+contentID
				  
		  $(".coreContent:visible").fadeOut(700);
		  $(".coreContent:visible").queue(function() {
			  $(contentName).fadeIn(700);
			  $(this).dequeue();
		  });
		  $("#core > p").removeClass("active");
		  $(tabName).addClass("active");
		  $("#core").removeClass();
		  $("#core").addClass(tabID);
		}

	}
	
    
	$("#core > #one").click(function () {
	  coreValues('one','contentOne');
    });

	$("#core > #two").click(function () {
	  coreValues('two','contentTwo');
    });

	$("#core > #Three").click(function () {
	  coreValues('Three','contentThree');
    });
	  
	  
 });	// End Core Values Swap Animation 

 
  $(document).ready(function() {
 // Features Section Nav
	$(".linkOne").click(function () {
		  $(".featureNav1").attr("id","one");
		  $(".featureContent:visible").hide();
		  $("#contentOne").show();
		  $(".navItem").removeClass("on");
		  $("#divOne").addClass("on");
		  dividerSize();
    });
  
	$(".linkTwo").click(function () {
		  $(".featureNav1").attr("id","two");
		  $(".featureContent:visible").hide();
		  $("#contentTwo").show();
		  $(".navItem").removeClass("on");
		  $("#divTwo").addClass("on");
		  dividerSize();
    });

	$(".linkThree").click(function () {
		  $(".featureNav1").attr("id","three");
		  $(".featureContent:visible").hide();
		  $("#contentThree").show();
		  $(".navItem").removeClass("on");
		  $("#divThree").addClass("on");
		  dividerSize();
    });
  

	// End Features Section Nav


  // resize footer on short pages
  var winH = $(window).height()
  var headH = $("#headOutside").outerHeight()
  var navH = $("#navOutside").outerHeight()
  var bodyH = $("#bodyOutside").outerHeight()
  var footH = $("#footerOutside").outerHeight()
  var totalH = headH+navH+bodyH+footH
  
  if (winH > totalH) {
  	var fDif = (winH-headH-navH-bodyH+5)
	$("#footerOutside").height(fDif);
  }
  // end footer resize  


  
	// 3-Col Divider Auto Resize
	function contentFade() {
	  $('.process .column p').animate( { opacity:"1" } , 800 );
	  $('.process .column div').fadeIn(800);
	}
			
	function dividerSize() {
	 	var divSize=$(".threeCols").height();
		if ($('.threeCols .divider').is(':visible')) {
		$(".threeCols .divider").animate({ 
			height: divSize - 30
			}, /*1500*/ 100 );
		}
	}
  
//	var t=setTimeout(contentFade,200);
	var t=setTimeout(dividerSize,400);

  }); // End 3-Col Divider Auto Resize
  
  // round corners 
	DD_roundies.addRule('.roundOrange, .dlPDF', '4px', true);
	DD_roundies.addRule('.bodyContent .round', '4px', true);
	DD_roundies.addRule('.round2', '2px', true);
	DD_roundies.addRule('#twitter_div .head, .threeCols h2, h2.choc, .twoHeads h2, .round .links', '3px', true);
//	DD_roundies.addRule('#core #title', '3px 0 0 3px', true);

  
$(document).ready(function() {	


// misc functions

	function ieEnhance() {
	$("#processImg1").attr("src","/images/img_workflowModel1.png");
	$("#processImg2").attr("src","/images/img_workflowModel2.png");
	$("#processImg3").attr("src","/images/img_workflowModel3.png");
	$(".process .divider img").attr("src","/images/img_orangeArrow2.png");
	$("#approachImg").attr("src","/images/img_approach.png");
	}

if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
 if (ieversion>=7) 
  ieEnhance();
}
else 
 ieEnhance();

 


   
   $(".noLink").attr("onClick","return false");

	function addRound() {
	DD_roundies.addRule('#TB_window .round', '4px', true);
	}
   
   
	function tbPop() {
		Cufon.replace('#TB_ajaxWindowTitle');
		Cufon.replace('h1');
		Cufon.replace('h3');
		$("#TB_closeAjaxWindow").click(tb_remove);
		var t=setTimeout(addRound,400);
		var t=setTimeout(addRound,2000);

	}

	$(".thickbox").click(function() {
	 tbPop();
	});

	if(location.search == "?thanks"){
		tb_show("CONTACT","/contactThanks.html?height=444&width=593", "");
	
	}
	   
  }) 
  
  
  
// clear text on search field
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = "";
$(thefield).removeClass("ital");
}  
