/*
set scripts
*/

$(document).ready(function(){
				//Examples of how to assign the ColorBox event to elements
				//$('a#colorBox').colorbox({rel:'nofollow'});
				$('a#colorBox').colorbox();
				$("a#colorBox[rel='elearning']").colorbox({width:"88%", height:"100%", iframe:true,});
				
				// initialize spacegallery
				$('div#myGallery').spacegallery({loadingClass: 'loading'});
				
				//striped tables
				$("table.tableList tr:odd").addClass("odd");
				
				// initialize scrollable 
    			$("div#scrollCasestudy.scrollable").scrollable({ 
					size: 1,
					easing: 'custom',
					speed: 500
				});
				// custom easing called "custom" 
				$.easing.custom = function (x, t, b, c, d) { 
   					 var s = 1.70158;  
    				if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 
    				return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 
				};
				
	// initialize scrollable2 
    $("div#scrollBrands.scrollable").scrollable({
		size: 30,
	});
				
	$(".items img.brandGallery").click(function() { 
 
    // calclulate large image's URL based on the thumbnail URL  
    var url = $(this).attr("src").replace("-sm", ""); 
 
    // get handle to element that wraps the image and make it semitransparent 
    var wrap = $("#image_wrap").fadeTo("medium", 0.5); 
 
    // the large image  
    var img = new Image(); 
 
    // call this function after it's loaded 
    img.onload = function() { 
 
        // make wrapper fully visible 
        wrap.fadeTo("fast", 1); 
 
        // change the image 
        wrap.find("img").attr("src", url); 
 
    }; 
 
    // begin loading the image from flickr 
    img.src = url; 
 
	// when page loads simulate a "click" on the first image 
	}).filter(":first").click();

								
});
