var maxWidth = 517; function resizeImage(image) { if (image.width > maxWidth) { if (!image.naturalWidth) {image.naturalWidth = image.width}; if (!image.naturalHeight) {image.naturalHeight = image.height}; image.width = maxWidth; image.height = Math.floor(image.naturalHeight/(image.naturalWidth/517)); } } function check_images() { count = document.images.length; i = 0; while(count>i){ url = document.images[i].src; if(url.match(/fotos\//)){ if(document.images[i].complete){ resizeImage(document.images[i]); }else{ document.images[i].onload = resizeImage; } } i++; } } function verifyClick(pId) { var xmlHttpReq = false; var self = this; if (window.XMLHttpRequest) { self.xmlHttpReq = new XMLHttpRequest(); } else if (window.ActiveXObject) { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } var tm = new Date().getTime(); self.xmlHttpReq.open('GET', "/scripts/verifyClick.php?id=" + pId + "&ts=" + tm, true, true); self.xmlHttpReq.onreadystatechange = function() { if (self.xmlHttpReq.readyState == 4) { } } self.xmlHttpReq.send(''); } function verifyPage(pId) { var xmlHttpReq = false; var self = this; if (window.XMLHttpRequest) { self.xmlHttpReq = new XMLHttpRequest(); } else if (window.ActiveXObject) { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } var tm = new Date().getTime(); self.xmlHttpReq.open('GET', "/scripts/verifyPage.php?id=" + pId + "&ts=" + tm, true); self.xmlHttpReq.onreadystatechange = function() { if (self.xmlHttpReq.readyState == 4) { } } self.xmlHttpReq.send(''); }