
   NS4 = (document.layers);
   NS6 =  ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 5))
   IE4 = (document.all);
   MAC45 = (navigator.appVersion.indexOf("MSIE 4.5") != -1)
  ver4 = (NS4 || IE4);   
 isMac = (navigator.appVersion.indexOf("Mac") != -1);
 menuHeight=-18;
 menuOffset=258;
var overmenu = false;
var openmenu = null;
var overcheck = null;
 
 
function FindLeftEdge(img) {
// Find Position of Image File
        xPos = img.offsetLeft;
        tempEl = img.offsetParent;
        while (tempEl != null) {
                xPos += tempEl.offsetLeft;
                tempEl = tempEl.offsetParent;
        }
        return xPos;
}

function FindTopEdge(img) {
// Find Position of Image File
        yPos = img.offsetTop;
        tempEl = img.offsetParent;
        while (tempEl != null) {
                yPos += tempEl.offsetTop;
                tempEl = tempEl.offsetParent;
        }
        if (MAC45) yPos=menuOffset;
        return yPos;
        }

function findloc (imgname)
// Find Position of Image File
{
var holdingImage = document.images[imgname];
var canvasLeft = (NS4 && !NS6) ? holdingImage.x : FindLeftEdge(holdingImage);
var canvasTop = (NS4 && !NS6) ? holdingImage.y : FindTopEdge(holdingImage);
var canvasWidth = holdingImage.width;
var canvasHeight = holdingImage.height;
return ([canvasLeft,canvasTop]);
}

function showMenu(imgname) 
// Show Menu Layer
{
        if (NS6) 
                menu=document.getElementById(imgname+"layer")
        else if (NS4)
                menu=eval("document.layers."+imgname+"layer")
        else
                menu=eval(imgname+"layer");
        if (NS4) menu.visibility = "show"
        else menu.style.visibility = "visible"
        openmenu=imgname;
}

function hideMenu() 
// Hide Menu Layer
{
if (openmenu != null)
        {
        if (NS6) 
                menu=document.getElementById(openmenu+"layer")
        else if (NS4)
                menu=eval("document.layers."+openmenu+"layer")
        else
                menu=eval(openmenu+"layer");
            if (NS4) menu.visibility = "hide"
            else menu.style.visibility = "hidden"
                unswap_img(openmenu)
        }
}

function popup (imgname)
// Pop Up Menu
{
        if (NS6) 
                menu=document.getElementById(imgname+"layer")
        else if (NS4)
                menu=eval("document.layers."+imgname+"layer")
        else
                menu=eval(imgname+"layer");
if (NS4)
{
        menu.top = findloc(imgname)[1]-1-menuHeight;
        menu.left = findloc(imgname)[0]-1;
}
else if (NS6)
{
        menu.style.top = findloc(imgname)[1]-1-menuHeight;
        menu.style.left = findloc(imgname)[0]-1;
}
else
{
        menu.style.pixelTop = findloc(imgname)[1]-1-menuHeight;
        menu.style.pixelLeft = findloc(imgname)[0]-1;
}
showMenu(imgname);
}

function checkmenu (openmenu,check)
// Check to see if menu is open but not used, if so it is closed - saved
{
if ((overmenu == 0) && (check == overcheck))
{
        if (NS6) 
                menu=document.getElementById(openmenu+"layer")
        else if (NS4)
                menu=eval("document.layers."+openmenu+"layer")
        else
                menu=eval(openmenu+"layer");
            if (NS4) menu.visibility = "hide"
            else menu.style.visibility = "hidden"
                unswap_img(openmenu)
}
}

function menutimeout (openmenu)
// half second timeout after mouse moves away from image or subnav in IE
// version 1.1
{
if (IE4){
overcheck=overcheck+1;
setTimeout("checkmenu(openmenu,"+overcheck+")",40);
}
}

function tocItem (name) {
this.on = new Image();
this.on.src = "../iim_en/menu/" + name + "_o.gif"
this.off = new Image();
this.off.src = "../iim_en/menu/" + name + ".gif"
}

function toc_new (name) {
tocItem[name] = new tocItem(name);
}

function swap_img (imgName, openmenu)
// Swap out image for mouseover event
{
if (document.images) {
if ((openmenu == null) || (IE4) || (NS6))
        document[imgName].src = tocItem[imgName].on.src
else
        {
        image= eval("document.layers."+openmenu+"layer.document.images['"+imgName+"']");
        image.src = tocItem[imgName].on.src;
        }
}
}

