function imprimir(id){
	var v = window.open('fichaNotaPrint.php?articuloId=' + id, '', 'WIDTH=800, HEIGHT=600, SCROLLBARS=1');
	v.moveTo((screen.width / 2) - 400, (screen.height / 2) - 300);
}
function imprimir2(id){
	var v = window.open('fichaSubNotaPrint.php?subNotaId=' + id, '', 'WIDTH=800, HEIGHT=600, SCROLLBARS=1');
	v.moveTo((screen.width / 2) - 400, (screen.height / 2) - 300);
}


function aumentarTexto(id) {
	var texto = document.getElementById(id);
	var tam = texto.style.fontSize;
	v = parseInt(tam);
	if (v < 16){
		v++;
		cad = v + "px";
		texto.style.fontSize = cad;
	}
}

function reducirTexto(id) {
	var texto = document.getElementById(id);
	var tam = texto.style.fontSize;
	v = parseInt(tam);
	if (v > 9) {
		v--;
		cad = v + "px";
		texto.style.fontSize = cad;
	}
}

function volverTexto(id) {
	texto = document.getElementById(id);
	tamanio = texto.style.fontSize;
	cad = tamanio.substr(0,2);
	val = parseInt(cad);
	cad = "12px";
	texto.style.fontSize = cad;
}
function verImagen2(imagen, comentario)
{
	var w = window.open('verImagen2.php?imagen=' + imagen+'&comentario='+comentario, 'WinImagen', ' toolbars=no, scrollbars=yes, resizable=yes');
}
function verImagen(imagenId, articuloId)
{
	var w = window.open('verImagen.php?imagenId=' + imagenId+'&articuloId='+articuloId, 'WinImagen', ' toolbars=no, scrollbars=yes, resizable=yes');
}

function enviar(strAccion){
	var errores = "";

	with(document.datos){									
		if(usuario.value=="")
			errores += "- Debe ingresar su nombre de usuario\n";
		if(pass.value=="")
			errores += "- Debe ingresar su password.\n";
		if(pass2.value=="")
			errores += "- Debe confirmar su password.\n";
		if(pass.value!=pass2.value)
			errores += "- Debe ingresar el password y su confirmación correctamente.\n";
		if(nombre.value=="")
			errores += "- Debe ingresar su nombre\n";
		if(apellido.value=="")
			errores += "- Debe ingresar su apellido\n";
		if(email.value=="")
			errores += "- Debe ingresar su email.\n";
		if(email2.value=="")
			errores += "- Debe confirmar su email.\n";
		if(email.value!=email2.value)
			errores += "- Debe ingresar el email y su confirmación correctamente.\n";
		if(ocupacion.value=="")
			errores += "- Debe ingresar su ocupación.\n";
		if(errores==""){
			accion.value=strAccion;
			submit();
		}else{
			alert(errores);
		}
	}
}
function enviarLogin(strAccion){
	var errores = "";

	with(document.login){									
		if(usuario.value=="")
			errores += "- Debe ingresar su nombre de usuario\n";
		if(pass.value=="")
			errores += "- Debe ingresar su password.\n";
		if(errores==""){
			accion.value=strAccion;
			submit();
		}else{
			alert(errores);
		}
	}
}
function enviarOC(){
	var errores = "";

	with(document.frmOlvido){
		if(email.value == "")
			errores += "- Debe ingresar su email.\n";
		
		if(errores == ""){
			accion.value = 'OC';
			submit();
		} else {
			alert(errores);
		}
	}	
}
function abrirEnviarComentario(aId){
	var w = window.open('_comentar.php?articuloId='+aId, 'WinImagen', 'width=600, height=450, toolbars=no, scrollbars=yes, resizable=yes');
}
function abrirEnviarAmigo() {
	var capa = document.getElementById('capaFijaMail');
	if(capa.style.display == 'block')
		capa.style.display = 'none';
	else
		capa.style.display = 'block';
}
function cerrarEnviarAmigo() {
	var capa = document.getElementById('capaFijaMail');
	capa.style.display = 'none';
}
