// cufon

Cufon.replace('.wrapper h3 a, .wrapper h3, .wrapper h2 a, .wrapper h2, nav ul li a, .wrapper h1, .sm-case-study h4, .sm-case-study h5, .sm-sprites h4', {hover: true});

// sidebar height
$(window).load(function() {
	var biggestHeight = 0;
	$('.same-height').each(function(){
		if($(this).height() > biggestHeight){
			biggestHeight = $(this).height();
		}
	});
	$('.same-height').height(biggestHeight);
});



// slider
$(document).ready(function() {
    $('#img-rotator').cycle({
				fx:     'wipe',
        speed:  'fast',
        timeout: 6000,
        pager:  '#rotator-nav',
		slideExpr: 'img'

    });
});


// people scroll

$(window).load(function() {
		$("div#makeMeScrollable").smoothDivScroll({ 
		  scrollStep: 20, 
			scrollInterval: 10

		});
	});


$(document).ready(function() {

  // recent work and services
	$('section.work ul li:eq(0)').addClass('padding');
	$('section.work ul li:eq(2)').addClass('padding');

	$('section.work ul li').children('div').show();
	$('section.work ul li').children('div').animate({opacity: 0}, 0);
	$('section.work ul li').hover(function() {
    $(this).children('div').animate({opacity: 1}, 200);
}, function() {
    $(this).children('div').animate({opacity: 0}, 200);
})

// broadcast examples
/*$('section.broadcast-examples ul li').children('div.hover').show();
	$('section.broadcast-examples ul li').children('div.hover').animate({opacity: 0}, 0);
	$('section.broadcast-examples ul li').hover(function() {
    $(this).children('div').animate({opacity: 1}, 200);
}, function() {
    $(this).children('div').animate({opacity: 0}, 200);
})*/

  // services
  $('section.services ul li:eq(0)').addClass('padding');
	$('section.services ul li:eq(2)').addClass('padding');
	$('section.services ul li img').animate({opacity: .6}, 0);
  $('section.services ul li').hover(function() {
    $(this).children('img').fadeTo('fast', 1);
    $(this).children('h3 a').css("color", "#222");
}, function() {
    $(this).children('img').fadeTo('fast', .6);
    $(this).children('h3 a').css("color", "#444");
})

  // strategy 
  $('section.strategy-buckets ul li:eq(2)').css("margin-right", "0");	
  $('section.strategy-links ul li:eq(1)').css("margin-right", "0");	


  // portfolio
  $('section.full ul.portfolio-list li:nth-child(4n)').css('margin-right', '0');
  
  $('section.full ul.portfolio-list li').children('div').show();
	$('section.full ul.portfolio-list li').children('div').animate({opacity: 0}, 0);
	$('section.full ul.portfolio-list li').hover(function() {
    $(this).children('div').animate({opacity: 1}, 200);
}, function() {
    $(this).children('div').animate({opacity: 0}, 200);
})
	$('ul.portfolio-img li:nth-child(2n)').addClass('left'); 


  // portfolio page
  $('section.portfolio-sidebar .related ul li:nth-child(2n)').css('margin-right', '0');
  
  $('section.portfolio-sidebar .related ul li').children('div').show();
	$('section.portfolio-sidebar .related ul li').children('div').animate({opacity: 0}, 0);
	$('section.portfolio-sidebar .related ul li').hover(function() {
    $(this).children('div').animate({opacity: 1}, 200);
}, function() {
    $(this).children('div').animate({opacity: 0}, 200);
})

	$('section.main ul.blog-roll li:first').css('padding-top', '0');

	// thank you
  $('section.full ul.thank-you li:nth-child(3)').css('margin-right', '0');
  
  $('section.full ul.thank-you li').children('div').show();
	$('section.full ul.thank-you li').children('div').animate({opacity: 0}, 0);
	$('section.full ul.thank-you li').hover(function() {
    $(this).children('div').animate({opacity: 1}, 200);
}, function() {
    $(this).children('div').animate({opacity: 0}, 200);
})

  // orange article list
  $('ul.articleList li:nth-child(4n)').css('padding-right', '0');

	// people scroll
	$('#makeMeScrollable div.scrollableArea a.img-js').fadeTo("fast", .5);

	$('#makeMeScrollable div.scrollableArea .people-holder .people-pop').hide();
	$('#makeMeScrollable div.scrollableArea .people-holder').mouseenter(function() {
			$(this).children('a.img-js').animate({opacity: 1, top: '-=10'});
			$(this).children('a.img-js').css("z-index", "100");
			$(this).children('div').show();
			$(this).children('div').animate({opacity: .9});
			$(this).children('div').css("z-index", "200");

	});	
		$('#makeMeScrollable div.scrollableArea .people-holder').mouseleave(function() {
			$(this).children('a.img-js').animate({opacity: 0.5, top: '+=10'});
			$(this).children('a.img-js').css("z-index", "0");
			$(this).children('div').hide();
	});
	
	var newWidth = $('#makeMeScrollable div.scrollableArea').width() - 850;
	$('#makeMeScrollable div.scrollableArea').width(newWidth);
	
	//social media section
	$('ul.sm-sprites li').mouseenter(function() {
    	$(this).children('div.orange').show();
    	$(this).children('div.gray').hide();
    	$(this).children('div.excerpt').show();
	});	
	$('ul.sm-sprites li').mouseleave(function() {
    	$(this).children('div.orange').hide();
    	$(this).children('div.gray').show();
    	$(this).children('div.excerpt').hide();
	});	

});


