if(typeof(STATIC_CONTENT_PATH) != "undefined"){ 
	//alert('STATIC_CONTENT_PATH='+STATIC_CONTENT_PATH); 
} else { 
	//alert('STATIC_CONTENT_PATH not defined');
	STATIC_CONTENT_PATH = 'http://na-webtmp/Static/';
} 

var Eastwood = new EastwoodLib();
$(document).ready(function(){
	if ( $("*").index($('#tabs')[0]) != -1 ) { Eastwood.tabs(); }
	if ( $("*").index($('#csCarousel')[0]) != -1 ) { Eastwood.carousel(); } 
	if ( $("*").index($('#mainwrap.home')[0]) != -1 ) { Eastwood.initHome(); } 
	if ( $("*").index($('.cw_structTxt_accordians')[0]) != -1 ) { Eastwood.accordian(); } 
	if ( $("*").index($('.tabTitle')[0]) != -1 ) { Eastwood.inlineTabs();  } 
	if ( $("*").index($('a[rel="avidShadowbox"]')[0]) != -1 ) { Eastwood.avidShadowbox();  } 
	if ( $("*").index($('a[rel="QTShadowbox"]')[0]) != -1 ) { Eastwood.QTShadowbox();  } 
	if ( $("*").index($('a[rel="videoShadowbox"]')[0]) != -1 ) { Eastwood.videoShadowbox();  } 
	if ( $("*").index($('a[rel="videoShadowboxInline"]')[0]) != -1 ) { Eastwood.videoShadowboxInline();  } 
	if ( $("*").index($('table.featurestbl')[0]) != -1 ) { $("table.featurestbl tr:first th").css("background","#eaeaef"); } 
	if ( $("*").index($('.cw_linkList_FamilySolutions')[0]) != -1 ) {$('<br class="clear" />').insertAfter(".cw_linkList_FamilySolutions ul"); } 
	if ( $("*").index($('.cw_imgPromos_pod2x840')[0]) != -1 ) { Eastwood.padpod2x840();  } 
	if ( $("*").index($('.group_structTxt_width280')[0]) != -1 ) {$('<br class="clear" />').insertAfter(".group_structTxt_width280"); } 
	if ( $("*").index($('#lowerHolderContent')[0]) != -1 ) {$('#lowerHolderContent').append('<br class="clear" />'); } 
	if ( $("*").index($('.cw_imgPromos_pod3x840')[0]) != -1 ) { Eastwood.padpod3x840();  } 
	if ( $("*").index($('.cw_imgPromos_pod4x840')[0]) != -1 ) { Eastwood.padpod4x840();  } 
	if ( $("*").index($('#LowerWellContent .cw_imgPromos_pod4x840')[0]) != -1 ) { Eastwood.lowerwellPods();  } 
	if ( $("*").index($('.pod')[0]) != -1 ) { Eastwood.biosPods();  } 
	if ( $("*").index($('.#Display .content')[0]) != -1 ) { Eastwood.displayPanel();  } 
	if ( $("*").index($('.cw_linkedImg_brandBox')[0]) != -1 ) { Eastwood.brandBox();  } 
	if (( $("*").index($('.headerTabs')[0]) != -1 ) && ($("*").index($('#hero')[0]) == -1 )) { Eastwood.tabsNoHero();  }
	if ( $("*").index($('.overlay')[0]) != -1 ) { Eastwood.overlayShadowbox();  } 
	if ( $("*").index($('.heroPod3x3')[0]) != -1 ) { Eastwood.productHome();  } 
	if ( $("*").index($('table.tablesorter')[0]) != -1 ) { Eastwood.productTable();  } 
	if ( $("*").index($('a[href$="shadowbox"]')[0]) != -1 ) { Eastwood.openShadowbox(); }
	if ( $("*").index($('.box33Stories')[0]) != -1 ) { Eastwood.box33Stories(); }
	if ( $("*").index($('.blueActionButton2')[0]) != -1 ) { Eastwood.setPricingBtns(); }
	if ( $("*").index($('.cw_quote_fullWidth')[0]) != -1 ) { Eastwood.chkQtImg(); }
	$("select#productsField").change(function() {
		var thisLoc = $('select#productsField option:selected').val();
		window.location = thisLoc;
	});
	$(document).pngFix();

});
function popup( url, code, width, height ) {
	if( code == null )
	{
		code = "newPopup";
	}
	
	if( width == null )
	{
		width = 800;
	}
	
	if( height == null )
	{
		height = 600;
	}
		
	var popup = window.open( url, code, "width=" + width + ", height=" + height + ", left=50, top=50, toolbar=no, menubar=yes, scrollbars=yes, location=0, status=no" );
	popup.focus();
}
function EastwoodLib() {

	this.tabs = function tabsFn() {
		var mLI = 0;
		var wFull = $("#tabs").innerWidth(); // full width of tab area
		var tCnt = $("#tabs ul li").length; // number of tabs
		var tmLI = mLI*(tCnt-1); // will always be zero?
		wFull = wFull - tmLI; // no change?
		var wtLI = 0;
		$("#tabs ul li").each(function (i) {
			var thisW = $(this).innerWidth(); // individual width of tab
			wtLI = wtLI + thisW; // running total width of tab content
		});
		var wtFill=Math.floor((wFull - wtLI)/tCnt); // width per tab to fill
		var wtNewLI = 0;
		var wLastLI = 0;
		$("#tabs ul li").each(function (i) {
			if (tCnt<3) {
				var thisTabWidth = ($(this).innerWidth() + $(this).innerWidth()); // new tab width
			} else {
				var thisTabWidth = ($(this).innerWidth() + wtFill); // new tab width
			}
			$(this).css("width",thisTabWidth+"px"); // assigns new tab width
			wtNewLI = wtNewLI + thisTabWidth; // running total of tab widths
			wLastLI = thisTabWidth; // the last tab's width
		});
		$("#tabs ul li a").each(function () { 
			$(this).css("display","block");
		});
		//$("#tabs ul li:last").css("width", (wLastLI+(wFull-wtNewLI))+"px"); // sets last tab to be the remaining empty space
		$("#tabs ul li:not(:first)").css("margin-left", mLI+"px");
		var tabPage = (window.location.pathname.substring(window.location.pathname.lastIndexOf('/') + 1)).toLowerCase();
		$("#tabs ul li a").each(function (i) {
			var thisTab = (($(this).attr("href")).substring(($(this).attr("href")).lastIndexOf('/') + 1)).toLowerCase();
			if (thisTab == tabPage) {
				$(this).attr("className","selected");
			}
		});
		if ( $("*").index($('.tabContent')[0]) != -1 ) { Eastwood.headerTabs(); }
	}//tabs
	
	this.headerTabs = function headerTabsFn() {
		var tCnt = $("#tabs.headerTabs ul li").length;
		var hoverDiv;
		$("#tabs.headerTabs ul li").click(function () {
			Eastwood.closeResetTab();
			var index = $("#tabs.headerTabs ul li").index(this);
			hoverDiv = $("#hero div.tabContent").eq(index);
			$(hoverDiv).fadeIn(350);
			
			$(this).addClass("selected");
			return false;
		});
		$("#content,#footer").click(function() {
			Eastwood.closeResetTab();
		});
		$("#hero div.tabContent #closePanel").click(function() {
			Eastwood.closeResetTab();
			return false;
		});
	}//headerTabs
	
	this.inlineTabs = function inlineTabsFn() {
		$("span.tabTitle").css("cursor","pointer");
		$("span.tabTitle a").click(function() {
			$("span.tabTitle a").each(function() {
				$(this).removeAttr("className","selected");
			});
			$("div.description").each(function() {
				$(this).fadeOut(250);
			});
			$(this).attr("className","selected");
			$(this).closest("span").next().fadeIn(350);
			return false;
		});
		//alert($("span.tabTitle a").length);
		$("a.tbLink:eq(0)").trigger('click');
	} //inlineTabs
	
	this.closeResetTab = function closeResetTabFn() {
		$("#hero div.tabContent").each(function() {
			$(this).fadeOut(250);
		});
		$("#tabs.headerTabs ul li").wait().removeClass("selected");
	}//closeResetTab

	this.tabsNoHero = function tabsNoHeroFn() {
		//adjust header bg position to 0 0
		$("#header").addClass("ext");
	}//closeResetTab

	this.carousel = function carouselFn() {
		$("ul#csCarousel li").each(function (i) {
			$("div.jcarousel-control").append("<a href='#'></a>");
		}); // controller bar
		jQuery("#csCarousel").jcarousel({
			scroll:4,
			initCallback: csCarousel_initCallback,
			itemVisibleInCallback: {
				onAfterAnimation:  csCarousel_itemVisibleInCallbackAfterAnimation
			},
			itemVisibleOutCallback: {
				onAfterAnimation:  csCarousel_itemVisibleOutCallbackAfterAnimation
			}
		}); // carousel init and event callbacks
	}//carousel

	this.flashHero = function flashHeroFn(flashFile,divPlacement,flashWidth,flashHeight,flashBgColor) {
		var flashvars = {};
		var params = {};
		params.autostart = "true";
		params.play = "true";
		params.autoPlay = "true";
		params.menu = "true";
		params.wmode = "transparent";
		//params.bgcolor = flashBgColor;
		params.allowScriptAccess = "sameDomain";
		params.align = "middle";
		var attributes = {};
		attributes.id = "";
		swfobject.embedSWF(flashFile, divPlacement, flashWidth, flashHeight, "8.0.0", "expressInstall.swf", flashvars, params, attributes);
	} //flashHero

	this.inlineVideo = function inlineVideoFn(video,divPlacement,medType) {
		var imgPtrStr = "#"+divPlacement+" img";
		if (medType=='cw_media_audio') {
			var flashvars = {datasource:'/Static'+video};
			var pathToAudio = STATIC_CONTENT_PATH+"resources/flash/audioPlayer.swf";
            var params = {scale:"noscale", bgcolor:"#ffffff", align: "middle", allowScriptAccess: "always"};
            var attributes = {};
            attributes.id = "player";
            swfobject.embedSWF(pathToAudio, divPlacement, "100%", "100%", "9.0.0", false, flashvars, params, attributes);
		} else {
			var pathToVideo = STATIC_CONTENT_PATH+"resources/flash/flvPlayerSmall.swf?moviePath=http://media-cdn.avid.com/media/eastwood/"+video+"_512.flv";
			var newPathtoVideo = "http://media-cdn.avid.com/media/eastwood/"+video+"_512.flv";
			var newPathtoPlayer = STATIC_CONTENT_PATH+"resources/flash/flvPlayerSmall.swf";
			$(imgPtrStr).css("cursor","pointer");
			$(imgPtrStr).click(function() {
			var flashvars = {};
				flashvars.videoPath = newPathtoVideo;
				flashvars.movieTitle = video;
				flashvars.playerName = "inlinePlayer";
				flashvars.autoplay = "on";
			var params = {};
				params.menu = "false";
				params.salign = "t";
				params.bgcolor = "#FFFFFF";
				params.allowfullscreen = "true";
				params.wmode = "opaque";
				params.allowScriptAccess = "sameDomain";
				
			var attributes = {};
				attributes.id = "site";
				attributes.align = "top";

			swfobject.embedSWF(newPathtoPlayer, divPlacement, "522", "329", "8.0.0", "expressInstall.swf", flashvars, params, attributes);
			});
		}
	} //inlineVideo
	this.avidTV = function avidTVFn(video,divPlacement) {
			var pathToVideo = STATIC_CONTENT_PATH+"resources/flash/flvPlayer.swf?moviePath=http://media-cdn.avid.com/media/eastwood/"+video+"_768.flv";
			var newPathtoVideo = "http://media-cdn.avid.com/media/eastwood/"+video+"_768.flv";
			var newPathtoPlayer = STATIC_CONTENT_PATH+"resources/flash/flvPlayer.swf";
			var flashvars = {};
				flashvars.videoPath = newPathtoVideo;
				flashvars.movieTitle = video;
				flashvars.playerName = "AvidTVPlayer";
			var params = {};
				params.menu = "false";
				params.salign = "t";
				params.bgcolor = "#FFFFFF";
				params.allowfullscreen = "true";
				params.wmode = "opaque";
				params.allowScriptAccess = "sameDomain";
				
			var attributes = {};
				attributes.id = "site";
				attributes.align = "top";
			swfobject.embedSWF(newPathtoPlayer, divPlacement, "778", "473", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
		//});
	} //avidTV

	this.shadowboxVideo = function shadowboxVideoFn(video,divPlacement) {
			var pathToVideo = STATIC_CONTENT_PATH+"resources/flash/flvPlayer.swf?moviePath=http://media-cdn.avid.com/media/eastwood/"+video+"_768.flv";
			var newPathtoVideo = "http://media-cdn.avid.com/media/eastwood/"+video+"_768.flv";
			var newPathtoPlayer = STATIC_CONTENT_PATH+"resources/flash/flvPlayer.swf";
			var flashvars = {};
				flashvars.videoPath = newPathtoVideo;
				flashvars.movieTitle = video;
				flashvars.playerName = "shadowboxPlayer";
				flashvars.autoplay = "on"
			var params = {};
				params.menu = "false";
				params.salign = "t";
				params.bgcolor = "#000000";
				params.allowfullscreen = "true";
				params.wmode = "opaque";
				params.allowScriptAccess = "sameDomain";
				
			var attributes = {};
				attributes.id = "site";
				attributes.align = "top";
			swfobject.embedSWF(newPathtoPlayer, divPlacement, "778", "473", "8.0.0", "expressInstall.swf", flashvars, params, attributes);
	} //shadowboxVideo

	this.newsTicker = function() {
		var newsDelay = 7500;
		var newsCount = 0;
		var newsLength = $('.newsTicker span.headline').length;
		var newsContainer = $('.newsTicker span.current');
		var newsInitVal = newsContainer.html();

		function doNextNews(){
			newsContainer.fadeOut(250, function(){
				newsCount++;
				if(newsCount == newsLength){
					newsCount = 0;
						newsContainer.html(newsInitVal)
					} else {
						newsContainer.html($('.newsTicker span.headline').eq(newsCount).clone().html())
						}
				newsContainer.fadeIn(350);
			});
		}
		function doPrevNews(){
			newsContainer.fadeOut(250, function(){
				newsCount--;
				if(newsCount < 0) {
					newsCount = newsLength-1;
					newsContainer.html($('.newsTicker span.headline').eq(newsCount).clone().html());
				} else if (newsCount == 0){
					newsContainer.html(newsInitVal);
				} else {
					newsContainer.html($('.newsTicker span.headline').eq(newsCount).clone().html());
				}
				newsContainer.fadeIn(350);
			});
		}
		$('.newsTicker, .newsTicker .more, .newsTicker .prev').hover(
			function(){
				clearInterval(newsTimer);
				},
			function(){
				clearInterval(newsTimer);
				doAuto();
				}
		)
		$('.newsTicker .more').click(function(){
			clearInterval(newsTimer);
			doNextNews();
			return false;
		})
		$('.newsTicker .prev').click(function(){
			clearInterval(newsTimer);
			doPrevNews();
			return false;
		})
		var newsTimer = 0;
		function doAuto(){
			newsTimer = setInterval(function(){doNextNews(true);},newsDelay)	
		}
		doAuto();
	} // newsTicker

	this.initHome = function initHomeFn() {
		$("#header").addClass("home");
		$("span.headline:first").addClass("current");
		Eastwood.newsTicker();
	} //initHome

	this.accordian = function accordianFn() {
		$(".cw_structTxt_accordians .preview a.accord").click(function() {
			$(this).closest("div").next().slideToggle("fast", function(){
			});
			return false;
		});
	} //accordian
	
	this.displayPanel = function displayPanelFn() {
		$("ul#Nav li").hover(function() {
			$(this).css("color","#333333")
		}, function() {
			if (!($(this).hasClass("selected"))) {
				$(this).css("color","#006BB6")
			}
		});
		var reqTab = (location.hash).slice(1);
		if (reqTab) { 
			$("ul#Nav li").each(function(i) {
				if ( ($(this).attr("rel")) == reqTab ) {
					var t = $("ul#Nav li").index(this);
					$("#Display .content:eq("+t+")").show();
					$(this).addClass("selected");
				}
			});
		} else {
			$("#Display .content:first").show();
			$("ul#Nav li:first").addClass("selected");
		}
		$("ul#Nav li").click(function() {
			$("#Display .content").hide();
			$("ul#Nav li").each(function (i) {
				if ($(this).hasClass("selected")) {
					$(this).removeClass("selected").css("color","#006BB6");
				}
			});
			//$("ul#Nav li").removeClass("selected");
			$(this).addClass("selected");
			var n = $("ul#Nav li").index(this);
			$("#Display .content:eq("+n+")").animate({
					opacity: "toggle"
				}, 250, "linear");
			return false;
		});
	} // displayPanel
	
	this.avidShadowbox = function avidShadowboxFn() {
		$('a[rel="avidShadowbox"]').click(function() {
			var thisURL = $(this).attr("href");
			Shadowbox.open({
			 content:    thisURL,
			 player:  "iframe",
			 height:     550,
			 width:      700
			});
			return false;
		});
	} //avidShadowbox

	this.QTShadowbox = function QTShadowboxFn() {
		$('a[rel="QTShadowbox"]').click(function() {
			var thisURL = $(this).attr("href");
			Shadowbox.open({
			 content:    thisURL,
			 player:  "iframe",
			 height:     778,
			 width:      1034
			});
			return false;
		});
	} //avidShadowbox

	this.videoShadowbox = function videoShadowboxFn() {
		$('a[rel="videoShadowbox"]').click(function() {
			var thisURL = $(this).attr("href");

			var pathToVideo = STATIC_CONTENT_PATH+"resources/flash/flvPlayer.swf?moviePath=http://media-cdn.avid.com/media/eastwood/"+thisURL;
			var newPathtoVideo = "http://media-cdn.avid.com/media/eastwood/"+thisURL;
			var newPathtoPlayer = STATIC_CONTENT_PATH+"resources/flash/flvPlayer.swf";
			var flashvars = {};
				flashvars.videoPath = newPathtoVideo;
				flashvars.movieTitle = video;
				flashvars.playerName = "shadowboxPlayer";
				flashvars.autoplay = "on"
			var params = {};
				params.menu = "false";
				params.salign = "t";
				params.bgcolor = "#000000";
				params.allowfullscreen = "true";
				params.wmode = "opaque";
				params.allowScriptAccess = "sameDomain";
				
			var attributes = {};
				attributes.id = "site";
				attributes.align = "top";
			var thisContent = swfobject.embedSWF(newPathtoPlayer, divPlacement, "778", "473", "8.0.0", "expressInstall.swf", flashvars, params, attributes);


			Shadowbox.open({
			 content:    thisContent,
			 player:  "iframe",
			 height:     472,
			 width:      778
			});
			return false;
		});
	} //videoShadowbox

	this.videoShadowboxInline = function videoShadowboxInlineFn() {
		//alert('inline');
		var contentHTML = "<div class='inner' style='width:778px;'><div style='margin:10px auto;'><div class='inlineVideo'><div id='flashVideo'></div></div></div></div>"
		$('a[rel="videoShadowboxInline"]').click(function() {
			//alert('click');
			var thisURL = $(this).attr("href");
			Shadowbox.open({
			 content:    "<div class='inner' style='width:778px;'><div style='margin:10px auto;'><div class='inlineVideo'><div id='flashVideo'></div></div></div></div>",
			 player:  "html",
			 height:     472,
			 width:      778
			});
			
			return false;
		});
	} //videoShadowboxInline

	this.overlayShadowbox = function overlayShadowboxFn() {
		$('div.pod').hover(
			function() {
				$(this).addClass('overBio');
			},
			function() {
				$(this).removeClass('overBio');
			}
		);
		$('div.pod').click(function() {
			var thisContent = $('.overlay',this).html();
			Shadowbox.open({
			 content:    thisContent,
			 player:  "html",
			 height:     550,
			 width:      700
			});
			//return false;
		});
	} //bios

	this.padpod3x840 = function padpod3x840Fn() {
		var podLength = $(".cw_imgPromos_pod3x840").length;
		$('<br class="clear" />').insertBefore(".cw_imgPromos_pod3x840:eq(0)");
		$('<br class="clear" />').insertAfter(".cw_imgPromos_pod3x840:eq(2),.cw_imgPromos_pod3x840:eq(5)");
		$(".cw_imgPromos_pod3x840:eq(1),.cw_imgPromos_pod3x840:eq(4),.cw_imgPromos_pod3x840:eq(7),.cw_imgPromos_pod3x840:eq(10)").addClass("middle");
		$(".cw_imgPromos_pod3x840 .long_desc ul li:gt(0)").before('<li>&nbsp;&nbsp;|&nbsp;&nbsp;</li>');
	} // padpod3x840
	
	this.padpod4x840 = function padpod4x840Fn() {
		var podLength = $(".cw_imgPromos_pod4x840").length;
		$(".cw_imgPromos_pod4x840 .long_desc ul li:gt(0)").before('<li>&nbsp;&nbsp;|&nbsp;&nbsp;</li>');
		$('<br class="clear" />').insertAfter(".cw_imgPromos_pod4x840:eq(3),.cw_imgPromos_pod4x840:eq(7),.cw_imgPromos_pod4x840:eq(11),.cw_imgPromos_pod4x840:eq(15),.cw_imgPromos_pod4x840:eq(19),.cw_imgPromos_pod4x840:eq(23),.cw_imgPromos_pod4x840:eq(27),.cw_imgPromos_pod4x840:eq(31),.cw_imgPromos_pod4x840:eq(35),.cw_imgPromos_pod4x840:eq(39),.cw_imgPromos_pod4x840:eq(43),.cw_imgPromos_pod4x840:eq(47)");
		$(".cw_imgPromos_pod4x840:eq(3),.cw_imgPromos_pod4x840:eq(7),.cw_imgPromos_pod4x840:eq(11),.cw_imgPromos_pod4x840:eq(15),.cw_imgPromos_pod4x840:eq(19),.cw_imgPromos_pod4x840:eq(23),.cw_imgPromos_pod4x840:eq(27),.cw_imgPromos_pod4x840:eq(31),.cw_imgPromos_pod4x840:eq(35),.cw_imgPromos_pod4x840:eq(39),.cw_imgPromos_pod4x840:eq(43),.cw_imgPromos_pod4x840:eq(47)").addClass("last");
	} // padpod4x840
	
	this.padpod2x840 = function padpod2x840Fn() {
		$('<br class="clear" />').insertBefore(".cw_imgPromos_pod2x840:eq(0)");
		$('<br class="clear" />').insertAfter(".cw_imgPromos_pod2x840:odd");
		$(".cw_imgPromos_pod2x840:odd").addClass("last");
		$(".cw_imgPromos_pod2x840 .long_desc ul li:gt(0)").before('<li>&nbsp;&nbsp;|&nbsp;&nbsp;</li>');
	} // padpod2x840
	
	this.brandBox = function brandBoxFn() {
		$('<br class="clear" />').insertBefore(".cw_linkedImg_brandBox:eq(0)");
		$('<br class="clear" />').insertAfter(".cw_linkedImg_brandBox:eq(1),.cw_linkedImg_brandBox:eq(3)");
		$(".cw_linkedImg_brandBox:eq(0),.cw_linkedImg_brandBox:eq(2)").addClass("left");
	} // padpod2x840

	this.biosPods = function biosPodsFn() {
		$('<br class="clear" />').insertBefore(".pod:eq(0)");
		$('<br class="clear" />').insertAfter(".pod:eq(2),.pod:eq(5),.pod:eq(8),.pod:eq(11),.pod:eq(14)");
	} // padpod3x840

	this.lowerwellPods = function lowerwellPodsFn() {
			$("#LowerWellContent .cw_imgPromos_pod4x840:first").addClass("first");
			$("#LowerWellContent .cw_imgPromos_pod4x840:last").addClass("last");
	} //lowerwellPods

	this.productHome = function productHomeFn() {
		$(".heroPod3x3:eq(2),.heroPod3x3:eq(5)").addClass("last");
		$(".heroPod3x3 a").hover( 
			function () {
				$(this).css("background-position", "0 -140px");
			}, function () {
    			$(this).css("background-position", "0 0");
  			}
		);
	} //productHome

	this.productTable = function productTableFn() {
		$("table.tablesorter tbody tr:odd").addClass("odd");
	} // productTable

	this.openShadowbox = function openShadowboxFn() {
		$('a[href$="shadowbox"]').click(function() {
			var thisURL = $(this).attr("href");
			Shadowbox.open({
			 content:    thisURL,
			 player:  "iframe",
			 height:     600,
			 width:      875
			});
			return false;
		});
	} // openShadowbox

	this.box33Stories = function box33StoriesFn() {
		$('<br class="clear" />').insertAfter(".box33Stories li:eq(2),.box33Stories li:eq(5),.box33Stories li:eq(8),.box33Stories li:eq(11),.box33Stories li:eq(14)");
	} // box33Stories

	this.setPricingBtns = function setPricingBtnsFn() {
		var thisClass = $('.blueActionButton2').attr('class');
		//alert(thisClass);
		var caseNo = 0;
		if (thisClass == 'blueActionButton2 rr_pricing_BuyNow') {
			$('a.rentNow').css('display','none');
		}
		if (thisClass == 'blueActionButton2 rr_pricing_NoLink') {
			  $('a.buyNow').css('display','none');
			  $('a.rentNow').css('display','none');
		}
		if (thisClass == 'blueActionButton2 rr_pricing_rentNow') {
			  $('a.buyNow').css('display','none');
		}
	} // setPricingBtns

	this.chkQtImg = function chkQtImgFn() {
		$(".cw_quote_fullWidth .holder blockquote").each(function () { 
			if ($('.holder img').length) {
				//alert('img found');
			} else {
				//alert('not img found');
				$(this).css('padding-left','40px').css('width','535px');
				$(this).children('span').css('left','10px');
			}
		
		});
	} // chkQtImg

}//EastwoodLib

function csCarousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
    	var scrollToIndex = $(".jcarousel-control a").index(this);
        carousel.scroll(jQuery.jcarousel.intval(scrollToIndex+1));
        return false;
    });
    jQuery('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });
}
function csCarousel_itemVisibleInCallbackAfterAnimation(carousel, item, idx, state) {
    var thisID = idx-1;
    var URLStr = "url('"+STATIC_CONTENT_PATH+"images/interface/carousel_bluedot.jpg')"
    $(".jcarousel-control a").eq(thisID).css("background-image",URLStr);
}
function csCarousel_itemVisibleOutCallbackAfterAnimation(carousel, item, idx, state) {
    var thisID = idx-1;
    var URLStr = "url('"+STATIC_CONTENT_PATH+"images/interface/carousel_graydot.jpg')"
    $(".jcarousel-control a").eq(thisID).css("background-image",URLStr);
}

$.fn.wait = function(time, type) {
	//alert('fired');
	time = time || 5000;
	type = type || "fx";
	return this.queue(type, function() {
		var self = this;
		setTimeout(function() {
			$(self).dequeue();
		}, time);
	});
};

// audio functions
	function thisMovie(movieName){
	    if(navigator.appName.indexOf("Microsoft") != -1){return window[movieName]}
	    else{return document[movieName]}
	}
	jQuery(function() {
		$("#playerholder").bind("mouseleave",function(){
			// the "player" here is the swfobject "attributes.id"
			thisMovie("player").closeSlider();
	    });
	});
	function openPlaylist(what){
		jQuery(function() {
			if(what == 'open'){
				$('#playerholder').stop().animate({height: "130px"},300)
			}
			if(what == 'close'){
				$('#playerholder').stop().animate({height: "36px"},480)
			}
		});
	}

window.onload = function(){
	Shadowbox.init();
	//if(typeof($(document).pngFix()) != "undefined"){ $(document).pngFix() }
	//$(document).pngFix();
};

