Seti: Marte come il nostro Polo Nord. Ospitava altre forme di vita

terra-marte

E se la Terra ospitasse luoghi simili a quelli che si potrebbero incontrare su Marte? Questo sicuramente aiuterebbe a comprendere la storia e l’evoluzione di questo pianeta che tanto intriga ed affascina gli astrofisici. Ovviamente però sul nostro pianeta nessun posto riproduce esattamente le condizioni in cui ci si potrebbe imbattere su Marte; ma è possibile incontrare quelle che, in epoche assai lontane, lo hanno caratterizzato.

Grazie ad alcune accurate analisi sui mutamenti subìti dal pianeta marziano, è possibile oggi comprendere molto della sua evoluzione storica. Inoltre, con le derivanti similitudini delle trasformazioni vissute dalla Terra, i ricercatori potrebbero panificare meglio le future missioni in programma alla volta di Marte.

L’astrobiologo Alberto Fairen del SETI Institute, Search for Extra-Terrestrial Intelligence, organismo il cui scopo è la ricerca della vita intelligente extraterrestre, ha identificato i tre stadi durante i quali Marte si sarebbe evoluto. Nello specifico, lo studio condotto da Fairen e dal suo team ha analizzato “l’evoluzione di Marte spiegandone i parallelismi con alcuni posti presenti sulla Terra”.

Primo stadio, Marte ghiacciato. Risale ai primi 700/900 milioni di anni del ‘neonato’ pianeta rosso, quella che gli scienziati definiscono l’era più fredda che il pianeta abbia patito. Le temperature erano proibitive e la superficie era probabilmente ricoperta di acqua. Potenzialmente, dunque, avrebbe potuto ospitare forme di vita. Molti depositi minerari e ed ex bacini acquiferi, di cui oggi siamo venuti a conoscenza, sembrano risalire a questa epoca. Il Polo Nord terrestre, alcune zone dell’Australia occidentale o del Canada artico presentano le stesse caratteristiche. La loro composizione chimica, inoltre, potrebbe aver preservato alcune forme di vita.

Secondo stadio, Marte innevato. Non appena le condizioni ambientali sul pianeta sono diventate sempre più secche e fredde, l’acqua fino ad allora presente ha cominciato a ghiacciarsi. La scomparsa del campo magnetico ed il congelamento di gran parte della superficie marziana ha reso praticamente impossibile la sopravvivenza di qualsiasi microrganismo. È l’epoca che risale a circa 3 miliardi di anni fa. Gli astrobiologi sono particolarmente interessati al modo in cui alcuni microbi o tracce di vita si siano preservati allo stesso modo che in alcuni ambienti terrestri. Pare infatti che, oltre al congelamento in superficie, frequenti fossero anche i fenomeni di vulcanismo e di inondazioni delle terre più basse. Sul suolo terrestre, condizioni simili si riscontrano solo nelle regioni artiche, in Antartide ed in Groenlandia.

Terzo e ultimo stadio, Marte iperarido. È l’epoca che perdura negli ultimi 3 miliardi di anni e nota per essere estremamente arida e fredda. Marte appare come un pianeta continuamente minacciato e colpito dalle radiazioni ultraviolette del Sole. Sebbene non siano presenti sulla Terra posti caratterizzati dalle stesse condizioni climatiche, il deserto di Atacama in Cile propone una di queste peculiarità: il calore che fa evaporare l’acqua. Il suolo, pertanto, ospiterebbe dei batteri ed alcuni organismi che potrebbero essere presenti anche sulla superficie marziana.

Il dibattito non sembra esaurirsi. Lo scienziato planetario Victor Baker, dell’Università dell’Arizona, aggiunge che “comprendere i vari periodi della storia del pianeta rosso potrebbe aiutare a formulare strategie riguardanti i posti in cui ricercare forme di vita”. Nulla di assodato, ma sicuramente molto accattivante. Di certo un modo per rendere più simile a noi un pianeta ancora poco conosciuto ed inospitale come Marte.

Federica Vitale

