function getBrowserWidth () {
	if (window.innerWidth) return window.innerWidth;
	else if (document.documentElement && document.documentElement.clientWidth != 0) return document.documentElement.clientWidth;
	else if (document.body) return document.body.clientWidth;
	else return 0;
}

function getBrowserHeight () {
	if (window.innerHeight) return window.innerHeight;
	else if (document.documentElement && document.documentElement.clientHeight != 0) return document.documentElement.clientHeight;
	else if (document.body) return document.body.clientHeight;
	return 0;
}

var height=0;
var width=0;

width = getBrowserWidth();
height = getBrowserHeight();

if (width >1400){
	document.write('<style type="text/css" media="screen">#wrapper-body{width:142.5em; margin:0 auto;}</style>')
} 
else if (width < 1000){
	document.write('<style type="text/css" media="screen">#wrapper-body{width:100em; margin:0 auto; overflow:scroll;}</style>')
} 



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";
			if (anchor.getAttribute("title")){
				anchor.title = anchor.getAttribute("title") + " (se abre en nueva ventana)";
			}
			else{
				anchor.title = "(se abre en nueva ventana)";
			}
		}
	}
	
}
window.onload = externalLinks;
