Slider = {
	Initialize : function(images)
	{
		$(function() {
			for (var i=0;i<images.length;i++)
			{
				var pic = images[i];
				
				var relLink = 'scrollable_picture_' + i.toString();
				
				var headerText = '<h2>' + pic.title + '</h2><br />';
				//var imgTag = '<img src="' + pic.thumb + '" alt="' + pic.title + '" rel="#' + relLink + '" />';
				var imgTag = '<a class="img" href="' + pic.image + '" rel="facebox[.bolder]"><img src="' + pic.thumb + '" alt="' + pic.title + '" /></a>';
				var captionText = '<i>' + pic.text + '</i>';
				
				var videoLink = '';
				if (pic.video != '' && pic.video != null) {				
					var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
					if (is_chrome==true) {
						videoLink = '<a class="watchvideo-btn" href="/product/movie.asp?url=' + pic.video + '" rel="facebox[.bolder]"><button type="button">' + pic.videoCaption + '</button></a>';
					} else {	
						videoLink = '<a class="watchvideo-btn" href="/product/movie.asp?url=' + pic.video + '" rel="facebox[.bolder]"><button type="button">' + pic.videoCaption + '</button></a>';
					}
				}
				
				$(".scrollable .items").append('<div class="panel"><div class="inside">' + headerText + '<div>' + imgTag + '</div><p>' + captionText + '</p>' + videoLink + '</div></div>');
				
				$("#overlayContainer").append('<div class="apple_overlay black" id="'+ relLink + '"><img src="' + pic.image + '" style="width: 650px; margin: 15px 0 0 20px;" /></div>');
				
				//
				
			}
			$(".scrollable").scrollable({
				size:1,
				clickable : false
			});
			
			$("a[rel]").overlay({
				expose: '60554f',
				effect: 'apple',
				onBeforeLoad: function() {
					var wrap = this.getContent().find(".contentWrap");
					wrap.load(this.getTrigger().attr("href"));
				} 
			});			
			
			$(".scrollable img[rel]").overlay({effect: 'apple'});
		});
	}
}
