
	var pagina = {
		inicio : function(){

			_dim = this.dimension()
			
			$('buscar').addEvents({
					'keypress' : function(event){
						var event = new Event(event);
						if(event.key == "enter"){
							window.location.href= "index.php?palabra="+this.value
						}
					}
			});
			
			this.ajustar()
			this.dameHora()
			
			formulario.ini()
			control.elementos()
			tablas.filas()
			
			if($("subir_swf")){
				subir.ini()
			}
			
			if($("texto")){
				if(window.ie){
					tinyMCE.init({
						mode : "textareas",
						language : "es",
						browsers : "msie,gecko,opera",
						theme : "advanced",
						height : "300",
						plugins : "inlinepopups,safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
						theme_advanced_buttons1 : "preview,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect,|,forecolor,backcolor",
						theme_advanced_buttons2 : "cut,copy,paste,|,bullist,numlist,|,undo,redo,|,link,unlink,image,code,|,emotions,iespell,media,|,fullscreen",
						theme_advanced_resizing : true,
						theme_advanced_toolbar_location : "top",
						theme_advanced_toolbar_align : "left",
						extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
						theme_advanced_statusbar_location : "bottom"
					});
				}
			}

			var Tips1 = new Tips($$('.Tips1'), {
				initialize:function(){
					this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 200, wait: true}).set(0);
				},
				onShow: function(toolTip) {
					this.fx.start(1);
				},
				onHide: function(toolTip) {
					this.fx.start(0);
				}
			});
			
		},
		dimension : function(){
			var xScroll, yScroll;
	
			if (window.innerHeight && window.scrollMaxY) {	
				xScroll = document.body.scrollWidth;
				yScroll = window.innerHeight + window.scrollMaxY;
			} else if (document.body.scrollHeight > document.body.offsetHeight){ 
				xScroll = document.body.scrollWidth;
				yScroll = document.body.scrollHeight;
			} else { 
				xScroll = document.body.offsetWidth;
				yScroll = document.body.offsetHeight;
			}
	
			var windowWidth, windowHeight;
			if (self.innerHeight) {	
				windowWidth = self.innerWidth;
				windowHeight = self.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) { 
				windowWidth = document.documentElement.clientWidth;
				windowHeight = document.documentElement.clientHeight;
			} else if (document.body) { 
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
			}	
	
			if(yScroll < windowHeight){
				pageHeight = windowHeight;
			} else { 
				pageHeight = yScroll;
			}

			if(xScroll < windowWidth){	
				pageWidth = windowWidth;
			} else {
				pageWidth = xScroll;
			}

			arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
			return arrayPageSize;
		},
		vacio : function(q){
			for ( i = 0; i < q.length; i++ ) {
				if ( q.charAt(i) != " " ) {
					return true
				}
    	    }
        	return false			
		},
		validarEmail : function(valor){
			if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
				return true
			}else{
				return false
			}
		},
		test : function(){
			alert("Prueba de comando")	
		},
		ajustar : function(){
			if($("zona_de_ajuste")){
				var objX = $("zona_de_ajuste").getPosition();
				$("zona_de_ajuste").style.height = ""+((_dim[3]-objX.y))+"px"
				$("zona_de_ajuste").style.width = ""+((_dim[2]-objX.x)-10)+"px"
			}
		},
		dameHora : function(){
	        var now = new Date();  
    	    var hours = now.getHours();  
        	var minutes = now.getMinutes(); 
	        var seconds = now.getSeconds();
    	    var timeValue = "Bienvenido, hoy es " + now.getDate() + " de " + _mes[now.getMonth()]  + "  " + ((hours >12) ? hours -12 :hours)
        	timeValue += ((minutes < 10) ? ":0" : ":") + minutes 
	        timeValue += ((seconds < 10) ? ":0" : ":") + seconds
    	    timeValue += (hours >= 12) ? " P.M." : " A.M. "
        	$("hora").innerHTML = timeValue;
	        setTimeout("pagina.dameHora()",1000);
		},
		refrescar : function(){
			window.location.href=window.location.href;
		}
	}