function setDivContentSize(){
   var h = $(window).height();

   h = (h-330);
   
   $(function(){
		$('#main-content').css('height',h);
		$('#mcs_container').css('height',h-34);
		$('#mcs_container .dragger_container').css('height',h-44);		 
		$('#mcs2_container').css('height',h-64);
		$('#mcs2_container .dragger_container').css('height',h-74);
		
		mCustomScrollbars();

	});
   
}

$(window).ready(function() {
  setDivContentSize();
});

$(window).resize(function() {
 setDivContentSize();
});

$(window).load(function() {
 setDivContentSize();
});

function mCustomScrollbars(){
	
	if ( $("#mcs_container").length ) {
		$("#mcs_container").mCustomScrollbar("vertical",200,"easeOutCirc",1.25,"fixed","yes","no",0);
	}
	
	if ( $("#mcs2_container").length ) {
		$("#mcs2_container").mCustomScrollbar("vertical",200,"easeOutCirc",1.25,"fixed","yes","no",0);
	}
	
	
}


$.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 LoadNewContent(id,file){
	$("#"+id+" .customScrollBox .content").load(file,function(){
		mCustomScrollbars();
	});
}
