/* default template js */
$(document).ready(function()
{
	$(".parent").click(function() 
		{
//		var id = $(this).attr("id");
//		//$(this).addClass("parentopen");
//		$(".parent:not("+id+")").removeClass("parentopen");
//		$(this).toggleClass("parentopen");
//		$("#s_"+id).slideDown();
//		$(".sub:not(#s_"+id+")").slideUp();
		var kid = $(this).contents().children(':first');
		//console.debug(kid);
		var id = kid.attr("id");
		var page = id.replace('s_', "");
		var hostname = window.location.hostname;
		var protocol = window.location.protocol;
		location.href=protocol+'//'+hostname+'/'+page;
		});		
	$("li:not(.current)").hover(
		function()
		{
			$(this).css("color","#fff");
		},
		function()
		{
			$(this).css("color","#a3a3a3");
		});
		
	$("li:not(.parent)").click(function()
		{
			var id = $(this).attr("id");
			var hostname = window.location.hostname;
			var protocol = window.location.protocol;
			location.href=protocol+'//'+hostname+'/'+id;
		});

	if($("#accordion").length)
	{
		jQuery.each(jQuery.browser, function(i, val) {
			if(i=="msie" && jQuery.browser.version.substr(0,1)=="6")
			{
				$('.c_pull_quote').css('display','none');
			}
		});
		$(function() {
			$("#accordion").accordion({header: 'h3'} );
		});
		$('#podcontent3').mouseover(function(){
			$('#podcontent3').css('cursor','pointer');
		})
		$("h3").click(function() {
			$(".podarrow").attr("src","/_templates/cms1/skins/1/imageset/homepods/pod_arrow_off.gif");
			var id = $(this).attr("id");
			$("#"+id+" .podarrow").attr("src","/_templates/cms1/skins/1/imageset/homepods/pod_arrow_on.gif");
			switch(true)
			{
				case(id == 'pod1'):
					$("#pod1").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/ea_pod_open_top.gif)');
					$("#pod2").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/closed_pod.gif)');
					$("#pod3").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/closed_pod.gif)');
					$("#pod4").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/closed_pod.gif)');
					$("#pod1 .thumb").fadeOut("slow");
					if($("#pod2 .thumb").css("display") == 'none')
					{
						$('#pod2 .thumb').fadeIn("slow");
					};
					if($("#pod3 .thumb").css("display") == 'none')
					{
						$('#pod3 .thumb').fadeIn("slow");
					};
					if($("#pod4 .thumb").css("display") == 'none')
					{
						$('#pod4 .thumb').fadeIn("slow");
					};
				break;
				case(id == 'pod2'):
					$("#pod1").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/closed_pod.gif)');
					$("#pod2").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/connexitol_pod_open_top.jpg)');
					$("#pod3").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/closed_pod.gif)');
					$("#pod4").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/closed_pod.gif)');
					$("#pod2 .thumb").fadeOut("slow");
					if($("#pod1 .thumb").css("display") == 'none')
					{
						$('#pod1 .thumb').fadeIn("slow");
					};
					if($("#pod3 .thumb").css("display") == 'none')
					{
						$('#pod3 .thumb').fadeIn("slow");
					};
					if($("#pod4 .thumb").css("display") == 'none')
					{
						$('#pod4 .thumb').fadeIn("slow");
					};
				break;
				case(id == 'pod3'):
					$("#pod1").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/closed_pod.gif)');
					$("#pod2").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/closed_pod.gif)');
					$("#pod3").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/tribal_pod_open_top.jpg)');
					$("#pod4").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/closed_pod.gif)');
					$("#pod3 .thumb").fadeOut("slow");
					if($("#pod1 .thumb").css("display") == 'none')
					{
						$('#pod1 .thumb').fadeIn("slow");
					};
					if($("#pod2 .thumb").css("display") == 'none')
					{
						$('#pod2 .thumb').fadeIn("slow");
					};
					if($("#pod4 .thumb").css("display") == 'none')
					{
						$('#pod4 .thumb').fadeIn("slow");
					};
				break;
				case(id == 'pod4'):
					$("#pod1").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/closed_pod.gif)');
					$("#pod2").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/closed_pod.gif)');
					$("#pod3").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/closed_pod.gif)');
					$("#pod4").css('backgroundImage', 'url(/_templates/cms1/skins/1/imageset/homepods/defero_open_top.gif)');
					$("#pod4 .thumb").fadeOut("slow");
					if($("#pod1 .thumb").css("display") == 'none')
					{
						$('#pod1 .thumb').fadeIn("slow");
					};
					if($("#pod2 .thumb").css("display") == 'none')
					{
						$('#pod2 .thumb').fadeIn("slow");
					};
					if($("#pod3 .thumb").css("display") == 'none')
					{
						$('#pod3 .thumb').fadeIn("slow");
					};
				break;
			}
			return false;
		});
	}

	
});

Shadowbox.init({
    language: "en",
    skipSetup: false,
	overlayColor: '#2f569b',
	overlayOpacity: '0.5',
	displayNav: true,
    players: ["iframe"]
});


function videoClick(file){
	Shadowbox.open({
        content:    '/_portfolio/vid.html',
        player:     'iframe',
    	width: 840,
    	height: 670,
    	displayNav: true
    	
       });
}
