//JScript
jQuery.noConflict();

(function($) {
$(document).ready(function(){


 

 $("div.press_contentlist").mouseover(function (){  
         
        //mouse over LI and look for A element for transition  
        $(this).find('a')
		.animate( { paddingLeft: '5px',paddingRight: '5px'}, { queue:false, duration:100 } );
		$(this).find('p')
		.css("backgroundPositionx","5px");
		});
		$("div.press_contentlist").mouseout(function (){  
         
        //mouse over LI and look for A element for transition  
        $(this).find('a')
		.animate( { paddingLeft: '0px'}, { queue:false, duration:100 } );
		
		});
     

 
  $("div.info_contentlist").mouseover(function (){  
         
        //mouse over LI and look for A element for transition  
        $(this).find('a')
		.animate( { paddingLeft: '5px',paddingRight: '5px'}, { queue:false, duration:100 } );
		/*$(this).find('p')
		.css("backgroundPositionx","5px");*/
		});
		$("div.info_contentlist").mouseout(function (){  
         
        //mouse over LI and look for A element for transition  
        $(this).find('a')
		.animate( { paddingLeft: '0px'}, { queue:false, duration:100 } );
		
		});




//Get our elements for faster access and set overlay width
	var div = $('#StepsPanel');

	
	//Get menu width
	var divWidth = div.width();
	//Remove scrollbars	
	div.css({overflow: 'hidden'});
	
	//Find last image container
	var firststep = $('#FirstPanel'),
	     secondstep = $('#SecondPanel') , 
                  thirdstep = $('#ThirdPanel'),
                  fourthstep = $('#FourthPanel');
				 fifthstep = $('#FifthPanel');
				 sixthstep = $('#SixthPanel');
				seventhstep = $('#SeventhPanel');
			var	secondmoveSlide = divWidth + divWidth;
			var thirdmoveslide = divWidth + divWidth + divWidth;
			var fourthmoveslide =div.scrollLeft(0,2000);
			
  firststep.click(function(e) {
  //stepScroll('#StepsPanel',0,divWidth);
  div.animate({scrollLeft: divWidth }, 700);
  });
  
   secondstep.click(function(e) {
  // stepScroll('#StepsPanel',divWidth,divWidth + divWidth);
    div.animate({scrollLeft: secondmoveSlide }, 700);
  //div.scrollLeft(divWidth + divWidth); 
  });
  
   thirdstep.click(function(e) {
  // stepScroll('#StepsPanel',divWidth,divWidth + divWidth);
    div.animate({scrollLeft: thirdmoveslide }, 700);
  //div.scrollLeft(divWidth + divWidth); 
  });
  
  fourthstep.click(function(e) {
      div.animate({scrollLeft: fourthmoveslide}, 700);
  }); 
  
   fifthstep.click(function(e) {
  div.scrollLeft(0,2000); });
  
   sixthstep.click(function(e) {
  div.scrollLeft(0,2000); });
  
   seventhstep.click(function(e) {
  div.scrollLeft(0,2000); });
  
  
   
  $('#under21').click(function(e) {
  secondmoveSlide = divWidth + divWidth + divWidth;
   $('#under24').css("font-weight","normal");
	  $('#above24').css("font-weight","normal"); 
  $('#a').css("background-color","#1965AB");
   $('#a').css("color","white");
   $('#under21').css("font-weight","bold");
   $('#b').css("background-color","white");
   $('#b').css("color","#1965AB");
   $('#c').css("background-color","white");
   $('#c').css("color","#1965AB");
   
  });
	
   $('#yes').click(function(e) {
   thirdmoveslide = divWidth + divWidth + divWidth;
   $('#no').css("font-weight","normal");
	 $('#yes').css("font-weight","bold");
    $('#a1').css("background-color","#1965AB");
   $('#a1').css("color","white");
   $('#b1').css("background-color","white");
   $('#b1').css("color","#1965AB");
     
  });
  
   $('#no').click(function(e) {
   thirdmoveslide = divWidth + divWidth + divWidth + divWidth;
   $('#yes').css("font-weight","normal");
	 $('#no').css("font-weight","bold");
    $('#a1').css("background-color","white");
   $('#a1').css("color","#1965AB");
   $('#b1').css("background-color","#1965AB");
   $('#b1').css("color","white");
   
  });
	
   $('#under24').click(function(e) {
   
   secondmoveSlide = divWidth + divWidth;
    $('#under21').css("font-weight","normal");
	 $('#under24').css("font-weight","bold");
	  $('#above24').css("font-weight","normal");
   $('#b').css("background-color","#1965AB");
   $('#b').css("color","white");
   $('#a').css("background-color","white");
   $('#a').css("color","#1965AB");
   $('#c').css("background-color","white");
   $('#c').css("color","#1965AB");

  
  });

  $('#above24').click(function(e) {
     secondmoveSlide = divWidth + divWidth;
	 $('#under21').css("font-weight","normal");
	 $('#under24').css("font-weight","normal");
	  $('#above24').css("font-weight","bold");
   $('#c').css("background-color","#1965AB");
   $('#c').css("color","white");
   $('#a').css("background-color","white");
   $('#a').css("color","#1965AB");
   $('#b').css("background-color","white");
   $('#b').css("color","#1965AB");
   });
  
    $('#above5').click(function(e) {
	fourthmoveslide = divWidth + divWidth + divWidth + divWidth + divWidth;
	$('#above5').css("font-weight","bold");
	 $('#under5').css("font-weight","normal");
	  $('#under2').css("font-weight","normal");
	   $('#none').css("font-weight","normal");
	$('#a11').css("background-color","#1965AB");
   $('#a11').css("color","white");
   $('#b11').css("background-color","white");
   $('#b11').css("color","#1965AB");
   $('#c11').css("background-color","white");
   $('#c11').css("color","#1965AB");
    $('#d11').css("background-color","white");
   $('#d11').css("color","#1965AB");
	 });
  
    $('#under5').click(function(e) {
	fourthmoveslide = divWidth + divWidth + divWidth + divWidth + divWidth ;
	$('#above5').css("font-weight","normal");
	 $('#under5').css("font-weight","bold");
	  $('#under2').css("font-weight","normal");
	   $('#none').css("font-weight","normal");
	$('#b11').css("background-color","#1965AB");
   $('#b11').css("color","white");
   $('#a11').css("background-color","white");
   $('#a11').css("color","#1965AB");
   $('#c11').css("background-color","white");
   $('#c11').css("color","#1965AB");
    $('#d11').css("background-color","white");
   $('#d11').css("color","#1965AB");
	});
  
    $('#under2').click(function(e) {
	fourthmoveslide = divWidth + divWidth + divWidth + divWidth + divWidth + divWidth;
	$('#above5').css("font-weight","normal");
	 $('#under5').css("font-weight","normal");
	  $('#under2').css("font-weight","bold");
	   $('#none').css("font-weight","normal");
	$('#c11').css("background-color","#1965AB");
   $('#c11').css("color","white");
   $('#a11').css("background-color","white");
   $('#a11').css("color","#1965AB");
   $('#b11').css("background-color","white");
   $('#b11').css("color","#1965AB");
    $('#d11').css("background-color","white");
   $('#d11').css("color","#1965AB");
	});
  
    $('#none').click(function(e) {
	fourthmoveslide = divWidth + divWidth + divWidth + divWidth + divWidth + divWidth;
	$('#above5').css("font-weight","normal");
	 $('#under5').css("font-weight","normal");
	  $('#under2').css("font-weight","normal");
	   $('#none').css("font-weight","bold");
	$('#d11').css("background-color","#1965AB");
   $('#d11').css("color","white");
   $('#a11').css("background-color","white");
   $('#a11').css("color","#1965AB");
   $('#c11').css("background-color","white");
   $('#c11').css("color","#1965AB");
    $('#b11').css("background-color","white");
   $('#b11').css("color","#1965AB");
	 });
  
});


$("span#info_heading").click( function(e) { 
$("span#info_heading").removeClass('notselected');
$("span#press_heading").addClass('notselected');
$("div#newsContent").hide();
$("div#infosessioncontent").show();
$('#viewinfo').attr('href', 'mba-program/admissions/tour-dates'); 
});


$("span#press_heading").click( function(e) { 
$("span#press_heading").removeClass('notselected');
$("span#info_heading").addClass('notselected');
$("div#newsContent").show();
$("div#infosessioncontent").hide();
$('#viewinfo').attr('href', 'about-hult/press'); 
});


$('div#press_height').jScrollPane({showArrows:true});
$('div#infosession_height').jScrollPane({showArrows:true});
$("div#infosessioncontent").hide();
//makeScrollable("div.press_content_height", "div.press_content_wrapper");
//makeInfoScrollable("div.infosession_content_height", "div.infosession_content_wrapper");

function makeScrollable(wrapper, scrollable)
{
	
$(wrapper).mousemove(function(e) {

		//Sidebar Offset, Top value
		var s_top = parseInt($(wrapper).offset().top);		
		
		//Sidebar Offset, Bottom value
		var s_bottom = parseInt($(wrapper).height() + s_top);
	
		
		var mheight = parseInt($(scrollable).height());
	        var scrollspeed = Math.round( mheight / parseInt($(wrapper).height()));

		if( scrollspeed > 5) //if the scroll height is more default it to the min value to avoid speed scroll
                {
		 scrollspeed = 5;
		}
	
		//Calculate the top value
		//This equation is not the perfect, but it 's very close	
		//var top_value = Math.round(( (s_top - e.pageY) /100) * mheight / 2)

		if(e.pageY > 518)
                {
		//var top_value = Math.round((s_top - e.pageY) * scrollspeed)
		var top_value = Math.round(( (s_top - e.pageY) /200) * mheight / 3)
		//Animate the #menu by chaging the top value
		$(scrollable).animate({top: top_value}, { queue:false, duration:100});
                }
	});

$(wrapper).mouseleave(function(e) {
		
		//Animate the #menu by chaging the top value
		$(scrollable).animate({top: 0}, { queue:false, duration:500});
	});
	
} 

function makeInfoScrollable(wrapper, scrollable)
{
	
$(wrapper).mousemove(function(e) {

		//Sidebar Offset, Top value
		var s_top = parseInt($(wrapper).offset().top);		
		
		//Sidebar Offset, Bottom value
		var s_bottom = parseInt($(wrapper).height() + s_top);
	
		
		var mheight = parseInt($(scrollable).height());
        var scrollspeed = Math.round( mheight / parseInt($(wrapper).height()));

	
		//Calculate the top value
		//This equation is not the perfect, but it 's very close	
		//var top_value = Math.round(( (s_top - e.pageY) /100) * mheight / 2)

		if(e.pageY > 518)
                {
		//var top_value = Math.round((s_top - e.pageY) * scrollspeed)
		var top_value = Math.round(( (s_top - e.pageY) /300) * mheight / 4)
		//Animate the #menu by chaging the top value
		$(scrollable).animate({top: top_value}, { queue:false, duration:100});
                }
	});
	
	$(wrapper).mouseleave(function(e) {
		
		//Animate the #menu by chaging the top value
		$(scrollable).animate({top: 0}, { queue:false, duration:500});
	});
}




})(jQuery);

