// -------------------------------------------- // checks the name of your browser // isIE or isNN are boolean varibles identeficated this isNN=navigator.appName.indexOf('Netscape')>=0; isIE=navigator.appName.indexOf('Explorer')>=0; var bV=parseInt(navigator.appVersion); NS4=(document.layers) ? true : false; IE4=((document.all)&&(bV>=4))?true:false; ver4 = (NS4 || IE4) ? true : false; // ------------------------------------------- // open extra window // usage: openWindow("test.htm") or openWindow("test.jpg", 200, 120) function openWindow(filename, w, h, winname) { var nWidth; var nHeigth; if (h) nHeigth = h; else nHeigth = 500; if (w) nWidth = w; else nWidth = 700; if (!winname) winname = "_blank"; var desktop = window.open(filename, winname, "width="+nWidth+",height="+nHeigth+",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes"); }; //------------------------------------------- // inserts flash move into the document body function insertFlash(filename, w, h) { if (h) nHeigth = h; else nHeigth = 500; if (w) nWidth = w; else nWidth = 700; document.write(''); }; //-------------------------------------------- // timeout close the window. You can change the action // to use it U have to place in your HTML timer initiation // nTimer = setTimeout("leave();", nTimerExpired); var nTimer; var nTimerExpired = 15000; // U have to change this time // window.focus(); function leave() { if (nTimer) clearTimeout(nTimer); window.close(); }; //------------------------------------------------- // go to URL. function goToURL(url) { var sURL; if (url) sURL=url; else sURL="/"; location.href=sURL; }; // -------------------------------------------------- function PutToCart(num, id,ownerlogin) { var nCell = "amount"+num; if (!num && !id) { window.open('/korzina.pl?ownerlogin='+ownerlogin, "Korzina","width=600,height=550,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes"); this.blur(); } else { window.open('/korzina.pl?ownerlogin='+ownerlogin+'&amount='+ document.forms["shop"].elements[nCell].value+'&zakaz_id='+ id, "Korzina","width=600,height=550,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes"); if (document.forms["iscart"].opd.value=="yes") { this.focus(); alert("Товар помещен в корзину. Для просмотра используйте ссылку «Ваша корзина»"); } else { document.forms["iscart"].opd.value="yes"; this.focus(); alert("Товар помещен в корзину. Для просмотра используйте ссылку «Ваша корзина»"); } } // window.frames.korzina.location="/korzina-iframe.pl"; }; // --- работа с картинками --- function openImg(pic, title, wnd) { var sTitle = title ? title : "Просмотр иллюстрации"; var sWnd = wnd ? wnd : "_blank"; if (pic) { var pWnd = window.open('',sWnd,'toolbar=no,location=no,status=no,menubar=no,scrollbars=no, fullscreen=no, resizable=yes, centered=yes'); var wndCnt; wndCnt = "