// JavaScript Document
var j = jQuery.noConflict();

j(document).ready(function() {

	// flash
	if(j('object').size() > 0) {
		var HIAAFlash = j('object');
		var HIASId = '';
		HIAAFlash.each(function() {
			HIASId = j(this).attr('id');
			swfobject.registerObject(HIASId);
			j(this).css({visibility: 'visible'});
		});
	}

	/*j('#nav > ul').superfish({
		delay:         1000,
		autoArrows:    false,
		dropShadows:   false
	});*/

	// zoom
	j('a.graph').colorbox({
		opacity:	0.5
	});
	if(j('th[headers="download"] a.sfoglia').size() > 0) {
		j('th[headers="download"] a.sfoglia').colorbox({
			opacity:	0.5,
			iframe:		true,
			href:		j(this).attr('href'),
			width:		'90%',
			height:		'90%'
		});
	}

	// fadein/out banner
	j('#photos ul').innerfade({
		speed:				1500,
		timeout:			3000,
		containerheight: 	'241px'
	});

	// google map
	if(j('#map').size() > 0) {
		j('#map').jmap('init', {
			mapCenter:				[45.536665, 10.480136],
			mapControl:				'large',
			mapEnableType:			true,
			debugMode:				false,
			language:				"it",
			mapShowjMapsIcon:		false,
			mapZoom:				9,
			mapEnableScrollZoom:	false
		})
		.jmap('AddFeed', {
			feedUrl:	'http://maps.google.it/maps/ms?ie=UTF8&hl=it&vps=2&jsv=321b&msa=0&output=nl&msid=211613554304032790830.00049e1de940bd49f6e9c'
		});
	}

	// pulse
	if(j('.pulse').size() > 0) {
		j('.pulse').effect('pulsate');
	}

	// email address
	if(j('a.email').size() > 0) {
		j('a.email').each(function() {
			var HIASIndirizzo = (j(this).attr('href')).replace('.htm?', '@').replace('=', '.');
			j(this).attr('href', 'mailto:' + HIASIndirizzo);
			j(this).text(HIASIndirizzo);
		});
	}
});
//
