
$(document).ready(function(){
	

	$("#scrollbanner").scrollable({next: '.BannerNext', prev: '.BannerPrev', circular: true}).navigator().autoscroll({interval: 7000});
	
	// if the function argument is given to overlay,<!-- jquerytools scroller --> 
	// it is assumed to be the onBeforeLoad event listener
	//$("a[rel]").overlay({
	
	if($("a.pop").length > 0){ 
		$("a.pop").overlay({
			target: "#overlay",

			mask: 'black',
			effect: 'apple',

			onBeforeLoad: function() {

				// grab wrapper element inside content
				var wrap = this.getOverlay().find(".contentWrap");

				// load the page specified in the trigger
				wrap.load(this.getTrigger().attr("href"));
			}

		});
	}
	
	


	//<!-- Plays id "player" if exists on page -->
	if($('#player').length > 0){
		flowplayer("player", "http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf", {
		  
		  clip: {
			// stop at the first frame and start buffering
			autoPlay: false,
			autoBuffering: true,
			scaling: "fit"
		  },
		// change the default controlbar skin
		
		plugins: {
			controls: {
				buttonColor: 'rgba(249, 246, 235, 0.9)',
				buttonOverColor: '#a06a39',
				backgroundColor: '#bfb79c',
				backgroundGradient: 'medium',
				
				sliderColor: '#b84126',
				progressColor: '#b84126',
				sliderBorder: 'none',
				
				volumeSliderColor: '#FFFFFF',
				volumeBorder: '1px solid #bfb79c',
				
				
				timeBgColor: '#bfb79c',
				timeColor: '#40403f',
				durationColor: '#40403f',
				
				tooltipColor: 'rgba(249, 246, 235, 0.7)',
				tooltipTextColor: '#40403f'
				
			}
			
		}
		
		});
	}


});	



//* Target Blank -----------------------------------------------------*/

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
	   anchor.getAttribute("rel") == "external")
	 anchor.target = "_blank";
 }
}
window.onload = function() {
externalLinks();
}
	

