/*

	HL2 2010 Redesign
	------------------

	@file 		who-we-are.js
	@version 	1.0.0b
	@date 		2010-03-04 16:33:13 -0800 (Thu, 4 Mar 2010)
	@author 	Marissa Wells <hello@marissawells.com>

	Copyright (c) 2010 HL2 <http://www.hl2.com>

*/

// **********************************
// ***** Custom jQuery scripts
// ***** Used in 'Who We Are' section
// **********************************

// Compensate for Wordpress including prototype.js in the wp_head
jQuery.noConflict();

jQuery(document).ready(function() {

	// Add current class to 'Who We Are' in main nav
	jQuery("li#who-we-are-nav a").addClass("current");
	
		
	// Stretch marquee space on click if not on the main 'Who We Are' page
	jQuery("body#news-awards section#marquee, body.news section#marquee, body#connect-with-us section#marquee, body#journal section#marquee, body.journal section#marquee").css("cursor","pointer").toggle(
		function(){
			jQuery(this).animate({height:"440px"},400);
		},
		function(){
			jQuery(this).animate({height:"13px"},400);
		}
	);
	
	
	// qTip in marquee
	jQuery("body#who-we-are * div#marquee-tooltip-button span").delay(400).fadeOut(300).delay(150).fadeIn(300).delay(150).fadeOut(300).delay(150).fadeIn(300);
	jQuery("div#marquee-tooltip-button").toggle(
		function(){
			jQuery(this).addClass("off").removeClass("on");
			jQuery("span", this).text("+");
		},
		function(){
			jQuery(this).addClass("on").removeClass("off");
			jQuery("span", this).text("-");
		}
	);
	jQuery("div#marquee-tooltip-button").qtip({
		content: 'And every challenge is unique, so we fully engage our clients to find new ways of telling stories that move: people, products, mountains. We know that Good Ideas come from anywhere, and we seek them out wherever they live. Our collaborative culture thrives on a common sense of integrity and humor &mdash; equal parts magic and metrics, creative and carnival.',
		style: {
			width: 295,
			padding: 20,
			background: '#000000',
			color: '#ffffff',
			'font-size': '11px',
			'line-height': '18px',
			border: {
				width: 1,
				color: '#000'
			},
			tip: true
		},
		position: {
			corner: {
				target: 'rightMiddle',
				tooltip: 'leftMiddle'
			}
		},
		show: {
			effect: {
				type: 'fade',
				length: 100
			},
			when: {
				event: 'click'
			}
		},
		hide: {
			effect: {
				type: 'fade',
				length: 100
			},
			when: {
				target: 'div#marquee-tooltip-button',
				event: 'click'
			}
		}
	});

});