jsObjects = new Array();
	
function AbreVentana(url, x, y, w, h, sb, loc) {
	MiVentana = window.open (url,'MiVentana','location='+loc+', scrollbars='+sb+',left='+x+',top='+y+',height='+h+',width='+w);
	MiVentana.resizeTo(w+10,h+60);
	MiVentana.focus();
}

function loadingAjax(id){
	document.getElementById(id).innerHTML='<img src="images/loading_ajax.gif" />';
}

function createRequestObject() {
    var obj;
    var browser = navigator.appName;
    
    if(browser == "Microsoft Internet Explorer"){
        obj = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else{
        obj = new XMLHttpRequest();
    }
    return obj;    
}
function carga_pagina(url,params,handler,method) {
	method = method || "POST";
	http = createRequestObject();
	http.onreadystatechange = handler;
	http.open("POST", url);
	http.setRequestHeader("Pragma", "no-cache");
	http.setRequestHeader("Cache-Control", "no-cache");      	
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');	
	window.setTimeout(function () {
		http.send(params);
	}, 10);
}



function fileBrowserCallBack(field_name, url, type, win) {
		var connector = "../../filemanager/browser.html?Connector=connectors/php/connector.php";
		var enableAutoTypeSelection = true;
		
		var cType;
		tinyfck_field = field_name;
		tinyfck = win;
		
		switch (type) {
			case "image":
				cType = "Image";
				break;
			case "flash":
				cType = "Flash";
				break;
			case "file":
				cType = "File";
				break;
		}
		
		if (enableAutoTypeSelection && cType) {
			connector += "&Type=" + cType;
		}
		
		var ventana = window.open(connector, "tinyfck", "modal,width=600,height=400");
		if(!ventana) { 
			alert("Compruebe que su navegador no tenga activado un bloqueador de ventanas para esta página."); 
		}
	}
	
function make_url_friendly(texto){
	var oldletters = new Array('á|â|ä|à','é|ê|ë|è','í|î|ï|ì','ó|ô|ö|ò','ú|û|ü|ù','ñ',' ');
	var newletters = new Array('a','e','i','o','u','n','-');
	for(var i=0;i<oldletters.length;i++){
		texto = texto.replace(new RegExp(oldletters[i], "gi"),newletters[i]);
	}
	var valid = new RegExp("[0-9a-z]","i");
	var t = new String('');
	for (var i=0;i<texto.length;i++){
		if (!valid.test(texto.substr(i,1))){
			t += '-';
		}else{
			t += texto.substr(i,1);
		}
	}
	t = t.replace(/\-+/gi,'-');
	t = t.replace(/-$/,'');
	t = t.replace(/^-/,'');
	return t.toLowerCase();
}