<!--
var txtObject;
var txtDefSize=12;

function txtBar() {
	//Creates a content control layer with basic commands, such as Text size Up/Down, print content & send content by mail
}

txtBar.prototype.call = function (cmd,id) {
	
	var item = document.getElementById(id);
	
	if(cmd == 'print') {		
		var _win = window.open('',id,'width=500,height=500,address=no,buttons=no');
		_win.document.write('<html><head><title>IMPRIMIR</title><style>@import url(print.css); body,td {font-size:'+item.style.fontSize+';font-family:'+item.style.fontFamily+'}</style>'+
		'<body>'+
		'<div style="height:90px;text-align:center;"><img src="_print_top.jpg" border="" alt="CFC Santiago" /></div>'+
		item.innerHTML+'</body></html>');
		_win.document.close();
		_win.print();
		return;
	}
	
	if(cmd == 'email') {
		var _win = window.open('linkSendMail.php?url='+document.location,"mailSend",'width=300,height=400,left='+((screen.width-300)/2)+',top='+((screen.height-400)/2)+',address=no,buttons=no,scrollbars=no');
		return;
	}
	
	if(cmd == 'zooma') {
		var value = getFontSize(item);
		changeFontSize(item,++value);		
	}
	
	if(cmd == 'zoomb') {
		var value = getFontSize(item);
		changeFontSize(item,--value);		
	}
	item.focus();
}

function getFontSize (item) {
	var math = /\D/;
	var value = item.style.fontSize;
	if(value == "") {
		value = txtDefSize;
	} else {
		while (isNaN(value)) {
			value = value.replace(math,"");
		}
	}
	return value;
}

function changeFontSize (item,value) {
	if(value>=txtDefSize) {
		for (var i = 0 ; i < item.childNodes.length ; i++) {
			changeFontSize(item.childNodes.item(i), value);
		}
		if( item.style ) item.style.fontSize = value+'px';
	}
}

function txtBarFunction (cmd,ID) {
	if (txtObject != null) {
		txtObject.call(cmd,ID);
	}
	
}
txtObject = new txtBar;
//-->
