// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
// jQuery.noConflict()

jQuery(document).ready(function() {
 jQuery(".zebra tr:not(:first)")
 .mouseover(function(){jQuery(this).addClass("over");})
 .mouseout(function(){jQuery(this).removeClass("over");});
 jQuery(".zebra tr:nth-child(even)").addClass("alt");
 jQuery("#expand_link").click(function(){jQuery("#expand_std_deviation").toggle(); return false;});
 jQuery("#login_form").submit(function(){ sslMismatchAlert(); });
});

// alert them about the ssl certificate if they try to login from something other than www.whattoexpect.org 
var sslMismatchAlert = function(){ 
	if (location.href.indexOf('www1.whattoexpect.org') > 0 && location.href.indexOf('https:') != 0){
		alert('We are currently updating our website! Please be advised that you should get a message about our SSl certificate not matching the domain name. This is due to an update to our server and is temporary.\n\nPlease view the certificate to confirm that it is valid for www.whattoexpect.org to be sure that you can continue on without risk.\n\nIf you prefer to wait, this message should go away within the next 24 hours.\n\nThank You\n- The What to Expect Foundation');
	}
	return false;
}
