/*
 * JavaScript for CamiStinson.com
 * Brandon McKinney
 * Requires JQuery 1.2.3
 */


/*
 * CONSTANTS
 */
var config = Object;
config.ajaxurl = 'ajax.php';



/*
 * 
 */
$(document).ready(function(){
	$('a').mouseover(function(){
		$(this).animate({
			color: '#990022'
		});
	});
	
	
	$('#calendar').mouseover(showCalendar);
	$('#calendar').mouseleave(hideCalendar);
	
	
	$().piroBox({
        my_speed: 300, //animation speed
        bg_alpha: 0.5, //background opacity
        radius: 4, //caption rounded corner
        scrollImage : false, // true == image follows the page _|_ false == image remains in the same open position
                           // in some cases of very large images or long description could be useful.
        slideShow : 'true', // true == slideshow on, false == slideshow off
        slideSpeed : 3, //slideshow 
        pirobox_next : 'piro_next', // Nav buttons -> piro_next == inside piroBox , piro_next_out == outside piroBox
        pirobox_prev : 'piro_prev', // Nav buttons -> piro_prev == inside piroBox , piro_prev_out == outside piroBox
        close_all : '.piro_close, .piro_overlay' // add class .piro_overlay(with comma)if you want overlay click close piroBox
    });
});



/*
 * SHOW THE CALENDAR
 */
function showCalendar(){
    $('#calendar').animate({top: 0});
}



/*
 * HIDE THE CALENDAR
 */
function hideCalendar(){
    $('#calendar').animate({top: -267});
}



/*
 * SEND THE CONTACT FORM VIA AJAX
 */
function submitContactForm(){
    $('#btnSubmit').attr('disabled','disabled').fadeTo('normal', .5);
    $.ajax({
        type: 'post',
        url: config.ajaxurl,
        data: {
            aid: 'sendContactForm',
            name: $('#inName').attr('value'),
            email: $('#inEmail').attr('value'),
            msg: $('#inMsg').attr('value')
        },
        success: function(ret){
            $('#frmContact').fadeOut('normal',function(){
                $('#frmContact').html(ret).fadeIn()
            });
        }
    });
}


