// JavaScript Document

function envie(texto, category) {
	var width=screen.availWidth;
	var height=screen.availHeight;
	wleft = (width - 430) / 2;
	wtop = (height - 420) / 2;	
	window.open('enviar.php?texto='+texto+'&category='+category,'amigo', 'height=420,width=430,toolbar=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,,location=no,modal=yes,dependent=yes,dialog=yes,screenX='+wleft+',screenY='+wtop+',left='+wleft+',top='+wtop);
}

function envieConteudo(texto, lang) {
	var width=screen.availWidth;
	var height=screen.availHeight;
	wleft = (width - 430) / 2;
	wtop = (height - 420) / 2;	
	window.open('enviar.php?conteudo='+texto+'&lang='+lang,'amigo', 'height=420,width=430,toolbar=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,,location=no,modal=yes,dependent=yes,dialog=yes,screenX='+wleft+',screenY='+wtop+',left='+wleft+',top='+wtop);
}

function changeFontSize(direction) {
	
	objs = $('contentMain').descendants();
	objs.each(function(item) { 
		doChange(item, direction); 
	}); 

	
}

function doChange(element, direction) {
	if (direction == 'increase') 
		quantity = 2;
	else 
		quantity = -2;
	newFont = $(element).getStyle('font-size');
	newFont = newFont.substring(0, newFont.indexOf('px'));
	newFont = parseInt(newFont) + quantity;
	newFont = 'font-size: ' + newFont + 'px';
	$(element).setStyle(newFont);
}