// light box 
$(document).ready(function(){
		$("a[rel='lightbox']").colorbox();
		$(".lightbox").colorbox({inline:true, href:"#inline_example1"});
		$(".example6").colorbox({iframe:true, innerWidth:425, innerHeight:344});

});


// contact form

$(document).ready(function() { 

/* BEGIN TARGET FOR CONTACT FORM */
var ocean = { target: '#alert1', beforeSubmit: showRequest, success: showResponse }; 
$('#contact-form').ajaxForm(ocean); });
 
function showRequest(formData, jqForm, ocean) { 
var queryString = $.param(formData);
return true; }
/* END TARGET FOR CONTACT FORM */

/* FUNCTION TO CLEAR FORM AFTER SUBMISSION */ 
function showResponse(responseText, statusText) { } 
$.fn.clearForm = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	  this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	  this.checked = false;
	else if (tag == 'select')
	  this.selectedIndex = -1;
  });
};


$(document).ready(function() { 

/* BEGIN TARGET FOR CONTACT FORM */
var ocean = { target: '#alert2', beforeSubmit: showRequest, success: showResponse }; 
$('#footer-form').ajaxForm(ocean); });
 
function showRequest(formData, jqForm, ocean) { 
var queryString = $.param(formData);
return true; }
/* END TARGET FOR CONTACT FORM */

/* FUNCTION TO CLEAR FORM AFTER SUBMISSION */ 
function showResponse(responseText, statusText) { } 
$.fn.clearForm = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	  this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	  this.checked = false;
	else if (tag == 'select')
	  this.selectedIndex = -1;
  });
};

$(document).ready(function() { 

/* BEGIN TARGET FOR CONTACT FORM */
var ocean = { target: '#alert3', beforeSubmit: showRequest, success: showResponse }; 
$('#enews-contact-form').ajaxForm(ocean); });
 
function showRequest(formData, jqForm, ocean) { 
var queryString = $.param(formData);
return true; }
/* END TARGET FOR CONTACT FORM */

/* FUNCTION TO CLEAR FORM AFTER SUBMISSION */ 
function showResponse(responseText, statusText) { } 
$.fn.clearForm = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	  this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	  this.checked = false;
	else if (tag == 'select')
	  this.selectedIndex = -1;
  });
};

$(document).ready(function() { 

/* BEGIN TARGET FOR CONTACT FORM */
var ocean = { target: '#alert4', beforeSubmit: showRequest, success: showResponse }; 
$('#enews-home-form').ajaxForm(ocean); });
 
function showRequest(formData, jqForm, ocean) { 
var queryString = $.param(formData);
return true; }
/* END TARGET FOR CONTACT FORM */

/* FUNCTION TO CLEAR FORM AFTER SUBMISSION */ 
function showResponse(responseText, statusText) { } 
$.fn.clearForm = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	  this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	  this.checked = false;
	else if (tag == 'select')
	  this.selectedIndex = -1;
  });
};

$(document).ready(function() { 

/* BEGIN TARGET FOR CONTACT FORM */
var ocean = { target: '#alert7', beforeSubmit: showRequest, success: showResponse }; 
$('#enews-sidebar-form').ajaxForm(ocean); });
 
function showRequest(formData, jqForm, ocean) { 
var queryString = $.param(formData);
return true; }
/* END TARGET FOR CONTACT FORM */

/* FUNCTION TO CLEAR FORM AFTER SUBMISSION */ 
function showResponse(responseText, statusText) { } 
$.fn.clearForm = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	  this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	  this.checked = false;
	else if (tag == 'select')
	  this.selectedIndex = -1;
  });
};

$(document).ready(function() { 

/* BEGIN TARGET FOR CONTACT FORM */
var ocean = { target: '#alert10', beforeSubmit: showRequest, success: showResponse }; 
$('#enews-blog-form').ajaxForm(ocean); });
 
function showRequest(formData, jqForm, ocean) { 
var queryString = $.param(formData);
return true; }
/* END TARGET FOR CONTACT FORM */

/* FUNCTION TO CLEAR FORM AFTER SUBMISSION */ 
function showResponse(responseText, statusText) { } 
$.fn.clearForm = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	  this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	  this.checked = false;
	else if (tag == 'select')
	  this.selectedIndex = -1;
  });
};

$(document).ready(function() { 

/* BEGIN TARGET FOR CONTACT FORM */
var ocean = { target: '#alert5', beforeSubmit: showRequest, success: showResponse }; 
$('#apply-form').ajaxForm(ocean); });
 
function showRequest(formData, jqForm, ocean) { 
var queryString = $.param(formData);
return true; }
/* END TARGET FOR CONTACT FORM */

/* FUNCTION TO CLEAR FORM AFTER SUBMISSION */ 
function showResponse(responseText, statusText) { } 
$.fn.clearForm = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	  this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	  this.checked = false;
	else if (tag == 'select')
	  this.selectedIndex = -1;
  });
};

$(document).ready(function() { 

/* BEGIN TARGET FOR CONTACT FORM */
var ocean = { target: '#alert6', beforeSubmit: showRequest, success: showResponse }; 
$('#book-form').ajaxForm(ocean); });
 
function showRequest(formData, jqForm, ocean) { 
var queryString = $.param(formData);
return true; }
/* END TARGET FOR CONTACT FORM */

/* FUNCTION TO CLEAR FORM AFTER SUBMISSION */ 
function showResponse(responseText, statusText) { } 
$.fn.clearForm = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	  this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	  this.checked = false;
	else if (tag == 'select')
	  this.selectedIndex = -1;
  });
};


