	$(function(){
			$('#slider').anythingSlider();
		});
				$(function(){
			$('#slider').anythingSlider({
				resizeContents      : true,
				addWmodeToObject    : 'transparent',
				navigationFormatter : function(index, panel){ // Format navigation labels with text
					return ['Vimeo-iframe', 'Vimeo-embed', 'YouTube-iframe', 'YouTube-embed', 'HTML5 Video'][index - 1];
				}
			});
		});
		$(window).load(function() {
	mCustomScrollbars();
});

function mCustomScrollbars(){
	/* 
	malihu custom scrollbar function parameters: 
	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",600,"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();
	});
}
        $(function (){
            //facebook widget
            $(".facebook").hover(function(){
                $(".facebook").stop(true, false).animate({left:"-9"},"medium");
            },function(){
                $(".facebook").stop(true, false).animate({left:"-214"},"medium");
            },500);
        });
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel();
});	
/* FancyBox Start */
$(document).ready(function() {
		$(".fancyIMG").fancybox();
	});
	$("a[rel=group]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
			$(document).ready(function() {
		$(".fancyYouTube").click(function() {
		$.fancybox({
			'transitionIn'	:	'elastic',
			'transtionsOut' : 	'elastic',
			'width'			:	680,
			'height'		:	459,
			'href'			:	this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			:	'swf',
			'swf'			: {
			'wmode'				: 'transparent',
			'allowfullscreen'	: 'true'
			}
		});
		return false;
		});
	});	
/* FancyBox End */
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=600,height=540,scrollbars=yes');
return false;
}
//-->
