// Custom routines used on all or most pages

/* Modified to initiliase within the script rather than in the document body */
$(document).ready(function(){
	$('#features').toggle();
	/*$('#features_nojs').toggle();*/
	$('#features_nojs').remove(); /* Div has to be removed rather than toggled otherwise IE6 shows whitespace */
	$('#features').jshowoff({ speed:5000, links: false, controls: false, changespeed: 300 });
	
	$('#features_image').toggle();
	/*$('#features_nojs').toggle();*/
	$('#features_image_nojs').remove(); /* Div has to be removed rather than toggled otherwise IE6 shows whitespace */
	$('#features_image').jshowoff({ speed:10000, links: false, controls: false, changespeed: 1000 });
	
	new Nifty('div#general_image_container','big');	
	new Nifty('div.home_teaser','big,tl,tr');	
	//new Nifty('div.ngg-album','big');	
	new Nifty('div.weather_surround','big');	
	
	var download = getParameterByName('download');	
	if (download != '')		
		window.location = '/downloads/' + download;		
});


function getParameterByName(name)
{
  name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
  var regexS = "[\\?&]" + name + "=([^&#]*)";
  var regex = new RegExp(regexS);
  var results = regex.exec(window.location.href);
  if(results == null)
    return "";
  else
    return decodeURIComponent(results[1].replace(/\+/g, " "));
}