!-- // used to save the current hostname var gAvgHostName = ""; var gAvgDataElement = null; var shortened_urls = new Array("tinyurl.com","3.ly","bit.ly","tiny.cc","short.to","is.gd","tr.im"); var border_colors = new Array( "#00A120;", "#EAA500;", "#F57301;", "#D20003;" ); var background_colors = new Array( "#C3E5CA;", "#FEEFAE;", "#FFD3B0;", "#F5D4C1;" ); var images = new Array ( "linkscanner://safe12.png", "linkscanner://caution12.png", "linkscanner://warning12.png", "linkscanner://blocked12.png" ); var showCleanVerdicts = true; var showLowRiskVerdicts = true; var showMedRiskVerdicts = true; function avg_ls_does_url_contain(url, contain) { if ((url == null) || (url.length 1)) { return false; } var strUrl = new String(url); // breakup the url to check var parts = strUrl.split("/"); if (parts.length -1) { return true; } return false; } function avg_ls_valid_gmail_search(url) { if ((url == null) || (url.length 1)) return false; var hostMatch = false; // split the url based on '/' var strUrl = new String(url); var parts =strUrl.split("/"); // need domain and path if ((parts == null) || (parts.length 4)) return false; var domain= parts[2]; var path = parts[3]; if ((domain.indexOf("mail.google.") != -1) || (domain.indexOf("gmail.") != -1)) { // save the hostname to use getting links gvgHostName = "google.com"; return true; } return false; } function avg_ls_get_parent_div(element) { if ((element ==null) || (element.parentNode == null)) return null; while (element != null) { if ((element.tagName == "DIV") && element.className && (element.className.length > 0)) return element; element = element.parentNode; } // no div return null; } function avg_ls_parse_ads(href) { if (!href) return href; // check for google ad var regex = "^http(s)?\:\/\/([a-zA-Z0-9]+)\.googlesyndication\.com.+\&adurl\=(.+)"; var re = new RegExp(regex); var matches = href.match(re); if (matches && (matches.length >= 4)) { // else we want the fourth value var match = matches[3]; if (match && (match.length > 0)) return match } return href; } function avg_ls_get_gmail_links(doc, processFrames) { if (doc == null) return; var links = new Array(); var anchors = avg_ls_get_anchors(doc); var element = null; var outHref = ""; var elemClass = ""; // loop through all for (var i = 0; (i < anchors.length) && anchors; i++) { element = anchors[i]; // already processed this element if (element.getAttribute("avglschecked")) continue; // initial checks if ((element.href == null) || (element.href.length < 1)) continue; if (avg_ls_does_url_contain(element.href, gAvgHostName)) continue; // don't mark anything but http:// if (element.href.indexOf("mailto") == 0) continue; if (element.parentNode) { var parentDiv = avg_ls_get_parent_div(element); if ((parentDiv.tagName == "DIV") && ((parentDiv.className == "ii gt") || // mail message body (parentDiv.className == "mv") || // top sponsored links (parentDiv.className == "vb") || // right sponsored links (parentDiv.className == "im") || // inside quotes (parentDiv.className == "gmail_quote") // quote )) // right ads { // parse for any ads var newHref = avg_ls_parse_ads(element.href); // add the image avg_ls_check_url(doc, element, newHref); } } } // recursively process all frames if (processFrames && doc.frames && (doc.frames.length > 0)) { for (var j = 0; j < doc.frames.length; j++) { // 'editable' frame it's probably a reply if (doc.frames[j].frameElement.className && (doc.frames[j].frameElement.className.indexOf("editable") != -1)) { continue; } avg_ls_get_gmail_links(doc.frames[j].document, processFrames); } } return links; } function avg_ls_valid_facebook_search(url) { if ((url == null) || (url.length < 1)) return false; var hostMatch = false; // split the url based on '/' var strUrl = new String(url); var parts = strUrl.split("/"); // need domain and path if ((parts == null) || (parts.length < 2)) return false; var domain= parts[2]; if (domain.indexOf("www.facebook.com") != -1) { // save the hostname to use getting links gAvgHostName = "www.facebook.com"; return true; } return false; } function avg_ls_get_facebook_links(doc, processFrames) { if (doc == null) return; var links = new Array(); var anchors = avg_ls_get_anchors(doc); var element = null; var outHref = ""; var elemClass = ""; // loop through all for (var i = 0; (i < anchors.length) && anchors; i++) { element = anchors[i]; // initial checks if ((element.href == null) || (element.href.length < 1)) continue; if (avg_ls_does_url_contain(element.href, gAvgHostName)) continue; // don't put verdicts in areas where typing is going on if (element.parentNode) { var parentDiv = avg_ls_get_parent_div(element); if ((parentDiv.tagName == "DIV") && (parentDiv.className == "Mentions_Input")) continue; } // already processed this element if (element.getAttribute("avglschecked")) continue; avg_ls_check_url(doc, element, element.href); } /*///cbk - take it out for now the home page can't access frameElement // recursively process all frames if (processFrames && doc.frames && (doc.frames.length > 0)) { for (var j = 0; j < doc.frames.length; j++) { if (doc.frames[j].frameElement != null ) { // 'editable' frame it's probably a reply if (doc.frames[j].frameElement.className && (doc.frames[j].frameElement.className.indexOf("editable") != -1)) { continue; } } avg_ls_get_facebook_links(doc.frames[j].document, processFrames); } } *///cbk return links; } function avg_ls_has_image(element) { if ((element == null) || (element.firstChild == null)) return false; var nextElem = element.firstChild; while (nextElem) { if (nextElem.id && (nextElem.id.indexOf("avg_ls_image") != -1)) return true; nextElem = nextElem.nextSibling; } return false; } function avg_ls_update_image(doc, element, image ) { if ((doc == null) || (element == null)) return ; // mark the element as processed element.setAttribute("avglschecked", "1"); // if no image, nothing to add if (image == null) return; // update the image if (element && element.firstChild) { image_elem = element.firstChild; element.firstChild.src = image; } } function avg_ls_add_image(doc, element, image, flyover) { if ((doc == null) || (element == null)) return; // if no image, nothing to add if (image == null) return; // create a new image var img = doc.createElement("img"); img.src = image; img.border="0"; img.hspace="5"; img.id = "avg_ls_image"; img.setAttribute("title", ""); // append the image to the link element.appendChild(img); img = null; var newImg = element.lastChild; if (flyover && newImg && newImg.id == "avg_ls_image") { newImg.attachEvent("onmouseover", function() {avg_ls_showinline(newImg, flyover)}); newImg.attachEvent("onmouseout", function() {avg_ls_hideinline()}); } } var timeoutId = null; var stopGmail = false; function avg_ls_monitor_gmail(doc, processFrames) { // clear the timer if set if (timeoutId) { clearTimeout(timeoutId); timeoutId = null; } // get the links avg_ls_get_gmail_links(doc, processFrames); // reset the if (!stopGmail) timeoutId = setTimeout(function() {avg_ls_monitor_gmail(doc, processFrames);}, 1000); } function avg_ls_monitor_facebook(doc, processFrames) { // clear the timer if set if (timeoutId) { clearTimeout(timeoutId); timeoutId = null; } // get the links avg_ls_get_facebook_links(doc, processFrames); // reset the if (!stopGmail) timeoutId = setTimeout(function() {avg_ls_monitor_facebook(doc, processFrames);}, 1000); } function avg_ls_process_links(doc, processFrames) { if (avg_ls_valid_gmail_search(doc.location.href)) { // process the gmail links stopGmail = false; avg_ls_init_ratings(doc); showCleanVerdicts = false; avg_ls_monitor_gmail(doc, processFrames); } if (avg_ls_valid_facebook_search(doc.location.href)) { // process the facebook links stopGmail = false; avg_ls_init_ratings(doc); showCleanVerdicts = false; avg_ls_monitor_facebook(doc, processFrames); } } function avg_ls_reload(e) { avg_ls_process_links(document, true); } function avg_ls_onload(e) { if (timeoutId) { clearTimeout(timeoutId); timeoutId = null; } var doc = document; // set the event handler for the data element to listen for load/reloads var data_element = doc.getElementById("avglsdata"); if (data_element) { // save data element for use in later iframes gAvgDataElement = data_element; // rowexit event used to notify javascript of a page data load avg_ls_remove_event(data_element, "rowexit", avg_ls_reload); avg_ls_add_event(data_element, "rowexit", avg_ls_reload); // process links for the document avg_ls_process_links(doc, true); } } function avg_ls_get_anchors(doc) { return doc.getElementsByTagName("a"); } function avg_ls_call_func(doc, name, param1, param2, param3, param4, param5) { var avg_ls_data = null; // get the data element if (gAvgDataElement == null) { avg_ls_data = doc.getElementById("avglsdata"); if ((avg_ls_data == null) || (name == null)) { // data element does not exist return; } gAvgDataElement = avg_ls_data; } else { avg_ls_data = gAvgDataElement; } // for some reason you can't fire and event on an element with no parent node if ((avg_ls_data == null) || (avg_ls_data.parentNode == null)) { return; } // set the attributes avg_ls_data.setAttribute("function", name); if (param1) avg_ls_data.setAttribute("param1", param1); if (param2) avg_ls_data.setAttribute("param2", param2); if (param3) avg_ls_data.setAttribute("param3", param3); if (param4) avg_ls_data.setAttribute("param4", param4); if (param5) avg_ls_data.setAttribute("param5", param5); avg_ls_data.fireEvent("onrowenter"); // get the result return avg_ls_data.getAttribute("result"); } function avg_ls_get_image(result) { if ((result == null) || (result.length < 1)) return null; var strResult = new String(result); var parts = strResult.split("::"); if (parts.length < 3) return; var nSeverity = parseInt(parts[0]); var image = null; switch(nSeverity) { case 0: if (showCleanVerdicts) image = images[nSeverity]; break; case 1: if (showLowRiskVerdicts) image = images[nSeverity]; break; case 2: if (showMedRiskVerdicts) image = images[nSeverity]; break; case 3: image = images[nSeverity]; break; default: image = "linkscanner://unknown12.gif"; break; } return image; } // do the url check function avg_ls_check_url(doc, element, href) { if (avg_ls_has_image(element)) return; var result = avg_ls_call_func(doc, "MalsiteCheck", href); if (result == null) return; var parts = result.split("::"); if (parts.length < 3) return; var nSeverity = parts[0]; var riskCategory = parts[1]; var riskName = parts[2]; if ( nSeverity == 0 ) { // safe shortened urls will get checked at mouse over time if (avg_ls_filter_url(href, shortened_urls)) { // add onmouseover for anchors with shortened url avg_ls_add_event(element, "mouseover", avg_ls_mouse_over); return; } } // mark as processed element.setAttribute("avglschecked", "1"); // get the image from the result var image = avg_ls_get_image(result); if (image == null) return; var bgColor = background_colors[nSeverity]; var borderColor = border_colors[nSeverity]; // build the inline html var html = ""; html += "

