/*************************************************
* Gestione navigazione (risoluzione, linguaggio) *
*************************************************/
function selecthomepage(){
	var s_home='';
	var s_res = screen.width;

	if (s_res <= 800){
    		s_home = 'home8.htm';
	}

	if (s_res > 800){
    		s_home = 'home.htm';
	}
//alert(s_home);
	document.location.replace(s_home);
}

var clickmessage="            © 2000-2004 Centro Vela Dervio\nTutti i diritti sono riservati ai legittimi proprietari\n                  All rigths reserved"

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.which==3&&e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick
}


function disableimage(){
if (document.all)
document.onmousedown=disableclick
else if (document.getElementById)
document.onmouseup=disableclick
else if (document.layers)
associateimages();
}

//configure the two variables below to match yoursite's own info
var bookmarkurl="http://www.centroveladervio.it/"
var bookmarktitle="Centro Vela Dervio"

function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function addbookmark_f18euro2007(){
	var url_f18euro2007="http://www.f18euro2007.eu/"
	var urltitle_f18euro2007="F18 Euro Championship 2007"
if (document.all)
window.external.AddFavorite(url_f18euro2007,urltitle_f18euro2007)
}


function calcDate(){

navvers = navigator.appVersion.substring(0,1);
if (navvers > 3)
	navok = true;
else
	navok = false;

today = new Date;
day = today.getDay();
daynum = today.getDate();
if (daynum<10)
	daynum = "0"+daynum;
month = today.getMonth();
if (navok)
	year = today.getFullYear();
else
	year = today.getYear();
TabDay = new Array("Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato");
TabMonth = new Array("Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre");
messageDate = TabDay[day] + " " + daynum + " " + TabMonth[month] + " " + year;
return(messageDate);
}

function getEm(em) {
    var stringPos = false;
    var stringEm = "";
    if (em.length>0) {
    for (var i=0; i<em.length; i++) {
    stringPos = (i % 2) ? false : true;
    if (stringPos == true) {
    stringEm = stringEm + "%" + em.charAt(i);
    } else {
    stringEm = stringEm + em.charAt(i);
    }
  }
  stringEm = unescape(stringEm);
  window.location.href = stringEm;
  }
}


