// Easing equation, borrowed from jQuery easing plugin
// http://gsgd.co.uk/sandbox/jquery/easing/
jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

jQuery(function( $ ){
	
	$('#slideshow').serialScroll({
		items:'li',
		prev:'#screen2 a.prev',
		next:'#screen2 a.next',
		//offset:-230, //when scrolling to photo, stop 230 before reaching it (from the left)
		start:1, //as we are centering it, start at the 2nd
		//duration:1200,
		//interval:2000, 
		//force:true,
		stop:true,
		lock:false,
		cycle:true, //don't pull back once you reach the end
		//easing:'easeOutQuart', //use this easing equation for a funny effect
		jump: false,//click on the images to scroll to them,
		lazy:true
	});


});
function resize(){
	var cnt=Math.round(($(window).width()-250)/200)*200;
			
		    $('#slideshow').css('width', cnt + 'px');
			if ($(window).width()<1100){
				$('.header_menu1').css('letter-spacing', '1px');
				$('#flag1').css('padding-left', '5px');		
				$('.block').css('width', '24%');	
				$('.fback').css('width', '30%');	
				$('.tags_main').css('width', '93%');
				$('#menu').css('width', '540px');
				$('#disigners').css('width', '98%');
				$('.footer_text').css('width', '26%');
				$('.footer').css('width', '26%');
				$('#w3c').css('width', '600px');
				
			}
			else {
				
				$('#flag1').css('padding-left', '80px');
				$('.header_menu1').css('letter-spacing', '3px');
				$('.block').css('width', '308px');
				$('.fback').css('width', '303px');
				$('.tags_main').css('width', '991px');
				$('#menu').css('width', '800px');
				$('#disigners').css('width', '1050px');	
				$('.footer_text').css('width', '313px');
				$('.footer').css('width', '313px');	
				$('#w3c').css('width', '912px');
			}
	}
		$(document).ready(function() {
			resize();
		});
		$(window).resize(function() {			
			resize();
		});
var i=0;
	var portfolioId=[];
	var portfolioImage=[];
	var portfolioTitle=[];
$(document).ready(function(){ 
	for (i = 0; i < 9; i++) if (portfolioId[i]!='undefined'){
		$('#slider').html($('#slider').html() + "<li><a href='index.php?id=" + 	portfolioId[i] + "'><img class='portfolio' src='" + portfolioImage[i] + "' alt='' /></a><div><a href='index.php?id=" + portfolioId[i] + "'>" + portfolioTitle[i] + "</a></div></li>");
	}
	
//	alert($('#slider').html())
});
function incr(){
if (i!=total-1){
i++;
$('#slider').html($('#slider').html() + "<li><a href='index.php?id=" + 	portfolioId[i] + "'><img class='portfolio' src='" + portfolioImage[i] + "' alt='' /></a><div><a href='index.php?id=" + portfolioId[i] + "'>" + portfolioTitle[i] + "</a></div></li>");

}
}
