function fMapOnOff(obj) {
 var map = document.getElementById('mapimg');
 var id = obj.id;
 if (map.className == 'map_base') {
  map.className = id;
 } else {
  map.className = 'map_base'; 
 }
}

function hRow(theRow, theColor) {
    var theCells = null;
    if (theColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    // Opera does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined') {
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].setAttribute('bgcolor', theColor, 0);
        } // end for
    }
    else {
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].style.backgroundColor = theColor;
        }
    }
    return true;
}

var newWindow
function popWindow(TheURL, newWidth, newHeight, ShowMenu, Name) {
  var output = ''
  var options
  options = 'width=' + newWidth + ',height=' + newHeight
  if (ShowMenu == 1) {
  	ShowMenu = 'yes';
  	newHeight = newHeight + 60
  };
  if (ShowMenu == 0) {
  	ShowMenu = 'no';
  	newHeight = newHeight + 30
  };
  options = options + ',menubar='+ShowMenu+',toolbar=no,scrollbars=yes,resizable=yes,status=no'

  if (newWindow && newWindow.focus && !newWindow.closed) {
    newWindow.focus();
    newWindow.resizeTo(newWidth,newHeight);
  } else {
    newWindow = window.open('', Name, options);
    if (!newWindow) { alert ('Please disable your pop-up killer!'); return; }
    newWindow.resizeTo(newWidth,newHeight);
  }
  newWindow.moveTo((screen.width-newWidth-10)/2,(screen.height-newHeight-100)/2);
  newWindow.document.location = TheURL;
  newWindow.resizeTo(newWidth,newHeight);
  newWindow.focus();
}

function imgWindow(imgSource, imgWidth, imgHeight, ttl, alt) 
	{
		if (alt == '') { alt = 'Затвори'; }
		var output = ""
		var options
		options = 'width=' + imgWidth + ',height=' + imgHeight + ',scrollbars=no, resizable=no'
		
		var imgWin = window.open("", imgHeight, options);
		output += "<html><head><title>"+ttl+"</title></head><body marginwidth=0 marginheight=0 topmargin=0 leftmargin=0>"
		output += "<a href='javascript:window.close()'><img src="
		output += imgSource
		output += " width="
		output += imgWidth
		output += " height="
		output += imgHeight
		output += " border=0 alt='"+alt+"'></a>"
		output += "</body></html>"
		
		imgWin.document.write(output)
		imgWin.document.close()
	}

// SendMailTo procedure (avoid SPAM)
function ePismo(suf, adr, dom, name) {
 if (name) {
 	window.location = "mail"+"to:"+name+"<"+adr+"@"+dom+"."+suf+">";
 } else {
 	window.location = "mail"+"to:"+adr+"@"+dom+"."+suf;
 }
}

