window.onerror = null;
 var DOM;
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS4 = (bName == "Netscape" && bVer >= 4);
 var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
 if (document.getElementById) {DOM = true; NS4 = false} else {DOM= false;}
 var menuActive = 0
 var menuOn = 0
 var onLayer
 var timeOn = null
 var loaded = 0
 var menu1 = new Image(); menu1.src = "../images/menu/spacer.gif";
 var menu2 = new Image(); menu2.src = "../images/menu/lilarrow.gif";
 
// MENU COLOR VARIABLE
var menuColor = "#E9F2FF"

//PRECACHE IMAGES HERE
function LoadImgs(){
  if (document.images) {
  about0 = new Image(); about0.src="../images/menu/about0.gif"; about1 = new Image(); about1.src="../images/menu/about1.gif"; 
  hotels0 = new Image(); hotels0.src="../images/menu/hotels0.gif"; hotels1 = new Image(); hotels1.src="../images/menu/hotels1.gif"; 
  tour0 = new Image(); tour0.src="../images/menu/tour0.gif"; tour1 = new Image(); tour1.src="../images/menu/tour1.gif"; 
  norder0 = new Image(); norder0.src="../images/menu/norder0.gif"; norder1 = new Image(); norder1.src="../images/menu/norder1.gif"; 
  uinfo0 = new Image(); uinfo0.src="../images/menu/uinfo0.gif"; uinfo1 = new Image(); uinfo1.src="../images/menu/uinfo1.gif"; 
  kiev0 = new Image(); kiev0.src="../images/menu/kiev0.gif"; kiev1 = new Image(); kiev1.src="../images/menu/kiev1.gif"; 
  loaded = 1
  }
 }// LAYER SWITCHING CODE
if (NS4 || IE4) {
 if (navigator.appName == "Netscape") {
  layerStyleRef="layer.";
  layerRef="document.layers";
  styleSwitch="";
  }else{
  layerStyleRef="layer.style.";
  layerRef="document.all";
  styleSwitch=".style";
 }
}

// SHOW MENU
function showLayer(layerName){
 if (NS4 || IE4 || DOM) {
  if (timeOn != null) {
    clearTimeout(timeOn)
    hideLayer(onLayer)
    }
  if (NS4 || IE4) {
    eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
  } 
  if (DOM) document.getElementById(layerName).style.visibility='visible'
 
 }
onLayer = layerName
}

//BUTTON ROLLOVER
function change(Name, No) {
 //if (document.images && (loaded == 1)) {
 if ( loaded == 1 ) {
   document [Name].src = eval(Name + No + ".src");
  }
 return true
}

// HIDE MENU
function hideLayer(layerName){
 if (menuActive == 0) {
  if (NS4 || IE4) {
   eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
  }
  if (DOM) document.getElementById(layerName).style.visibility='hidden'
 }
}

// TIMER FOR BUTTON MOUSE OUT
function btnTimer() {
 timeOn = setTimeout("btnOut()",1000)
}

// BUTTON MOUSE OUT
function btnOut(layerName) {
 if (menuActive == 0) {
  hideLayer(onLayer)
  }
}

// MENU MOUSE OVER  
function menuOver(itemName) {
 clearTimeout(timeOn)
 menuActive = 1
 if (NS4 || IE4 || DOM) {
  if (NS4) {
    	document[onLayer].document.images[itemName].src = menu2.src
 	} else {
     	document [itemName].src = menu2.src
 	}
 }
}

// MENU MOUSE OUT 
function menuOut(itemName) {
 menuActive = 0 
  if (NS4 || IE4 || DOM) {
  if (NS4) {
    document[onLayer].document.images[itemName].src = menu1.src
  } else {
     document [itemName].src = menu1.src
  }
  }
  timeOn = setTimeout("hideLayer(onLayer)", 400)
 }

// Creates menu object
function menuLink(title, url) {
 this.title = title
 this.url = url
}

// Builds menu table
function menuMaker(menuArray) {
 n = ""
 j = eval(menuArray + ".length") - 1;
 topTable = "<div ID='" + eval(menuArray + ".id") + "'><table  border='1' cellspacing='0' cellpadding='4' bgcolor='" + menuColor +"' bordercolor='#808080' bordercolorlight='#C0C0C0' bordercolordark='#000000'><tr><td><table border='0' cellspacing='0' cellpadding='0' bgcolor='" + menuColor + "'>"
 endrow = "</td></tr>"
 btmTable = "</table></td></tr></table></div>"
 
 n += topTable
 for( var i = 0; i <=j; i++) {
  bgnrow = "<tr><td><img src='../images/menu/spacer.gif' width=15 height=15 alt='' border='0' name='" + eval(menuArray + ".imgname") + i + "'></td><td>";
  n += bgnrow + "<a class='PopUpMenu' href='" + eval(menuArray + "[" + i + "].url") + "' onMouseOver='menuOver(\"" + eval(menuArray + ".imgname") + i + "\")' onMouseOut='menuOut(\"" + eval(menuArray + ".imgname") + i + "\")' class='menus' target='_top'>" + eval(menuArray + "[" + i + "].title") + "</a>" + endrow
 }
 n += btmTable
 return n
}

