<!--
// -----------------------------------------------------------------
// 	utils.js
// -----------------------------------------------------------------
function open_win( page,w,h )
{
		window.open( page,'','resizable,scrollbars=0,menubar=0,width='+w+',height='+h,'');
}
function open_gallery( page ) 
{
	window.open( page,'','resizable,scrollbars=0,menubar=0,width=800,height=580','');
}
function showimage( img_filename ) {
   w = window.open( '','','resizable=1,scrollbars=0,menubar=0,width=780,height=560','' );
   w.document.write( "<html><head><title>Il Giardino dei Trulli</title>" );
   w.document.write( "<link href='gallery.css' rel='stylesheet' type='text/css'>" );
   w.document.write( "</head>" );
   w.document.write( "<body>" );
   w.document.write( "<table width='100%' height='100%' border='0'><tr><td align='center' valign='middle'>" );
   s = "<img src='" + img_filename + "'>";
   w.document.write( s );
   w.document.write( "</td></tr>" );
   w.document.write( "<tr><td align='center' valign='top'><p><a href='javascript:this.close();'>Chiudi/Close</a></p></td></tr>" );
   w.document.write( "<tr><td>&nbsp;</td></tr>" );
   w.document.write( "</table>" );
   w.document.write( "</body></html>" );
   w.document.close();
   w.focus();
}
function showbigimage( img_filename ) {
   w = window.open( '','','resizable=1,scrollbars=1,menubar=0,width=820,height=620','' );
   w.document.write( "<html><head><title>Il Giardino dei Trulli</title>" );
   w.document.write( "<link href='gallery.css' rel='stylesheet' type='text/css'>" );
   w.document.write( "</head>" );
   w.document.write( "<body bgcolor='#FFFFFF' topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>" );
   w.document.write( "<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td align='center' valign='middle'>" );
   s = "<img src='" + img_filename + "'>";
   w.document.write( s );
   w.document.write( "</td></tr>" );
   w.document.write( "<tr><td align='center' valign='top'><a href='javascript:this.close();' style='color:#ffffff; font-size:12px;'>chiudi</a></td></tr>" );
   w.document.write( "</table>" );
   w.document.write( "</body></html>" );
   w.document.close();
   w.focus();
}


// -----------------------------------------------------------------
// Function    : IsEmailValid
// Language    : JavaScript
// Description : Checks if given email address is of valid syntax
// Copyright   : (c) 1998 Shawn Dorman
// http://www.goodnet.com/~sdorman/web/IsEmailValid.html
// -----------------------------------------------------------------
// Ver    Date    Description of modification
// --- ---------- --------------------------------------------------
// 1.0 09/04/1996 Original write
// 1.1 09/30/1998 CHG: Use standard header format
// -----------------------------------------------------------------
// Source: Webmonkey Code Library
// (http://www.hotwired.com/webmonkey/javascript/code_library/)
// -----------------------------------------------------------------

function IsEmailValid(FormName,ElemName)
{
var EmailOk  = true
var Temp     = document.forms[FormName].elements[ElemName]
var AtSym    = Temp.value.indexOf('@')
var Period   = Temp.value.lastIndexOf('.')
var Space    = Temp.value.indexOf(' ')
var Length   = Temp.value.length - 1   // Array is from 0 to length-1

if ((AtSym < 1) ||                     // '@' cannot be in first position
    (Period <= AtSym+1) ||             // Must be atleast one valid char btwn '@' and '.'
    (Period == Length ) ||             // Must be atleast one valid char after '.'
    (Space  != -1))                    // No empty spaces permitted
   {  
      EmailOk = false
      alert( 'Indirizzo e-mail non valido!' )
      Temp.focus()
   }
return EmailOk
}

//-->
