function SetAllCheckBoxes(FormName, FieldName, CheckValue)

{

if(!document.forms[FormName])

return;

var objCheckBoxes = document.forms[FormName].elements[FieldName];

if(!objCheckBoxes)

return;

var countCheckBoxes = objCheckBoxes.length;

if(!countCheckBoxes)

objCheckBoxes.checked = CheckValue;

else

// set the check value for all check boxes

for(var i = 0; i < countCheckBoxes; i++)

objCheckBoxes[i].checked = CheckValue;

}







function my_hide_div(itm)

{

	if ( ! itm ) return;

	

	itm.style.display = "none";

}



function my_show_div(itm)

{

	if ( ! itm ) return;

	

	itm.style.display = "";

}



function ShowHide(id1, id2)

{

	if (id1 != '') toggleview(id1);

	if (id2 != '') toggleview(id2);

}

function ShowDiv(id1, id2)

{

	if (id1 != '') toggleview_1(id1);

	if (id2 != '') toggleview_1(id2);

}

function HideDiv(id1, id2)

{

	if (id1 != '') toggleview_2(id1);

	if (id2 != '') toggleview_2(id2);

}

	

/*-------------------------------------------------------------------------*/

// Get element by id

/*-------------------------------------------------------------------------*/



function my_getbyid(id)

{

	itm = null;

	

	if (document.getElementById)

	{

		itm = document.getElementById(id);

	}

	else if (document.all)

	{

		itm = document.all[id];

	}

	else if (document.layers)

	{

		itm = document.layers[id];

	}

	

	return itm;

}



function toggleview(id)

{

	if ( ! id ) return;

	

	if ( itm = my_getbyid(id) )

	{

		if (itm.style.display == "none")

		{

			my_show_div(itm);

		}

		else

		{

			my_hide_div(itm);

		}

	}

}



function toggleview_1(id)

{

	if ( ! id ) return;

	

	if ( itm = my_getbyid(id) )

	{

		if (itm.style.display == "none")

		{

			my_show_div(itm);

		}

		else

		{

			my_show_div(itm);

		}

	}

}



function toggleview_2(id)

{

	if ( ! id ) return;

	

	if ( itm = my_getbyid(id) )

	{

		if (itm.style.display == "none")

		{

			my_hide_div(itm);

		}

		else

		{

			my_hide_div(itm);

		}

	}

}















function nascondi(id)

{

	if ( ! id ) return;

	

	if ( itm = my_getbyid(id) )

	{

		

			my_hide_div(itm);

		

	}

}



function mostra(id)

{

	if ( ! id ) return;

	

	if ( itm = my_getbyid(id) )

	{

		

			my_show_div(itm);

		

	}

}







function ingrandimento(foto,w,h)

	{

	

	var pw = Math.floor((screen.width-w)/2);

	var ph = Math.floor((screen.height-h)/2);

	

	i1 = new Image;

	i1.src = foto;

	html = '<HTML>\n<HEAD>\n<TITLE>:: PianetaVacanze.it - Ingrandimento Foto ::</TITLE>\n</HEAD>\n<CENTER><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0 BGCOLOR="#243F30">\n<A href="javascript:self.close();"><IMG SRC="'+foto+'" BORDER=0 alt="Clicca per chiudere la finestra" NAME=imageTest" width="' + w + '" height="' + h + '"></A></CENTER>\n</BODY>\n</HTML>';

	popupImage = window.open('','_blank',"top="+ph+",left="+pw+",width="+w+",height="+h,'toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0');

	popupImage.document.open();

	popupImage.document.write(html);

	popupImage.document.close()

	};

	

	//per i thumbnail

	function ingrandimento1(foto,w,h)

	{

	

	var pw = Math.floor((screen.width-w)/2);

	var ph = Math.floor((screen.height-h)/2);

	

	i1 = new Image;

	i1.src = foto;

	html = '<HTML>\n<HEAD>\n<TITLE>:: PianetaVacanze.it - Ingrandimento Foto ::</TITLE>\n</HEAD>\n<CENTER><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0 BGCOLOR="#243F30">\n<A href="javascript:self.close();"><IMG SRC="'+foto+'" BORDER=0 alt="Clicca per chiudere la finestra" NAME=imageTest"></A></CENTER>\n</BODY>\n</HTML>';

	popupImage = window.open('','_blank',"top="+ph+",left="+pw+",width="+w+",height="+h+",scrollbars=yes, resizable=yes");

	popupImage.document.open();

	popupImage.document.write(html);

	popupImage.document.close()

	};







