﻿// Big SlideShow
$(document).ready(function () {
	var textToInsert = "";
	$('#features').html = "";
	$.getJSON("FetchSlideShow.aspx?type=bill", function (result) {
		$.each(result.BillBoardItem, function (i, item) {
			textToInsert += "<div><a href='" + item.Url + "'><img src='" + item.Picture + "' class='featuresPic' alt='' /></a></div>";
		});
		$('#features').append(textToInsert);
		$(function () {
			// initialize scrollable
			$('#features').jshowoff
									(
										{
											controls: true,
											links: false,
											effect: 'fade',
											speed: 10000,
											changeSpeed: 3000
										}
									);
		});
	});
});


// Sliding portfoliogrid
jQuery
(
	function () {
		for (i = 1; i < 999; i++) {
			var moveLeft = Math.floor(Math.random() * 7) * 100;
			var moveTop = Math.floor(Math.random() * 7) * 100;
			var speed = 5000;
			var delay = 10000;
			if (i / 2 == Math.floor(i / 2)) {
				speed = 3500;
				delay = 0;
			}
			else {
				moveLeft -= 50;
				moveTop -= -30;
			}
			$('#dlPortfolioScroller').delay(delay).animate
					(
						{
							left: -moveLeft,
							top: -moveTop
						},
						speed,
						'easeInOutElastic',
						function () {

						}
					) 
		}
	}
)


