// Gaston Alive Global Javascript
window.addEvent('domready', function() {
	
	// onFocus Changes for Search Text Input
	var sInput = $('s');
	//alert(sInput);
	sInput.setProperty("value","Search Gaston Alive");
	sInput.addEvents({
		'focus':function() {
			sInput.setProperty("value","");
		},
		'blur':function() {
			sInput.setProperty("value","Search Gaston Alive");
		},
	});

	// Set up homepage slideshow
	function initEventSlideShow() {
		new SimpleSlideShow({
		  startIndex: 0,
		  slides: $$('#feature-holder .hentry'),
		  // nextLink: 'slide-next',
		  // 		  prevLink: 'slide-prev',
			slideInterval: 5800,
			autoRotate: true
		});
	}
	
	// start slideshow
	if ($(document.body).hasClass('home')) {
		initEventSlideShow();
	}
	
	
	
});
	
	

// 	var bx = $('modal'), blkbx = $('blackbox');
// 	var w = window.getSize();
// 	var wH = w.y, wW = w.x;
// 	//alert(w.x);
// // 	var bx = $("#modal"), blkbx = $("#blackbox");
// // 	var wH = $(window).height(), wW = $(window).width();
// 	var bxS = bx.getSize();
// 	var bxH = bxS.y, bxW = bxS.x;
// 	//bx.toggleClass('selected');
// 	
// 	// wW - bxW / 2 = Left
// 	var bxLeft = ((wW-bxW)/2);
// 	bx.setStyle('left',bxLeft);
// 	// wH - bxH /2 = Top
// 	var bxTop = ((wH-bxH)/2);
// 	bx.setStyle('top',bxTop);
// 	
// 	// Hide Modal on Double Click
// 	bx.addEvent('dblclick',function (){
// 		bx.setStyle('display','none');
// 		blkbx.setStyle('display','none');
// 	});
	
	
	// bx.dblclick(function () {
	// 		bx.css("display","none");
	// 		blkbx.css("display","none");
	// 		$.cookie('ga_initial_visit','returning',{expires:2});
	// 	})
	

// 	// Check to see if page has been visited recently
// 	if ($.cookie('ga_initial_visit') == 'returning') {
// 		//alert("you've been here before");
// 		bx.css("display","none");
// 		blkbx.css("display","none");
// 	} else if ($.cookie('ga_initial_visit') != 'returning') {
// 		//alert("this must be your first visit");
// 	}
// 	
// 	// Delete Cookie on Keypress (c)
// 	$(document).keypress(function (e) {
// 		if (e.keyCode == 99 || e.charCode == 99) {
// 			$.cookie('ga_initial_visit',null);
// 		}
// 	});
// 	
// 	// wW - bxW / 2 = Left
// 	var bxLeft = ((wW-bx.width())/2);
// 	bx.css("left",bxLeft);
// 	// wH - bxH /2 = Top
// 	var bxTop = ((wH-bx.height())/2);
// 	bx.css("top",bxTop);
// 	
// 	// Hide Modal on Double Click
// 	bx.dblclick(function () {
// 		bx.css("display","none");
// 		blkbx.css("display","none");
// 		$.cookie('ga_initial_visit','returning',{expires:2});
// 	})
// 
// 	// Hide Modal on Keypress (h)
// 	$(document).keypress(function (e) {
// 		if (e.keyCode == 104 || e.charCode == 104) {
// 			bx.css("display","none");
// 			blkbx.css("display","none");
// 			$.cookie('ga_initial_visit','false',{expires:2});
// 		}
// 	});
//