$().ready(function() { 
	var k, j;j = 1;
	var allImgs = new Array();
	
	jQuery(arr).each(function(){
			allImgs[k] = new Image();
			allImgs[k].src = (this[0] == '/' || this.match('http://')) ? this : baseURL + this;
			k++;
	});	
	$('.kwicks li').click(function () {
		var numero = $(this).attr("id").substr(5);
		if( numero != j ) { $('#fotoHead').fadeOut("3000");	$('#foto').html("<img src='/wp-content/themes/regard/images/foto"+numero+".jpg' width='681' height='240'>").hide().fadeIn("3000"); j = numero; }
	});
	$('.kwicks').kwicks({  
		min: 60,  
		duration: 400,  
		sticky: true,  
		event : 'click'
	});
	
	var idPage2 = 0;
	if( idPage == 31 ){
		idPage2 = 1;
	} else if ( idPage == 33 ) {
		idPage2 = 2;
	} else if ( idPage == 35 ) {
		idPage2 = 3;
	} else if ( idPage == 37 ) {
		idPage2 = 4;
	} else if ( idPage == 946 ) {
		idPage2 = 5;
	} else if ( idPage == 948 ) {
		idPage2 = 6;
	}
	
	$('.kwicks2').kwicks({  
		min : 45,
		spacing : 0,
		defaultKwick: idPage2,
		isVertical : true,
		sticky: true,
		event : 'click'
	});
	if( $("#contenuti").height() < $("#topbar").height() )	$("#contenuti").height( $("#topbar").height() - 60 );
	if( $("#topbar").height() < $("#contenuti").height() )	$("#colpage").height( $("#contenuti").height() + 30 );
	if( $("#col2").height() < $("#col1").height() )	$("#col2").height( $("#col1").height() );
	if( $("#col2").height() < $("#sidebarblog").height() )	$("#col2").height( $("#sidebarblog").height() );
	$("#coldx").height( $("#colsx").height() );
	
	$('#topbar').scrollFollow({
		container: 'colpage',
		offset: 4	});
});