//Menu Arrays
Array.prototype.id = "aboutMenu"
Array.prototype.imgname = "ab"
abMenu = new Array(2)
abMenu[0] = new menuLink("<nobr>About </nobr>", "../about/about_1.html")
abMenu[1] = new menuLink("<nobr>Site Map</nobr>", "../about/site_map.html")


hoMenu = new Array(4)
hoMenu.id = "hotelsMenu"
hoMenu.imgname = "ho"
hoMenu[0] = new menuLink("<nobr>Kiev hotels</nobr>", "../hotel/hotel_1.html")
hoMenu[1] = new menuLink("<nobr>Yalta hotels</nobr>", "../hotel/hotel_cr_1.html")
hoMenu[2] = new menuLink("<nobr>Sevastopol hotels </nobr>", "../hotel/hotel_cr_6.html")
hoMenu[3] = new menuLink("<nobr>Simferopol hotels</nobr>", "../hotel/hotel_cr_2.html")


toMenu = new Array(8)
toMenu.id = "tourMenu"
toMenu.imgname = "to"
toMenu[0] = new menuLink("<nobr>Cascade in Kyiv</nobr>", "../tour/tour_cascad.html")
toMenu[1] = new menuLink("<nobr>Kyiv 4days/ 3 nights</nobr>", "../tour/tour_17.html")
toMenu[2] = new menuLink("<nobr>Chornobyl tour </nobr>", "../tour/tour_3.html")
toMenu[3] = new menuLink("<nobr>Kyiv-Lviv-Kyiv</nobr>", "../tour/tour_22.html") 
toMenu[4] = new menuLink("<nobr>Uman` tour</nobr>", "../tour/tour_26.html")
toMenu[5] = new menuLink("<nobr>Chernihiv tour </nobr>", "../tour/tour_28.html")
toMenu[6] = new menuLink("<nobr>Poltava tour</nobr>", "../tour/tour_27.html")
toMenu[7] = new menuLink("<nobr> Conference Service  </nobr>", "../tour/tour_12.html")


noMenu = new Array(2)
noMenu.id = "norderMenu"
noMenu.imgname = "no"
noMenu[0] = new menuLink("<nobr>Tickets order </nobr>", "../tickets/tickets_1.html")
noMenu[1] = new menuLink("<nobr>Hotel reservation form </nobr>", "../tickets/tickets_2.html")


uiMenu = new Array(5)
uiMenu.id = "uinfoMenu"
uiMenu.imgname = "ui"
uiMenu[0] = new menuLink("<nobr>Travel to Ukraine</nobr>", "../info/info_1.html")
uiMenu[1] = new menuLink("<nobr>VISA SUPPORT</nobr>", "../info/info_2.html")
uiMenu[2] = new menuLink("<nobr>CUSTOMS RULES </nobr>", "../info/info_3.html")
uiMenu[3] = new menuLink("<nobr>Ukraine Registration</nobr>", "../info/info_4.html")
uiMenu[4] = new menuLink("<nobr>Transport services</nobr>", "../info/trans_1.html")

kiMenu = new Array(7)
kiMenu.id = "kievMenu"
kiMenu.imgname = "ki"
kiMenu[0] = new menuLink("<nobr>Kiev-Pechersk Lavra</nobr>", "../photo/photo_1.html")
kiMenu[1] = new menuLink("<nobr>Andreyevsky Uzviz</nobr>", "../photo/photo_2.html")
kiMenu[2] = new menuLink("<nobr>St. Andrew's Cathedral</nobr>", "../photo/photo_5.html")
kiMenu[3] = new menuLink("<nobr>Mariynsky Palace</nobr>", "../photo/photo_8.html")
kiMenu[4] = new menuLink("<nobr>St.Sophia Cathedral</nobr>", "../photo/photo_3.html")
kiMenu[5] = new menuLink("<nobr>Mikhaylovskiy Cathedral</nobr>", "../photo/photo_4.html")
kiMenu[6] = new menuLink("<nobr>Ukraine History museum</nobr>", "../photo/photo_6.html")



