function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
if(typeof(customWidth) == 'undefined' ||  !(customWidth>0)) customWidth = 970;
if(typeof(customHeight) == 'undefined' ||  !(customHeight>0)) customHeight = 780;
window.open(href, windowname, 'width='+customWidth+',height='+customHeight+',resizable=yes,scrollbars=no');
return false;
}


function overrideServerName(servers){
  var actualFunc = function(){
    var tagsA = document.getElementsByTagName("A");
	for(var i=0;i<tagsA.length;i++){
		if(tagsA[i].href.indexOf("balanced.mosaic-network.com")>0){
			tagsA[i].href=tagsA[i].href.replace("balanced.mosaic-network.com",servers[Math.floor(servers.length*Math.random())]+".mosaic-network.com");
		}
	}
  }
  //try now. for browsers that do support defer, and such
  actualFunc();
  //for sure
  window.onload = actualFunc;
  //overkill:
  if (document.addEventListener) {
	document.addEventListener("DOMContentLoaded", actualFunc, false);
	document.addEventListener("load", actualFunc, false);
  }else if(window.attachevent){ 
  //for ones with attachevent
	window.attachevent("onload", actualFunc);
  }
}
