$(document).ready(function () {

    //Scroll the Home Page images
    $(".HomeGallery").carouFredSel({
	width:450,
	items:{start:0,visible:1},
	scroll:{items:1, pauseOnHover:true, duration:2000, easing:'linear'},
	auto:{pauseDuration:5000}
    });
	
	//Set class for current active page in main navigation
	var pathname = window.location.pathname;
    var linkHref = "";
    $(".sidebar ul#menuElem li a").each(function () {
        linkHref = $(this).attr("href");
        if (pathname.indexOf(linkHref.substring(0, (linkHref.length - 5))) > -1) {
            $(this).addClass("current");
        }
    })	

    //Colorbox - Modals
    $("a.colorbox_form").colorbox({ opacity: "0.75", width: "700px", height: "500px", iframe: true });
    $("a.galleryImage").colorbox({ opacity:"0.75", photo:true, maxHeight:"75%", maxWidth:"75%" });	

});
