<!--
// -----------------------------------------------------------------
// 	Rufino Clown
// -----------------------------------------------------------------
var Popup = {
  open: function(options)
  {
    this.options = {
      url: '#',
      width: 600,
      height: 500,
      name:"_blank",
      location:"no",
      menubar:"no",
      toolbar:"no",
      status:"yes",
      scrollbars:"yes",
      resizable:"yes",
      left:"",
      top:"",
      normal:false
    }
    Object.extend(this.options, options || {});

    if (this.options.normal){
        this.options.menubar = "yes";
        this.options.status = "yes";
        this.options.toolbar = "yes";
        this.options.location = "yes";
    }

    this.options.width = this.options.width < screen.availWidth?this.options.width:screen.availWidth;
    this.options.height=this.options.height < screen.availHeight?this.options.height:screen.availHeight;
    var openoptions = 'width='+this.options.width+',height='+this.options.height+',location='+this.options.location+',menubar='+this.options.menubar+',toolbar='+this.options.toolbar+',scrollbars='+this.options.scrollbars+',resizable='+this.options.resizable+',status='+this.options.status
    if (this.options.top!="")openoptions+=",top="+this.options.top;
    if (this.options.left!="")openoptions+=",left="+this.options.left;
    window.open(this.options.url, this.options.name,openoptions );
    return false;
  }
}

function openwin( page ) {
	window.open( page,'','resizable,scrollbars=0,menubar,width=820,height=620','');
}
function openwinb( page ) {
	window.open( page,'','resizable,scrollbars,menubar,width=760,height=550',''); 
}
function showimage( img_filename ) {
   w = window.open( '','','resizable=1,scrollbars=0,menubar=0,width=780,height=520','' );
   w.document.write( "<html><head><title>Rufino Clown</title>" );
   w.document.write( "<link href='rufino.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 + "' class='img_border'>";
   w.document.write( s );
   w.document.write( "</td></tr>" );
   w.document.write( "<tr><td align='center' valign='top'><a href='javascript:this.close();'>chiudi</a></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>Rufino Clown</title>" );
   w.document.write( "<link href='rufino.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
}


// DHTML Window script- Copyright Dynamic Drive (http://www.dynamicdrive.com)
// For full source code, documentation, and terms of usage,
// Visit http://www.dynamicdrive.com/dynamicindex9/dhtmlwindow.htm

var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function drag_drop( e ) 
{
	if (ie5&&dragapproved&&event.button==1)
	{
		document.getElementById("dwindow").style.left=tempx+event.clientX-offsetx+"px"
		document.getElementById("dwindow").style.top=tempy+event.clientY-offsety+"px"
	}
	else if (ns6&&dragapproved)
	{
		document.getElementById("dwindow").style.left=tempx+e.clientX-offsetx+"px"
		document.getElementById("dwindow").style.top=tempy+e.clientY-offsety+"px"
	}
}

function initializedrag( e )
{
	offsetx=ie5? event.clientX : e.clientX
	offsety=ie5? event.clientY : e.clientY
	document.getElementById("dwindowcontent").style.display="none" //extra
	tempx=parseInt(document.getElementById("dwindow").style.left)
	tempy=parseInt(document.getElementById("dwindow").style.top)
	dragapproved=true
	document.getElementById("dwindow").onmousemove=drag_drop
}

function loadwindow(url,width,height)
{
	if (!ie5&&!ns6)
		window.open(url,"","width=width,height=height,scrollbars=1")
	else {
		document.getElementById("dwindow").style.display='';
		document.getElementById("dwindow").style.width=initialwidth=width+"px";
		document.getElementById("dwindow").style.height=initialheight=height+"px";
		document.getElementById("dwindow").style.left="30px";
		document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+30+"px" : iecompattest().scrollTop*1+30+"px";
		document.getElementById("cframe").src = url;
	}
}

function maximize() {
	if (minrestore==0){
	minrestore=1 //maximize window
	document.getElementById("maxname").setAttribute("src","restore.gif")
	document.getElementById("dwindow").style.width=ns6? window.innerWidth-20+"px" : iecompattest().clientWidth+"px"
	document.getElementById("dwindow").style.height=ns6? window.innerHeight-20+"px" : iecompattest().clientHeight+"px"
}
else {
	minrestore=0 //restore window
	document.getElementById("maxname").setAttribute("src","max.gif")
	document.getElementById("dwindow").style.width=initialwidth
	document.getElementById("dwindow").style.height=initialheight
	}
	document.getElementById("dwindow").style.left=ns6? window.pageXOffset+"px" : iecompattest().scrollLeft+"px"
	document.getElementById("dwindow").style.top=ns6? window.pageYOffset+"px" : iecompattest().scrollTop+"px"
}

function closeit(){
document.getElementById("dwindow").style.display="none"
}

function stopdrag(){
dragapproved=false;
document.getElementById("dwindow").onmousemove=null;
document.getElementById("dwindowcontent").style.display="" //extra
}

//-->



