function LimpiarCampos_Libros()
{
  	 var _lstColeccion = document.getElementById("lstColeccion");
  	 _lstColeccion.selectedIndex = 0;
 	 	
 	 	var _lstTema = document.getElementById("lstTemas");
				_lstTema.selectedIndex = 0;  	 
  	 
 	 	var _autor = document.getElementById("txtAutor");
 	 	_autor.value = "";

 	 	var _descripcion = document.getElementById("txtDescripcionLibro");
 	 	_descripcion.value = "";
 	 	
 	 	var _ISBN = document.getElementById("txtISBN");
 	 	_ISBN.value = "";
 	 		 	
 	 	var _formato = document.getElementById("txtFormatoLibro");
 	 	_formato.value = "";

 	 	var _cantpaginas = document.getElementById("txtPaginasLibro");
 	 	_cantpaginas.value = "";
 	 	
    var _edad5_8 = document.getElementById("chkEdad5_8");
    _edad5_8.checked = false;
    
    var _edad9_12 = document.getElementById("chkEdad9_12");
    _edad9_12.checked = false;
    
    var _edad13 = document.getElementById("chkEdad13");
    _edad13.checked = false;
        
 	 	var _lstUD1 = document.getElementById("lstUsosDidacticos1"); 	 
 	 	_lstUD1.selectedIndex = 0;
  	 
 	 	var _lstUD2 = document.getElementById("lstUsosDidacticos2"); 	 
 	 	_lstUD2.selectedIndex = 0;
 	 	
 	 	var _lstUD3 = document.getElementById("lstUsosDidacticos3"); 	 
  	 _lstUD3.selectedIndex = 0;
 	 	
  	 var _lstUD4 = document.getElementById("lstUsosDidacticos4"); 	 
  	 _lstUD4.selectedIndex = 0;
 	 	
 	 	var _docentes = document.getElementById("chkDocentes");
 	 	_docentes.checked = false;
 	 	
 	 	var _keywords = document.getElementById("txtKeywords");
 	 	_keywords.value = "";

 	 	var _nom_carrito1 = document.getElementById("txtNombreCarrito1");
 	 	_nom_carrito1.value = "";

 	 	var _URL_carrito1 = document.getElementById("txtURLCarrito1");
 	 	_URL_carrito1.value = "";
 	 	
 	 	var _nom_carrito2 = document.getElementById("txtNombreCarrito2");
 	 	_nom_carrito2.value = "";

 	 	var _URL_carrito2 = document.getElementById("txtURLCarrito2");
 	 	_URL_carrito2.value = "";
 	 	
 	 	var _nom_carrito3 = document.getElementById("txtNombreCarrito3");
 	 	_nom_carrito3.value = "";

 	 	var _URL_carrito3 = document.getElementById("txtURLCarrito3");
 	 	_URL_carrito3.value = "";

 	 	var _nom_carrito4 = document.getElementById("txtNombreCarrito4");
 	 	_nom_carrito4.value = "";

 	 	var _URL_carrito4 = document.getElementById("txtURLCarrito4");
 	 	_URL_carrito4.value = "";
 	 	
 	 	var _mostrar = document.getElementById("chkMostrarLibro");
 	 	_mostrar.checked = true; 	 	
}

function getWindowDimension(isWidth)
{
	var winW = 630, winH = 460;
	if (parseInt(navigator.appVersion)>3) 
	{
		if (navigator.appName=="Netscape") 
		{
   winW = window.innerWidth-16;
   winH = window.innerHeight-16;
  }
  if (navigator.appName.indexOf("Microsoft")!=-1) 
  {
   winW = document.body.offsetWidth-20;
   winH = document.body.offsetHeight-20;
  }
	}
 return (isWidth)? winW : winH;
}

function pageWidth() 
{
	return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
} 

function pageHeight() 
{
	return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;
} 

                    
function findPosX(obj) {    
 var curleft = 0;
 if(obj.offsetParent) 
 {
  while(1) 
  {
   curleft += obj.offsetLeft;
   if(!obj.offsetParent)
    break;
   obj = obj.offsetParent;
  }  
 } 
 else if(obj.x)
 curleft += obj.x;
 return curleft;
}
    
function findPosY(obj) 
{    
	var curtop = 0;
 if(obj.offsetParent) 
 {
 	while(1) 
 	{
			curtop += obj.offsetTop;
			if(!obj.offsetParent)
			    break;
			obj = obj.offsetParent;
  }    
 } 
 else if(obj.y) curtop += obj.y;
 return curtop;
}

function recargar_captcha(item)
{
  item.src="../captcha_visual.php?"+Math.floor(Math.random()*99);
}

function closeMessage()
{
	messageObj.close();	
}

function setearEstilo(obj,estilo)
{
	obj.setAttribute("class",estilo); //FF
 obj.className=estilo;	 //IE 
}

function displayMessage(messageContent,cssClass,width,height)
{
	messageObj.setHtmlContent(messageContent);
	messageObj.setSize(width,height);
	messageObj.setCssClassMessageBox(cssClass);
	messageObj.setSource(false);	// no html source since we want to use a static message here.
	messageObj.setShadowDivVisible(false);	// Disable shadow for these boxes	
	messageObj.display();
}

function closeMessage()
{
	messageObj.close();	
}

function ventana(url,nombre_ventana)
{
	var oVent = window.open(url,nombre_ventana);
	if (oVent==null || typeof(oVent)=="undefined") 
	{
		alert("No se pudo abrir la ventana con el juego. Seguramente tenés un POPUP BLOCKER (bloqueador de POPUPs). Deshabilitá el bloqueador, y volvé a intentarlo.");
		return false;
	}
	else return true;
}
