jQuery(document).ready(function(){
	
	// grid
	env = window.location.host;
	if(env.match(/local/g)) { init_grid_toggle() }
	
	// swap form field values
	jQuery('.default-value').each(function() {
		var default_value = this.value;
		jQuery(this).focus(function() {
			if(this.value == default_value) {
				this.value = '';
			}
		});
		jQuery(this).blur(function() {
			if(this.value == '') {
				this.value = default_value;
			}
		});
	});
	
	
	// slideshow
	jQuery('#slideshow').loopedSlider({
		autoStart: 8000, //Set to positive number for true. This number will be the time between transitions.
		// autoStart: 0, //Set to positive number for true. This number will be the time between transitions.
		containerClick: false, //Click slider to goto next slide? true/false
		slidespeed: 1000 //Speed of slide animation, 1000 = 1second.
	});
	
	
	
});

function showGrid() {
	jQuery("#container").append("<div id='grid'></div>");
	jQuery("#container").css("position","relative");
}

function showGridUnder() {
	jQuery("#container").css({'background':'url(/wp-content/themes/sml/css/grid.png) repeat-y 0 0' });
}


var init_grid_toggle = function() {
  jQuery(document).bind('keydown', 'alt+g', function() {
	
    if(jQuery('#grid').length>0) {  
      jQuery("#grid").remove();
    } else {
		showGrid();
    }
  });
}

