var LinkDivActive = 0;
var onDiv;
var timeOnDiv;
var layerRef;
var styleRef;
var showVar;
var hideVar;
var hideDivi;
var showDivi;

if (navigator.appName == "Netscape") {
 layerRef="document.";
 styleRef="";
 showVar="'show'";
 hideVar="'hide'";
 showDivi="''";
 hideDivi="'none'";
} else {
 layerRef="document.all.";
 styleRef=".style";
 showVar="'visible'";
 hideVar="'hidden'";
 showDivi="''";
 hideDivi="'none'";
}

//Divisions Show | Hide
function switchDiv(divn) {
	eval('if ('+layerRef+divn+styleRef+'.visibility == '+hideVar+') {showDiv(divn);} else {hideDiv(divn);}');
}

function hideDiv(divn) {
 eval(layerRef+divn+styleRef+'.visibility = '+hideVar);
 eval(layerRef+divn+styleRef+'.display = '+hideDivi);
}
function showDiv(divn) {
 eval(layerRef+divn+styleRef+'.visibility = '+showVar);
 eval(layerRef+divn+styleRef+'.display = '+showDivi);
}

//Link Divisions Stuff
function showLinkDiv(divn) {
 if (timeOnDiv != null) {
  clearTimeout(timeOnDiv);
  hideDiv(onDiv);
 }
 showDiv(divn);
 onDiv = divn;
}

function divTimer() {
 timeOnDiv = setTimeout("divOut()",500)
}

function divOut() {
 if (LinkDivActive == 0) {
  hideDiv(onDiv);
 } 
}

function LinkDivOver() {
 LinkDivActive = 1;
 clearTimeout(timeOnDiv);
}

function LinkDivOut() {
 LinkDivActive = 0;
 timeOnDiv = setTimeout("divOut()",500)
}

function check_form (confirmMsg) {
	var is_confirmed = confirm(confirmMsg);
	return is_confirmed;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
 window.open(theURL,winName,features);
}
function selectPath(startpath,elid,elid1,itemid) {
	itemid=parseInt(itemid);
//	if (itemid>0) {itemid=itemid+'/';}
	var s = showModalDialog(startpath+"?urbanid="+itemid, "", "font-family:Verdana;font-size:12;dialogWidth:50em;dialogHeight:41em");
	if (s) {
		document.getElementById(elid).innerHTML='<img src="../gallery/tumb/'+itemid+'/'+s+'" border=0>';
		document.getElementById(elid1).value=s;
	}
}
function selectPathNew(startpath,elid,elid1,itemid) {
	itemid=parseInt(itemid);
	var win = window.open(startpath+"?urbanid="+itemid+"&elid="+elid+"&elid1="+elid1, "", "scrollbars=yes,resizable=yes,width=400,height=500,left=150,top=100");
}
function removeItem(remIt) {
	var is_confirmed = confirm('Удалить?');
	if (is_confirmed) {
		location.href=remIt;
	}
}