/*================================
 GUND FOUNDATION
 
 Last Updated By: Ryan Perry
 Last Updated: 04/30/2010
================================*/

/*================================================
 Photography Slideshow
================================================*/
/**
 * We use the initCallback callback
 * to assign functionality to the controls
 */
function mycarousel_initCallback(carousel) {
    $('.photography-content .gallery .gallery-control a').bind('click', function() {
        carousel.scroll($.jcarousel.intval($(this).text()));
        return false;
    });

    $('.gallery-next').bind('click', function() {
        carousel.next();
        return false;
    });

    $('.gallery-previous').bind('click', function() {
        carousel.prev();
        return false;
    });
};


$(document).ready(function(){

/*================================================
 Main Navigation Drop-Down Menu
================================================*/
$(".header-container ul.nav").superfish({
	hoverClass: 'hover',
	autoArrows: false,
	delay: 500, 
	dropShadows: true,
	disableHI: true,
	animation: {opacity:'show', height:'show'}
});


/*================================================
 Photography Slideshow
================================================*/
$('.photography-content .gallery').jcarousel({
	//auto: 2,
    wrap: 'both',
	scroll: 1,
	animation: 'slow',
    initCallback: mycarousel_initCallback,
    // This tells jCarousel NOT to autobuild prev/next buttons
    buttonNextHTML: null,
    buttonPrevHTML: null
});

/*$(".photography-content .gallery .gallery-control a").each(function(galleryIndex){


	$( this ).bind ("click",function(){							 
	//$(".photography-content .gallery").jcarousel(galleryIndex);		
		return false;
 	});
});*/


/*================================================
 Add Asterisk  for Required Fields 
================================================*/
/*---- Input Textboxes/Textarea ----*/
$(".form-container .form-row .form-textbox[required $= True]").prev(".form-label").append("<span class='form-required'> *</span>");

/*---- Selectboxes ----*/
$(".form-container .form-row .form-selectbox[required $= True]").prev(".form-label").append("<span class='form-required'> *</span>");

/*---- Checkboxes ----*/
$(".form-container .form-row .form-checkbox[required $= True]").prev(".form-label").append("<span class='form-required'> *</span>");

/*---- Radio Buttons ----*/
$(".form-container .form-row .form-radio[required $= True]").prev(".form-label").append("<span class='form-required'> *</span>");





});




