$(document).ready(function(){ /* Clear email on select */ $("form.artsdbLogin #email").live( 'focus', function() { $(this).val( "" ); } ); $("form.mailingList #email").live( 'focus', function() { $(this).val( "" ); } ); /* Link toggle element. */ $("a.toggle").live( 'click', function() { $( "#" + $(this).attr("rel") ).slideToggle("slow"); return false; } ); // Calendar change month. $("a.calendar_change_month").live( 'click', function() { $.post( "include/calendar.php", { month: $(this).attr("rel"), id: $("#entry_id").val() }, function( data ) { $(".calendar").html( data ); } ); return false; } ); // Calendar set date. $("a.calendar_link, a.calendar_link_event").live( 'click', function() { $("input.calendar").val( $(this).attr("rel") ); // Display event details. if( $("input#eventCal").length > 0 ) { $.post( "ajax/eventCal.php", { date: $("input#eventCal").attr("value"), id: $("#entry_id").val() }, function( data ) { if( data.length > 0 ) { $("div#eventBox").html( data ); } } ); } return false; } ); // Enable lightbox for galleries. $('a[rel=lightbox]').lightBox(); // Flash music player track change. $("a.flash_music").live( 'click', function() { $.post( "ajax/flashMusic.php", { id: $(this).attr("rel"), track: $(this).attr("target") }, function( data ) { $("div#flashAudio").html( data ); } ); return false; } ); // Add extra fields. $( "#add_info" ).live( 'click', function() { $.post( "ajax/addField.php", { newfield : $("#newfield").val(), value: $("#value").val() }, function( data ) { $( "div.additional_info_container" ).append( data ); } ); return false; } ); // Remove extra fields. $( "a.remove_additional" ).live( 'click', function() { $( "div#additional_field_" + $(this).attr("rel") ).remove(); return false; } ); // Update card form on package change. $( "select#package" ).live( 'change', function() { if( $("select#package option:selected").text().match( /[^0-9]{1}0\.00/ ) ) { $( "#cardInfoContainer" ).hide( ); } else { $( "#cardInfoContainer" ).show( ); } } ); // Calendar change month. $( "a.event_calendar_change_month" ).live( 'click', function() { $.post( "generics/eventcal256.php", { month: $(this).attr( "rel" ) }, function( data ) { $( "#calender_container" ).html( data ); } ); return false; } ); });