
function clickBack() {
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.className == "linkback")  {
	   //var newDestiny = eval(history.back())
		anchor.onclick = goBack;
   }		
 } 
} 

function goBack() {
		history.back();
		return false;
}


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"; 
 } 
} 

function openPopup() {
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.className == "externalPopUp")  {
			anchor.onclick = openPicturePopup;
			return false;
		}		
	}
}

function openPicturePopup(_pathImage, _width, _height) {	
	_pathImage = '../autoescuela/mapa_localizacion.php';
	_width = '700';
	_height = '420';
	window.open(_pathImage, '','width='+_width+',height='+_height);
	return false;
}


window.onload = function() {
	clickBack();
	externalLinks();
	openPopup();
}