function unswap_img (imgName, openmenu)
// Return to original image
{
if (document.images) {
if ((openmenu == null) || (IE4) || (NS6))
    document[imgName].src = tocItem[imgName].off.src
else
        {
        image= eval("document.layers."+openmenu+"layer.document.images['"+imgName+"']");
        image.src = tocItem[imgName].off.src;
        }
}
}

if (document.images != null) {
toc_new('conocer');
toc_new('excursiones');
toc_new('tarifas');
}

// declaro imagenes que no tienen menu

image10 = new Image();
image10.src = "../WebStripper/protected.html#link=http://www.mirasdelmar.com.ar/xtras_en/iim_en/menu/consultas.gif";
image11 = new Image();
image11.src = "../WebStripper/protected.html#link=http://www.mirasdelmar.com.ar/xtras_en/iim_en/menu/consultas_o.gif";
image12 = new Image();
image12.src = "../WebStripper/protected.html#link=http://www.mirasdelmar.com.ar/xtras_en/iim_en/menu/mapas.gif";
image13 = new Image();
image13.src = "../WebStripper/protected.html#link=http://www.mirasdelmar.com.ar/xtras_en/iim_en/menu/mapas_o.gif";


function iimcambiar(iimname,iimsrc)
	{
	document[iimname].src=iimsrc;
	}
	
agent = navigator.userAgent;
if (parseInt(agent.substring(8,9)) > 3) {
if (screen.width >= 800) {
winwidth = 760;
winheight = 520;
} else {
winwidth = 620;
winheight = 420;
}
}
if (parseInt(agent.substring(8,9)) <= 3) {
winwidth = 620;
winheight = 420;
}

function abrir(url,name,width,height,resize,scroll) {
var dialogWin = new Object();
dialogWin.width = width;
dialogWin.height = height;
now = new Date();
var millis=now.getTime();
var mstr=""+millis;
if (document.layers) {
dialogWin.left = window.screenX + ((window.outerWidth - dialogWin.width) / 2);
dialogWin.top = window.screenY + ((window.outerHeight - dialogWin.height) / 2);
var attr = 'screenX=' + dialogWin.left + ',screenY=' + dialogWin.top + ',resizable=' + resize + ',width=' + dialogWin.width + ',height=' + dialogWin.height + ',scrollbars=' + scroll + ',menubar=no,location=no,toolbar=no,status=no,directories=no';
} else if (document.all) {
dialogWin.left = (screen.width - dialogWin.width) / 2;
dialogWin.top = (screen.height - dialogWin.height) / 2;
var attr = 'left=' + dialogWin.left + ',top=' + dialogWin.top + ',resizable=' + resize + ',width=' + dialogWin.width + ',height=' + dialogWin.height + ',scrollbars=' + scroll + ',menubar=no,location=no,toolbar=no,status=no,directories=no';
}
window.open(url,name,attr);
}
function peninsula() {
abrir('../WebStripper/protected.html#link=http://www.mirasdelmar.com.ar/xtras_en/mapas_peninsula.html','Peninsula','360','285','no','no');
}
function patagonia() {
abrir('../WebStripper/protected.html#link=http://www.mirasdelmar.com.ar/xtras_en/mapas_patagonia.html','Patagonia','260','420','no','no');
}
function chubut() {
abrir('../WebStripper/protected.html#link=http://www.mirasdelmar.com.ar/xtras_en/mapas_chubut.html','Chubut','330','235','no','no');
}
function peninsula2() {
abrir('../WebStripper/protected.html#link=http://www.mirasdelmar.com.ar/xtras_en/mapas_peninsula2.html','Peninsula','580','500','yes','no');
}
function ppiramides() {
abrir('../WebStripper/protected.html#link=http://www.mirasdelmar.com.ar/videos/ppiramides.htm','Peninsula','340','265','no','no');
}
function ptombo() {
abrir('../WebStripper/protected.html#link=http://www.mirasdelmar.com.ar/videos/ptombo.htm','Peninsula','340','265','no','no');
}
function pvaldes() {
abrir('../WebStripper/protected.html#link=http://www.mirasdelmar.com.ar/videos/pvaldes.htm','Peninsula','340','265','no','no');
}
