﻿/// <reference path="jquery-1.3.2.js" />
/// <reference path="colorbox/jquery.colorbox.js" />
/// <reference path="carousel/lib/jquery.jcarousel.js" />

$(document).ready(function() {

    //BuildCarousel('mycarousel', 'jcarousel-skin-abs', 'bigList', GetImageList(), '#overviewCarousel',4,102,136);
    BuildCarousel('mycarousel', 'jcarousel-skin-abs', 'vssProCarousel', 'bigList', GetImageList(), '#overviewCarousel', 3, 141, 188);

    //original height:65%, width:65%
    $("a[rel='bigList']").colorbox({ transition: 'elastic', speed: 500, initialWidth: 50, width: 'auto', initialHeight: 50, height: 'auto', opacity: 0.5 });
    $('#overviewCarousel').removeClass('hidden');
});

function GetImageList(){
    var thumbRoot = '/solutions/employee_scheduling_software/vsspro/resources/carousel/';
    var viewsRoot = '/solutions/employee_scheduling_software/vsspro/resources/media/';
    var reportsRoot = '/solutions/employee_scheduling_software/vsspro/resources/sample_schedules/';
	var images = [
	//Sample Views
		{src: thumbRoot + '28-day-view.png', target: viewsRoot + 'Sample_28_Day_View.jpg', title: '28-Day View' },
		{src: thumbRoot + 'weekly-view.png', target: viewsRoot + 'Sample_Weekly_View.jpg', title: 'Weekly View' },
		{src: thumbRoot + 'daily-view.png', target: viewsRoot + 'Sample_Daily_View.jpg', title: 'Daily View' },
	//Sample Reports
        {src: thumbRoot + 'staff-calendar.png', target: reportsRoot + 'staff_calendar.gif', title: 'Staff Calendar' },		
		{src: thumbRoot + 'weekly-schedule.png', target: reportsRoot + 'weekly_schedule.gif', title: 'Weekly Schedule' },
		{src: thumbRoot + 'daily-roster.png', target: reportsRoot + 'daily_roster.gif', title: 'Daily Roster' },
		{src: thumbRoot + 'shift-schedule.png', target: reportsRoot + 'shift_schedule.gif', title: 'Shift Schedule' },
		{src: thumbRoot + 'location.png', target: reportsRoot + 'schedule_by_location.gif', title: 'Schedule by Location' },
		{src: thumbRoot + 'personal-calendar.png', target: reportsRoot + 'personal_calendar.gif', title: 'Personal Calendar' },
		{src: thumbRoot + 'time-off-report.png', target: reportsRoot + 'time_off_report.gif', title: 'Time Off Report' },
        {src: thumbRoot + 'enterprise-hourly-coverage.png', target: '/solutions/employee_scheduling_software/vsspremier/resources/media/Sample_Hourly_Coverage_Report.jpg', title: 'Hourly Coverage [Premier only]' },
		{src: thumbRoot + 'est-cost.png', target: reportsRoot + 'estimated_cost_report.gif', title: 'Estimated Cost Report' },
		];		
	return images;
}

function BuildCarousel(listId, listClass, backgroundClass, rel, imageListArray, targetDiv, visibleElements, imgH, imgW ){
	var list = "<ul id=\"" + listId + "\"  class=\"" + listClass + "\">";
	for (i in imageListArray){
		var item = imageListArray[i];
		list += "<li><a href=" + item.target + " id=\"link" + i + "\" rel=\"" + rel + "\" alt=\"Employee scheduling software - " + item.title + "\" title=\"Employee scheduling software - " + item.title + "\" ><img src=\"" + item.src + "\" width=\"" + imgW + "\" height=\"" + imgH + "\" alt=\"Employee scheduling software - " + item.title + "\" title=\"Employee scheduling software - " + item.title + "\" /></a></li>";
	}	
	list += "</ul>";
	$(targetDiv).html(list);
	$('#' + listId).jcarousel({ visible: visibleElements, scroll: visibleElements, animation: 1500 });

	$('#overviewCarousel .jcarousel-container-horizontal').addClass(backgroundClass);
}


