var referrer = document.referrer;
/*var referrer = "http://www.google.it/search?hl=it&q=camogli&btnG=Cerca con Google&meta= ";*/
if (referrer != "") {
	//var referrer = referrer.replace("&","_|_");
	var referrer = escape(referrer);
} else {
	var referrer = "Nessun referrer oppure ingresso diretto";
}

function preview(quale) 
{
  Img2 = quale; //associo all' Img2 il contenuto che prelevo 
  //Img2.resize ('100','100');
  parent.document.swap.src = Img2;// swappo l' img iniziale con quella caricata 
}

function previewtitolo(commento,quale) 
{
  Img2 = quale; //associo all' Img2 il contenuto che prelevo 
  //Img2.resize ('100','100');
  parent.document.swap.src = Img2;// swappo l' img iniziale con quella caricata 

   document.getElementById("testing").innerHTML = commento;
}

function resize(img) { 
	if(img.width > 400) { 
		img.style.height = parseInt(img.height * 400 / img.width); 
		//img.style.width = 400; 
	}
		img.style.visibility = "visible"; 
} 

 function openpiccenter(url,name,x,y)
{
	var sx = screen.width;
	var sy = screen.height;
	var wx = (sx/2) - (x/2);
	var wy = (sy/2) - (y/2) - 50;
	picxywindow = window.open(url,name,"width=" + x + ",height=" + y + ",menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,left="+ wx +",top=" + wy);
	picxywindow.focus();
}	


function openPhoto (_n) {
	 i1 = new Image;
	 var chemin = _n;
	 i1.src = chemin;
	 html = '<HTML>\n<HEAD>\n<TITLE>Le immagini</TITLE>\n</HEAD>\n<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0>\n<CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+14,document.imageTest.height+32)"></CENTER>\n</BODY>\n</HTML>';
	 popupImage = window.open('','pop','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0');
	 popupImage.document.open();
	 popupImage.document.write(html);
	 popupImage.document.close();
	 popupImage.focus();
}

function openpage( form ) { 
	var newIndex = cercacountry.country_sl.selectedIndex; 
	if ( newIndex == 0 ) { 
		alert( "Fai una selezione" ); 
	} else { 
		cururl = cercacountry.country_sl.options[ newIndex ].value; 
		window.location.assign( cururl ); 
	} 
} 


var user;
var domain;
var suffix;
function jemail(user, domain, suffix){

document.write('<span class="style1"><a href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '">Hai idee o suggerimenti? Scrivici!</a></span>');
}



function checkIt(evt) {
    evt = (evt) ? evt : window.event
    var charCode = (evt.which) ? evt.which : evt.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        status = "Il campo accetto solo cifre- only numeric values are permitted"
        return false
    }
    status = ""
    return true
}

function validacerca(t) {
    if (t.srcid.value == "")
  	{
    alert("Scrivi un codice da cercare- Insert a code to search");
	 t.srcid.focus();
    return (false);
  	}
	return (true);
  }


