var gb = (((navigator.appName == "Netscape") && 
         (parseInt(navigator.appVersion) >= 3 )) || 
         ((navigator.appName == "Microsoft Internet Explorer") && 
         (parseInt(navigator.appVersion) >= 4 ))); 
var layers=new Array('Info', 'Systems', 'Services', 'Products', 'Constructions', 'Profiles', 'Services1');
var sh=0;
var Timer;

function fix() { if (gb) {clearTimeout(Timer);}}
function set() {if (gb) {Timer=setTimeout('if (sh==1) HideLayers()', 500);}}

function HideLayers() {
        if (gb) {
                for (i=0; i<7; i++) 
                        if (document.all[layers[i]])
                                document.all[layers[i]].style.visibility='hidden';
                sh=0;
        }
}

function Show(LayerName) {
        if (gb) {
                clearTimeout(Timer);
                HideLayers();
                document.all[LayerName].style.visibility='visible';
                sh=1;
        }
}

var MapWin;
function OpenMap(url, width, height) {
        if (MapWin) { MapWin.close(); }
        MapWin=window.open ("", "Photos", "width="+width+",height="+height+",resizable=0");
        MapWin.document.open();
        MapWin.document.writeln("<HTML><head><title>Фотографии</title></head><BODY leftmargin=0 topmargin=0 oncontextmenu='return false' ondragstart='return false'><img src="+url+" width="+width+" height="+height+" border=0></BODY></HTML>");
        MapWin.document.close();
        MapWin.focus();
}

var PMapWin;
function OpenPMap(url) {
        if (PMapWin) { PMapWin.focus(); }
        else {
	        MapWin=window.open (url, "ObjectMap", "width=537,height=558,resizable=0");
	        MapWin.focus();
	}
}

var fWin;
function OpenF(url, width, height) {
        if (fWin) { fWin.close(); }
        else {
	        fWin=window.open (url, "UserWindow", "width="+width+",height="+height+",resizable=0");
	        fWin.focus();
	}
}

function OpenRec(url, width, height) {
        if (MapWin) { MapWin.close(); }
        var widthWin=width+20;
        MapWin=window.open ("", "Photos", "width="+widthWin+",height=600,resizable=0,scrollbars=1");
        MapWin.document.open();
        MapWin.document.writeln("<HTML><head><title>Фотографии</title></head><BODY leftmargin=0 topmargin=0 oncontextmenu='return false' ondragstart='return false'><img src="+url+" width="+width+" height="+height+" border=0></BODY></HTML>");
        MapWin.document.close();
        MapWin.focus();
}

function ReadCookie(cname) {
  var cl = cname.length;
  var l = document.cookie.length;
  var x = 0;
  while (x <= l) {
    if (document.cookie.substring(x, x+cl) == cname) {
      return(true);
    }
    x = document.cookie.indexOf(' ', x)+1;
    if (x == 0) {break;}
  }
  return(false);
}

//---------------------------------------------------------------------
/*
function makeFloatWin(obj){ this.css=eval(obj+'.style');}

function checkScrolled(){
//    scrolled=n?"window.pageYOffset":"document.body.scrollTop";
//    scrolled="document.body.scrollTop";
//    WhereBuy.css.top=eval(scrolled)+8;
    WhereBuy.css.top=document.body.scrollTop+10;
}

function WhereBuyInit(){
	WhereBuy=new makeFloatWin('RightBlock');
//	ie?window.onscroll=checkScrolled:checkScrolled();
window.onscroll=checkScrolled;
}

onload=WhereBuyInit;
*/
