dom = (document.getElementById)? true : false;
nn4 = (document.layers)? true : false;
ie4 = (!dom && document.all)? true : false;

var maxmenu = 5;
var start = 0;
var activmenu = 0;
var cur = 0;
var tim;
var overactiv = 0;
var overcolor = '#FFFFFF';
var outcolor = '#FFFFFF';

//horizontal popup
function showmenuvert(el,pos)
{
var cx;
if (dom) {
  cx=document.body.offsetWidth;
};
if (nn4) {
  cx=window.innerWidth;
};
cx=cx / 2 - pos
 if (dom) {document.getElementById(el).style.visibility = "visible";document.getElementById(el).style.left=cx;}
 else if (ie4) {document.all[el].style.visibility = "visible";document.all[el].style.left=cx;}
 else if (nn4) {document.layers[el].visibility = "show";document.layers[el].left=cx}
 activmenu = 1;
}

function activvert(el,pos)
{
if (activmenu == 1)
{
if (el != cur) {hidemenu(cur); showmenuvert(el,pos); cur = el; }
}
   else {showmenuvert(el.pos); cur = el; }
}

//verticalpopup
function showmenu(el)
{
var cx;
if (dom) {
  cx=document.body.offsetWidth;
};
if (nn4) {
  cx=window.innerWidth;
};
cx=cx / 2 - 200
 if (dom) {document.getElementById(el).style.visibility = "visible";document.getElementById(el).style.left=cx;}
 else if (ie4) {document.all[el].style.visibility = "visible";document.all[el].style.left=cx;}
 else if (nn4) {document.layers[el].visibility = "show";document.layers[el].left=cx}
 activmenu = 1;
}

function hidemenu(el)
{
 if (dom) document.getElementById(el).style.visibility = "hidden";
 else if (ie4) document.all[el].style.visibility = "hidden";
 else if (nn4) document.layers[el].visibility = "hide";
 activmenu = 0;
}

function hideall()
{
  for (i=1; i<=maxmenu; i++)
 {
 if (dom) document.getElementById('menu'+i).style.visibility = "hidden";
 else if (ie4) document.all['menu'+i].style.visibility = "hidden";
 else if (nn4) document.layers['menu'+i].visibility = "hide";
 }
 activmenu = 0;
}

function noactiv()
{
if (start != 0) hidemenu(cur)
}

function activ(el)
{
if (activmenu == 1)
{
if (el != cur) {hidemenu(cur); showmenu(el); cur = el; }
}
   else {showmenu(el); cur = el; }
}

function ClickActiv()
{
if (activmenu == 1) hidemenu(cur);
else showmenu(cur);
}

function timeactiv()
{
/*e=event.srcElement;
e.style.color='#000000';
pr=e.parentElement;
pr.bgColor='#BFD0EF';*/
 overactiv=0;
 tim=setTimeout('tactiv()','800');
}

function tactiv()
{
if (overactiv == 0 && activmenu == 1) hidemenu(cur);
}

function timedisable()
{
/*e=event.srcElement;
e.style.color='#FFFFFF';
pr=e.parentElement;
pr.bgColor='#4E6099';*/
if (start != 0)
{clearTimeout(tim);  overactiv=1}
else start = 1;
}

function bgLighting (div,optColor)
{
        if (optColor == 'over') {
        if (dom) document.getElementById(div).style.backgroundColor = overcolor;
        if(ie4) document.all[div].style.backgroundColor = overcolor;
        if(nn4) document.layers[div].bgColor = overcolor;
	}
	else {
        if (dom) document.getElementById(div).style.backgroundColor = outcolor;
        if(ie4) document.all[div].style.backgroundColor = outcolor;
        if(nn4) document.layers[div].bgColor = outcolor;
	}
}

var  status1 = 1;

function SHblock(item)
{
if (item == 'infoblock1') {block = status1}

if (block == 1)
{
  if (dom) document.getElementById(item).style.display = 'none';
  else if (ie4) document.all[item].style.display = 'none';
  block = 0;
}
else
{
  if (dom) document.getElementById(item).style.display = 'block';
  else if (ie4) document.all[item].style.display = 'block';
  block = 1;
}

if (item == 'infoblock1') {status1 = block}

}

function openForm(){
	var newwindow = "http://hosting.solidcactus.com/tellafriend/tell-friend-cabin.asp?url=" + escape(window.location);
	var window_properties = "top=0,left=0,scrollbars=yes,width=643,height=550";
	var PicWindow = window.open(newwindow,"tellafriend",window_properties);
}
	leftNav = new Image();
	leftNav.src = "/lib/yhst-65999174371671/bg-leftnav.gif";
	leftNavUP = new Image();
	leftNavUP.src = "/lib/yhst-65999174371671/bg-leftnavup.gif";

function CaricaFoto(img, name, wid, hi){
  foto1= new Image();
  foto1.src=(img);
  viewFotos(img, name, wid, hi);
}

function viewFotos(img, name, wid, hi){

 features =
    "toolbar=no,location=no,directories=no,status=no,menubar=no," +
    "resizable=no,width=" + wid + ",height=" + hi;
 dlg = window.open ("","Details",features);
 dlg.document.write("<html><head><title>" + name + " Zoom</title></head>");
 dlg.document.write("<body bgcolor=white topmargin=0 leftmargin=0><center>");
 dlg.document.write("<table align=center>");
 dlg.document.write("<tr><td align=center valign=middle>");
 dlg.document.write("<b><font size=2 face=Arial>" + name + "</font></b><br><br>");
 dlg.document.write("<img src=" + img + ">");
 dlg.document.write("</td></tr>");
 dlg.document.write("<tr><td align=center valign=middle>");
 dlg.document.write("<a href=# onClick=window.close();>");
 dlg.document.write("<font size=1 face=Arial>Click to close</font></a>");
 dlg.document.write("</td></tr>");
 dlg.document.write("</table></body></html>");
}

