//http://www.featureblend.com/license.txt function FlashTML(source,width,height){var self=this;var baseElement=document.createElement("div");var options=arguments[3]||{};var winIE=((navigator.appVersion.toLowerCase().indexOf("win")!=-1)&&(navigator.appName=="Microsoft Internet Explorer"));var idCount=FlashTML.idCount++;var namespaceAdded=false;var namespaceName="flashtml";var namespaceURN="http://www.featureblend.com/2007/flashtml/";self.domTemplate="";self.innerHTML="";self.xhtml="";self.inDocumentElement="";var getNameValueAttrFromOptions=function(name){return(options.hasOwnProperty(name))?getNameValueAttributes(name,options[name].toString()):"";};var getNameValueAttributes=function(name,value){return{"@name":name,"@value":value};};var createElementFromRule=function(name,target){var newElement=safeCreateElement(name.replace("#",""));return target.appendChild(newElement);};var setAttributeFromRule=function(name,value,target){target.setAttribute(name.replace("@",""),value);};var safeCreateElement=function(name){if((name=="object"||name=="param")&&document.namespaces){if(!namespaceAdded){document.namespaces.add(namespaceName,namespaceURN);namespaceAdded=true;} return document.createElement(namespaceName+":"+name);}else{return document.createElement(name);}};var htmlTidy=function(str){str=str.replace(/<\?xml([^>]*)>/,"");str=str.replace(eval("/"+namespaceName+":/g"),"");str=str.replace(/><\/param>/g,">");str=str.replace(/()/g,"");return str;};var parseRules=function(position,target){for(var i in position){if(position.hasOwnProperty(i)){if(i.charAt(0)=="#"){var appendedElement;if(typeof position[i]=="object"&&position[i].length){for(var j=0;j'+title+''; if(txt) ret += '
'+txt+'
'; if(extrainfo) { ret += '
Więcej informacji...
'; ret += ''; } $('gAlert-innerHTML').innerHTML = ret; if(typeof(Effect)!='undefined') { $('gAlert_cont').style.display = 'block'; //new Effect.Appear('gAlert_cont2',{duration:200}); }else{ $('gAlert_cont').style.display = 'block'; } } function filtruj2() { document.forms.filterform.submit(); } function filtruj() { document.getElementById('cena_wszystkie').checked = true; document.getElementById('cena_przedzial').checked = false; window.setTimeout(filtruj2,50); } function strtotext(cena) { var form = document.forms['filterform']; tmp = cena.split('-'); var cod = tmp[0]; var cdo = tmp[1]; if(!(cod > 0)) { cod = ''; } if(!(cdo > 0)) { cdo = ''; } form['filter_cenaod'].value = cod; form['filter_cenado'].value = cdo; } function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function pokazukryj_z_cookies() { var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if(c.indexOf('arest_ps_') >= 0) { // mamy dane o przegl. var row = c.indexOf('='); var klasa = c.substring(9,row); var war = c.substring(row+1,c.length); pokazukryj2(klasa,war); } } return null; } function kategoria_z_cookies() { var ret = 0; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if(c.indexOf('arest_kategoria') >= 0) { var row = c.indexOf('='); var ret = c.substring(row+1,c.length); return ret; } } return ret; } function string_pokaz(klasa) { var czego = 'elementów'; if(klasa.indexOf('producenci') >= 0) { czego = 'producentów'; } return ''; } function string_ukryj(klasa) { var czego = 'elementów'; if(klasa.indexOf('producenci') >= 0) { czego = 'producentów'; } return ''; } function pokazukryj2(klasa, idsp) { var wf = document.getElementById("wfiltry"); var prods = wf.getElementsByTagName("div"); for(i=0; i= 0) { if(prods[i].className.indexOf('glowne') < 0) prods[i].style.display = idsp; } } var przycisk = document.getElementsByName('pokazukryj_'+klasa); var dspl = '' + idsp; if(typeof(przycisk[0]) != 'undefined') { if(dspl == 'none') { przycisk[0].innerHTML = string_pokaz(klasa); }else{ przycisk[0].innerHTML = string_ukryj(klasa); } } } function pokazukryj(klasa) { var wf = document.getElementById("wfiltry"); var prods = wf.getElementsByTagName("div"); var cok = 'none'; for(i=0; i= 0) { if(prods[i].style.display == 'none') { prods[i].style.display = 'block'; cok = 'block'; }else if(prods[i].className.indexOf('glowne') < 0) { prods[i].style.display = 'none'; } } } var przycisk = document.getElementsByName('pokazukryj_'+klasa); if(przycisk[0].innerHTML == string_ukryj(klasa)) { przycisk[0].innerHTML = string_pokaz(klasa); }else{ przycisk[0].innerHTML = string_ukryj(klasa); } createCookie('arest_ps_'+klasa,cok,14); } function zapamietaj_ceny() { var form = document.forms['filterform']; if(typeof(form['filter_cenaod']) != 'undefined') { var x = form['filter_cenaod'].value; if(!(x > 0)) { form['filter_cenaod'].value = ''; x = 0; } createCookie('arest_filter_cena_od',x,14); } if(typeof(form['filter_cenado']) != 'undefined') { var x = form['filter_cenado'].value; if(!(x > 0)) { form['filter_cenado'].value = ''; x = 0; } createCookie('arest_filter_cena_do',x,14); } } function ceny_z_cookies() { var form = document.forms['filterform']; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if(c.indexOf('arest_filter_cena_od') >= 0) { var row = c.indexOf('='); var cena = c.substring(row+1,c.length); if(typeof(form['filter_cenaod']) != 'undefined') { if(form['filter_cenaod'].value == '') { form['filter_cenaod'].value = cena; } } } if(c.indexOf('arest_filter_cena_do') >= 0) { var row = c.indexOf('='); var cena = c.substring(row+1,c.length); if(typeof(form['filter_cenado']) != 'undefined') { if(form['filter_cenado'].value == '') { form['filter_cenado'].value = cena; } } } } zapamietaj_ceny(); return null; } function wyczysc_ceny_z_cookies() { createCookie('arest_filter_cena_od',0,14); createCookie('arest_filter_cena_do',0,14); } function przedzial_zaznacz(e) { var ord1 = e.keyCode; var ord2 = e.charCode; if(ord2 > ord1) { // iefix var ord = ord2; }else{ var ord = ord1; } if((ord >= 48) && (ord <= 57)) { document.getElementById('cena_wszystkie').checked = false; document.getElementById('cena_przedzial').checked = true; } } var IE = document.all?true:false; if (!IE) document.captureEvents(Event.MOUSEMOVE) document.onmousemove = getMouseXY; var tempX = 0; var tempY = 0; function getMouseXY(e) { if (IE) { // grab the x-y pos.s if browser is IE tempX = event.clientX + document.body.scrollLeft; tempY = event.clientY + document.body.scrollTop; } else { // grab the x-y pos.s if browser is NS tempX = e.pageX; tempY = e.pageY; } if (tempX < 0){tempX = 0;} if (tempY < 0){tempY = 0;} return true; } var last; var lastClassName; function getHeight() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } return myHeight; } function hrow(eid) { //last = eid; //lastClassName = document.getElementById(eid).className; //document.getElementById(eid).className = 'trh'; } function drow() { //document.getElementById(last).className = lastClassName; } function drukuj_cennik(mode, request) { var form = document.forms['filterform']; if(form) { var tmp = form.action; form.target='drukujcennik'; form.action='http://www.arest.pl/wydruk-cennika'+request+'&mode='+mode; form.submit(); form.action = tmp; form.target = '_top'; }else{ window.open('http://www.arest.pl/wydruk-cennika'+request+'&mode='+mode, 'drukujcennik'); } return false; } function pds(id, ile) { if($('st_'+id+'_'+1).style.cursor == 'default') return false; for(var i=1;i<=6;i++) { if(ile >= i) { $('st_'+id+'_'+i).src = '/layout/buttons2/star4.gif'; }else{ $('st_'+id+'_'+i).src = '/layout/buttons2/star4g.gif'; } } } function pdo(id, ocena) { var url = '/ajax.php?act=ocen_towar&id='+id+'&ocena='+ocena; new Ajax.Request(url, {method: 'get',onSuccess: function (transport) { var ilosc = transport.responseText; var i; if(ilosc == '*') { $('oceny_'+id).innerHTML = 'Oddałeś już głos.'; }else{ $('oceny_'+id).innerHTML = 'Głos został oddany.'; pds(id,ocena); } for(i=1;i<=6;i++) { $('st_'+id+'_'+i).style.cursor = 'default'; } } } ); } function trodz(id) { if($('rodzina_'+id).style.display=='none') { $('rodzina_'+id).style.display = 'block'; $('rodzinahref_'+id).innerHTML = '(zwiń)'; $('rodzinahref_'+id).title = 'Zwiń tę listę'; }else{ $('rodzina_'+id).style.display = 'none'; $('rodzinahref_'+id).innerHTML = '(rozwiń)'; $('rodzinahref_'+id).title = 'Rozwiń tę listę'; } return false; } function debug(txt) { $('dbbg').innerHTML += txt+"\n"; } function bigphoto_loaded(obj, id) { obj.style.display='block'; $('loadfoto_'+id).style.display='none'; var st = document.body.scrollTop; var mp = tempY - st; var wh = getHeight(); var pos = 0; if(mp+obj.height > wh) { pos -= parseInt(obj.height - (wh-mp) / 2); } if(mp < 50) pos += 40; $('bigphoto_'+id).style.top = pos + 'px'; } var phint = 0; var photo_zoom_dir = ''; function photo_zoom(id, fotourl) { phint = window.setTimeout('photo_zoom_go(\''+id+'\',\''+fotourl+'\');', 700); } function photo_zoom_go(id, fotourl) { $('bigphoto_'+id).innerHTML = ''; Effect.Appear('bigphoto_'+id, {duration:0.3}); phint = 0; } function photo_unzoom(id) { if(phint) { window.clearTimeout(phint); phint = 0; }else{ Effect.Fade('bigphoto_'+id, {duration:0.1}); } } function WiecejOfert(obj) { $('wiecej_ofert_wiecej').style.display='none'; $('wiecej_ofert_mniej').style.display='block'; new Effect.Appear('moreshort',{duration:0.2}); var date = new Date(); date.setTime(date.getTime()+(365*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); document.cookie = "wiecejofert=1"+expires+"; path=/"; } function MniejOfert(obj) { $('wiecej_ofert_wiecej').style.display='block'; $('wiecej_ofert_mniej').style.display='none'; new Effect.Fade('moreshort',{duration:0.2}); var date = new Date(); date.setTime(date.getTime()+(365*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); document.cookie = "wiecejofert=0"+expires+"; path=/"; } function setOpacity(objid,value) { $(objid).style.opacity = value/10; $(objid).style.filter = 'alpha(opacity=' + value*10 + ')'; } function ostprzegl() { var url = '/ajax.php?act=ostprzegladane&ostprzegl='+oldostprzegl; new Ajax.Request(url, {method: 'get',onSuccess: function (transport) { var ret = transport.responseText; if(ret != '0') { var tab = ret.split('|||'); oldostprzegl = tab[0]; $('ostatnioprzegladali').innerHTML = tab[1]; setOpacity('ostatnioprzegladali',1); new Effect.Appear('ostatnioprzegladali',{duration:0.3}); } }}); } var lastgifts = 0; function ShowGifts(zakres) { new Effect.Appear('gift-zakres-'+zakres,{duration:0.07}); } function ChangeGifts(zakres) { if(zakres == lastgifts) return false; new Effect.Fade('gift-zakres-'+lastgifts,{duration:0.1}); lastgifts = zakres; window.setTimeout('ShowGifts('+zakres+')',210); } var chowaj = 0; var pokazuj = 0; var akt = 1; var max = 6; var ac = 0; var canac = true; function klatka() { if(chowaj > 0) { var l1 = parseInt($('pimage'+chowaj).style.left); var l2 = parseInt($('pinfo'+chowaj).style.left); l1 = parseInt(l1 - speed); l2 = parseInt(l2 + speed); speed += 2; $('pimage'+chowaj).style.left = l1 + 'px'; $('pinfo'+chowaj).style.left = l2 + 'px'; if(l2 > 600) { if($('flashbang1')) window.setTimeout("flashbang("+next+");",500); $('promo'+chowaj).style.display = 'none'; $('promo'+next).style.display = 'block'; $('pimage'+next).style.left = '-595px'; $('pinfo'+next).style.left = '760px'; chowaj = 0; pokazuj = next; } } if(pokazuj > 0) { var l1 = parseInt($('pimage'+pokazuj).style.left); var l2 = parseInt($('pinfo'+pokazuj).style.left); l1 = parseInt(l1 + speed); l2 = parseInt(l2 - speed); speed -= 1.8; if(speed < 1) speed = 1; $('pimage'+pokazuj).style.left = l1 + 'px'; $('pinfo'+pokazuj).style.left = l2 + 'px'; if(l2 <= 160) { akt = pokazuj; pokazuj = 0; } } } function flashbang(nr) { for(var i=0;i<3;i+=2) { window.setTimeout("Effect.Fade('flashbang"+nr+"',{duration:0.1});",i*110); window.setTimeout("Effect.Appear('flashbang"+nr+"',{duration:0.1});",(i+1)*110); } window.setTimeout("$('flashbang"+nr+"').style.display='block';",(i+2)*110); } function diveffect(nr) { if((nr != akt) && (chowaj == 0) && (pokazuj == 0)) { speed = 3; chowaj = akt; next = nr; if($('prefix'+chowaj)) Effect.Fade('prefix'+chowaj,{duration:0.1}); if($('prefix'+next)) { window.setTimeout("Effect.Appear('prefix"+next+"',{duration:0.15})", 600); } $('pbtn'+chowaj).className = ''; $('pbtn'+next).className = 'select'; } return false; } function autoklatka(noklatkaback) { if(canac) { var klatka = 0; ac++; if(noklatkaback) { klatka = 1 + ac % (max); }else if(ac % 2 == 0) { klatka = 1; }else{ klatka = (2+parseInt(ac/2)%(max-1)); } diveffect(klatka); } if(noklatkaback) { window.setTimeout('autoklatka('+noklatkaback+')',3500); }else{ window.setTimeout('autoklatka('+noklatkaback+')',6000); } } /* * * Ajax Autocomplete for Prototype, version 1.0.4 * (c) 2010 Tomas Kirda * * Ajax Autocomplete for Prototype is freely distributable under the terms of an MIT-style license. * For details, see the web site: http://www.devbridge.com/projects/autocomplete/ * */ var Autocomplete = function(el, options){ this.el = $(el); this.id = this.el.identify(); this.el.setAttribute('autocomplete','off'); this.suggestions = []; this.data = []; this.badQueries = []; this.selectedIndex = -1; this.currentValue = this.el.value; this.intervalId = 0; this.cachedResponse = []; this.instanceId = null; this.onChangeInterval = null; this.ignoreValueChange = false; this.serviceUrl = options.serviceUrl; this.options = { autoSubmit:false, minChars:1, maxHeight:300, deferRequestBy:0, width:0, container:null }; if(options){ Object.extend(this.options, options); } if(Autocomplete.isDomLoaded){ this.initialize(); }else{ Event.observe(document, 'dom:loaded', this.initialize.bind(this), false); } }; Autocomplete.instances = []; Autocomplete.isDomLoaded = false; Autocomplete.getInstance = function(id){ var instances = Autocomplete.instances; var i = instances.length; while(i--){ if(instances[i].id === id){ return instances[i]; }} }; Autocomplete.highlight = function(value, re){ return value.replace(re, function(match){ return '' + match + '<\/strong>' }); }; Autocomplete.prototype = { killerFn: null, initialize: function() { var me = this; this.killerFn = function(e) { if (!$(Event.element(e)).up('.autocomplete')) { me.killSuggestions(); me.disableKillerFn(); } } .bindAsEventListener(this); if (!this.options.width) { this.options.width = this.el.getWidth(); } var div = new Element('div', { style: 'position:absolute;' }); div.update('
'); this.options.container = $(this.options.container); if (this.options.container) { this.options.container.appendChild(div); this.fixPosition = function() { }; } else { document.body.appendChild(div); } this.mainContainerId = div.identify(); this.container = $('Autocomplete_' + this.id); this.fixPosition(); Event.observe(this.el, window.opera ? 'keypress':'keydown', this.onKeyPress.bind(this)); Event.observe(this.el, 'keyup', this.onKeyUp.bind(this)); Event.observe(this.el, 'blur', this.enableKillerFn.bind(this)); Event.observe(this.el, 'focus', this.fixPosition.bind(this)); this.container.setStyle({ maxHeight: this.options.maxHeight + 'px' }); this.instanceId = Autocomplete.instances.push(this) - 1; }, fixPosition: function() { var offset = this.el.cumulativeOffset(); $(this.mainContainerId).setStyle({ top: (offset.top + this.el.getHeight()) + 'px', left: offset.left + 'px' }); }, enableKillerFn: function() { Event.observe(document.body, 'click', this.killerFn); }, disableKillerFn: function() { Event.stopObserving(document.body, 'click', this.killerFn); }, killSuggestions: function() { this.stopKillSuggestions(); this.intervalId = window.setInterval(function() { this.hide(); this.stopKillSuggestions(); } .bind(this), 300); }, stopKillSuggestions: function() { window.clearInterval(this.intervalId); }, onKeyPress: function(e) { if (!this.enabled) { return; } // return will exit the function // and event will not fire switch (e.keyCode) { case Event.KEY_ESC: this.el.value = this.currentValue; this.hide(); break; case Event.KEY_TAB: case Event.KEY_RETURN: if (this.selectedIndex === -1) { this.hide(); return; } this.select(this.selectedIndex); if (e.keyCode === Event.KEY_TAB) { return; } break; case Event.KEY_UP: this.moveUp(); break; case Event.KEY_DOWN: this.moveDown(); break; default: return; } Event.stop(e); }, onKeyUp: function(e) { switch (e.keyCode) { case Event.KEY_UP: case Event.KEY_DOWN: return; } clearInterval(this.onChangeInterval); if (this.currentValue !== this.el.value) { if (this.options.deferRequestBy > 0) { // Defer lookup in case when value changes very quickly: this.onChangeInterval = setInterval((function() { this.onValueChange(); }).bind(this), this.options.deferRequestBy); } else { this.onValueChange(); } } }, onValueChange: function() { clearInterval(this.onChangeInterval); this.currentValue = this.el.value; this.selectedIndex = -1; if (this.ignoreValueChange) { this.ignoreValueChange = false; return; } if (this.currentValue === '' || this.currentValue.length < this.options.minChars) { this.hide(); } else { this.getSuggestions(); } }, getSuggestions: function() { var cr = this.cachedResponse[this.currentValue]; if (cr && Object.isArray(cr.suggestions)) { this.suggestions = cr.suggestions; this.data = cr.data; this.suggest(); } else if (!this.isBadQuery(this.currentValue)) { new Ajax.Request(this.serviceUrl, { parameters: { query: this.currentValue }, onComplete: this.processResponse.bind(this), method: 'get' }); } }, isBadQuery: function(q) { var i = this.badQueries.length; while (i--) { if (q.indexOf(this.badQueries[i]) === 0) { return true; } } return false; }, hide: function() { this.enabled = false; this.selectedIndex = -1; this.container.hide(); }, suggest: function() { if (this.suggestions.length === 0) { this.hide(); return; } var content = []; var re = new RegExp('\\b' + this.currentValue.match(/\w+/g).join('|\\b'), 'gi'); this.suggestions.each(function(value, i) { content.push((this.selectedIndex === i ? '
', Autocomplete.highlight(value, re), '
'); } .bind(this)); this.enabled = true; this.container.update(content.join('')).show(); }, processResponse: function(xhr) { var response; try { response = xhr.responseText.evalJSON(); if (!Object.isArray(response.data)) { response.data = []; } } catch (err) { return; } this.cachedResponse[response.query] = response; if (response.suggestions.length === 0) { this.badQueries.push(response.query); } if (response.query === this.currentValue) { this.suggestions = response.suggestions; this.data = response.data; this.suggest(); } }, activate: function(index) { var divs = this.container.childNodes; var activeItem; // Clear previous selection: if (this.selectedIndex !== -1 && divs.length > this.selectedIndex) { divs[this.selectedIndex].className = ''; } this.selectedIndex = index; if (this.selectedIndex !== -1 && divs.length > this.selectedIndex) { activeItem = divs[this.selectedIndex] activeItem.className = 'selected'; } return activeItem; }, deactivate: function(div, index) { div.className = ''; if (this.selectedIndex === index) { this.selectedIndex = -1; } }, select: function(i) { var selectedValue = this.suggestions[i]; if (selectedValue) { this.el.value = selectedValue; if (this.options.autoSubmit && this.el.form) { this.el.form.submit(); } this.ignoreValueChange = true; this.hide(); this.onSelect(i); } }, moveUp: function() { if (this.selectedIndex === -1) { return; } if (this.selectedIndex === 0) { this.container.childNodes[0].className = ''; this.selectedIndex = -1; this.el.value = this.currentValue; return; } this.adjustScroll(this.selectedIndex - 1); }, moveDown: function() { if (this.selectedIndex === (this.suggestions.length - 1)) { return; } this.adjustScroll(this.selectedIndex + 1); }, adjustScroll: function(i) { var container = this.container; var activeItem = this.activate(i); var offsetTop = activeItem.offsetTop; var upperBound = container.scrollTop; var lowerBound = upperBound + this.options.maxHeight - 25; if (offsetTop < upperBound) { container.scrollTop = offsetTop; } else if (offsetTop > lowerBound) { container.scrollTop = offsetTop - this.options.maxHeight + 25; } this.el.value = this.suggestions[i]; }, onSelect: function(i) { (this.options.onSelect || Prototype.emptyFunction)(this.suggestions[i], this.data[i]); } }; Event.observe(document, 'dom:loaded', function(){ Autocomplete.isDomLoaded = true; }, false); function IntoBasket(ID) { parent.location.href = "/koszyk-akcja/insert="+ID; } function IntoBasketCombo(ids) { parent.location.href = "/koszyk-akcja/insertcombo="+ids; } function KonfigBasket(ID) { parent.location.href = "/koszyk-akcja/konfig="+ID; } function DetailedInfo(id) { okno = window.open('/showtowar.php?ID='+id, 'info_o_towarze_'+id , 'toolbar=yes,resizable=1,scrollbars=yes,menubar=yes,location=yes, width=600, height=640, left=50, top=0'); if (parseInt(navigator.appVersion)>=4) okno.window.focus(); } function tplP(id) { okno = window.open('/tpl.php?tplP='+id, 'info_o_towarze_'+id , 'toolbar=no,resizable=0,scrollbars=yes,menubar=no,location=no, width=660, height=640, left=50, top=0');if (parseInt(navigator.appVersion)>=4) okno.window.focus(); } function otworzokono(mypage,myname,w,h,features) { var winl = (screen.width-w)/2; var wint = (screen.height-h)/2; if(navigator.appName == 'Opera') wint = parseInt(wint * 0.5); if (winl < 0) winl = 0; if (wint < 0) wint = 0; var settings = 'height=' + h + ','; settings += 'width=' + w + ','; settings += 'top=' + wint + ','; settings += 'left=' + winl + ','; settings += features; win = window.open(mypage,myname,settings); win.window.focus(); } function Pomoc(temat) { if(typeof(pomoc)!='undefined') { if(pomoc.open && !pomoc.closed) { pomoc.close(); } } otworzokono('/centrum-pomocy/'+(temat), 'pomoc', 640, 500, 'toolbar=no,resizable=0,scrollbars=yes,menubar=no,location=no') return false; } function BigFoto(id ) { id++; } function LoadSnow() { var myObj = new FlashTML("/layout/snow_lq.swf", "930", "100", {quality:'low',menu:'false',wmode:'transparent'}); myObj.replace("snoww"); } var IE = document.all?true:false; if (!IE) document.captureEvents(Event.MOUSEMOVE) document.onmousemove = getMouseXY; var tempX = 0; var tempY = 0; function getMouseXY(e) { if (IE) { // grab the x-y pos.s if browser is IE tempX = event.clientX + document.body.scrollLeft; tempY = event.clientY + document.body.scrollTop; } else { // grab the x-y pos.s if browser is NS tempX = e.pageX; tempY = e.pageY; } if (tempX < 0){tempX = 0;} if (tempY < 0){tempY = 0;} return true; } var cod = 0; var cdo = 0; var ppi = 0; var cs = 0; var spp = 0; var tar = ''; var forcenomove = true; function przenies_pas(ktory) { tar = ktory; spp = tempX; if(ktory == 'belka_od') { cs = parseInt($('jasnypas1').style.width); }else{ cs = parseInt($('srodek').style.width); } forcenomove = false; ppi = setInterval('przenos()',1); } function przenos() { if(forcenomove) return true; var dif = tempX - spp; var v = cs + dif; var w1 = parseInt($('jasnypas1').style.width); var w2 = 16; var w3 = parseInt($('srodek').style.width); var w4 = 16; var w5 = parseInt($('jasnypas2').style.width); if(tar == 'belka_od') { var min = 0; var max = 180 - (w2+w4+w5+1); }else{ var min = 1; var max = 180 - (w1+w2+w4); } v = parseInt(v); if(v < min) v = min; if(v > max) v = max; if(tar == 'belka_od') { w1 = v; w3 = 180 - (w1+w5+w4+w2); }else{ w3 = v; w5 = 180 - (w1+w2+w3+w4); } $('jasnypas1').style.width = w1+'px'; $('srodek').style.width = w3+'px'; $('jasnypas2').style.width = w5+'px'; if(tar == 'belka_od') { $('testcena_od').value = parseInt((mincena + w1 * ror / (180-w2-w2)) / 50) * 50; }else{ var cod = parseInt(mincena + w1 * ror / (180-w2-w2)); $('testcena_do').value = parseInt((cod + w3 * ror / (180-w2-w2)) / 50) * 50 + 50; } } function update_testcena() { var cod = $('testcena_od').value; var cdo = $('testcena_do').value; cod = parseInt(cod); cdo = parseInt(cdo); var w2 = 16; if(isNaN(cod)) cod = parseInt(mincena); if(isNaN(cdo)) cdo = parseInt(maxcena); if(cod < mincena) cod = mincena; if(cdo > maxcena) cdo = maxcena; if(cod > cdo) cod = mincena; if(cdo < cod) cdo = maxcena; w1 = parseInt( ((cod-mincena)*(180-w2-w2) / ror) / 1 ) * 1; w3 = parseInt( ((cdo-cod)*(180-w2-w2) / ror) / 1 ) * 1; w5 = 180 - (w1+w2+w2+w3); $('jasnypas1').style.width = w1+'px'; $('srodek').style.width = w3+'px'; $('jasnypas2').style.width = w5+'px'; $('testcena_od').value = cod; $('testcena_do').value = cdo; } function nie_przenos_pasa() { forcenomove = true; clearInterval(ppi); ppi = 0; } function rgbhex(r,g,b) { var hr = parseInt(r).toString(16); var hg = parseInt(g).toString(16); var hb = parseInt(b).toString(16); if(r < 16) hr = '0'+hr; if(g < 16) hg = '0'+hg; if(b < 16) hb = '0'+hb; return '#'+hr+hg+hb; } function bar_color(f) { b = 30; f = 1 - f; if(f < 0.5) { g = 230; r = f * 230 * 2; }else{ r = 230; g = 230 - (f-0.5) * 230; } return rgbhex(r,g,b); } var testy = new Array(0,0,0,0); function updatetb(nr,ibox) { var v = ibox.value; if(v < 0) v = 0; if(v > bar_max[nr-1]) v = bar_max[nr-1]; ibox.value = v; var f = v / bar_max[nr-1]; stopeffect = 30; $('testbar'+nr).style.width = parseInt(180*f); $('testbar'+nr).style.backgroundColor = bar_color(f); } function set_bars() { var w = $('konfigi').options[$('konfigi').selectedIndex].value; if(w >= 0) { var tab = konfig[w].split(','); var ceny = tab[0].split('-'); var sortby = tab[1]; var ind = 0; //sortselect var f = document.forms['bibliotekaform']['konfig[sortby]']; for(var i=0;i 1) { wyn = tab[i]; }else{ wyn = parseInt(tab[i] * bar_max[i-1]); } nr = i - 1; $('pwynik'+nr).value = wyn; if(wyn > 0) { $('testbaron'+nr).checked = true; }else{ $('testbaron'+nr).checked = false; } shtb(nr,wyn>0); updatetb(nr,$('pwynik'+nr)); } update_testcena(); } } function shtb(nr,bool) { if(bool) { $('dtestbar'+nr).style.display = 'block'; }else{ $('dtestbar'+nr).style.display = 'none'; } $('pwynik'+nr).style.display = $('dtestbar'+nr).style.display; } function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+encodeURIComponent(value)+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return decodeURIComponent(c.substring(nameEQ.length,c.length)); } return null; } function DodajPorownanie(id) { var str = readCookie('bench_porownywane'); var nowy; if(str) { nowy = str+','+id; }else{ nowy = id; } createCookie('bench_porownywane',nowy,9999); var ile = parseInt($('porcount').innerHTML); $('porcount').innerHTML = ile + 1; $('porownanie'+id).innerHTML = ''; $('porbtn').innerHTML = '
'; return false; } function DodajPorownanie2(id) { var str = readCookie('bench_porownywane'); var nowy; if(str) { nowy = str+','+id; }else{ nowy = id; } createCookie('bench_porownywane',nowy,9999); var ile = parseInt($('porcount').innerHTML); $('porcount').innerHTML = ile + 1; $('porownanie'+id).innerHTML = ''; $('porbtn').innerHTML = '
'; return false; } function UsunPorownanie(id) { $('komputer'+id).style.display = 'none'; UsunFunction(id); return false; } function UsunFunction(id) { var str = readCookie('bench_porownywane'); var tab = str.split(','); var newtab = new Array(); for(var i=0;i 0) && (tab[i] != id)) newtab.push(tab[i]); } createCookie('bench_porownywane',newtab.join(','),9999); var ile = parseInt($('porcount').innerHTML); $('porcount').innerHTML = ile - 1; if((ile-1) == 0) { $('mainben').innerHTML = '
Lista komputerów jest pusta.
'; } } function UsunPorownanie2(id,nr) { var vnr = ctab[nr]; ctab[nr] = ''; var s = ctab.join(','); for(var i=(vnr+1);i