function isMSIE() {
	return (navigator.appName == "Microsoft Internet Explorer");
}

function popup(url, name, width, height, isResizable, hasScrollbars, hasToolbar, hasMenubar, hasStatus) {
	isResizable = typeof(isResizable)=="undefined"? "no": isResizable;
	hasScrollbars = typeof(hasScrollbars)=="undefined"? "auto": hasScrollbars;
	hasToolbar = typeof(hasToolbar)=="undefined"? "no": hasToolbar;
	hasMenubar = typeof(hasMenubar)=="undefined"? "no": hasMenubar;
	hasStatus = typeof(hasStatus)=="undefined"? "yes": hasStatus;
	var top = (screen.height - height) / 2;
	var left = (screen.width - width) / 2;
	var settings = "width="+width+",height="+height+",top="+top+",left="+left+",resizable="+isResizable+",scrollbars="+hasScrollbars+",toolbar="+hasToolbar+",menubar="+hasMenubar+",status="+hasStatus;
	return window.open(url, name, settings);
}



function Imprimir(id_art) {
	/*var w = popup('about:blank', 'ImprimirNota', '600', '400', 'no', 'yes', 'no', 'no', 'yes');
	var f = $('frmImprimirNota');
	f.action = '../home/imprimir_nota.php';
	f.target = 'ImprimirNota';
	f['cuerpo'].value = $('texto').innerHTML.replace($('texto_interior').innerHTML, '');
	f['titulo'].value = $('nota_titulo').innerHTML.replace(/\<[^\<]*\>/ig, '');
	f['volanta'].value = $('nota_volanta').innerHTML;
	f['copete'].value = $('nota_copete').innerHTML;*/
	popup("../imprimir_articulo.php?id_art="+id_art, "ImprimirNota", "600", "400", "no", "yes", "no", "no", "yes");	
	//f.submit();
}

function EnviarEdicionActual(idNota) {
	popup("../home/index.php?p=edicion_actual_enviar&idNota="+idNota, "EnviarEdicionActual", "520", "300", "no", "yes", "no", "no", "yes");
}


function EnviarArticulo(id_art) {
	popup("../enviar_nota.php?id_art="+id_art, "EnviarEdicionActual", "520", "550", "no", "yes", "no", "no", "yes");
}


$(document).ready(function(){
	$('#aumentar').fontSizer({
		action: "up",
		elements: ".desarrollonoti",
		max: 36
	});
			
	$('#disminuir').fontSizer({
		action: 'down',
		elements: ".desarrollonoti"
	});
})

$(function(){
	$('.auto-submit-star').rating({
	callback: function(value, link){
	 // 'this' is the hidden form element holding the current value
	 // 'value' is the value selected
	 // 'element' points to the link element that received the click.
	 var param = "art_id="+$("#art_id").val()+"&votacion="+value;
	 $.ajax({
	   type: "POST",
	   url: "voto.php",
	   contentType: "application/x-www-form-urlencoded",
	   data: param,
	   beforeSend: inicioEnvio = function(){
	    $("#result").text('Cargando...');
	   },
	   cache: false,
	   success: getmessage = function(html){
		  $("#result").text(html);
	   }
	 });
	 return false;
						   
	  // To submit the form automatically:
	  //this.form.submit();
					   
	  // To submit the form via ajax:
	  //$(this.form).ajaxSubmit();
	  }
	 });
});
