/** Las compatibilidades son extraidas de tiny_mce_src.js.
En el caso de que falle alguna recuperar la última versión de tiny_mce y 
ver:
function TinyMCE_Engine
openWindow : function
Global instances
*/
function MotorMicroweb () {
	ua = navigator.userAgent;
	this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
	this.isMSIE5 = this.isMSIE && (ua.indexOf('MSIE 5') != -1);
	this.isMSIE5_0 = this.isMSIE && (ua.indexOf('MSIE 5.0') != -1);
	this.isMSIE7 = this.isMSIE && (ua.indexOf('MSIE 7') != -1);
	this.isGecko = ua.indexOf('Gecko') != -1;
	this.isSafari = ua.indexOf('Safari') != -1;
	this.isOpera = ua.indexOf('Opera') != -1;
	this.isMac = ua.indexOf('Mac') != -1;
	this.isNS7 = ua.indexOf('Netscape/7') != -1;
	this.isNS71 = ua.indexOf('Netscape/7.1') != -1;
}

MotorMicroweb.prototype = {

abrirEditor : function(url, ancho, alto, funcion ) {
    if (!(width = parseInt(ancho))) width = 800;
    if (!(height = parseInt(alto))) height = 600;
   // if (!(width = parseInt(ancho))) width = 640;
   // if (!(height = parseInt(alto))) height = 480;
	if (motorMW.isIE) height += 40;
	else height += 20;
    x = parseInt(screen.width / 2.0) - (width / 2.0);
	y = parseInt(screen.height / 2.0) - (height / 2.0);
    var win = window.open(url, "mwPopup","top=" + y + ",left=" + x + ",width=" + width + ",height=" + height +',toolbar=no,fullscreen=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
    // Make it bigger if statusbar is forced
    if (motorMW.isGecko) {
    	if (win.document.defaultView.statusbar.visible)
    		win.resizeBy(0, motorMW.isMac ? 10 : 24);
    }
    
},
pecharEditor: function(win) {
	win.close();
	location.reload(true);
},
reenviarEditor: function(win,text) {
	win.close();
	if(text=="FAQ"){
		location.href=("/servizos/faqs.php");
	}else{
		location.href=("/servizos/marco_legal.php");
	}
}
} // Fin prototype

// Asignacions Globais
var motorMW = MotorMicroweb; // Compatiblity with gzip compressors
var motorMW = new MotorMicroweb();  

