/*  Sitewide Javascript includes, added just before </head>.  */

jQuery(document).ready( function($) {
	$('#header_connect').submit(function() {
		if( $('#connect_address',this).val().match(/\S+@\S+\.\S+/) == null ) {
			$('#connect_address',this).val('Enter your email address');
			$('<div style="position: absolute;right: 150px;top: 50px;background-color:#F5BC2F;color:#000;border: 2px solid black;padding: 10px;">Invalid Email Address</div>.').insertAfter('#header_connect').fadeOut(2000);
		} else {
			// blah....
			$(this).submit();
			
			var data = $(this).serialize();
			$.ajax({
			   type: "POST",
			   url: "http://optin.simplycast.com/optin/",
			   data: data,
			   success: function(msg){
				$('<div style="position: absolute;right: 150px;top: 50px;background-color:#F5BC2F;color:#000;border: 2px solid black;padding: 10px;">Thanks!  We\'ll be in touch</div>.').insertAfter('#header_connect').fadeOut(5000);
			   }
			 });
		}
		return false;
	});

	$('#connect_address')
		.focus(function(){
			$(this).val('');
		})
		.blur(function(){
			if($(this).val() == '' )
				$(this).val('Enter your email address');
		});});


// Add option to /calendar, enable jQuery UI Theme (included in header-child.php)
var extra_calendar_options = {theme: true};


var extra_calendar_options = {
    theme: true,
    header: {
        left: '',
        center: 'title',
        //right: 'prev,next today'
        right: 'prev,next'
    },
    // Modify /calendar request to do only The Met
    events:  EventList.ajaxurl + '?action=eventcalendar&query=/calendar/room/the-met/'
};



