/*

BASE Functions & jQuery init.

==================================================================================================================*/

//jQuery Load
$(document).ready(function() {
		/*Scrolling background clouds */
 
	var offset = 700;
	var offseta = 400;
 
	function scrollbackground() {
		// decrease the offset by 1, or if its less than 1 increase it by
		// the background height minus 1
   		offset = offset + .6;
		offseta = offseta - 1;
		// apply the background position
		if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)))
		{
				$('body.home #clouds2').css("background-position", offseta + "px top");
		}
		else {
   				$('body.home #clouds1').css("background-position", offset + "px top");
				$('body.home #clouds2').css("background-position", offseta + "px top");
		}
   		// call self to continue animation
   		setTimeout(function() {
			scrollbackground();
			}, 100
		);
   	}
 
	// Start the animation
	scrollbackground();
	
	
	$("ul.tabs").tabs("div.panes > div", {
		effect: 'fade',
		rotate: true
	});	
		var api = $("ul.tabs").data("tabs");	
		// go back to previous tab
		$(".controls #prev").click(function() {api.prev();});
		// advance to the next tab
		$(".controls #next").click(function() {api.next();});
	
});


// Print Page
function printThis() {
	(window.print) ? window.print() : alert('To print his page press Ctrl-P on your keyboard \nor choose print from your browser or device after clicking OK');
}
