window.onload = function() {	//preloader
$(document).ready(function(){

/*SLIDER*/
//Edit this:
	var promowidth = 980;
	var numberofpromo = 3;
	var speed = 500;
//end
	var totalwidth = promowidth * numberofpromo;
	var max_animation = totalwidth - promowidth;
	$("#slider_promo ul").css({"width" : totalwidth});	//add width to slider

	var temp_animate = 0;
//functions
	function slider_next() {
		if (temp_animate == (max_animation)) {
			temp_animate = 0;
			$("#slider_promo ul").animate( { marginLeft: temp_animate }, speed );
		} else {
			temp_animate = temp_animate + promowidth;
			$("#slider_promo ul").animate( { marginLeft: -temp_animate }, speed );
		};
	};
	function slider_prev() {
		if (temp_animate == 0) {
			temp_animate = max_animation;
			$("#slider_promo ul").animate( { marginLeft: -temp_animate }, speed );
		} else {
			temp_animate = temp_animate - promowidth;
			$("#slider_promo ul").animate( { marginLeft: -temp_animate }, speed );
		};
	};
/*	function slider_intro() {
		$("#slider_promo ul").animate({marginLeft : -totalwidth+promowidth}, 0);
		$("#slider_promo ul").delay(500);
		$("#slider_promo ul").animate({marginLeft : 0}, 250);
	};
	slider_intro();
*/
	$(".slider_next").click(function () {
		slider_next();
	});
	$(".slider_prev").click(function () {
		slider_prev();
	});
	
	


	
/*Light box*/
	$(function() {
		$('.lightbox a.thumb, a.lightbox').lightBox({fixedNavigation:true});
	});
	
	
/*IE debug: Opacity*/
	$(".thumb").css({"opacity" : "0.6"});
	$(".thumb").mouseover(function(){
		$(this).css({"opacity" : "1"});
	}).mouseleave(function(){
		$(this).css({"opacity" : "0.6"});
	});

});
};

