// JavaScript Document
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 swapImage(_object, _origen, _destino) {
	//alert("object "+_object+", origen "+_origen+", destino "+_destino);
	var container = document.getElementById(_destino);
	defImage = container.src.split('/');
	var tempHref = container.src;
	container.src = _object;
	var foo = 'thumb_'+_origen;
	var temp = defImage[0]+'//'+defImage[2]+'/'+defImage[3]+'/'+defImage[4]+'/thumb_'+defImage[5];
	document.getElementById(_origen).href = tempHref;
	document.getElementById(foo).src = temp;
	//return false;
}

function openPicturePopup(_image, _pathImage, _pathPopup, _width, _height) {	
	window.open( _pathPopup +"?image=" + _image+"&pathImage="+_pathImage, '','width='+_width+',height='+_height);
}

//function openPicturePopup(_image, _width, _height) {	
//	window.open( "../catalogo/popup.php?image=" + _image, 'ventana_emergente','width='+_width+',height='+_height);
//}



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 loadFlash(){
}

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