$(document).ready(function(){
	
	$('#suggestion_box').hide();
	
	$('a.modal').click(function() {
		var modal = $(this).attr("href");
		$(modal).modal({
			opacity: 60,
			overlayCss: {backgroundColor:"#FFFFFF"},
			closeClass: "modalClose",
			closeHTML: ""
		});
		return false;
	});
	
	$("#samples_nav li a").click(function () {  

        // switch all tabs off  
        $(".active").removeClass("active");  

        // switch this tab on  
        $(this).addClass("active");  

        // slide all elements with the class 'content' up  
        // $("#home_video_cycle > div").fadeOut();
        // using hide instead of fadeOut - animation was wonky
        $("#home_video_cycle > div").hide();

        // Now figure out what the 'title' attribute value is and find the element with that id.  Then slide that down.  
        var content_show = $(this).attr("href"); 
   
        $(content_show).show();  
		return false

    });
    
    var flyout_hover_config = {    
     	over: flyout_mouseover, // function = onMouseOver callback (REQUIRED)    
     	timeout: 250, // number = milliseconds delay before onMouseOut    
     	out: flyout_mouseout // function = onMouseOut callback (REQUIRED)    
	};

    var flyout_hover_config1 = {    
     	over: flyout_mouseover1, // function = onMouseOver callback (REQUIRED)    
     	timeout: 250, // number = milliseconds delay before onMouseOut    
     	out: flyout_mouseout1 // function = onMouseOut callback (REQUIRED)    
	};
    var flyout_hover_config2 = {    
     	over: flyout_mouseover2, // function = onMouseOver callback (REQUIRED)    
     	timeout: 250, // number = milliseconds delay before onMouseOut    
     	out: flyout_mouseout2 // function = onMouseOut callback (REQUIRED)    
	};

    var flyout_hover_config3 = {    
     	over: flyout_mouseover3, // function = onMouseOver callback (REQUIRED)    
     	timeout: 250, // number = milliseconds delay before onMouseOut    
     	out: flyout_mouseout3 // function = onMouseOut callback (REQUIRED)    
	};
	$(".home_list_video").hoverIntent(flyout_hover_config);

	$(".home_list_video1").hoverIntent(flyout_hover_config1);

	$(".home_list_video2").hoverIntent(flyout_hover_config2);

	$(".home_list_video3").hoverIntent(flyout_hover_config3);

	$("#home_banners_scroll")
	.before('<div id="scroll_nav" style="z-index:10">')
	.cycle( {
		fx:     'fade',
		 timeout:17000 ,
		pause: 1,
		pager: "#scroll_nav",
	    next:   '#home_scroll_next', 
	    prev:   '#home_scroll_prev'
	});
	
});

function flyout_mouseover3()
{
	var id3 = $(this).attr("id");
    $("#info_pop3_"+id3).fadeIn();
}

function flyout_mouseout3()
{
	var id3 = $(this).attr("id");
    $("#info_pop3_"+id3).fadeOut();
}


function flyout_mouseover2()
{
	var id2 = $(this).attr("id");
    $("#info_pop2_"+id2).fadeIn();
}

function flyout_mouseout2()
{
	var id2 = $(this).attr("id");
    $("#info_pop2_"+id2).fadeOut();
}


	
function flyout_mouseover1()
{
	var id1 = $(this).attr("id");
    $("#info_pop1_"+id1).fadeIn();
}

function flyout_mouseout1()
{
	var id1 = $(this).attr("id");
    $("#info_pop1_"+id1).fadeOut();
}


function flyout_mouseover()
{
	var id = $(this).attr("id");
    $("#info_pop_"+id).fadeIn();
}

function flyout_mouseout()
{
	var id = $(this).attr("id");
    $("#info_pop_"+id).fadeOut();
}

