/*************************************************\ | Меню и вспомогательные функции | | для сайта | | http://www.dipaul.ru | \*************************************************/ /*** Владимир Тихонов ***\ \*** http://wt.nm.ru ***/ function newImage(arg) { if (document.images) { rslt = new Image(); rslt.src = arg; return rslt; } } /*** Предварительная загрузка картинки в теге body onload= ***/ var preloadFlag = false; function preloadImages(arg) { if (document.images) { pict = newImage(arg); preloadFlag = true; } } /*** Вывод окна по центру экрана с заданными размерами показываемой картинки с меню и,при необходимости, скроллингом ***/ function wn(name_pic, width, height) { var width_c; var height_c; var dX = 10; var dY = 30; width_s = window.screen.availWidth - dX; height_s = window.screen.availHeight - dY; var top_r = "top=" + (height_s - height)/2 + ","; var left_r = "left=" + (width_s - width)/2 ; var sb="scrollbars=no, "; if (width > width_s) { width=width_s; height=height+22; left_r = "left=0"; sb="scrollbars=yes, "; } if (height > height_s) { height=height_s; width=width+22; top_r = "top=0,"; sb="scrollbars=yes, "; } var winda=window.open(name_pic, '_blank', 'menubar=no,toolbar=no,location=no,status=no,directories=no,resizable=0,'+sb+'width='+width+',height='+height+','+top_r+left_r); winda.focus(); } /*** Вывод окна с файлом по центру экрана с заданными размерами окна с меню и скроллингом ***/ function wndd(name_pic, w_pic, h_pic){ var left_w =""; var top_w =""; scr_w=screen.width; if (w_pic=="s") {w_pic=Math.round(scr_w/1.1);} left_w = Math.round((screen.width - w_pic)/2); top_w = Math.round((screen.height - h_pic)/2); cfg="left="+left_w+",top="+top_w+",width="+w_pic+",height="+h_pic+",location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1"; window.open(name_pic,'_blank',config=cfg); } /*** Вывод окна по центру экрана с заданными размерами показываемой картинки без меню и скроллинга ***/ function wnds(name_pic, w_pic, h_pic){ var left_w =""; var top_w =""; left_w = Math.round((screen.width - w_pic)/2); top_w = Math.round((screen.height - h_pic)/2); cfg="left="+left_w+",top="+top_w+",width="+w_pic+",height="+h_pic+",location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0"; msgWindow=window.open("", "_blank", config=cfg); msgWindow.document.writeln(""); msgWindow.document.writeln("НПФ <Диполь>"); msgWindow.document.writeln(''); msgWindow.document.writeln(""); msgWindow.document.writeln(''); msgWindow.document.writeln(''); msgWindow.document.writeln(""); } /*** Вывод окна по центру экрана с заданными размерами показываемой картинки без меню и скроллинга с именем окна ***/ function wndss(name_pic, name_win, w_pic, h_pic){ var left_w =""; var top_w =""; left_w = Math.round((screen.width - w_pic)/2); top_w = Math.round((screen.height - h_pic)/2); cfg="left="+left_w+",top="+top_w+",width="+w_pic+",height="+h_pic+",location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0"; msgWindow=window.open("", name_win, config=cfg); msgWindow.document.writeln(""); msgWindow.document.writeln("НПФ <Диполь>"); msgWindow.document.writeln(''); msgWindow.document.writeln(""); msgWindow.document.writeln(''); msgWindow.document.writeln(''); msgWindow.document.writeln(""); } /*** Вывод окна по центру экрана с автоматически определяемыми размерами показываемой картинки; в теге ***/ function wnd(name_pic){ pict.src=name_pic; var left_w =""; var top_w =""; left_w = Math.round((screen.width - pict.width)/2); top_w = Math.round((screen.height - pict.height)/2); cfg="left="+left_w+",top="+top_w+",width="+pict.width+",height="+pict.height+",location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0"; msgWindow=window.open("", "win_new3", config=cfg); msgWindow.document.writeln(""); msgWindow.document.writeln("НПФ <Диполь>"); msgWindow.document.writeln(''); msgWindow.document.writeln(""); msgWindow.document.writeln(''); msgWindow.document.writeln(''); msgWindow.document.writeln(""); } /*** Вывод окна по центру экрана с с автоматически определяемыми размерами показываемой картинки; с заголовком и ссылкой, закрывающей окно ***/ function wndtxt(name_pic, txt){ pict.src=name_pic; var left_w =""; var top_w =""; left_w = Math.round((screen.width - pict.width)/2); top_w = Math.round((screen.height - pict.height)/2); top_close_h=pict.height - 30; cfg="left="+left_w+",top="+top_w+",width="+pict.width+",height="+pict.height+",location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0"; msgWindow=window.open("", "win_new4", config=cfg); msgWindow.document.writeln(""); msgWindow.document.writeln("НПФ <Диполь>. "); msgWindow.document.writeln(''); msgWindow.document.writeln(""); msgWindow.document.writeln(''); msgWindow.document.writeln('
'); msgWindow.document.writeln('

'+txt+'

'); msgWindow.document.writeln('
закрыть...

'); msgWindow.document.writeln('
'); msgWindow.document.writeln(""); } /*** Кнопка с бэкграундом, переключающим видимость объекта***/ function buttonz(name, pic_fore, pic_back, color_fore, color_back, pwidth, pheight){ document.writeln(''); document.write('Свернуть...'); document.write('Развернуть...'); document.writeln(''); } function vis(name) { eval('if (document.all.'+name+'.style.display == "none") {document.all.'+name+'.style.display = ""} else { document.all.'+name+'.style.display = "none" }') ; } function fullwin(){ window.open("index.htm","","fullscreen,scrollbars") } function channel(){ window.open("index.htm","","channelmode,scrollbars") } function hidtop() { //var x=800; var x=screen.width; if(x>640){document.all.top_02.style.display = ""} if(x>800){document.all.top_01.style.display = ""} }