function imprimir(url){
	ventanaImpresion = wAlert('',560+15,560,'');
	ventanaImpresion.location.href=url
	ventanaImpresion.print();  
}
/**
* Abre una ventana pop-up y introduce texto. ?til para hacer debugging.
*/
function wAlert(contenido,w,h,inicializar) {
 if(w==undefined||w==null)w='350';if(h==undefined||h==null)h='250';
 top.consoleRef=window.open('','myconsole',
  'width='+w+',height='+h+',menubar=0,toolbar=0,status=0,scrollbars=1,resizable=1');
 pre =(inicializar!=undefined||inicializar==1)? 
   '<html><head><title>Ventana</title></head>'
   +'<body bgcolor=white onLoad="self.focus()">':"";
 post =(inicializar!=undefined||inicializar==1)?'</body></html>':"";
 top.consoleRef.document.writeln(pre+contenido+post);
 top.consoleRef.document.close()
 return top.consoleRef;
}
/**
* 
*/
function GetParentWithClass(obj,classNamex){
	if(obj==undefined||obj.parentNode==undefined||obj.parentNode==null) return false;
	if(obj.className == classNamex)
		return obj;
	else
		return GetParentWithClass(obj.parentNode,classNamex);
}
/**
* 
*/
function GetParentWithId(obj,idSubStr){
	if(obj==undefined||obj.parentNode==undefined||obj.parentNode==null) return false;
	if(obj.id.indexOf(idSubStr) >= 0 )
		return obj;
	else
		return GetParentWithClass(obj.parentNode,idSubStr);
}

/**
* Obtener un array con la posici?n top y left de cualquier elemento
*/
function getPos(obj){
	subPos = pos = new Array(0,0);
	if(obj.nodeName!="body"&&obj.nodeName!="BODY"&&obj.nodeName!="html"&&obj.nodeName!="HTML"){
		try{subPos = getPos(obj.offsetParent);}catch(er){}
	}
	pos[0]=obj.offsetTop+subPos[0];
	pos[1]=obj.offsetLeft+subPos[1];
	return pos;
}
/**
 * Debug 
 */
if(window.console){
	console.objDebug = function(obj){ 
		for (property in obj) console.debug(property,obj[property]);
	}
}else{
	console = new Object();
	console.debug = function(param){alert(param);}
	console.objDebug = function(obj){ 
		for (property in obj) output += property +"::"+ obj[property]+";;";
		alert(output);
	}
}

