var myriad = { src: 'http://www.universalmind.com/assets/flash/myriad.swf' };
sIFR.activate(myriad);

sIFR.replace(myriad, {
	selector: 'h2',
	css: '.sIFR-root {color: #101010;}',
	wmode: 'transparent',
	offsetTop: '5'
});

sIFR.replace(myriad, {
	selector: '#approach>h2',
	css: '.sIFR-root {color: #990000;}',
	wmode: 'transparent',
	offsetTop: '5'
});

sIFR.replace(myriad, {
	selector: 'h2.thought-wall',
	css: '.sIFR-root {color: #c0c0c0;}',
	wmode: 'transparent',
	offsetTop: '5'
});
sIFR.replace(myriad, {
	selector: '#our-approach blockquote p,#portfolio blockquote.headline-quote p',
    css: '.sIFR-root {color: #a4bd59;leading:3px;}',
	wmode: 'transparent',
	offsetTop: '5'
});
sIFR.replace(myriad, {
	selector: '#primary blockquote p',
    css: '.sIFR-root {color: #a4bd59;leading:3px;}',
	wmode: 'transparent',
	offsetTop: '5'
});

sIFR.replace(myriad, {
	selector: '#sidebar blockquote p',
	css: '.sIFR-root {color: #6b91a6; leading: 5px}',
	wmode: 'transparent',
	offsetTop: '5'
});

$(document).ready(function() {
	var bWidth = $(".portfolio-quote").outerWidth();
	var iWidth = $(".portfolio-quote .img").outerWidth();
	$(".portfolio-quote .quote").width(bWidth-(iWidth+20));
	
	$(".thought span").append("<span></span>");
	
	$('a.external').click(function(){
		window.open(this.href);
		return false;
	});
	
	/*$("#main-nav li.dd").each(function(){
		$("ul",this).wrap("<div class=\"dropdown\"></div>")
		$(".dropdown",this).prepend("<div class=\"top\"><div class=\"right\"></div><span></span></div>");
		$(".dropdown",this).append("<div class=\"bot\"><div class=\"right\"></div></div>");
		
		var ulwidth = $("ul",this).width();
		$("ul",this).width(ulwidth-11);
		$("ul li",this).width(ulwidth-11);
		$("ul li a",this).width(ulwidth-22);
	});
	$(".dropdown").hide();
	
	if(jQuery.support.objectAll) {
		$("#main-nav li").hover(function(){		
			$(".dropdown", this).fadeIn("fast");
		},function(){
			$(".dropdown", this).hide();	
		});
	} else {
		$("#main-nav li").hover(function(){		
			$(".dropdown", this).show();
		},function(){
			$(".dropdown", this).hide();	
		});
	}*/

	$('#view-clients').click(function(){
		$('#portfolio-clients').slideToggle();
		$(this).toggleClass('clients-expanded');
	});
	
	$('#view-process, #process-head').click(function(e){
		e.preventDefault();
		$('#process-wrapper').animate({height: 'toggle'});
		$(this).toggleClass('process-expanded');
	});
	
	$('a.modal').colorbox({
		initialWidth: '761px',
		speed: 300
	},function(){
		$('a.external').click(function(){
			window.open(this.href);
			return false;
		});
	});
	/*$('a.jobs-modal').colorbox({
		initialWidth: '761px',
		iframe: true,
		speed: 300
	});*/
	$('a.thought-modal').colorbox({
		initialWidth: '661px',
		speed: 300
	},function(){
		$('p.tweet a, p.blog a, p.news a').addClass('external');
		$('a.external').click(function(){
			window.open(this.href);
			return false;
		});
	});
	
	$('#project-thumbs li a').colorbox({
		speed: 300
	});
	$('#project-vids li a').colorbox({
		speed: 300
	});
	
});