// JavaScript Document
var list = new Array();

$(window).load(function() {
	initAllButtons(list);
});

function initAllButtons(list){
	if(list.length==0){
		initGxAnim('#but1');
		initGxAnim('#but2');
		initGxAnim('#but3');
		initGxAnim('#but4');
		initGxAnim('#but5');
		//initGxAnim('#butEsp');
		
	} else {
		var i = 0;
		for(i = 0; i<list.length;i++) {
			initGxAnim(list[i]);
		}
	}
}
function initGxAnim(elemId){
	$(elemId).gxInit({queue: 'cancel'});
	
	if (elemId != '#butEsp'){
		
		$(elemId).hover(function() {
				$(elemId).gx({'left': -14}, 200, 'Sine');
			}, function() {
				$(elemId).gx({'left': -35}, 200, 'Sine');
			}
		);
	
	}
	
	else{
	
		$(elemId).hover(function() {
				
				$(elemId).gx({'top': -10 , 'height': 62}, 200, 'Sine');
				
				
			}, function() {
				
				$(elemId).gx({'top': 0 , 'height': 51}, 200, 'Sine');
			}
		);
	
	}
	
	
	
}
function stopButton(elemId){
	if (elemId != '#butEsp'){
		
		$(elemId).gx({'left': -14}, 200, 'Sine');
	}
	
	else{
	
		$(elemId).gx({'top': 0}, 200, 'Sine');
	
	}
	
}
function mCustomScrollbars(){
	/* 
	1) scroll type (values: "vertical" or "horizontal")
	2) scroll easing amount (0 for no easing) 
	3) scroll easing type 
	4) extra bottom scrolling space for vertical scroll type only (minimum value: 1)
	5) scrollbar height/width adjustment (values: "auto" or "fixed")
	6) mouse-wheel support (values: "yes" or "no")
	7) scrolling via buttons support (values: "yes" or "no")
	8) buttons scrolling speed (values: 1-20, 1 being the slowest)
	*/
	$("#mcs4_container").mCustomScrollbar("vertical",200,"easeOutCirc",1.25,"fixed","yes","no",0); 
}



/* function to fix the -10000 pixel limit of jquery.animate */
$.fx.prototype.cur = function(){
    if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
      return this.elem[ this.prop ];
    }
    var r = parseFloat( jQuery.css( this.elem, this.prop ) );
    return typeof r == 'undefined' ? 0 : r;
}

/* function to load new content dynamically */

function LoadNewContent(id,file){
	$("#"+id+" .customScrollBox .content").load(file,function(){
		mCustomScrollbars();
	});
}
