
//START - Funzioni per il guestbook//
function showFlag(url, image_field, form, field, extra) {
	if (!document.images) 
	{return}
	if(extra == 'undefined')
	{extra = '';}
	document.images[image_field].src = url + document[form][field].options[document[form][field].selectedIndex].value+extra
}

function textareaLenght(short_notice) {
  if(short_notice.value.length>500) {
    alert("Attenzione!! Nel testo introduttivo puoi inserire al Max 500 caratteri!!");
    short_notice.value=short_notice.value.substring(0,500);
  }
}

function textCounter(field, countfield, maxlimit) {
  if (field.value.length > maxlimit)
  field.value = field.value.substring(0, maxlimit);
  else
  countfield.value = maxlimit - field.value.length;
}
//END - Funzioni per il guestbook//


//START - Funzioni per la photo-gallery
function zoom_image(PATHFILE, IMAGE, Wimg, Himg) {

    var LARGHEZZA = (parseFloat(Wimg)+20);
    var ALTEZZA = (parseFloat(Himg)+20);

    var pop=window.open('about:blank', 'popwin', 'width='+LARGHEZZA+',height='+ALTEZZA);
    pop.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n');
    pop.document.write('<html>\n<head>\n');
    pop.document.write('<title>View Taibi M. Image</title>\n');
    pop.document.write('<style type="text/css">\nbody {margin:0px;padding:9px;\nbackground-color:#FFFFFF;color:#000000;\ntext-align:center;background-color:#EDD7B8;}\nimg {margin:0px auto;\nborder:1px solid #704D1D;}\n.cur {cursor:pointer;}\n</style>\n</head>\n');
    pop.document.write('<body onclick="window.close();">\n');
    pop.document.write('<img src="'+PATHFILE+'/'+IMAGE+'" width="'+Wimg+'" height="'+Himg+'" alt="immagine selezionata" class="cur" />\n');
    pop.document.write('</body>\n</html>');
    pop.document.close();
    pop.focus();
}
//END - Funzioni per la photo-gallery
