function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
function checkVersion()
{
  var ver = getInternetExplorerVersion();

  if ( ver > -1 )
  {
    if ( ver <= 7.0 ) 
      $("ul.nav li ul li.shadow").remove();
  }
}

function headerTagline() {
	$("div.header img.tagline").show();
}
function subnavContact() {
	$("div.subnav div.contact").show();
}

function flash() {
	$("div.flash div.word").html("<img src='/images/flash_experience.png' width='115' height='17' />");
	
	$("div.flash div.triangle").animate({paddingLeft:"0px"},3000);
	$("div.flash div.triangle").animate({paddingLeft:"150px"},600, function(){
		$("div.flash div.triangle img").attr({src:"/images/flash_triangle_left.png"});
		$("div.flash div.word img").attr({src:"/images/flash_consulting.png"});
	});
	$("div.flash div.triangle").animate({paddingLeft:"0px"},600, function(){
		$("div.flash div.triangle img").attr({src:"/images/flash_triangle_right.png"});
	});
	
	$("div.flash div.triangle").animate({paddingLeft:"0px"},3000);
	$("div.flash div.triangle").animate({paddingLeft:"150px"},600, function(){
		$("div.flash div.triangle img").attr({src:"/images/flash_triangle_left.png"});
		$("div.flash div.word img").attr({src:"/images/flash_dedication.png"});
	});
	$("div.flash div.triangle").animate({paddingLeft:"0px"},600, function(){
		$("div.flash div.triangle img").attr({src:"/images/flash_triangle_right.png"});
	});
	
	$("div.flash div.triangle").animate({paddingLeft:"0px"},3000);
	$("div.flash div.triangle").animate({paddingLeft:"150px"},600, function(){
		$("div.flash div.triangle img").attr({src:"/images/flash_triangle_left.png"});
		$("div.flash div.word img").attr({src:"/images/flash_experience.png"});
	});
	$("div.flash div.triangle").animate({paddingLeft:"0px"},600, function(){
		$("div.flash div.triangle img").attr({src:"/images/flash_triangle_right.png"});
	});
}

function nav() {
	$("ul.nav li#"+whichActive).addClass("active");
	$("ul.nav li").hover(
		function() {
			$(this).addClass("active");
			$(this).children("ul").show();
		}, 
		function() {
			$(this).removeClass("active");
			$("ul.nav li#"+whichActive).addClass("active");
			$(this).children("ul").hide();
		}
    );
}

function sitemap() {
	$("div.sitemap ul."+whichSitemap).show();
	$("div.sitemap ul." + whichSitemap + " li#" + whichSitemap + "_" + whichPage).hide();
	$("div.sitemap ul." + whichSitemap + " li#" + whichSitemap + "_" + whichPage).next("li").hide();
}

function faq() {
	$("div.content h3").click(function(){
		$("div.faq h3").removeClass("active");
		$(this).addClass("active");
		$("div.content p").hide();
		$(this).next().show();
	});
}

function consultants(){
	var consultantHeight = "";
	$("div.consultant").each(function(){
		var thisHeight = $(this).height();
		if ( thisHeight > consultantHeight ) {
			consultantHeight = thisHeight;
		}
	});
	$("div.consultant").css({height:consultantHeight});
	$("div.consultant").hover(
		function() { $(this).addClass("active"); }, 
		function() { $(this).removeClass("active"); }
	);
	$("div.consultant").click(function () {
		var url = $(this).find("a").attr('href');
		window.open(url);
	});
}


