function generate_address(username, domain) {
	var atsign = "&#64;";
	var addr = username + atsign + domain;
	document.write( "<" + "a" + " " + "href=" + "mail" + "to:" + addr + ">" + addr + "<\/a>");
}

function a_event(a,b,c) {
	if (a.addEventListener) {
		a.addEventListener(b,c,false);
	} else if (a.attachEvent) {
		a.attachEvent("on"+b,c);
	}
}

function get_win_height() {
	var h = 0;
	if (typeof(window.innerHeight) == 'number') {
		h = window.innerHeight;
	} else {
		if (document.documentElement && document.documentElement.clientHeight) {
			h = document.documentElement.clientHeight;
		} else {
			if (document.body && document.body.clientHeight) {
				h = document.body.clientHeight;
			}
		}
	}
	return h;
}

function get_win_width() {
	var w = 0;
	if (typeof(window.innerWidth) == 'number') {
		w = window.innerWidth;
	} else {
		if (document.documentElement && document.documentElement.clientWidth) {
			w = document.documentElement.clientWidth;
		} else {
			if (document.body && document.body.clientWidth) {
				w = document.body.clientWidth;
			}
		}
	}
	return w;
}

function get_scroll_width() {
   var w = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;
   return w ? w : 0;
}

function get_scroll_height() {
   var h = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
   return h ? h : 0;
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
} 

a_event(window, 'load', externalLinks);

