
// Create the google map on the location page
//google.load("jquery", "1.4.0");
google.load("maps", "2");

function initialize() {
    var map = new google.maps.Map2(document.getElementById('map'),{ size: new GSize(657,412) } );
    var STSWorldHeadquarters = new GLatLng(40.756633,-111.874372);
	var marker = new GMarker(new GLatLng(40.756633,-111.874372));
    marker.openInfoWindowHtml("<img src='http://prod.super_top_secret.nj2x.stackablehost.com/wp-content/themes/sts/images/sts-seal.png' width='30' height='30' /><br/><p>Super Top Secret</p>");
    map.addOverlay(marker);
	//map.setMapType(G_HYBRID_MAP);
	map.setCenter(STSWorldHeadquarters, 11);
	map.setUIToDefault();
	
}
google.setOnLoadCallback(initialize);


	
$(document).ready(function() {
	createHomeSlideshow();
	
	// create twitter feed
	$("#tweets").getTwitter({
		userName: "wearetopsecret",
		numTweets: 3,
		loaderText: "Loading tweets...",
		showHeading: false,
		showProfileLink: false,
		showTimestamp: true
	});
	
	// create flickr feed
	
	//
	// !!!! This needs the correct api_key and api_url to access the STS flickr account.
	//
	$("#flickr-feed").flickr({
	        api_key: '02113dd1d3d2a2f032ffb3f2c16eec45',
			user_id: '44689384@N05',
			type: 'search',
	        per_page: 12,
			sort: 'date-posted-desc',
	});
	

	//$('#listening-content').lastFM({
	//	username: 'wearetopsecret',
	//	apikey: '418bad267c49fa1dbf87cdff3b7cbc4f',
	//	number: 2,
	//	artSize: 'medium',
	//	noart: '',
	//	onComplete: function(){
	//	//Done
	//	}
	//});


});

function createHomeSlideshow() {
	// start home slideshow 
    $('.home-slideshow')
	.after('<div id="star-nav">')
	.cycle({ 
        fx: 'fade', // 'scrollHoriz' for bi-directional sliding
		speed: 2000,
		timeout: 6000,
		prev: '.slideshow-left-button',
		next: '.slideshow-right-button',
    });

	$('.slideshow-left-button,.slideshow-right-button').fadeTo(0, .4);
	
	$('.slideshow-left-button,.slideshow-right-button').bind("mouseenter", function(e){
	        $(this).fadeTo(100, 1);
	    });
	
	$('.slideshow-left-button,.slideshow-right-button').bind("mouseleave", function(e){
	        $(this).fadeTo(100, .4);
	    });
}



