


function hideLayer(layerid) {

var layer = document.getElementById(layerid);

layer.style.visibility = "hidden";

}





                                                                 

                                                                                             

var thresholdY = 0;                // in pixels; threshold for vertical repositioning of a layer

var ordinata_margin = 205;        // to start the layer a bit above the mouse vertical coordinate 

                                                                                       

DOM = (document.getElementById) ? 1 : 0;                                             

NS4 = (document.layers) ? 1 : 0;                                                    

IE4 = (document.all) ? 1 : 0;                                                      

var loaded = 0;        // to avoid stupid errors of Microsoft browsers            

                                                                       

                                                                                

                                                                          

                                                                              

// it works with NS4, Mozilla, NS6, Opera 5, IE                               

currentY = -1;                                                                

function grabMouse(e) {                                                       

        if (DOM && !IE4) {                                                    

                currentY = e.clientY;                                         

        } else if (NS4) {                                                     

                currentY = e.pageY;                                           

        } else {                                                              

                currentY = event.y;                                           

        }                                                                     

        if (DOM && !IE4 && navigator.appName != "Opera") {                    

                currentY += window.pageYOffset;                               

        } else if (IE4 && DOM) {                                              

                currentY += document.body.scrollTop;                          

        }


myRE = new RegExp("http://www.mediterraneanboatrentals.com", "i");

var topUrl = top.location.href;

if (topUrl.match(myRE) && parent.frames.length!=0){

xMousePos = 0; // Horizontal position of the mouse on the screen

yMousePos = 0; // Vertical position of the mouse on the screen

xMousePosMax = 0; // Width of the page

yMousePosMax = 0; // Height of the page

    if (document.layers) {

        xMousePos = e.pageX;

        yMousePos = e.pageY;

        xMousePosMax = window.innerWidth+window.pageXOffset;

        yMousePosMax = window.innerHeight+window.pageYOffset;

    } else if (document.all) { 

        xMousePos = window.event.x+document.body.scrollLeft;

        yMousePos = window.event.y+document.body.scrollTop;

        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;

        yMousePosMax = document.body.clientHeight+document.body.scrollTop;

    } else if (document.getElementById) {

        xMousePos = e.pageX;

        yMousePos = e.pageY;

        xMousePosMax = window.innerWidth+window.pageXOffset;

        yMousePosMax = window.innerHeight+window.pageYOffset;

    } 

        window.status = "Pos x =" + xMousePos + ", Pos y =" + yMousePos;

}


                                                                            

}
                                                                             

if ((DOM || NS4) && !IE4) {                                                   

        document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);            

}                                                                             

document.onmousemove = grabMouse;                                             

                                                                              

function popUp(menuName,on) {                                                 

        if (loaded) {        // to avoid stupid errors of Microsoft browsers   

                if (on) {      

//                        moveLayers(); 

                        if (DOM) {     

                                document.getElementById(menuName).style.visibility = "visible";

                        } else if (NS4) {                                    

                                document.layers[menuName].visibility = "show";

                        } else { 

                                document.all[menuName].style.visibility = "visible";

                        }

                } else {

                        if (DOM) {

                                document.getElementById(menuName).style.visibility = "hidden";

                        } else if (NS4) {

                                document.layers[menuName].visibility = "hide";

                        } else {

                                document.all[menuName].style.visibility = "hidden";

                        }

                }

        }

}


function popUpL2() {
shutdown();
popUp('L2',true);
}
function popUpL5() {
shutdown();
popUp('L5',true);
}
function popUpL12() {
shutdown();
popUp('L12',true);
}
function popUpL18() {
shutdown();
popUp('L18',true);
}
function popUpL24() {
shutdown();
popUp('L24',true);
}

function moveLayers() {

if (DOM) {

document.getElementById('L2').style.left = 155;
document.getElementById('L2').style.top = 135;
document.getElementById('L5').style.left = 155;
document.getElementById('L5').style.top = 150;
document.getElementById('L12').style.left = 155;
document.getElementById('L12').style.top = 165;
document.getElementById('L18').style.left = 155;
document.getElementById('L18').style.top = 180;
document.getElementById('L24').style.left = 155;
document.getElementById('L24').style.top = 195;


} else if (NS4) {

document.layers['L2'].left = 155;
document.layers['L2'].top = 135;
document.layers['L5'].left = 155;
document.layers['L5'].top = 150;
document.layers['L12'].left = 155;
document.layers['L12'].top = 165;
document.layers['L18'].left = 155;
document.layers['L18'].top = 180;
document.layers['L24'].left = 155;
document.layers['L24'].top = 195;


} else {

document.all['L2'].style.pixelLeft = 155;
document.all['L2'].style.pixelTop = 135;
document.all['L2'].style.pixelWidth = 145;
document.all['L5'].style.pixelLeft = 155;
document.all['L5'].style.pixelTop = 150;
document.all['L5'].style.pixelWidth = 145;
document.all['L12'].style.pixelLeft = 155;
document.all['L12'].style.pixelTop = 165;
document.all['L12'].style.pixelWidth = 145;
document.all['L18'].style.pixelLeft = 155;
document.all['L18'].style.pixelTop = 180;
document.all['L18'].style.pixelWidth = 145;
document.all['L24'].style.pixelLeft = 155;
document.all['L24'].style.pixelTop = 195;
document.all['L24'].style.pixelWidth = 145;


}

}

function shutdown() {
popUp('L2',false);
popUp('L5',false);
popUp('L12',false);
popUp('L18',false);
popUp('L24',false);
}
if (NS4) {
document.onmousedown = function() { shutdown(); }
} else {
document.onclick = function() { shutdown(); } 
}




var ua=navigator.userAgent.toLowerCase();

temp=ua.indexOf("msie");

if(temp>0){var esie=1;}



function moveLayerY(menuName, ordinata) {


if(document.getElementById(menuName).style.visibility != "visible"){

if (loaded) {        // to avoid stupid errors of Microsoft browsers

if (ordinata != -1 && !isNaN(ordinata)) {        // The browser has detected the mouse position

if (DOM) {

if(esie){scrolldistance=document.body.scrollTop;}else{scrolldistance=0;}

        appoggio = parseInt(document.getElementById(menuName).style.top);

        if (isNaN(appoggio)) appoggio = 0;

        if (Math.abs(appoggio + ordinata_margin - ordinata) > thresholdY)

                document.getElementById(menuName).style.top = ordinata - ordinata_margin - scrolldistance;

} else if (NS4) {

        if (Math.abs(document.layers[menuName].top + ordinata_margin - ordinata) > thresholdY)

                document.layers[menuName].top = ordinata - ordinata_margin;

} else {

        if (Math.abs(document.all[menuName].style.pixelTop + ordinata_margin - ordinata) > thresholdY)

                document.all[menuName].style.pixelTop = ordinata - ordinata_margin;

}

}

}

}

}

// -->
