$(document).ready(function()
{
	/***********************************************************************************************
	* heights regulations
	* $('#div_id').get(0) == $('#div_id')[0] == document.getElementById('div_id');
	*/
	var h_col_sx = 0, h_col_dx = 0, tmp = 0, final_height = 0;

	h_col_sx = $('#column-sx').outerHeight({margin: true});
	h_col_dx = $('#column-dx').outerHeight({margin: true});
	if(h_col_sx > h_col_dx)
	{
		tmp = h_col_sx - h_col_dx;
		if($('#content-home').get(0)) {
			final_height = $('#content-home').outerHeight({margin: true}) + tmp;
			$('#content-home').height(final_height);
		}
		if($('#contenuti').get(0)) {
			final_height = $('#contenuti').outerHeight({margin: true}) + tmp;
			$('#contenuti').height(final_height);
		}
	}
})

// Cambio l'immagine di bg mettendo quella per l'hover
function hoverMenu(voce_menu) {
	var voce = document.getElementById(voce_menu);
	if(SEASON != '1')
		voce.style.background = "#8fa033";
	else
		voce.style.background = "#7090c7";
}
	
// Tolgo l'immagine di hover e rimetto quella normale
function leaveHover(voce_menu) {
	var voce = document.getElementById(voce_menu);
	voce.style.background = "none";
}

function checkPhotoCommunity()
{
	if(
		document.newPhotoCommunityPost.powercontent_name_ContentObjectAttribute_ezstring_data_text_pcattributeid.value != '' &&
		document.newPhotoCommunityPost.powercontent_photocommunity_where_ContentObjectAttribute_ezstring_data_text_pcattributeid.value != '' &&
		document.newPhotoCommunityPost.powercontent_photocommunity_when_ContentObjectAttribute_ezstring_data_text_pcattributeid.value != '' &&
		document.newPhotoCommunityPost.powercontent_photocommunity_body_ContentObjectAttribute_data_text_pcattributeid.value != '' &&
		document.newPhotoCommunityPost.powercontent_photocommunity_image_ContentObjectAttribute_data_imagename_pcattributeid.value != ''
	)
	{
	if(document.newPhotoCommunityPost.powercontent_photocommunity_accetto_ContentObjectAttribute_data_boolean_pcattributeid.checked == true)
		{
			document.newPhotoCommunityPost.submit();
		}
		else
		{
			alert('Se non si accetta la privacy non viene permesso l\'invio della foto');
		}
	}
	else
	{
		var errors = '';
		if(document.newPhotoCommunityPost.powercontent_name_ContentObjectAttribute_ezstring_data_text_pcattributeid.value == '')
		{
			errors += 'Inserire "Titolo della foto"';
		}
		if(document.newPhotoCommunityPost.powercontent_photocommunity_where_ContentObjectAttribute_ezstring_data_text_pcattributeid.value == '')
		{
			errors += '\nInserire "Dove hai scattato la photo"';
		}
		if(document.newPhotoCommunityPost.powercontent_photocommunity_when_ContentObjectAttribute_ezstring_data_text_pcattributeid.value == '')
		{
			errors += '\nInserire "Quando hai scattato la photo"';
		}
		if(document.newPhotoCommunityPost.powercontent_photocommunity_body_ContentObjectAttribute_data_text_pcattributeid.value == '')
		{
			errors += '\nInserire "Descrizione della foto"';
		}
		if(document.newPhotoCommunityPost.powercontent_photocommunity_image_ContentObjectAttribute_data_imagename_pcattributeid.value == '')
		{
			errors += '\nInserire la foto!';
		}
		alert(errors);
	}
}

function checkComment()
{
	if(document.newComment.powercontent_abstract_ContentObjectAttribute_data_text_pcattributeid.value != '')
	{
		document.newComment.submit();
	}
}



