// Set up page to do multiple loads //function addLoadEvent(func) {	var oldonload = window.onload;	if (typeof window.onload != 'function') {		window.onload = func;	} 	else 	{		window.onload = function() {		  if (oldonload) {			oldonload();		  }		  func();		}	}	}/*addLoadEvent(nameOfSomeFunctionToRunOnPageLoad);addLoadEvent(function() { 	more code to run on page load 	}); */ var prepareLinks = {	"sites" : function(){		var url=document.location.toString();		var domain=url.split(".")[1];		var siteName=document.getElementById("siteName");		var h=document.getElementById("sites");		var img=h.getElementsByTagName("img");		var imgLength=img.length;		for (x=0;x<imgLength;x++){			if (img[x].getAttribute('rel')==domain){				siteName.innerHTML=": "+img[x].alt;				img[x].parentNode.className="selected";			}			img[x].onclick=function(){				document.location="http://www."+this.getAttribute('rel')+".com";			}		}	},};// LOAD EVENTS //addLoadEvent(function() 	{ 		if (document.getElementById("sites"))		{			prepareLinks.sites();		}	}); 