/** * unespaceEntities * * @param cdata Data to process */ function unescapeEntities(cdata) { var buff=''; for (var pos=0; pos', sparse); // This is the start tag string containing all the attributes var tags = doc.substr(sparse, end); // sw sets the reading mode : attribute or attribute value var attName = ''; var attValue = ''; var sw = false; var ret=''; var j = 0; for (var i=0; i'; var startSlice = doc.indexOf(startTag); var cdata; // When LINE3 is empty it is not in the document for example if (-1 != startSlice) { var endTag = ''; var endSlice = doc.indexOf(endTag); // We get the CDATA in the tag cdata = doc.slice((startSlice+ startTag.length), endSlice); if (esc) { cdata = unescapeEntities(cdata); } } else { // If there is no such tag we return an empty string cdata = ''; } return cdata; } /** * replaceEntities * Pangora * * @param cdata * @param includeAmpersand */ function replaceEntities(cdata, includeAmpersand) { var buff=''; for (var pos=0; pos'.length) == '>') { buff += '>'; pos += '>'.length; } else if (cdata.substr(pos, '&'.length) == '&') { buff += '&'; pos += '&'.length; } else if (cdata.substr(pos, '''.length) == ''') { buff += '\''; pos += '''.length; } else if (cdata.substr(pos, '"'.length) == '"') { buff += '"'; pos += '"'.length; } else if (includeAmpersand == true && cdata.substr(pos, '&'.length) == '&') { buff += '&'; pos += '&'.length; } else { buff += cdata.substr(pos, 1); ++pos; } } return buff; } /** * Ajax Part - getXmlhttpObject */ var XMLHTTP_PROGIDS = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0']; function getXmlhttpObject() { var http = null; var last_e = null; try{ http = new XMLHttpRequest(); } catch(e) { } if(!http){ for(var i=0; i<3; ++i){ var progid = XMLHTTP_PROGIDS[i]; try{ http = new ActiveXObject(progid); }catch(e){ last_e = e; } if(http){ XMLHTTP_PROGIDS = [progid]; // so faster next time break; } } /*if(http && !http.toString) { http.toString = function() { "[object XMLHttpRequest]"; } }*/ } if(!http){ } return http; } /** * Write a popup (promo) */ function writePopup(url, width, height, wait, cookie_name, cookie_duration, probability, scrollbars) { // Default parameters if (arguments.length < 8) scrollbars = 0; if (arguments.length < 7) probability = 1; // Should be betwen 0 and 1 if (arguments.length < 6) cookie_duration = null; // In days if (arguments.length < 5) cookie_name = 'popup'; if (arguments.length < 4) wait = 0; // If cookie is present, popup must not be displayed if (document.cookie.indexOf(cookie_name) != -1) return; // If random (between 0 and 1) is over probability, popup must not be displayed if (Math.random() >= probability) return; // Build a cookie to prevent other display var c = cookie_name + '=1;Path=/'; if (cookie_duration != null) { var d = new Date(); d.setTime(d.getTime() + (cookie_duration*24*60*60*1000)); c = c + ';expires=' + d.toGMTString(); } document.cookie = c; // Open popup setTimeout('popPromo(\"' + url + '\", ' + width + ', ' + height + ', \'' + scrollbars + '\')', Math.max(wait, 1)); } function pop2(url, width, height, cn, ncr, lt) { // default parameters if (arguments.length < 7) lt = 1; if (arguments.length < 6) ncr = 0; if (arguments.length < 5) cn = 'pump'; var cpu = PM.Cookie.get(cn); // Second page or more if(cpu != null) { // test blocked cookie if(cpu < 0) return; // cookie update cpu = parseInt(cpu) + 1; if(cpu < ncr) { PM.Cookie.set(cn, cpu, lt); return; } else { PM.Cookie.set(cn, -1, lt); } } // First page else { if(ncr == 0) { PM.Cookie.set(cn, -1, lt); } else { PM.Cookie.set(cn, 0, lt); return; } } win=window.open('', 'pump', 'toolbar=no,location=no, status=0, menubar=0, scrollbars=no, location=no, resizable=no, width=' + width + ', height=' + height); win.resizeTo(width, height); win.document.location.href = url; win.blur(); } function site2(url, width, height, cn, ncr, lt) { // default parameters if (arguments.length < 7) lt = 1; if (arguments.length < 6) ncr = 0; if (arguments.length < 5) cn = 'pump'; var cpu = PM.Cookie.get(cn); // Second page or more if(cpu != null) { // test blocking cookie (=-1) if(cpu < 0) return; // cookie update cpu = parseInt(cpu) + 1; if(cpu < ncr) { PM.Cookie.set(cn, cpu, lt); return; } else { PM.Cookie.set(cn, -1, lt); } } // First page else { if(ncr == 0) { PM.Cookie.set(cn, -1, lt); } else { PM.Cookie.set(cn, 0, lt); return; } } win=window.open('', 'pump', 'toolbar=yes,location=no, status=1, menubar=1, scrollbars=yes, location=yes, resizable=yes, width=' + width + ', height=' + height); win.resizeTo(width, height); win.document.location.href = url; win.blur(); }