// **************script per il selettore delle cittą

<!--- Hide from old browsers
function jumpBox(list) {location.href = list.options[list.selectedIndex].value} 
// end hiding --->




// **************stampa PAGINE

function printit(){  
if (NS) {
    window.print() ;  
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);
WebBrowser1.outerHTML = "";  
}
}




// **************elimina tasto destro

<!--
var message="";
function clickIE() { if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getelementByld&&!document.all)){
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmousep=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// -->



// **************sondaggio vedi i risultati 

function vota(larga,alta)
	{
	if (parseInt(navigator.appVersion) > 2)
		{
		open('http://www.guidamica.com/index/vote.php?action=results','','width='+larga+',height='+alta+',status=no,menubar=no,resizable=no,scrollbars=no');
		}
		
	}


// **************aggiungi ai preferiti 

//configure the two variables below to match yoursite's own info
var bookmarkurl="http://www.guidamica.com"
var bookmarktitle="GuidAmica_per girare la cittą senza problemi"

function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}


// **************centro pop up vetrine virtuali

function centro(URL,nome){
largo=769; 
alto=470; 
posh=Math.floor((screen.height-alto)/2); 
posw=Math.floor((screen.width-largo)/2); 
fin=window.open(URL,nome,"width="+largo+",height="+alto+",scrollbars=yes,top="+posh+",left="+posw); 
fin.focus(); 
}


// **************pop up sito esterno =  BORSA, OROSCOPO, Etc...Etc...

function esterno(URL,nome){
largo=780; 
alto=400; 
posh=Math.floor((screen.height-alto)/2); 
posw=Math.floor((screen.width-largo)/2); 
fin=window.open(URL,nome,"width="+largo+",height="+alto+",location=yes,scrollbars=yes,top="+posh+",left="+posw); 
fin.focus(); 
}


// **************pop up mappe

function mappe(URL,nome){
largo=750; 
alto=430; 
posh=Math.floor((screen.height-alto)/2); 
posw=Math.floor((screen.width-largo)/2); 
fin=window.open(URL,nome,"width="+largo+",height="+alto+",location=no,scrollbars=yes,top="+posh+",left="+posw); 
fin.focus(); 
}
		
		
// **************chiudi pop up 

function Chiudi()
        {
        this.close();
        } 		


// **************stile della galleria foto

var OPER=navigator.userAgent.indexOf("Opera");
if(document.layers){
document.write("<link rel='stylesheet' href='stileNN.css' type='text/css'>");
}
else if((OPER>-1)) {
document.write("<link rel='stylesheet' href='stile.css' type='text/css'>");
}
else if(document.all) {
document.write("<link rel='stylesheet' href='stile.css' type='text/css'>");
}
else if(document.getElementById){
document.write("<link rel='stylesheet' href='stile.css' type='text/css'>");
}


// **************centra pop up nella galleria foto

//finestra centrale
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+'';
win = window.open(mypage,myname,settings)
}


// **************centro pop up in turismo (come trovarci) 

function centrato(URL,nome){
largo=432; 
alto=405; 
posh=Math.floor((screen.height-alto)/2); 
posw=Math.floor((screen.width-largo)/2); 
fin=window.open(URL,nome,"width="+largo+",height="+alto+",top="+posh+",left="+posw); 
fin.focus(); 
}


// **************centro pop up in credits
<!--
function credits(larga,alta)
	{
	if (parseInt(navigator.appVersion) > 2)
		{
		open('http://www.guidamica.com/credits/crediti.html','','width='+larga+',height='+alta+',status=no,menubar=no,resizable=no,scrollbars=no');
		}
	}
//-->


// **************centro pop up in redazione	
<!--
function redazione(larga,alta)
	{
	if (parseInt(navigator.appVersion) > 2)
		{
		open('../redazione/redazione.htm','','width='+larga+',height='+alta+',status=no,menubar=no,resizable=no,scrollbars=no');
		}
	}
//-->	 


// **************campo obbligatorio nel motore di ricerca del commercio, edicola, etc...etc...

function validate(theform) {
	if (theform.whatdoreplace.value=="") {
		alert("Devi inserire una parola per la ricerca !");
		return false; }
	 else { return true; }
}


// **************campo obbligatorio nel form del forum 

function obbligatorio(theform) {
	if (theform.body.value=="") {
		alert("Devi riempire tutti i campi !");
		return false; }
	 else { return true; }
}


// **************campo obbligatorio nel form della messaggeria 

function riempi(theform) {
	if (theform.name.value=="") {
		alert("Devi riempire tutti i campi !");
		return false; }
	 else { return true; }
}


// **************campo obbligatorio nel motore google 

function google(theform) {
	if (theform.q.value=="") {
		alert("Devi inserire una parola per la ricerca !");
		return false; }
	 else { return true; }
}


// **************campo obbligatorio nella newsletter 

function obb(theform) {
	if (theform.email.value=="") {
		alert("Devi inserire l'email !");
		return false; }
	 else { return true; }
}


// *******************Funzione limite caratteri nella messaggeria

<!--

var supportsKeys = false


function favChange(rnum) {
	f = document.Max;
	
	if (f.favs.selectedIndex >=0) {
		f.msgTo.value = f.favs.options[f.favs.selectedIndex].value
	}

	if (f.favs.selectedIndex > 0 && f.favs.selectedIndex <= rnum + 1) {
		f.comments.focus();
	} else {
		f.msgTo.focus();
	}
}
function calcCharLeft(f) {
		lenUSig = f.lenSSig.value
		maxLength = 1500 - f.lenSysSig.value - lenUSig
        if (f.comments.value.length > maxLength) {
	        f.comments.value = f.comments.value.substring(0,maxLength)
		    charleft = 0
        } else {
			charleft = maxLength - f.comments.value.length
		}

        f.msgCL.value = charleft
}

function textKey(f) {
	supportsKeys = true
	calcCharLeft(f)
}

//-->


// *******************Funzione limite caratteri in cartoline virtuali
<!-- 
function controlla(f,cartoline,maxlettere) 
{ 
if (f.value.length > maxlettere) 
f.value = f.value.substring(0,maxlettere); 
} 
// --> 



// *******************Funzione limite caratteri in scrivi alla redazione
<!-- 
function controlla(f,saibal_form,maxlettere) 
{ 
if (f.value.length > maxlettere) 
f.value = f.value.substring(0,maxlettere); 
} 
// --> 



// *******************Funzione smilies nella messaggeria


function Aggiungi(testo) 
{ 
document.Max.comments.value+=testo; 
} 


// *******************Funzione restrizione caratteri nella messaggeria

function vai(t){ 
if(t.value.match(/['"():;]/)){ 
t.value=t.value.replace(/['"():;]/g,'');}} 

