$(document).ready(function() {
	
	$('#slides').load('http://lumoslearning.com/llwp/wp-content/themes/twentyeleven/loadslides.php', function() {
  	$('#slides').cycle({
	fx:      'cover',
    timeout:  6000,
	pager:  '#nav',
	pagerAnchorBuilder: function(idx, slide) {
     return '#nav li:eq(' + (idx) + ') a';
    }
	});
});	
	$('#pause').click(function() { 
		$('#slides').cycle('pause'); 
		$('#pauseli').addClass('hide');
		$('#playli').removeClass('hide');
	});
	
	$('#play').click(function() { 
		$('#slides').cycle('resume');
		$('#playli').addClass('hide');
		$('#pauseli').removeClass('hide');
	});
	
	
	
	
	/* TABS */
		$("#tabs li").click(function() {
		//	First remove class "active" from currently active tab
		$("#tabs li").removeClass('active');

		//	Now add class "active" to the selected/clicked tab
		$(this).addClass("active");

		//	Hide all tab content
		$(".tab_content").hide();

		//	Here we get the href value of the selected tab
		var selected_tab = $(this).find("a").attr("href");

		//	Show the selected tab content
		$(selected_tab).fadeIn();

		//	At the end, we add return false so that the click on the link is not executed
		return false;
	});
	
	//Tooltips
	$(".tip_trigger").hover(function(){
		tip = $(this).find('.tip');
		tip.show(); //Show tooltip
	}, function() {
		tip.hide(); //Hide tooltip		  
	}).mousemove(function(e) {
		var mousex = e.pageX + 20; //Get X coodrinates
		var mousey = e.pageY + 20; //Get Y coordinates
		var tipWidth = tip.width(); //Find width of tooltip
		var tipHeight = tip.height(); //Find height of tooltip
		//Distance of element from the right edge of viewport
		var tipVisX = $(window).width() - (mousex + tipWidth);
		//Distance of element from the bottom of viewport
		var tipVisY = $(window).height() - (mousey + tipHeight);
		if ( tipVisX < 20 ) { //If tooltip exceeds the X coordinate of viewport
			mousex = e.pageX - tipWidth - 20;
		} if ( tipVisY < 20 ) { //If tooltip exceeds the Y coordinate of viewport
			mousey = e.pageY - tipHeight - 20;
		} 
		tip.css({  top: mousey, left: mousex });
	});
	
	// accordian
	//Set default open/close settings
	$('.acc_container').hide(); //Hide/close all containers
	//$('.acc_trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container

	//On Click
	$('.acc_trigger').click(function(){
		if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
			$('.acc_trigger').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
			$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
		}
		return false; //Prevent the browser jump to the link anchor
	});
	
	//hover
		$('.customerss').hover(function() {
			$(this).animate({
			height: '390px'
			}, 300);
			},function() {
			$(this).animate({
			height: '300px'
			}, 300);
		});
	
	/*
	var images = [
	'http://lumoslearning.com/llwp/wp-content/themes/twentyeleven/images/b1.jpg',
	'http://lumoslearning.com/llwp/wp-content/themes/twentyeleven/images/b2.jpg',
	'http://lumoslearning.com/llwp/wp-content/themes/twentyeleven/images/b3.jpg'
	];

	$(images).each(function() {
		var image = $('<img />').attr('src', this);
	});
	
	$('<img />').attr('src', 'imageURL.jpg').load(function(){ $('.profile').append( $(this) );   });
*/	
	
	
	/*
		$('.loginform').hover(function() {
			$(this).animate({
			height: '220px'
			}, 300);
			},function() {
			$(this).animate({
			height: '28px'
			}, 300);
		});
	*/	
	
	
	
		$('.schools').css({
				backgroundPosition: "0% 0%"
			}).hover(
				function() {
					$(this).stop().animate({
						'background-position-y': "100%"
					}, "100");
				}, function() {
					$(this).stop().animate({
						'background-position-y': "0%"
					}, "100");
				}
			);
		
	$('#teachers').hoverscroll({
	vertical: false,	// Display the list vertically or horizontally
	width:    400,		// Width of the list container
	height:   100,		// Height of the list container
	arrows:   true,	// Display direction indicator arrows or not
	arrowsOpacity: 0.7,	// Max possible opacity of the arrows
    fixedArrows: false,  // Fixed arrows on the sides of the list (disables arrowsOpacity)
	//rtl:      false     // Print images from right to left
	debug:    false     // Debug output in the firebug console
	});
	
	
	$(".request-demo").colorbox({iframe:true, width:"700px", height:"750px"});
	$(".select-state").colorbox({iframe:true, width:"70%", height:"80%"});
	$(".toc").colorbox({iframe:true, width:"80%", height:"80%"});
	$(".ltpvideo").colorbox({iframe:true, width:"450px", height:"360px"});
	$(".more-link").colorbox({iframe:true, width:"80%", height:"80%"});
	$(".login").colorbox({inline:true, width:"325px",height:"275px"});
	$(".phone").colorbox({inline:true, width:"425px",height:"180px"});

});
