﻿if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET","tipy.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;

var x=xmlDoc.getElementsByTagName("tip");
var i = Math.floor(Math.random()*x.length);
document.write(x[i].childNodes[0].nodeValue);
document.write('<div align="right"><strong>'+x[i].attributes.author.value+'<\/srtong><\/div>');

