var showOverlayOnLoad = false;
var isLoggedIn = false;
var return_s = "";
var return_id = "";
var slideshow_src = new Array();
var slideshow_caption = new Array();
var slideshow_caption2 = new Array();
var slideshow_index = 0;

function adjustShadows() {
	//var content_height = parseInt(YAHOO.util.Dom.getStyle($('content_container'), 'height'), 10);
	var content_height = $('content_container').offsetHeight;
	$$('shadow_edge_left').height = (content_height + "px");
	$$('shadow_edge_right').height = (content_height + "px");
}

function adjustOverlay() {
	//var content_height = parseInt(YAHOO.util.Dom.getStyle($('content_container'), 'height'), 10);
	var content_height = $('content_container').offsetHeight;
	$$('overlay').height = (content_height + "px");
}

function turnOnOverlay() {
	$$('overlay').visibility = "visible";
	$$('overlay_content_outer').visibility = "visible";
}

function turnOffOverlay() {
	$$('overlay').visibility = "hidden";
	$$('overlay_content_outer').visibility = "hidden";
}



function focusSignupInput(element) {
	if (element.value != "") element.style.backgroundPosition = "0px -62px";
	else element.style.backgroundPosition = "0px -31px";
}

function blurSignupInput(element) {
	if (element.value != "") element.style.backgroundPosition = "0px -62px";
	else element.style.backgroundPosition = "0px 0px";
}

function blankSignupInput(event,element) {
	var keynum;
	if(window.event) { // IE
		keynum = event.keyCode;
	} else if(event.which) { // Netscape/Firefox/Opera
		keynum = event.which;
	}
	
	if (element.value.length <= 1) {
		if (keynum == 8) element.style.backgroundPosition = "0px -31px";
		else element.style.backgroundPosition = "0px -62px";
	} else if (element.value != "") element.style.backgroundPosition = "0px -62px";
	else element.style.backgroundPosition = "0px -31px";
}

function updateSignupInputs() {
	var input_ids = new Array('first_name','last_name','email','zip');
	for (var i=0; i < input_ids.length; i++) {
		blurSignupInput($(input_ids[i]));
	}
}

function loadSlide(index) {
	$('slideshow_caption').innerHTML = slideshow_caption[index];
	$('slideshow_caption2').innerHTML = slideshow_caption2[index];
	$('slideshow_img').src = slideshow_src[index];
	$('slideshow_num').innerHTML = (index + 1);
}

function slideshowNext() {
	if((slideshow_index + 1) < slideshow_src.length) {
		loadSlide(slideshow_index + 1);
		slideshow_index++;
	}
}

function slideshowPrevious() {
	if((slideshow_index - 1) >= 0) {
		loadSlide(slideshow_index - 1);
		slideshow_index--;
	}
}

function doLogin() {
	$('private_entry').submit();
}

function doSignup() {
	$('email_signup').submit();
}

function highlightHeaderNav(element) {
	element.style.backgroundPosition = "0px -25px";
	element.style.cursor = "Pointer";
}

function normalHeaderNav(element) {
	element.style.backgroundPosition = "0px 0px";
}