$(document).ready(function(){
	// Plans toggle
	$(".plan-swap a.flink").click(function(event) {
		event.preventDefault();
		changeto=$(this).attr("href");
		$(".swapimg").fadeOut(function() {
		$(".swapimg").attr("src", changeto);
		$(".swapimg").fadeIn();
		});
		$(".plan-swap a").removeClass("highlight");
		$(this).addClass("highlight");
	});
	
	// Cycle for home quotes
	$('.cycleMe').cycle({
		fx: 'fade',
		speed:   1000, 
		timeout: 3500
	});
	
	$('#slideshow').after('<div class="grid_16 alpha center"><ul class="galleryNav"></div>').cycle({
    	fx: 'fade',
			speed:   2000, 
			timeout: 5000,
			delay: -2000,
	    pager:  '.galleryNav',
	    // callback fn that creates a thumbnail to use as pager anchor 
			pagerAnchorBuilder: function(idx, slide) { 
					return '<li><a href="#">' + (idx+1) + '</a></li>'; 
			}	
	});

	
	// prettyPhoto
/*	$("a[rel^='prettyPhoto']").prettyPhoto({
		theme: 'light_square', /* light_rounded / dark_rounded / light_square / dark_square / facebook */																			 
	/*	allowresize: false
	});*/ //commented out because it was stopping validation from working
	
	$('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';
}
