
	function input_focus( obj ){
		$( obj ).value = '';
	}
	
	function input_blur( obj , txt ){
		if( $F( obj )== '' )
		$( obj ).value = txt;
	}
	
	function encu_vote(){
		var objs = $$('.encu-radio');
		var flag = false;
		for( var i = 0; i < objs.length; i++){ 
			if( objs[i].checked ){ 
				flag = objs[i].value;
			}
		}
		if( flag ){
			document.forms['encu'].submit(); 
		}else{
			alert( 'Elija una opción' )
		}
	}

	// Inicio Telones
	var telon_max = undefined;
	var telon_tmp = undefined;
	
	function _show( id ){
		_reset();
		var obj = 'telon-' + id;
		_posTelon(obj)
		$( obj ).show();
		$( id ).addClassName('menu-active');
		//telon_tmp = setTimeout("_hide()",3000);
	}

	function _stay( obj ){
		$( obj ).show();
		var _a = obj.split('-');
		$( 'm-' + _a[2] ).addClassName('menu-active');
		clearInterval(telon_tmp);
	}
	
	function _hide( obj ){
		_reset();
	}
	
	function _reset(){
		for(i = 1; i < telon_max; i++){
			$( 'telon-m-' + i ).hide();
			$( 'm-' + i ).removeClassName('menu-active');
		}
	}
	
	function _posTelon(obj){
		$( obj ).style.top 		= ( getElementTop('body-grana') ) + "px";
		$( obj ).style.left 	= ( getElementLeft('body-grana') ) + "px";
	}
	
	function getElementLeft(elemID){
		var offsetTrail = document.getElementById(elemID);
		var offsetLeft = 0;

		while (offsetTrail){
			offsetLeft += offsetTrail.offsetLeft;
			offsetTrail = offsetTrail.offsetParent;
		}
		if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined" && navigator.appName=="Microsoft Internet Explorer" ){
			offsetTop += parseInt(document.body.topMargin);
		}
		return offsetLeft;
	}
	
	function getElementTop(elemID){
		var offsetTrail = document.getElementById(elemID);
		var offsetTop = 0;
		while (offsetTrail){
			offsetTop += offsetTrail.offsetTop;
			offsetTrail = offsetTrail.offsetParent;
		}
		if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined" && navigator.appName=="Microsoft Internet Explorer" ){
			offsetTop += parseInt(document.body.topMargin);
		}
		return offsetTop;
	}	
	// Fin Telones
	
	
	// Inicio Acordion
	var obj_opened 	= undefined;
	
	function accordion_conmute( id ){
		if( obj_opened != id ){
			$( 'accordion-title-' + obj_opened ).removeClassName('accordion-title-' + obj_opened + '-open');
			$( 'accordion-title-' + obj_opened ).addClassName('accordion-title-' + obj_opened);
			$( 'accordion-title-' + id ).removeClassName('accordion-title-' + id);
			$( 'accordion-title-' + id ).addClassName('accordion-title-' + id + '-open');
			Effect.BlindUp( 'accordion-cont-' + obj_opened );
			Effect.BlindDown( 'accordion-cont-' + id );
			obj_opened = id;
		}
	}
	
	function accordion_init( id ){
		$( 'accordion-title-' + id ).removeClassName('accordion-title-' + id);
		$( 'accordion-title-' + id ).addClassName('accordion-title-' + id + '-open');
		Effect.BlindDown( 'accordion-cont-' + id );
		obj_opened 	= id;
	}
	// Fin Acordion	
	
	
	var supportsKeys = false;

	function calcCharLeft( obj, _max, div ){
		try{
			var maxLength = parseInt(_max);
			if ( $F( obj ).length > maxLength ){
				$( obj ).value = $( obj ).value.substring( 0 , maxLength );
				charleft = 0;
			} 
			else
				charleft = maxLength - $( obj ).value.length;
	
			$( div ).update("Restan: " + charleft + " caracteres");
		}catch(o){}
	}

	function textKey(f, _max, div){
		supportsKeys = true
		calcCharLeft(f, _max, div)
	}
	
	function ViewEncuRes(){
		popUpWindow(URI_PATH + 'encuestas/resultados.php');
	}
	
	var popUpWin = 0;
	
	function popUpWindow(URLStr){
		if(popUpWin){
			if(!popUpWin.closed) popUpWin.close();
		}
		popUpWin = open(URLStr, 'popUpWin', 'fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=490,height=400');
	}
	
	function centerMe(){
		var height = window.innerHeight !== undefined ? window.innerHeight : window.document.body.clientHeight;
		var width = window.innerWidth !== undefined ? window.innerWidth : window.document.body.clientWidth;
		window.moveTo(window.screen.availWidth/2 - width / 2, window.screen.availHeight/2 - height / 2);
		resizeTo($('popup').getWidth() + 15, $('popup').getHeight() + 86);
	}
	
	function previewOver(obj){
		$(obj).removeClassName('PreviewOff');
		$(obj).addClassName('PreviewOn');
	}
	
	function previewOut(obj){
		$(obj).removeClassName('PreviewOn');
		$(obj).addClassName('PreviewOff');
	}
	
	function OnMouseOver(obj){
		$(obj).removeClassName('previewOut');
		$(obj).addClassName('previewOver');
	}
	
	function OnMouseOut(obj){
		$(obj).removeClassName('previewOver');
		$(obj).addClassName('previewOut');
	}
	