// Scroller plugin
$(function()
{
    $('#slideshow').cycle({
        speed: 1000,
        timeout: 10000,
        pager: '#featured_nav',
        pagerEvent: 'mouseover',
        pauseOnPagerHover: true,
        fx: 'fade' // available efx: fade, shuffle, zoom, turnDown, curtainX, scrollRight
    });
});

// Tab items
$(document).ready(function() {

	//Default Action
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});

});

// Fade links
$(document).ready(function(){
	$(".fadehover").hover(
	function() {
		$(this).animate({"opacity": "0.5"}, "fast");
	},
	function() {
		$(this).animate({"opacity": "1"}, "fast");
	});
	
});

// IE 6 png fix
$(document).ready(function()
{
	$("a[rel='plans']").colorbox();
	$("a[rel='gallery']").colorbox();
    $(document).pngFix();
});

// Clear form text field and repopulate with default value
function clearText(field){
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
}

// Site navigation
$(function(){
    $("ul.main_menu li").hover(function(){
        $(this).addClass("hover");
        $('ul:first',this).css('visibility', 'visible');
    }, function(){
        $(this).removeClass("hover");
        $('ul:first',this).css('visibility', 'hidden');
    });
    $("ul.main_menu li ul li:has(ul)").find("a:first").append(" &raquo; ");
});




