var interFont = 1;
var maxWidthFont = 20;
var minWidthFont = 10;

function imprimir(iddoc){
	width = 502; 
	height = 450; 
	leftPosition = 0;
	topPosition = 0;
	leftPosition = (screen.width) ? (screen.width-width)/2 : 0;
	if (screen.height && (screen.height <= 600)) {
		topPosition = 0;
	} else {
		topPosition = (screen.height) ? (screen.height-height)/2 : 0;
	}
	var settings='width='+width+', height='+height+', left='+leftPosition+', top='+topPosition+', toolbar=0, location=0, directories=0, menubar=0, scrollbars=1, resizable=0, status=0';
	var popup=window.open("modules.php?name=webstructure&file=print&idwebstructure="+iddoc, '', settings);
	popup.focus();
}

function increaseFontSize(){	
	var fontSize = $('contentTxt').getStyle('fontSize');
	var newSize = parseInt(fontSize.replace('px', ''));
	if (newSize <= maxWidthFont){
		newSize = newSize +1;
		Element.setStyle($('contentTxt'), { fontSize: newSize + 'px' });
		Element.setStyle($('contentTxt'), { lineHeight: newSize+ (interFont*3) + 'px' });
	}

}

function decreaseFontSize(){

	var fontSize = $('contentTxt').getStyle('fontSize');
	var newSize = parseInt(fontSize.replace('px', ''));
	if (newSize >= minWidthFont){
		newSize = newSize -1;
		Element.setStyle($('contentTxt'), { fontSize: newSize + 'px' });
		Element.setStyle($('contentTxt'), { lineHeight: newSize+ (interFont*3) + 'px' });		
	}


}

function getRadioValue(idOrName) {
			var value = null;
			var element = document.getElementById(idOrName);
			var radioGroupName = null;  
			
			// if null, then the id must be the radio group name
			if (element == null) {
					radioGroupName = idOrName;
			} else {
					radioGroupName = element.name;     
			}
			if (radioGroupName == null) {
					return null;
			}
			var radios = document.getElementsByTagName('input');
			for (var i=0; i<radios.length; i++) {
					var input = radios[ i ];    
					if (input.type == 'radio' && input.name == radioGroupName && input.checked) {                          
							value = input.value;
							break;
					}
			}
			return value;
	}
