function Ventana(url,width,height)
{
	var a = window.open(url,"_blank","width=" + width +", height=" + height);
}

var fuente_tamano_actual = 13;
var fuente_mas_pequena = 12;
var fuente_mas_grande = 20;

function AgrandaFuente(idcontenedor){
	fuente_tamano_actual = (fuente_tamano_actual >= fuente_mas_grande) ? fuente_mas_grande : fuente_tamano_actual + 1;
	var cont = document.getElementById(idcontenedor);
	cont.style.fontSize = fuente_tamano_actual;
	cont.style.lineHeight = (fuente_tamano_actual + 3) + "px";
}

function AchicaFuente(idcontenedor){
	fuente_tamano_actual = (fuente_tamano_actual <= fuente_mas_pequena) ? fuente_mas_pequena : fuente_tamano_actual - 1;
	var cont = document.getElementById(idcontenedor);
	cont.style.fontSize = fuente_tamano_actual;
	cont.style.lineHeight = (fuente_tamano_actual + 3) + "px";
}

function Imprimir(pagina,datos)
{
	var a = window.open("imprimir.php?p=" + pagina + "&d=" + datos,"_imprimir_","width=500,height=450,scrollbars=yes");
}

function Enviar(pagina,datos)
{
	var a = window.open("enviar.php?p=" + pagina + "&d=" + datos,"_enviar_","width=480,height=400,scrollbars=no");
}

function MandarAImprimir(idaocultar)
{
	document.getElementById(idaocultar).style.display="none";
	window.print();
}

function Galeria(nota_id, galeria_id)
{
	var a = window.open("galeria.php?nid=" + nota_id + "&id=" + galeria_id ,"_galeria_","width=566,height=566,scrollbars=no");
}


function UpdateComment(extra,type,comment_id) {
	var myRequest = new Request({
								method: 'post',
								evalResponse: true,
								evalScripts : true,
								url: "/includes/procesar_agregado.php"								
								});		
	myRequest.send("data=" + extra + "&type=" + type + "&comment_id=" + comment_id);
}

function encuesta(){
	
	url = document.URL; 
	if (url.indexOf('SET_ENTITY_ID=') == 0 || url.indexOf('SET_ENTITY_ID=1') == 0){
	 myHTMLRequest = new Request.HTML({
									  method: 'get',
									  url:'cargar_encuesta.php',
									  update: $('encuesta')
									  }).send();;	
	}
	

	
	
	/*$.get("cargar_encuesta.php", function(data){
	  $('#encuesta').html(data)
	});
	*/
}
function Cargarvideo(video, imagen){
 var F = {	
	movie:"flvplayer.swf",
	width:"230",
	height:"180",
	majorversion:"7",build:"0",wmode:"transparent",bgcolor:"#000000",allowfullscreen:"true",
	flashvars:"file="+video+"&image="+imagen};
	UFO.create(	F, "video_player");

}
function ShowNotes(){
v = $('archivo').value;
    var list = $$('.news');
	list.each(function(el) {
		  $(el).setStyle('display', 'none');	
	});
	
	var list = $$('.nota_'+v);
	list.each(function(el) {	
		  $(el).setStyle('display', 'block');	
	});
}


function Validar1(){
	if ( $('nombre').get('value') != '' && $('email').get('value') != '' && $('comentario_1').get('value') != ''  )
	return true
	else
	alert("Debes completar todos los campos");
	
	return false;
}


var Menu = function()
{
	this.html = '';
	this.addTitle = function addTitle(anchorText)
	{
		this.html += '<li><a href="javascript:;">'+anchorText+'<!--[if gte IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul>';
	}
	this.addOption = function addOption(anchorText, url, newWindow)
	{
		strNewWindow = (newWindow == true)?'target = "_blank"':'';
		this.html += '<li><a href="'+url+'" '+strNewWindow+'>'+anchorText+'</a></li>';
	}
	this.closeTitle = function closeTitle()
	{
		this.html += "</ul><!--[if lte IE 6]></td></tr></table></a><![endif]--></li>";
	}
	this.create = function create()
	{
		myContainer = new Element('div', {'id': 'menu_js'});
		$$('.lateral-left').inject(myContainer, 'before');
		$('menu_js').set('html','<ul id ="dropdownMenu">'+this.html+'</ul>');
		//new DropdownMenu($('dropdownMenu'));
	}
}
