//the revolution will not be framed
if (self!=top) top.location=self.location;

addLoadEvent(moo); 

//
// addLoadEvent()
// Adds event to window.onload without overwriting currently assigned onload functions.
// Function found at Simon Willison's weblog - http://simon.incutio.com/
//
function addLoadEvent(func) {	
   var oldonload = window.onload;
   if (typeof window.onload != 'function'){
   window.onload = func;
   } else {
      window.onload = function() {
         oldonload();
         func();
      }
   }
}




function dhtmlLoadScript(url) {
   var e=document.createElement("script");
   e.src=url;
   e.type="text/javascript";
   document.getElementsByTagName("head")[0].appendChild(e);
}

function randomno(limit) {
   var no=Math.floor(limit*Math.random()) 
   if (no==limit) no--
   return no
}

function moo() {
   img_cow=new Image();
   img_cow.src="images/moocow.png";
   img_moocow=new Image();
   img_moocow.src="images/moocowmoo.png";
   $('cow').onmouseover=function() {$('cow').src=img_moocow.src};
   $('cow').onmouseout=function() {$('cow').src=img_cow.src};
}

function debug(s) {
   if (!$('debug')) {
      document.getElementsByTagName("body")[0].appendChild(Builder.node("div",{id:"debug",style:"position:absolute;top:0px;left:0px;color:red; background:grey; z-index:99"}));
   }
   if (!s) s="yo";
   $("debug").innerHTML+=s+"<br />";
}
