function MM_openBrWindow(theURL,winName,features) {  
	a = window.open(theURL,winName,features);  a.focus()
}	
function viewphoto(n,w,h,z) { //v2.0
		vedifoto(n)
	}
	function vedifoto(n) { //v2.0
		document.getElementById('mystuff').style.display = 'block'
		document.getElementById('mystuff').style.zIndex = 100
		document.getElementById("mystuffframe").src = subsito+'/'+lingua+'/'+n+'/0/0/0/collezione.html'
	}
function searchEnter(e){ //e is event object passed from function invocation
	var characterCode //literal character code will be stored in this variable
	if(e && e.which){ //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	}
	else{
	e = event
	characterCode = e.keyCode //character code is contained in IE's keyCode property
	}
	if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
	() //submit the form
	return false
	}
	else{return true}
}
function searchn() {
	var c = escape(document.getElementById('searchinput').value)
	if (c) document.location = subsito+'/'+lingua+'/'+c+'/search.html'
	return false;
}
function tagsn(tag) {
	var c = escape(tag)
	if (c) document.location = subsito+'/'+lingua+'/'+c+'/tag.html'
	return false;
}
function vaicerca() {
	var c = escape(document.forms[0].cerca.value)
	document.location = subsito+'/'+lingua+'/'+c+'/1/0011-01-2000-12-2008/cerca.html'
	return false;
}
function display_child(n,obj) {
	z = document.getElementById("Hopen-"+n)
	try {
	/*	y = parseInt(he_banner)+3
	    z.style.top = "-"+y+"px"
		x = parseInt(obj.style.left)
		z.style.left = x+"px"
		h = he_banner-5
		z.style.height = h+"px"
		z.style.zIndex = 10*/
		z.style.display = "block"
	} catch (err) {}
}

function hide_child(n,obj) {
	z = document.getElementById("Hopen-"+n);
	try {z.style.display = "none"} catch (err) {}
}
function search(n) {
	s = document.getElementById(n)
	z = escape(s.value)
	if (z) document.location = subsito+'/'+lingua+'/00644/'+z+'/page.html'
}

function go_menu(liv,n,m) { //v2.0
	var p = m.substr(0,4)
	if (p == 'http' || p == 'www.') {document.location = m}
	else { document.location = subsito+'/'+lingua+'/'+liv+'/'+n+'/'+m+'.html'}
}
function indirizzoEmailValido(n) {
		indirizzo = n.value
		if (window.RegExp) {
			var nonvalido = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
			var valido = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$";
			var regnv = new RegExp(nonvalido);
			var regv = new RegExp(valido);
			if (!regnv.test(indirizzo) && regv.test(indirizzo))	return true;
			alert ("indirizzo email non valido")
			n.focus()
			return false
		}
		else {
			if(indirizzo.indexOf("@") >= 0) return true;
			alert ("indirizzo email non valido")
			n.focus()
			return false
		}
	};
/* START applesearch object */

var applesearch;
if (!applesearch)	applesearch = {};

applesearch.init = function ()
{
	// add applesearch css for non-safari, dom-capable browsers
	if ( navigator.userAgent.toLowerCase().indexOf('safari') < 0  && document.getElementById )
	{
		this.clearBtn = false;
		
		// add style sheet if not safari
		var dummy = document.getElementById("dummy_css");
		if (dummy)	dummy.href = "/emotiv/CSS/applesearch.css";
	}
}

// called when on user input - toggles clear fld btn
applesearch.onChange = function (fldID, btnID)
{
	// check whether to show delete button
	var fld = document.getElementById( fldID );
	var btn = document.getElementById( btnID );
	if (fld.value.length > 0 && !this.clearBtn)
	{
		btn.style.background = "white url('/images/cerca/srch_r_f2.gif') no-repeat top left";
		btn.fldID = fldID; // btn remembers it's field
		btn.onclick = this.clearBtnClick;
		this.clearBtn = true;
	} else if (fld.value.length == 0 && this.clearBtn)
	{
		btn.style.background = "white url('/images/cerca/srch_r.gif') no-repeat top left";
		btn.onclick = null;
		this.clearBtn = false;
	}
}


// clears field
applesearch.clearFld = function (fldID,btnID)
{
	var fld = document.getElementById( fldID );
	fld.value = "";
	this.onChange(fldID,btnID);
}

// called by btn.onclick event handler - calls clearFld for this button
applesearch.clearBtnClick = function ()
{
	applesearch.clearFld(this.fldID, this.id);
}

/* END applesearch object */