// JavaScript Document
// perform JavaScript after the document is scriptable.
$(document).ready(function() {
	$("div.home_scrollable").scrollable({
		size: 1,
		clickable: false
	}).autoscroll({
		interval:11000
	}).circular();

	
	$(document).pngFix();
	
	$('.partner').hover(function(){
			$(this).children('.comment').stop().css("display", "block");
			$(this).children('.comment').stop().css("top", "0px");
		}
		, function(){
			$(this).children('.comment').stop().animate({"top": '400px'}, 800);
		}
	);	
	
	
	// install flowplayer into flowplayer container
	var player = $f("player", "/media/flash/flowplayer-3.1.5.swf", {
		onLoad: function () {
			this.setVolume(80);
		}, 					
		plugins: {
			controls: {
				playlist: true,
				autoHide: 'always',
				bufferColor: '#000000',
				volumeSliderGradient: 'none',
				tooltipColor: '#5F747C',
				durationColor: '#acc857',
				buttonOverColor: '#728B94',
				volumeSliderColor: '#000000',
				sliderGradient: 'none',
				buttonColor: '#000000',
				timeColor: '#a9a9a9',
				backgroundGradient: 'none',
				timeBgColor: '#676767',
				bufferGradient: 'none',
				backgroundColor: '#FFFFFF',
				progressColor: '#94b923',
				borderRadius: '0px',
				progressGradient: 'medium',
				sliderColor: '#000000',
				tooltipTextColor: '#ffffff',
				height: 24,
				opacity: 1.0
			}
		}		
	});
	// setup button action. it will fire our overlay 
	$("a[rel]").overlay({
		expose: '#000',
		// when overlay is opened, load our player
		onLoad: function() {
			player.load();
		},
		// when overlay is closed, unload our player
		onClose: function() {
			player.unload();
		}
	});	
	
});

document.write('\x3Cscript src="http://www.google.com/jsapi?key=ABQIAAAA1Q73oHZUWzLsZpI2f6gxBBSU3oUhilsDND8vdmmQE0zJ4TSEYBTuvJFsPlfB0GHXLNH7NBt2TVshDA" type="text/javascript">\x3C/script>');

function googleSerachInit() {
	google.load("search", "1");
	google.setOnLoadCallback(googleOnLoadCallback, true);
}
    
function googleOnLoadCallback() {
	// Create a search control      
	var searchControl = new google.search.SearchControl();	
	
	var search =  new google.search.WebSearch();
	search.setSiteRestriction("www.signalinc.com");//This will need to be updated to ceedd's website eventually

	var options = new google.search.SearcherOptions();
	options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
	
	searchControl.addSearcher(search,options);                
	// Tell the searcher to draw itself and tell it where to attach      
	searchControl.draw(document.getElementById("searchcontrol"));      
	
 }