function extLinks() {
if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i = anchors.length; i != 0; i--) {
		var a = anchors[i-1];
		if (!a.href) continue;
		if (a.getAttribute("rel") == "external") {
			a.target = "_blank";
		}
	}
}

var now = new Date;
var monthName = new Array("01","02","03","04","05","06","07","08","09","10","11","12");
var thisYear = now.getFullYear();
var thisYearString = thisYear.toString();
var twoDigitYear = getSubstring(thisYearString, 2, 2);

var currentDateTime = monthName[now.getMonth()] + '.'
					+ addZeroBefore(now.getDate()) + '.'
					+ twoDigitYear + ' : '
					+ addZeroBefore(now.getHours())
					+ showZeroFilled(now.getMinutes())
					+ showZeroFilled(now.getSeconds());


function showZeroFilled(thisValue) {
	if (thisValue > 9) {
		return ":" + thisValue;
	}
	return ":0" + thisValue;
}

function addZeroBefore(thisValue) {
	if (thisValue < 10) {
		return "0" + thisValue;
	}
	return thisValue;
}

function getSubstring(string, startPosition, length) {
	return string.substring(startPosition, startPosition+length);
}

function writeDT() {
	if (document.getElementById && document.createTextNode) {
		var dateTime = document.getElementById('dt');
		dateTime.firstChild.nodeValue = currentDateTime;
	}
}

function newWin(url,w,h,resize,scroll) {
	if (resize == null) { resizable = "no"; }
	if (scroll == null) { scrollbars = "no"; }
	var appWindow = window.open(url, "appWin", "menubar=no,toolbar=no," + "location=no,resizable=" + resize + ",scrollbars=" + scroll + ",left=0,top=0,width=" + w + ",height=" + h);
}


function validateZIP(id){
	var lang = document.getElementsByTagName('html')[0].lang;
	var reZip = /(^\d{5}$)/;
	var zip = document.getElementById(id);
	
	if(!reZip.test(zip.value)){
			if (lang == "en"){
				alert("Please enter a 5 digit ZIP Code.");
			}
			else{
                alert("Por favor, introduzca un c\u00F3digo postal de 5 d\u00EDgitos.");
				//alert("Por favor ingresa tu c\u00F3digo postal");
			}
		return false;
	}
	return true;
}