var ads = ''; ads += '<'+'script type="text/javascript" language="JavaScript" id="spe'; ads += 'c1"><'+'/script>\n\n<'+'script type="text/javascript" language="Ja'; ads += 'vaScript">\n/*<'+'![CDATA[*/\n/* 1. Sprawdzanie ilo¶ci zdjêæ w'; ads += ' artykule\n2. Nastêpnie wywolanie kodu \n document.write'; ads += '(‘<'+'scr’+’ipt type="text/javascript" langua'; ads += 'ge="JavaScript" src="http://ads.o2.pl/ad.php?sid=491&cnum=3"'; ads += '><'+'/scr’+’ipt>’);\n3. Czekanie na tablice '; ads += ' aLinks oraz aDesc\n4. Wstawianie linków nad zdjêciami:\n'; ads += '- sytuacja A: po uplywie okreslonego czasu tablice z pkt3 '; ads += 'sa typu \'undefined\' - a zatem nic nie robimy\n- sytuacja B'; ads += ': liczba zdjec jest taka sama jak liczba zwroconych linkow -'; ads += ' ukladamy linki w kolejnosci\n- sytuacja C: liczba zdjec j'; ads += 'est wieszka niz liczba zwroconych linkow*/\n\n// **********'; ads += '*************************\n// ETAP I\n// Pobieramy licz'; ads += 'bê zdjêæ w artykule\n// ***********************************'; ads += '\nif (typeof($$$) != \'function\') { function $$$(id) { return '; ads += 'document.getElementById(id); } }\n\n// definicja metody getE'; ads += 'lementByClassName()\n// Developed by Robert Nyman, http://ww'; ads += 'w.robertnyman.com\n// Code/licensing: http://code.google.com'; ads += '/p/getelementsbyclassname/\nvar getElementsByClassName = fun'; ads += 'ction (className, tag, elm){\nif (document.getElementsByCla'; ads += 'ssName) {\ngetElementsByClassName = function (className, t'; ads += 'ag, elm) {\nelm = elm || document;\nvar elements = elm'; ads += '.getElementsByClassName(className),\nnodeName = (tag)? n'; ads += 'ew RegExp("\\\\b" + tag + "\\\\b", "i") : null,\nreturnEleme'; ads += 'nts = [],\ncurrent;\nfor(var i=0, il=elements.length;'; ads += ' i<'+'il; i+=1){\ncurrent = elements[i];\nif(!nodeName '; ads += '|| nodeName.test(current.nodeName)) {\nreturnElements.p'; ads += 'ush(current);\n}\n}\nreturn returnElements;\n};'; ads += '\n}\nelse if (document.evaluate) {\ngetElementsByClassNam'; ads += 'e = function (className, tag, elm) {\ntag = tag || "*";\n'; ads += 'elm = elm || document;\nvar classes = className.split('; ads += '" "),\nclassesToCheck = "",\nxhtmlNamespace = "http:'; ads += '//www.w3.org/1999/xhtml",\nnamespaceResolver = (document'; ads += '.documentElement.namespaceURI === xhtmlNamespace)? xhtmlName'; ads += 'space : null,\nreturnElements = [],\nelements,\n'; ads += 'node;\nfor(var j=0, jl=classes.length; j<'+'jl; j+=1){\n'; ads += 'classesToCheck += "[contains(concat(\' \', @class, \' \'), \' " +'; ads += ' classes[j] + " \')]";\n}\ntry{\nelements = docume'; ads += 'nt.evaluate(".//" + tag + classesToCheck, elm, namespaceReso'; ads += 'lver, 0, null);\n}\ncatch (e) {\nelements = docume'; ads += 'nt.evaluate(".//" + tag + classesToCheck, elm, null, 0, null'; ads += ');\n}\nwhile ((node = elements.iterateNext())) {\n'; ads += 'returnElements.push(node);\n}\nreturn returnElements;'; ads += '\n};\n}\nelse {\ngetElementsByClassName = function (cla'; ads += 'ssName, tag, elm) {\ntag = tag || "*";\nelm = elm || d'; ads += 'ocument;\nvar classes = className.split(" "),\nclasse'; ads += 'sToCheck = [],\nelements = (tag === "*" && elm.all)? elm'; ads += '.all : elm.getElementsByTagName(tag),\ncurrent,\nret'; ads += 'urnElements = [],\nmatch;\nfor(var k=0, kl=classes.le'; ads += 'ngth; k<'+'kl; k+=1){\nclassesToCheck.push(new RegExp("(^|\\'; ads += '\\s)" + classes[k] + "(\\\\s|$)"));\n}\nfor(var l=0, ll=e'; ads += 'lements.length; l<'+'ll; l+=1){\ncurrent = elements[l];\n'; ads += 'match = false;\nfor(var m=0, ml=classesToCheck.length;'; ads += ' m<'+'ml; m+=1){\nmatch = classesToCheck[m].test(current.c'; ads += 'lassName);\nif (!match) {\nbreak;\n}\n}'; ads += '\nif (match) {\nreturnElements.push(current);\n}'; ads += '\n}\nreturn returnElements;\n};\n}\nreturn getElem'; ads += 'entsByClassName(className, tag, elm);\n};\n\n// tablica obje'; ads += 'cts - w niej trzymamy \'referencje\' do obrazków, przed ktorym'; ads += 'i bedziemy wstawia linki tekstowe\nvar objects = new Array()'; ads += ';\n// zmienna, ktora przechowuje info o liczbe zdjec w arty'; ads += 'kule\nvar nrOfImgs = 0;\n\n// uruchamia skrypt - po tym jak '; ads += 'zaladuje sie strona\nfunction startPTA() {\nif($$$(\'article'; ads += '_container\') && $$$(\'footer\')) {\nobjects = getElementsByC'; ads += 'lassName(\'img\', \'div\', document.getElementById("article_cont'; ads += 'ainer")); \nnrOfImgs = objects.length;\n// *************'; ads += '**********************\n// ETAP II\n// Pobiera'; ads += 'my linki tekstowe\n// ***********************************'; ads += '\n$$$(\'spec1\').src= \'http://ads.o2.pl/ad.php?sid=538&cnum=\''; ads += '+nrOfImgs;\n} else {\nsetTimeout(\'startPTA()\', 50);\n}\n'; ads += '}\n\nvar aDesc = new Array();\nvar aLinks = new Array();\nst'; ads += 'artPTA();\n\n// ***********************************\n// '; ads += 'ETAP III\n// Oczekiwanie na tablice\n// **************'; ads += '*********************\nvar dajSpokoj=0;\nfunction wait4tabs('; ads += ') {\nif (aDesc.length == 0) {\n if(dajSpokoj > 20'; ads += ') return; // 20 sekudn probowalismy - chbya nie ma linkow d'; ads += 'o wstawienia...\n setTimeout(\'wait4tabs()\', 1000);\n '; ads += ' dajSpokoj++;\n} else {\n putTXTad();\n}\n}\nwait4'; ads += 'tabs();\n\n\n\n\n\n\n//------------------------//\n//-------'; ads += '-----------------//\n//------------------------//\n/*functio'; ads += 'n UTF2iso(tempStr)\n{\ntempStr=tempStr.replace(/\\u0105/g,"±'; ads += '");\ntempStr=tempStr.replace(/\\u0107/g,"æ");\ntempStr=temp'; ads += 'Str.replace(/\\u0119/g,"ê");\ntempStr=tempStr.replace(/\\u014'; ads += '2/g,"³");\ntempStr=tempStr.replace(/\\u0144/g,"ñ");\ntempSt'; ads += 'r=tempStr.replace(/\\u00F3/g,"ó");\ntempStr=tempStr.replace('; ads += '/\\u015B/g,"¶");\ntempStr=tempStr.replace(/\\u017A/g,"¼");\n'; ads += 'tempStr=tempStr.replace(/\\u017C/g,"¿");\ntempStr=tempStr.re'; ads += 'place(/\\u0104/g,"¡");\ntempStr=tempStr.replace(/\\u0106/g,"Æ'; ads += '");\ntempStr=tempStr.replace(/\\u0118/g,"Ê");\ntempStr=temp'; ads += 'Str.replace(/\\u0141/g,"£");\ntempStr=tempStr.replace(/\\u014'; ads += '3/g,"Ñ");\ntempStr=tempStr.replace(/\\u00D3/g,"Ó");\ntempSt'; ads += 'r=tempStr.replace(/\\u015A/g,"¦");\ntempStr=tempStr.replace('; ads += '/\\u0179/g,"¬");\ntempStr=tempStr.replace(/\\u017B/g,"¯");\n'; ads += 'tempStr=tempStr.replace(/\\u139\\u161/g,"X");\nreturn tempStr'; ads += ';\n}*/\nfunction UTF2iso(tempStr)\n{\ntempStr=escape(tempSt'; ads += 'r);\ntempStr=tempStr.replace("%C4%uFFFD","±");\ntempStr=te'; ads += 'mpStr.replace("%C4%uFFFD","æ");\ntempStr=tempStr.replace(""'; ads += ',"ê");\ntempStr=tempStr.replace("","³");\ntempStr=tempStr.'; ads += 'replace("","ñ");\ntempStr=tempStr.replace("","ó");\ntempSt'; ads += 'r=tempStr.replace("","¶");\ntempStr=tempStr.replace("","¼")'; ads += ';\ntempStr=tempStr.replace("","¿");\ntempStr=tempStr.repla'; ads += 'ce("","¡");\ntempStr=tempStr.replace("","Æ");\ntempStr=tem'; ads += 'pStr.replace("","Ê");\ntempStr=tempStr.replace("","£");\nt'; ads += 'empStr=tempStr.replace("","Ñ");\ntempStr=tempStr.replace(""'; ads += ',"Ó");\ntempStr=tempStr.replace("","¦");\ntempStr=tempStr.'; ads += 'replace("","¬");\ntempStr=tempStr.replace("","¯");\nreturn'; ads += ' unescape(tempStr);\n}\n//------------------------//\n//----'; ads += '--------------------//\n//------------------------//\n\n\n\n'; ads += '\n// ***********************************\n// ETAP IV\n//'; ads += ' Wstawianie linków nad zdjeciami\n// *********************'; ads += '**************\n// generuje DIV\'a z linkiem tekstowym\nvar a'; ads += 'dIter = 0;\nvar nr=0;\nfunction createAd() {\nif(adIter >= '; ads += 'aDesc.length) adIter = 0;\n\nvar tempA = new Array();\nte'; ads += 'mpA = aDesc[adIter].split("|||");\n\n\nvar TXTad = docume'; ads += 'nt.createElement(\'DIV\');\n TXTad.style.borderStyle = '; ads += '\'solid\';\n TXTad.style.borderWidth = \'1px\';\nTXTad.'; ads += 'style.borderColor = \'red\';\nTXTad.style.padding = 5 + \'px\''; ads += ';\n TXTad.style.textAlign = \'center\';\nTXTad.style.'; ads += 'fontWeight = \'bold\';\nTXTad.style.fontSize = \'10px\';\nTX'; ads += 'Tad.style.marginBottom = \'2px\';\nTXTad.style.marginTop = \''; ads += '2px\';\nTXTad.style.clear = \'both\';\nTXTad.id = \'TXTad_\'+'; ads += 'nr;\nnr++;\n\n var TXThref1 = document.createElement(\''; ads += 'A\');\n TXThref1.style.color = \'#008800\'; \n '; ads += ' TXThref1.style.cursor = \'default\';\n TXThref1.style.'; ads += 'textDecoration = \'none\';\n TXThref1.href = \'javascrip'; ads += 't:void(0)\';\nTXThref1.innerHTML = tempA[0];//---\nTXT'; ads += 'ad.appendChild(TXThref1);\n\nvar TXThref2 = document.create'; ads += 'Element(\'A\');\n TXThref2.style.color = \'#0000ff\'; '; ads += '\nTXThref2.href = aLinks[adIter];//---\n TXThre'; ads += 'f2.innerHTML = tempA[1];//---\nTXThref2.target = \'_blan'; ads += 'k\';\n\n TXTad.appendChild(TXThref2);\n\nvar adIframe'; ads += ' = document.createEle\n\nadIter++;\n return TXTad'; ads += ';\n}\n\n// na podstawie informacji z tabli tab, wstawia link'; ads += 'i tekstowe przed obrazkami\nfunction putTXTad() {\n if(ob'; ads += 'jects.length > 0) {\n for(var iter=0; iter<'+'objects.le'; ads += 'ngth; iter++) \n {\nobjects[iter].parentNode.insertBe'; ads += 'fore(createAd(), objects[iter]);\n }\n }\n}\n\n/*]]>*'; ads += '/\n<'+'/script>'; document.write(ads);