// JavaScript Document

function eliminar(url,id) {
	if(confirm("Esta usted a punto de borrar el registro "+id+". ¿Desea Continuar?")) {
		location.href=url+'&del='+id;
	}
	else {
		return false;
	}
}

function redireccionar(mess,url){
	if(confirm(mess)) {
		location.href=url;
	}
	else {
		return false;
	}
}

function editar(url,id){
	location.href=url+'&id='+id;	
}

function valida() 
{ 
	if (document.form1.usuario.value=="") { 
         alert("El Campo Usuario es Necesario"); 
         document.form1.usuario.focus(); 
      return false; 
	} 
	
	if (document.form1.clave.value=="") { 
		alert("El Campo Clave es Necesario"); 
		document.form1.clave.focus(); 
		return false; 
   } 
}

function selectOption(elementID,id){

	var el=document.getElementById(elementID);

	for(var i=0;i<el.length;i++){
		if(el.options[i].value==id){
			el.selectedIndex=i;
			break;
		}
	}
}

function imagenGrande(root,concepto,imagen,width,height){
	window.open(root+'/imagenOriginal.php?concepto='+concepto+'&imagen='+imagen+'','imagen','width='+width+',height='+height+',scrollbars=no,toolbars=no');
}

function submitForm(form){
	document.getElementById('Submit').disabled=true;
	document.getElementById('Reset').disabled=true;	
	form.submit();
}

function changecolor(row){
	row.tempColor = row.style.backgroundColor;
	row.style.backgroundColor = '#FFFFF0';
}

function restorecolor(row){
	row.style.backgroundColor = row.tempColor;
}
	
