// JavaScript Document
function slide(x,y){

$(".info").animate({
		 marginLeft:x+"px"} , 500);
		if(y!=='back'){
		 	unhighlight(y);
			$("#back").css("display","inline");
		}else{
		 	highlight();
			$("#back").css("display","none");
		}
		 $(".menubutton#"+y).hover(function(){
		$(this).css("backgroundPosition","bottom");
		}, function() {
  		$(this).css("backgroundPosition","bottom");
		});
		

		 
		 }
function highlight(){
//var buttonarray2= new Array('hs','yoga','stu','pre','aplus','aboutus');
	$(".menubutton").hover(function(){
		$(this).css("backgroundPosition","bottom");
		}, function() {
  		$(this).css("backgroundPosition","bottom");
		});
	//for(var i=0;i<buttonarray2.length;i++){
		$(".menubutton").css("backgroundPosition","bottom")
	//}
		

}
function unhighlight(y){
var buttonarray= new Array('hs','yoga','stu','pre','aplus','aboutus');
//buttonarray=('hs','yoga','stu','pre','aplus','aboutus');

if (!Array.prototype.indexOf)
{
  Array.prototype.indexOf = function(elt /*, from*/)
  {
    var len = this.length >>> 0;
 
    var from = Number(arguments[1]) || 0;
    from = (from < 0)
         ? Math.ceil(from)
         : Math.floor(from);
    if (from < 0)
      from += len;
 
    for (; from < len; from++)
    {
      if (from in this &&
          this[from] === elt)
        return from;
    }
    return -1;
  };
}


buttonarray.splice(buttonarray.indexOf(y), 1);
	for(var i=0;i<buttonarray.length;i++){
		$(".menubutton#"+buttonarray[i]).hover(function(){
		$(this).css("backgroundPosition","bottom");
		}, function() {
  		$(this).css("backgroundPosition","top");
		});
		$(".menubutton#"+buttonarray[i]).css("backgroundPosition","top");
		
	}
		

}