/* Adds a function to the onload event                    */
/* newFunction parameter is a string: "myfunc(myparams);" */
function addFunction(myFunction, newFunction){
   // If myFunction, is a function
   if(eval("typeof " + myFunction +" == 'function'")) {
      var pfunc=eval(myFunction);
      // New myFunction
      eval(myFunction +"=function(){pfunc(); "+ newFunction +"}");
   } else {
      eval(myFunction +"=function(){"+ newFunction +"}");
   }
}

function popup(theURL,target,myWidth,myHeight){
	var myLeft = 0;
	var myTop = 0;
	var feature = "scrollbars=yes,resizable=yes";
	if (myWidth != 0 && myHeight != 0) {
		myLeft = (screen.width-myWidth)/2;
		myTop = (screen.height-myHeight)/2;
		feature = "width=" +myWidth +",height=" +myHeight +",left=" +myLeft +",top=" +myTop +"," +feature;
		window.open(theURL,target,feature);
	} else {
		window.open(theURL,target);
	}
	return false;
}

function write_email(domain,user){
	var recipient = user + "@" + domain
	var url_link = "mailto:" + recipient
	document.write(recipient.link(url_link));
}