
	$(document).ready(function(){
			
		//Call to actions buttons	
			$(".cta-off").hover(function(){
				$(this).attr("class", "cta-on");
				//$(this).css("opacity", 0.3);
				$("li.cta-on .cta-heading").css("color", "#ffcc00");
					
							/*b=-100;
							d=311;*/
						var $a=$(this).position();
						var $c=$("li.cta-on #cta-body").height();
						if(($a.top=0)&&($c=180)){
						
						$a=-100;
						$c=311;
							
						}
						else{
						
						$a=-100;
						$c=311;
						
						}
						console.log($a, $c);
						$(this).stop(true, true).animate({
								top: $a+"px",
								}, 500, function(){
								$("li.cta-on #cta-body").animate({
											height: $c+"px",
											}, 400, function(){
											$("li.cta-on .learn").attr("class","learn-hover");
											});
								
								});

						
						//$(this).fadeTo(200, 1);
						
					return false;
					}, function(){
						
						$(this).attr("class", "cta-off");
					//	$(this).css("opacity", 0.3);
						$("li.cta-off .cta-heading").css("color", "#09f");
								/*	b=0;
									d=180;*/
							var $a=$(this).position();
							var $c=$("li.cta-off #cta-body").height();		
							if(($a.top=-100)&&($c=311)){
								
								$a=0;
								$c=180;
									
								}
								else{
								
								$a=0;
								$c=180;
								
								}
							console.log($a, $c);
							$(this).stop(true, true).animate({
									top: $a+"px",
									}, 200, function(){
									$("li.cta-off #cta-body").animate({
												height: $c+"px",
												}, 100, function(){
												$("li.cta-off .learn-hover").attr("class","learn");	
												});
									
									});
						//	$(this).fadeTo(600, 0.7);
							return false;
						
					});
				//banner
				
				var index = 1;
    			setInterval(images,6000);
				function images() {
					if(index < 5) {
						index += 1;
						$("#banner-images").fadeOut(300,function(){
							$("#banner-images img").attr("src","http://localhost/jp/resources/css/images/banner"+index+".png");
							$("#banner-images").fadeIn(3000);
						});
						
						$("#preview").fadeOut(300,function(){
							$("#preview img").attr("src","http://localhost/jp/resources/css/images/cleverlearn"+index+".jpg");
							$("#preview").fadeIn(3000);
						});
	
					} else {
						index = 1;
					}
				}
				
				//Gallery
		
				    var galleries = $('.ad-gallery').adGallery();
					$('#switch-effect').change(
					  function() {
						galleries[0].settings.effect = $(this).val();
						return false;
					  }
					);
					$('#toggle-slideshow').click(
					  function() {
						galleries[0].slideshow.toggle();
						return false;
						console.log(a);
					  }
					  
					);
			
	});
			
	