"; html += ""; html += riskCategory + ""; html += riskName + " "; avg_ls_add_image(doc, element, image, html); } function avg_ls_add_event(obj, name, func) { if (obj.addEventListener) { obj.addEventListener(name, func, false); return true; } else if (obj.attachEvent) { return obj.attachEvent("on"+name, func); } else { return false; } } function avg_ls_remove_event(obj, name, func) { if (obj.removeEventListener) { obj.removeEventListener(name, func, false); return true; } else if (obj.detachEvent) { return obj.detachEvent("on"+name, func); } else { return false; } } function avg_ls_mouse_over(e) { if (e && e.srcElement && e.srcElement.href) { var element = e.srcElement; if (element.tagName == "A") { // check if it has an image already if (avg_ls_has_image(element)) { return; } // add the image, returns the anchor not the image avg_ls_add_image(document, element, "linkscanner://clock12.png"); // do the check and update in the background setTimeout(function() {avg_ls_check_and_update(document, element);}, 1); } } } function avg_ls_get_inline_image(element) { var nextElem = null; if ((element == null) || (element.firstChild == null)) return nextElem; nextElem = element.firstChild; while (nextElem) { if (nextElem.id && (nextElem.id.indexOf("avg_ls_image") != -1)) return nextElem; nextElem = nextElem.nextSibling; } return null; } function avg_ls_inline_hide_verdict(anchor) { var image = avg_ls_get_inline_image(anchor); if ( image ) { image.style.visibility = "hidden"; } } function avg_ls_check_and_update(doc, element) { var result = avg_ls_call_func(doc, "GetFinalUrl", element.href); if (result) { var result2 = avg_ls_call_func(doc, "MalsiteCheck", result); if (result2 == null) return; // remove the mouseover for this element, no need to fire again avg_ls_remove_event(element, "mouseover", avg_ls_mouse_over); // get the image from the result var image = avg_ls_get_image(result2); if (image == null) avg_ls_inline_hide_verdict(element); else { var img_elem = avg_ls_get_inline_image(element); if (img_elem) { img_elem.src = image; } } } } // function to find a url in a filter list function avg_ls_filter_url(url, filter) { var strUrl = new String(url); var parts = strUrl.split("/"); if ((parts == null) || (parts.length 3)) return false; var domain = parts[2]; for (var i = 0; i = 4) { showCleanVerdicts = (parseInt(parts[0]) == 1) ? true : false; showLowRiskVerdicts = (parseInt(parts[1]) == 1) ? true : false; showMedRiskVerdicts = (parseInt(parts[2]) == 1) ? true : false; } // setup for displaying the inline popup if ( !doc.getElementById("avg_ls_inline_popup") ) { var box = doc.createElement("DIV"); doc.body.appendChild(box); box.id = "avg_ls_inline_popup"; box.style.position = "absolute"; box.style.zIndex = "9999"; box.style.padding = "0px 0px"; box.style.marginLeft = "0px"; box.style.marginTop = "0px"; box.style.overflow = "hidden"; box.style.wordWrap = "break-word"; box.style.color = "black"; box.style.fontSize = "10px"; box.style.textAlign = "left"; box.style.lineHeight = "130%"; } } avg_ls_add_event(window, "load", avg_ls_onload); // -->!-- /* avg linkscanner inline verdict info popup */ // write verdict info and display the inline popup function avg_ls_showinline(imageElem, msg) { //set verdict info var flyover = document.getElementById('avg_ls_inline_popup'); if (flyover == null) return; flyover.innerHTML = msg; flyover.style.width = "auto"; //reset width flyover.style.position = "absolute"; avg_ls_positioninline(imageElem); } function avg_ls_positioninline(imageElem) { var flyover = document.getElementById('avg_ls_inline_popup'); if (flyover == null) return; // relative position of flyover in relation to icon var locateX = 0; // 0=left, 1=right var locateY = 0; // 0=above, 1=below, 2=beside icon var scrollXWidth = 1; // approx // Must know if there is a horizontal scroll bar for Firefox // for proper flyover positioning near bottom edge var scrollBarX = false; //default for Microsoft IE var scrollYWidth = 18; //normally 17 (+1 top border) if (window.innerHeight) { // not MSIE try { scrollYWidth = Math.floor(Math.abs(window.innerHeight - document.documentElement.clientHeight)) + 1; scrollBarX = (document.documentElement.clientWidth < document.documentElement.scrollWidth); } catch(er){} } // get window sizes if (window.innerHeight == undefined) // Microsoft IE { var windowX = (document.documentElement.clientWidth || document.body.clientWidth) - scrollXWidth; var windowY = document.documentElement.clientHeight || document.body.clientHeight; } else { var windowX = window.innerWidth - scrollXWidth; var windowY = window.innerHeight; } // get the flyover dimensions if (window.getComputedStyle == undefined) // Microsoft IE { var flyoverX = parseInt(flyover.offsetWidth); var flyoverY = parseInt(flyover.offsetHeight); } else { var style = document.defaultView.getComputedStyle(flyover, null); var flyoverX = parseInt(style.width); var flyoverY = parseInt(style.height); } flyover.style.width = flyoverX + "px"; // get the bounding rect for image(s) var imgRect = imageElem.getBoundingClientRect(); // half width/height (center) of element bounding rect var halfX = (imgRect.right - imgRect.left) / 2; var halfY = (imgRect.bottom- imgRect.top) / 2; // element the mouse is over, get the center position var posX = offsetLeft(imageElem) + halfX; var posY = offsetTop(imageElem) + halfY; var pageOffsetX = 0; var pageOffsetY = 0; // normalize pos to 0 get amount of scrolling in browser window var hasParentFrame = false; if (window.pageXOffset == undefined) // Microsoft IE { pageOffsetX = document.documentElement.scrollLeft || document.body.scrollLeft; pageOffsetY = document.documentElement.scrollTop || document.body.scrollLeft; var frames = document.frames; if (frames) { for (var i=0; i < frames.length; i++) { if (frames[i].document.getElementById(imageElem.id)) { pageOffsetX = frames[i].document.documentElement.scrollLeft; pageOffsetY = frames[i].document.documentElement.scrollTop; hasParentFrame = true; break; } } } } else { pageOffsetX = window.pageXOffset; pageOffsetY = window.pageYOffset; } posX -= pageOffsetX; posY -= pageOffsetY; //compensate for Firefox 3 if (posX < imgRect.left) posX = imgRect.left+halfX; // setup the offsets var offsetX = posX; var offsetY = posY; // calc where to display on page if ((windowX - posX) > posX) { // right offsetX += halfX; locateX = 1; } else { //left offsetX -= (flyoverX + halfX); } if ((windowY - posY) > posY) { // below if (posY < (windowY/4)) { offsetY -= halfY; locateY = 1; } else { offsetY -= (flyoverY / 2) - halfY; locateY = 2; } } else { // above if ((windowY - posY) < (windowY/4)) { offsetY -= (flyoverY - halfY); } else { offsetY -= (flyoverY / 2) + halfY; locateY = 2; } } // make sure we aren't off the screen if (offsetY < 0) offsetY = 0; if ((offsetY + flyoverY) > windowY) { offsetY = windowY - flyoverY; } else if (scrollBarX && ((windowY - (posY + halfY)) < scrollYWidth)) { //verdict overlaps the horizontal scrollbar offsetY = windowY - (flyoverY + scrollYWidth); } // add page offsets back - if not in frame if (!hasParentFrame) { offsetX += pageOffsetX; offsetY += pageOffsetY; } posX += pageOffsetX; posY += pageOffsetY; var paddedOffsetX = 0; //provide space between icon and flyover var padX = 3; if (locateX == 0) paddedOffsetX = offsetX - padX; else paddedOffsetX = offsetX + padX; // set where to put the flyover flyover.style.top = offsetY + "px"; flyover.style.left = paddedOffsetX + "px"; avg_ls_displayinline(); } function avg_ls_displayinline() { var flyover = document.getElementById('avg_ls_inline_popup'); if (flyover == null) return; // show the flyover flyover.style.visibility = "visible"; } function avg_ls_hideinline() { var flyover = document.getElementById('avg_ls_inline_popup'); if (flyover == null) return; flyover.visibility = "hidden"; //invisible flyover.style.left = "-5000px"; } function offsetTop(element) { var offset = 0; while (element) { offset += element.offsetTop; element = element.offsetParent; } return offset; } function offsetLeft(element) { var offset = 0; while (element) { offset += element.offsetLeft; element = element.offsetParent; } return offset; } // --></span></p> </div> </div> <!-- // used to save the current hostname var gAvgHostName = ""; var gAvgDataElement = null; var shortened_urls = new Array("tinyurl.com","3.ly","bit.ly","tiny.cc","short.to","is.gd","tr.im"); var border_colors = new Array( "#00A120;", "#EAA500;", "#F57301;", "#D20003;" ); var background_colors = new Array( "#C3E5CA;", "#FEEFAE;", "#FFD3B0;", "#F5D4C1;" ); var images = new Array ( "linkscanner://safe12.png", "linkscanner://caution12.png", "linkscanner://warning12.png", "linkscanner://blocked12.png" ); var showCleanVerdicts = true; var showLowRiskVerdicts = true; var showMedRiskVerdicts = true; function avg_ls_does_url_contain(url, contain) { if ((url == null) || (url.length 1)) { return false; } var strUrl = new String(url); // breakup the url to check var parts = strUrl.split("/"); if (parts.length -1) { return true; } return false; } function avg_ls_valid_gmail_search(url) { if ((url == null) || (url.length 1)) return false; var hostMatch = false; // split the url based on '/' var strUrl = new String(url); var parts =strUrl.split("/"); // need domain and path if ((parts == null) || (parts.length 4)) return false; var domain= parts[2]; var path = parts[3]; if ((domain.indexOf("mail.google.") != -1) || (domain.indexOf("gmail.") != -1)) { // save the hostname to use getting links gvgHostName = "google.com"; return true; } return false; } function avg_ls_get_parent_div(element) { if ((element == null) || (element.parentNode == null)) return null; while (element != null) { if ((element.tagName == "DIV") && element.className && (element.className.length > 0)) return element; element = element.parentNode; } // no div return null; } function avg_ls_parse_ads(href) { if (!href) return href; // check for google ad var regex = "^http(s)?\:\/\/([a-zA-Z0-9]+)\.googlesyndication\.com.+\&adurl\=(.+)"; var re = new RegExp(regex); var matches = href.match(re); if (matches && (matches.length >= 4)) { // else we want the fourth value var match = matches[3]; if (match && (match.length > 0)) return match } return href; } function avg_ls_get_gmail_links(doc, processFrames) { if (doc == null) return; var links = new Array(); var anchors = avg_ls_get_anchors(doc); var element = null; var outHref = ""; var elemClass = ""; // loop through all for (var i = 0; (i < anchors.length) && anchors; i++) { element = anchors[i]; // already processed this element if (element.getAttribute("avglschecked")) continue; // initial checks if ((element.href == null) || (element.href.length < 1)) continue; if (avg_ls_does_url_contain(element.href, gAvgHostName)) continue; // don't mark anything but http:// if (element.href.indexOf("mailto") == 0) continue; if (element.parentNode) { var parentDiv = avg_ls_get_parent_div(element); if ((parentDiv.tagName == "DIV") && ((parentDiv.className == "ii gt") || // mail message body (parentDiv.className == "mv") || // top sponsored links (parentDiv.className == "vb") || // right sponsored links (parentDiv.className == "im") || // inside quotes (parentDiv.className == "gmail_quote") // quote )) // right ads { // parse for any ads var newHref = avg_ls_parse_ads(element.href); // add the image avg_ls_check_url(doc, element, newHref); } } } // recursively process all frames if (processFrames && doc.frames && (doc.frames.length > 0)) { for (var j = 0; j < doc.frames.length; j++) { // 'editable' frame it's probably a reply if (doc.frames[j].frameElement.className && (doc.frames[j].frameElement.className.indexOf("editable") != -1)) { continue; } avg_ls_get_gmail_links(doc.frames[j].document, processFrames); } } return links; } function avg_ls_valid_facebook_search(url) { if ((url == null) || (url.length < 1)) return false; var hostMatch = false; // split the url based on '/' var strUrl = new String(url); var parts = strUrl.split("/"); // need domain and path if ((parts == null) || (parts.length < 2)) return false; var domain= parts[2]; if (domain.indexOf("www.facebook.com") != -1) { // save the hostname to use getting links gAvgHostName = "www.facebook.com"; return true; } return false; } function avg_ls_get_facebook_links(doc, processFrames) { if (doc == null) return; var links = new Array(); var anchors = avg_ls_get_anchors(doc); var element = null; var outHref = ""; var elemClass = ""; // loop through all for (var i = 0; (i < anchors.length) && anchors; i++) { element = anchors[i]; // initial checks if ((element.href == null) || (element.href.length < 1)) continue; if (avg_ls_does_url_contain(element.href, gAvgHostName)) continue; // don't put verdicts in areas where typing is going on if (element.parentNode) { var parentDiv = avg_ls_get_parent_div(element); if ((parentDiv.tagName == "DIV") && (parentDiv.className == "Mentions_Input")) continue; } // already processed this element if (element.getAttribute("avglschecked")) continue; avg_ls_check_url(doc, element, element.href); } /*///cbk - take it out for now the home page can't access frameElement // recursively process all frames if (processFrames && doc.frames && (doc.frames.length > 0)) { for (var j = 0; j < doc.frames.length; j++) { if (doc.frames[j].frameElement != null ) { // 'editable' frame it's probably a reply if (doc.frames[j].frameElement.className && (doc.frames[j].frameElement.className.indexOf("editable") != -1)) { continue; } } avg_ls_get_facebook_links(doc.frames[j].document, processFrames); } } *///cbk return links; } function avg_ls_has_image(element) { if ((element == null) || (element.firstChild == null)) return false; var nextElem = element.firstChild; while (nextElem) { if (nextElem.id && (nextElem.id.indexOf("avg_ls_image") != -1)) return true; nextElem = nextElem.nextSibling; } return false; } function avg_ls_update_image(doc, element, image ) { if ((doc == null) || (element == null)) return ; // mark the element as processed element.setAttribute("avglschecked", "1"); // if no image, nothing to add if (image == null) return; // update the image if (element && element.firstChild) { image_elem = element.firstChild; element.firstChild.src = image; } } function avg_ls_add_image(doc, element, image, flyover) { if ((doc == null) || (element == null)) return; // if no image, nothing to add if (image == null) return; // create a new image var img = doc.createElement("img"); img.src = image; img.border="0"; img.hspace="5"; img.id = "avg_ls_image"; img.setAttribute("title", ""); // append the image to the link element.appendChild(img); img = null; var newImg = element.lastChild; if (flyover && newImg && newImg.id == "avg_ls_image") { newImg.attachEvent("onmouseover", function() {avg_ls_showinline(newImg, flyover)}); newImg.attachEvent("onmouseout", function() {avg_ls_hideinline()}); } } var timeoutId = null; var stopGmail = false; function avg_ls_monitor_gmail(doc, processFrames) { // clear the timer if set if (timeoutId) { clearTimeout(timeoutId); timeoutId = null; } // get the links avg_ls_get_gmail_links(doc, processFrames); // reset the if (!stopGmail) timeoutId = setTimeout(function() {avg_ls_monitor_gmail(doc, processFrames);}, 1000); } function avg_ls_monitor_facebook(doc, processFrames) { // clear the timer if set if (timeoutId) { clearTimeout(timeoutId); timeoutId = null; } // get the links avg_ls_get_facebook_links(doc, processFrames); // reset the if (!stopGmail) timeoutId = setTimeout(function() {avg_ls_monitor_facebook(doc, processFrames);}, 1000); } function avg_ls_process_links(doc, processFrames) { if (avg_ls_valid_gmail_search(doc.location.href)) { // process the gmail links stopGmail = false; avg_ls_init_ratings(doc); showCleanVerdicts = false; avg_ls_monitor_gmail(doc, processFrames); } if (avg_ls_valid_facebook_search(doc.location.href)) { // process the facebook links stopGmail = false; avg_ls_init_ratings(doc); showCleanVerdicts = false; avg_ls_monitor_facebook(doc, processFrames); } } function avg_ls_reload(e) { avg_ls_process_links(document, true); } function avg_ls_onload(e) { if (timeoutId) { clearTimeout(timeoutId); timeoutId = null; } var doc = document; // set the event handler for the data element to listen for load/reloads var data_element = doc.getElementById("avglsdata"); if (data_element) { // save data element for use in later iframes gAvgDataElement = data_element; // rowexit event used to notify javascript of a page data load avg_ls_remove_event(data_element, "rowexit", avg_ls_reload); avg_ls_add_event(data_element, "rowexit", avg_ls_reload); // process links for the document avg_ls_process_links(doc, true); } } function avg_ls_get_anchors(doc) { return doc.getElementsByTagName("a"); } function avg_ls_call_func(doc, name, param1, param2, param3, param4, param5) { var avg_ls_data = null; // get the data element if (gAvgDataElement == null) { avg_ls_data = doc.getElementById("avglsdata"); if ((avg_ls_data == null) || (name == null)) { // data element does not exist return; } gAvgDataElement = avg_ls_data; } else { avg_ls_data = gAvgDataElement; } // for some reason you can't fire and event on an element with no parent node if ((avg_ls_data == null) || (avg_ls_data.parentNode == null)) { return; } // set the attributes avg_ls_data.setAttribute("function", name); if (param1) avg_ls_data.setAttribute("param1", param1); if (param2) avg_ls_data.setAttribute("param2", param2); if (param3) avg_ls_data.setAttribute("param3", param3); if (param4) avg_ls_data.setAttribute("param4", param4); if (param5) avg_ls_data.setAttribute("param5", param5); avg_ls_data.fireEvent("onrowenter"); // get the result return avg_ls_data.getAttribute("result"); } function avg_ls_get_image(result) { if ((result == null) || (result.length < 1)) return null; var strResult = new String(result); var parts = strResult.split("::"); if (parts.length < 3) return; var nSeverity = parseInt(parts[0]); var image = null; switch(nSeverity) { case 0: if (showCleanVerdicts) image = images[nSeverity]; break; case 1: if (showLowRiskVerdicts) image = images[nSeverity]; break; case 2: if (showMedRiskVerdicts) image = images[nSeverity]; break; case 3: image = images[nSeverity]; break; default: image = "linkscanner://unknown12.gif"; break; } return image; } // do the url check function avg_ls_check_url(doc, element, href) { if (avg_ls_has_image(element)) return; var result = avg_ls_call_func(doc, "MalsiteCheck", href); if (result == null) return; var parts = result.split("::"); if (parts.length < 3) return; var nSeverity = parts[0]; var riskCategory = parts[1]; var riskName = parts[2]; if ( nSeverity == 0 ) { // safe shortened urls will get checked at mouse over time if (avg_ls_filter_url(href, shortened_urls)) { // add onmouseover for anchors with shortened url avg_ls_add_event(element, "mouseover", avg_ls_mouse_over); return; } } // mark as processed element.setAttribute("avglschecked", "1"); // get the image from the result var image = avg_ls_get_image(result); if (image == null) return; var bgColor = background_colors[nSeverity]; var borderColor = border_colors[nSeverity]; // build the inline html var html = ""; html += "
"; html += ""; html += riskCategory + ""; html += riskName + " "; avg_ls_add_image(doc, element, image, html); } function avg_ls_add_event(obj, name, func) { if (obj.addEventListener) { obj.addEventListener(name, func, false); return true; } else if (obj.attachEvent) { return obj.attachEvent("on"+name, func); } else { return false; } } function avg_ls_remove_event(obj, name, func) { if (obj.removeEventListener) { obj.removeEventListener(name, func, false); return true; } else if (obj.detachEvent) { return obj.detachEvent("on"+name, func); } else { return false; } } function avg_ls_mouse_over(e) { if (e && e.srcElement && e.srcElement.href) { var element = e.srcElement; if (element.tagName == "A") { // check if it has an image already if (avg_ls_has_image(element)) { return; } // add the image, returns the anchor not the image avg_ls_add_image(document, element, "linkscanner://clock12.png"); // do the check and update in the background setTimeout(function() {avg_ls_check_and_update(document, element);}, 1); } } } function avg_ls_get_inline_image(element) { var nextElem = null; if ((element == null) || (element.firstChild == null)) return nextElem; nextElem = element.firstChild; while (nextElem) { if (nextElem.id && (nextElem.id.indexOf("avg_ls_image") != -1)) return nextElem; nextElem = nextElem.nextSibling; } return null; } function avg_ls_inline_hide_verdict(anchor) { var image = avg_ls_get_inline_image(anchor); if ( image ) { image.style.visibility = "hidden"; } } function avg_ls_check_and_update(doc, element) { var result = avg_ls_call_func(doc, "GetFinalUrl", element.href); if (result) { var result2 = avg_ls_call_func(doc, "MalsiteCheck", result); if (result2 == null) return; // remove the mouseover for this element, no need to fire again avg_ls_remove_event(element, "mouseover", avg_ls_mouse_over); // get the image from the result var image = avg_ls_get_image(result2); if (image == null) avg_ls_inline_hide_verdict(element); else { var img_elem = avg_ls_get_inline_image(element); if (img_elem) { img_elem.src = image; } } } } // function to find a url in a filter list function avg_ls_filter_url(url, filter) { var strUrl = new String(url); var parts = strUrl.split("/"); if ((parts == null) || (parts.length = imageElem.getBoundingClientRect(); // half width/height (center) of element bounding rect var halfX = (imgRect.right - imgRect.left) / 2; var halfY = (imgRect.bottom- imgRect.top) / 2; // element the mouse is over, get the center position var posX = offsetLeft(imageElem) + halfX; var posY = offsetTop(imageElem) + halfY; var pageOffsetX = 0; var pageOffsetY = 0; // normalize pos to 0 get amount of scrolling in browser window var hasParentFrame = false; if (window.pageXOffset == undefined) // Microsoft IE { pageOffsetX = document.documentElement.scrollLeft || document.body.scrollLeft; pageOffsetY = document.documentElement.scrollTop || document.body.scrollLeft; var frames = document.frames; if (frames) { for (var i=0; i < frames.length; i++) { if (frames[i].document.getElementById(imageElem.id)) { pageOffsetX = frames[i].document.documentElement.scrollLeft; pageOffsetY = frames[i].document.documentElement.scrollTop; hasParentFrame = true; break; } } } } else { pageOffsetX = window.pageXOffset; pageOffsetY = window.pageYOffset; } posX -= pageOffsetX; posY -= pageOffsetY; //compensate for Firefox 3 if (posX < imgRect.left) posX = imgRect.left+halfX; // setup the offsets var offsetX = posX; var offsetY = posY; // calc where to display on page if ((windowX - posX) > posX) { // right offsetX += halfX; locateX = 1; } else { //left offsetX -= (flyoverX + halfX); } if ((windowY - posY) > posY) { // below if (posY < (windowY/4)) { offsetY -= halfY; locateY = 1; } else { offsetY -= (flyoverY / 2) - halfY; locateY = 2; } } else { // above if ((windowY - posY) < (windowY/4)) { offsetY -= (flyoverY - halfY); } else { offsetY -= (flyoverY / 2) + halfY; locateY = 2; } } // make sure we aren't off the screen if (offsetY < 0) offsetY = 0; if ((offsetY + flyoverY) > windowY) { offsetY = windowY - flyoverY; } else if (scrollBarX && ((windowY - (posY + halfY)) < scrollYWidth)) { //verdict overlaps the horizontal scrollbar offsetY = windowY - (flyoverY + scrollYWidth); } // add page offsets back - if not in frame if (!hasParentFrame) { offsetX += pageOffsetX; offsetY += pageOffsetY; } posX += pageOffsetX; posY += pageOffsetY; var paddedOffsetX = 0; //provide space between icon and flyover var padX = 3; if (locateX == 0) paddedOffsetX = offsetX - padX; else paddedOffsetX = offsetX + padX; // set where to put the flyover flyover.style.top = offsetY + "px"; flyover.style.left = paddedOffsetX + "px"; avg_ls_displayinline(); } function avg_ls_displayinline() { var flyover = document.getElementById('avg_ls_inline_popup'); if (flyover == null) return; // show the flyover flyover.style.visibility = "visible"; } function avg_ls_hideinline() { var flyover = document.getElementById('avg_ls_inline_popup'); if (flyover == null) return; flyover.visibility = "hidden"; //invisible flyover.style.left = "-5000px"; } function offsetTop(element) { var offset = 0; while (element) { offset += element.offsetTop; element = element.offsetParent; } return offset; } function offsetLeft(element) { var offset = 0; while (element) { offset += element.offsetLeft; element = element.offsetParent; } return offset; } // -->"
Pin It

Cerca

Noi raccomandiamo Buono ed Economico