	function popUp(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=781,height=600,left = 390,top = 262');");
	}

$(document).ready(function() { 
						   
$("#thumbs a").click(function(e) { 
	e.preventDefault();
	var largePath = $(this).attr("href"); 
	$("#largeImg").html("<img src='" + largePath + "' />");
}); 


var allElements = $('div.thumbnails a'),
	WRAP_BY = 6;
for (var i = 0; i < allElements.length; i += WRAP_BY) {
	//first loop, elements 0 : 15, next loop elements 15:30 and so on
	allElements.slice(i, i + WRAP_BY).wrapAll('<div />');
}

	
$('#scroller').cycle({ 
	fx:      'fade', 
	speed:    4000, 
	timeout:  5000 ,
	pause:    1
});
	
$('div#slideshow').cycle({ 
	fx:     'scrollHorz', 
	timeout: 9000, 
	delay:  -2000,
	next:   'a#next', 
	prev:   'a#prev',
	cleartypeNoBg: true,
	pause:   1
});

$('div#gallery').cycle({
	fx: 'scrollHorz',
	timeout: 0,
	delay: -2000,
	next: 'a#next',
	prev: 'a#prev',
	cleartypeNoBg: true,
	pause: 1
});

$('div.logorotate').cycle({ 
	fx:      'fade', 
	speed:    4000, 
	timeout:  5000,
	cleartypeNoBg: true
});

/*
$('div.caserotate').cycle({ 
	fx:      'fade', 
	speed:    8000, 
	timeout:  5000,
	cleartypeNoBg: true
});
*/

//$('div.thumbnails_rotator').cycle({ 
//	fx:      'fade', 
//	speed:    4000, 
//	timeout:  5000 
//});

$('a.showmoremilano').click(function() {
    $('#moremilano').toggle(100);
    return false;
  });

		$(function () {
			var tabContainers = $('div.tabs > div');
			tabContainers.hide().filter(':first').show();
			
			$('div.tabs ul.tabNavigation a').click(function () {
				tabContainers.hide();
				tabContainers.filter(this.hash).show();
				$('div.tabs ul.tabNavigation a').removeClass('selected');
				$(this).addClass('selected');
				return false;
			}).filter(':first').click();
		});
		
});

