$(document).ready(function(){
  setBrowser();
  setCufon();
  $(window).scrollTop(0);
  $('#studioshots').cycle({ 
    fx: 'fade',
	timeout: 5000,
    speed: 500
  });
  $('#companies').cycle({ 
    fx: 'fade',
	timeout: 2500,
    speed: 500
  });
  $('#companies').mouseover(function() {
    $(this).cycle('pause');
  }).mouseout(function(){
    $(this).cycle('resume');
  });
});
$(window).load(function(){});
$(function(){
  /* Establish Pseudo Classes ---------------------------------------- */
  $('ul#navigation li.current_page_item a').removeAttr('href');
  $('ul li:first-child').addClass('first-child');
  $('ul li:last-child').addClass('last-child');
  $('ul li:only-child').addClass('solo');
  $('ul#navigation li.current_page_item:not(.last-child)').next().addClass('active-after')
  $('ul#navigation li.current_page_item:not(.first-child)').prev().addClass('active-before');
})(jQuery);
function setBrowser(){
  var $mobile = (navigator.userAgent.match(/(?:iPhone|iPad|iPod|Android)/i) != null);
  if(navigator.userAgent.match('MSIE 6')){
	browser = "ie6";
  }else if(navigator.userAgent.match('MSIE 7')){
	browser = "ie7";
  }else if(navigator.userAgent.match('MSIE 8')){
	browser = "ie8";
  }else if(navigator.userAgent.match('MSIE 9')){
	browser = "ie9";
  }else if(navigator.userAgent.match('MSIE')){
	browser = "ie";
  }else if(navigator.userAgent.match('Firefox')){
	browser = "gecko";
  }else if(navigator.userAgent.match('AppleWebKit')){
	browser = "webkit";
  }else if($mobile){
	browser = "mobile";
  }
  $('body').addClass(browser);
}
function exLinks(){
  $('a[rel="ex"]').click(function(){
	var link = $(this).attr('href');
	window.open(link);
	return false;
  });
}
function killCufon(){
  $(tradeGothic.toString()).css('visibility', 'hidden');
}
function setCufon(){
  tradeGothic = [ 'h2','#navigation > li > a','h3','#social .follow' ];
  Cufon.replace(tradeGothic, {fontFamily:'Trade Gothic', hover:true});
  $(tradeGothic.toString()).css('visibility', 'visible');
}
