var doCheck = (document.all!=null);
var openId="none";

navimgNames = new Array(
"/images/nav/on_home.gif",
"/images/nav/on_history.gif",
"/images/nav/on_hero.gif",
"/images/nav/on_creators.gif",
"/images/nav/on_creation.gif",
"/images/nav/on_competitions.gif",
"/images/nav/on_excursions.gif",
"/images/nav/on_guestbook.gif",
"/images/nav/on_about.gif"
)

loadNavImgs = new Array()

for(i=0; i < navimgNames.length; i++) {
  loadNavImgs[i] = new Image;
  loadNavImgs[i].src = navimgNames[i];
}

function rollOver(name) {
	document.images[name].src = "/images/nav/on_"+name+".gif";
}

function rollOut(name) {
	document.images[name].src = "/images/nav/off_"+name+".gif";
}

function getLayer(id) {        
   if (doCheck)       
      return document.all[id];
   else
      return document.layers[id];
}

function showLayer(id) {        
   var get = getLayer(id)
   if (get != null)          
      if (doCheck)
         get.style.visibility = "visible";
      else 
         get.visibility = "show";
}      
  
function hideLayer(id) {
   var get = getLayer(id)        
   if (get != null)          
      if (doCheck)
         get.style.visibility = "hidden";
      else
         get.visibility = "hide";
}

function drillDown(id,div) {
	if (div == 'yes') {
		idDiv = id+'Div';
		if (openId == 'none') {
			showLayer(idDiv);
			rollOver(id);
			openId = id;
			openIdDiv = idDiv;
		} else {
			hideLayer(openIdDiv);
			rollOut(openId);
			showLayer(idDiv);
			rollOver(id);
			openId = id;
			openIdDiv = idDiv;
		}
	} else {
		if (openId == 'none') {
			rollOver(id);
		} else {
			hideLayer(openIdDiv);
			rollOut(openId);
			rollOver(id);
			openId = 'none';
		}
	}
}

function divRollover(name) {
	openId = name;
	openIdDiv = name+"Div";
	showLayer(openIdDiv);
	rollOver(openId);
}

function divRollout(name) {
	hideLayer(name+'Div');
	rollOut(name);
	openId = 'none';
	openIdDiv = 'none';
}

function closeBut(name) {
	hideLayer(name+'Div');
	rollOut(name);
	openId = 'none';
	openIdDiv = 'none';
}

function mapPop(imageName,title,w,h) { 
	var dimensions = "width="+w+",height="+h; 
	var winName = title.replace(/ /g,""); 
	var title = title+" -- Памятник &quot;Тысячелетие России&quot;"; 
	var win = window.open("",winName,dimensions); 
	var d = win.document; 
	d.writeln("<html>"); 
	d.writeln("<head><title>"+title+"</title></head>"); 
	d.writeln("<body marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 onLoad=window.focus();>"); 
	d.writeln("<TABLE background=http://1000source.home.nov.ru/"+imageName+".jpg cellSpacing=0 cellPadding=0 width="+w+" border=0><TR><TD><img src=http://1000source.home.nov.ru/"+imageName+".gif border=0 width="+w+" height="+h+"></TD></TR></TABLE>"); 
	d.writeln("</body>"); 
	d.writeln("</html>"); 
	d.close(); 
}

function mapPop_scrollbars_down(imageName,title,w,h,w1) { 
	var dimensions = "width="+w1+",height=570,scrollbars=yes"; 
	var winName = title.replace(/ /g,""); 
	var title = title+" -- Памятник &quot;Тысячелетие России&quot;"; 
	var win = window.open("",winName,dimensions); 
	var d = win.document; 
	d.writeln("<html>"); 
	d.writeln("<head><title>"+title+"</title></head>"); 
	d.writeln("<body marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 onLoad=window.focus();>"); 
	d.writeln("<TABLE background=http://1000source.home.nov.ru/"+imageName+".jpg cellSpacing=0 cellPadding=0 width="+w+" border=0><TR><TD><img src=http://1000source.home.nov.ru/"+imageName+".gif border=0 width="+w+" height="+h+"></TD></TR></TABLE>"); 
	d.writeln("</body>"); 
	d.writeln("</html>"); 
	d.close(); 
}

function mapPop_scrollbars_right(imageName,title,w,h,h1) { 
	var dimensions = "width=770,height="+h1+",scrollbars=yes"; 
	var winName = title.replace(/ /g,""); 
	var title = title+" -- Памятник &quot;Тысячелетие России&quot;"; 
	var win = window.open("",winName,dimensions); 
	var d = win.document; 
	d.writeln("<html>"); 
	d.writeln("<head><title>"+title+"</title></head>"); 
	d.writeln("<body marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 onLoad=window.focus();>"); 
	d.writeln("<TABLE background=http://1000source.home.nov.ru/"+imageName+".jpg cellSpacing=0 cellPadding=0 width="+w+" border=0><TR><TD><img src=http://1000source.home.nov.ru/"+imageName+".gif border=0 width="+w+" height="+h+"></TD></TR></TABLE>"); 
	d.writeln("</body>"); 
	d.writeln("</html>"); 
	d.close(); 
}
