$(document).ready(function(){
	// Plans toggle
	$(".plan-swap a").click(function(event) {
		event.preventDefault();
		$(".swapimg").attr("src", $(this).attr("href"));
		$(".plan-swap a").removeClass("highlight");
		$(this).addClass("highlight");
	});
	// Cycle for home quotes
	$('.cycleMe').cycle({
		fx: 'fade',
		speed:   1000, 
		timeout: 3500
	});
	
	//gallery with thumbnails
    $('#slideshow').after('<ul id="thumbs">').cycle({
        fx:     'fade',
        speed:  1000,
        timeout: 0,
        pager:  '#thumbs',
        pagerAnchorBuilder: function(idx, slide) {
            return '<li><a href="#"><img src="' + slide.src + '" width="140" height="70" /></a></li>';
        }
    });
	
	// prettyPhoto
	$("a[rel^='prettyPhoto']").prettyPhoto({
		theme: 'light_square', /* light_rounded / dark_rounded / light_square / dark_square / facebook */																			 
		allowresize: true,
		show_title:false,
		overlay_gallery:false,
		social_tools:''
	});
	
	$('a.external').click(function(){
		window.open(this.href);
		return false;
	});


});


window.gOverride = {
urlBase: 'http://gridder.andreehansson.se/releases/latest/',
	gColor: '#EEEEEE',
	gColumns: 16,
	gOpacity: 0.35,
	gWidth: 10,
	pColor: '#C0C0C0',
	pHeight: 15,
	pOffset: 0,
	pOpacity: 0.55,
	center: true,
	gEnabled: false,
	pEnabled: false,
	setupEnabled: true,
	fixFlash: true,
	size: 960
}

createGridder = function() {
document.body.appendChild(
  document.createElement('script'))
	.src='/js/960.gridder.js';
}
