// ------------------------------------------------------------------------------------
// -----------------------------------	MvWindow 1.1	---------------------------------
// ------------------------------------------------------------------------------------
// ------------------------------ mvwindow.sourceforge.net ----------------------------
// ------------------------------------------------------------------------------------

var mbarleftpos = 0; 			// Minimized window start positon from left
								// Position der minimierten Fenster von Links

var mbarbottompos = 27; 		// Minimized window start positon from bottom
								// Position der minimierten Fenster von Unten

var cookiename = 'mvwindow';	// Cookie name
								// Name des Cookies

var n=10;						// Number of maximal minimized windows
								// Maximale Anzahl der minimiert dargestellten Fenstern

var MvAnimations = 1;			// Enable oder Disable the Animations ( 0 = off / 1 = on )
								// Aktivieren der Window Animationen ( 0 = off / 1 = on )

// ------------------------------- Do not make any changes above this line --------------------
// ------------------------------- Unterhalb dieser Linie bitte keine Änderungen vornehmen -----

var mousex;
var mousey;
var maxZ = 1600;
var init = 0;

var ywert = 0;
var xwert = 0;
var move = 0;
var dragx = 0;
var dragy = 0;
var xnow;
var ynow;

//var ie7 = (document.all && !window.opera && window.XMLHttpRequest) ? true : false;
var isIExplorer = (document.all && !window.opera) ? true : false;

var windowarr = new Array();
var mvw_alloverdiv_over = "mvw_alloverdiv_over";
var mvw_alloverdiv = "mvw_alloverdiv";

var windowname;
var windowsminimizedanz = new Array(n);

//if(ie7){ // IE7
if(isIExplorer){ // IE7
	document.attachEvent("onmousemove", moveit);
} else { // rest
	document.addEventListener("mousemove", moveit, true);
}

while (n>0)
{
	n--;
	windowsminimizedanz[n]=0;
}

var ismaximized = 0;

// ------------------------------------------------------------------------------------

function disableselectIE(){
	var obj = event.srcElement;
	if (obj.type == "text") {
		return true;
	} else if (obj.type == "textarea") {
		return true;
	}
	return false;
}

function disableselect(e){
	var obj = e.target;
	if (obj.tagName == "INPUT") {
		return true;
	} else if (obj.tagName == "TEXTAREA") {
		return true;
	}
	return false;
}

function reEnable(){
	return true;
 }

// ------------------------------------------------------------------------------------

function cookieactivate() {
	setwindows();
}

function drawALL(){

	for (x in windowarr)
	{
		wid = windowarr[x];

		eval(wid).draw();

	}
}

// ------------------------------------------------------------------------------------
function browserresize(oldMaxx, oldMaxy){
	for (x in windowarr)
	{
		wid = windowarr[x];

		_laMinX = eval(wid).minx*1;
		_laMaxX = eval(wid).maxx*1;
		_laMinY = eval(wid).miny*1;
		_laMaxY = eval(wid).maxy*1;

		_laAnchura = eval(wid).sx*1;
		_laAltura = eval(wid).sy*1;
		_laMitadAnchura = _laAnchura/2;
		_laMitadAltura = _laAltura/2;

/*
		bordeMinX = (eval(wid).wx*1 - _laMinX);
		if (( bordeMinX ) <= 30) {
				// esta muy cerca del borde o incluso fuera => lo pego al nuevo borde
			document.getElementById(wid).style.left = (_laMinX + bordeMinX) + 'px';
			eval(wid).wx = (_laMinX + bordeMinX);
		}

		bordeMinY = (eval(wid).wy*1 - _laMinY);
		if (( bordeMinY ) <= 30) {
				// esta muy cerca del borde o incluso fuera => lo pego al nuevo borde
			document.getElementById(wid).style.top = (_laMinY + bordeMinY) + 'px';
			eval(wid).wy = (_laMinY + bordeMinY);
		}

		bordeMaxX = oldMaxx - (eval(wid).wx*1 + _laAnchura);
		if (bordeMaxX <= 30) {
				// esta muy cerca del borde o incluso fuera => lo pego al nuevo borde
			document.getElementById(wid).style.left = (_laMaxX - _laAnchura - bordeMaxX) + 'px';
			eval(wid).wx = (_laMaxX - _laAnchura - bordeMaxX);
		}

		bordeMaxY = oldMaxy - (eval(wid).wy*1 + _laAltura);
		if (bordeMaxY <= 30) {
				// esta muy cerca del borde o incluso fuera => lo pego al nuevo borde
			document.getElementById(wid).style.top = (_laMaxY - _laAltura - bordeMaxY) + 'px';
			eval(wid).wy = (_laMaxY - _laAltura - bordeMaxY);
		}
	*/
		// veo hacia que lado esta y respeto la distancia al borde mas cercano
	mitadX = (eval(wid).wx*1 + (_laMitadAnchura)) - _laMinX;
	mitadY = (eval(wid).wy*1 + (_laAltura/2)) - _laMinY;
	laMitadX = (oldMaxx - _laMinX) / 2;
	laMitadY = (oldMaxy - _laMinY) / 2;

		if (mitadX <= laMitadX) {
				// esta muy cerca del borde izquierdo => lo dejo como esta
		} else {
				// esta muy cerca del borde derecho o incluso fuera => lo acerco al nuevo borde
			diffX = oldMaxx - (eval(wid).wx*1);
			document.getElementById(wid).style.left = (_laMaxX - diffX) + 'px';
			eval(wid).wx = (_laMaxX - diffX);
		}

		if (mitadY <= laMitadY) {
				// esta muy cerca del borde superior => lo dejo como esta
		} else {
				// esta muy cerca del borde inferior o incluso fuera => lo acerco al nuevo borde
			diffY = oldMaxy - (eval(wid).wy*1);
			document.getElementById(wid).style.top = (_laMaxY - diffY) + 'px';
			eval(wid).wy = (_laMaxY - diffY);
		}

		if (eval(wid).wx*1 < _laMinX) {
			document.getElementById(wid).style.left = _laMinX + 'px';
			eval(wid).wx = _laMinX;
		}

		if (eval(wid).wy*1 < _laMinY) {
			document.getElementById(wid).style.top = _laMinY + 'px';
			eval(wid).wy = _laMinY;
		}

		if (((eval(wid).wx*1) + _laAnchura) > _laMaxX) {
			document.getElementById(wid).style.left = (_laMaxX - _laAnchura) + 'px';
			eval(wid).wx = (_laMaxX - _laAnchura);
		}

		if (((eval(wid).wy*1) + _laAltura) > _laMaxY) {
			document.getElementById(wid).style.top = (_laMaxY - _laAltura) + 'px';
			eval(wid).wy = (_laMaxY - _laAltura);
		}

	}
	updateminimized();
}

// ------------------------------------------------------------------------------------
function setCookie(wid){
	if (init == 1){
		var expdate = new Date ();
			expdate.setTime (expdate.getTime() + (1000 * 60 * 60 * 24 * 31));

		cookievalue= +
			eval(wid).wx + ',' +
			eval(wid).wy + ',' +
			eval(wid).sx + ',' +
			eval(wid).sy + ',' +
			eval(wid).minimizepos + ',' +
			eval(wid).wenable + ',' +
			eval(wid).wdisable + ',' +
			eval(wid).wminimize + ',' +
			eval(wid).wmaximize + ',' +
			eval(wid).zindex	+ ',' +
			eval(wid).activewindow + ',' +
			maxZ;

		document.cookie = cookiename + '_' + wid + "=" + escape(cookievalue) +
			"; expires=" + expdate +	"; path=/";
	}

}

// ------------------------------------------------------------------------------------

function clearCookies(){

	var expdate = new Date ();

	for (x in windowarr)
	{
		wid = windowarr[x];
		document.cookie = cookiename + '_' + wid + "=" + escape('') + "; expires=" + expdate +	"; path=/";
	}
	document.location.reload();
}

// ------------------------------------------------------------------------------------
function getCookie (wid) {
		var dcookie = document.cookie;
		var cname = cookiename + '_' + wid + "=";
		var clen = dcookie.length;
		var cbegin = 0;
				while (cbegin < clen) {
				var vbegin = cbegin + cname.length;
						if (dcookie.substring(cbegin, vbegin) == cname) {
						var vend = dcookie.indexOf (";", vbegin);
								if (vend == -1) vend = clen;
						return unescape(dcookie.substring(vbegin, vend));
						}
				cbegin = dcookie.indexOf(" ", cbegin) + 1;
						if (cbegin == 0) break;
				}
		return null;
}

// ------------------------------------------------------------------------------------
function setwindows(){
 if (document.cookie) {
	for (x in windowarr)
	{
		wid = windowarr[x];

		var tmpwert = getCookie(wid);

		if (tmpwert)
		{
			var tmpwerte = tmpwert.split(",");
			eval(wid).wx = tmpwerte[0];
			eval(wid).wy = tmpwerte[1];
			eval(wid).sx = tmpwerte[2];
			eval(wid).sy = tmpwerte[3];
			eval(wid).minimizepos = tmpwerte[4];
			eval(wid).wenable = tmpwerte[5];
			eval(wid).wdisable = tmpwerte[6];
			eval(wid).wminimize = tmpwerte[7];
			eval(wid).wmaximize = tmpwerte[8];
			eval(wid).zindex = tmpwerte[9];
			eval(wid).activewindow = tmpwerte[10];
			maxZ = tmpwerte[11];

			if ( eval(wid).zindex > maxZ ) { maxZ = eval(wid).zindex };

			document.getElementById(wid).style.height = eval(wid).sy + 'px';
			document.getElementById(wid+"content").style.height = (eval(wid).sy)-20 + 'px';
			document.getElementById(wid).style.width = eval(wid).sx + 'px';
			document.getElementById(wid).style.top = eval(wid).wy + 'px';
			document.getElementById(wid).style.left = eval(wid).wx + 'px';

			document.getElementById(wid).style.zIndex = eval(wid).zindex;

	 	if (eval(wid).wenable == 1){
	 		document.getElementById(wid).style.visibility = 'visible';
	 	}

	 	if (eval(wid).wminimize == 1) {

	 		leftpos = 0;

			for (z=0; z<10; z++)
			{
			 if( windowsminimizedanz[z] == 0 )
			 {
			 	leftpos = mbarleftpos + (z*101);
				windowsminimizedanz[z] = 1;
				eval(wid).minimizepos = z;
				break;
			 }
			}
			toppos = document.body.clientHeight - mbarbottompos;

	 		document.getElementById(wid).style.width = '100px';
			document.getElementById(wid).style.height = '20px';
			document.getElementById(wid).style.top = toppos + 'px';
			document.getElementById(wid).style.left = leftpos + 'px';
			eval(wid).draw();
	 	}

	 	if (eval(wid).wmaximize == 1) {

	 		document.getElementById(wid).style.width = (eval(wid).maxx - eval(wid).minx) + 'px';
			document.getElementById(wid).style.height = (eval(wid).maxy - eval(wid).miny) + 'px';
			document.getElementById(wid).style.top = eval(wid).miny + 'px';
			document.getElementById(wid).style.left = eval(wid).minx + 'px';
			eval(wid).draw();

			document.getElementById(wid+"content").style.height = (eval(wid).maxy - eval(wid).miny)-20 + 'px';
			ismaximized = 1;
	 	}
		}
	}
	}

	init = 1;

	for (x in windowarr)
	{
	document.getElementById("title"+windowarr[x]).className='mvw_title_over';
	if (document.getElementById(windowarr[x]+'contentbgtable')) {
		document.getElementById(windowarr[x]+'contentbgtable').className='mvw_inhalt_over';
	}
	if (eval(windowarr[x]).activewindow == 1){
		document.getElementById("title" + windowarr[x]).className='mvw_title';
		if (document.getElementById(windowarr[x] + 'contentbgtable')){
			document.getElementById(windowarr[x] + 'contentbgtable').className='mvw_inhalt';
		}
	}

	}

}

// ------------------------------------------------------------------------------------
function setstyle(tid){

	for (x in windowarr)
	{
		document.getElementById("title"+windowarr[x]).className='mvw_title_over';
		if(document.getElementById(windowarr[x] + 'contentbgtable'))
		{
			document.getElementById(windowarr[x] + 'contentbgtable').className='mvw_inhalt_over';
		document.getElementById(windowarr[x] + 'content').style.overflow='hidden';
		}
		eval(windowarr[x]).activewindow = 0;
		eval(windowarr[x]).updatecookie();
	}

	document.getElementById("title"+tid).className='mvw_title';
	if (document.getElementById(tid + 'contentbgtable')){
		document.getElementById(tid + 'contentbgtable').className='mvw_inhalt';
		document.getElementById(tid + 'content').style.overflow='auto';
	}

	eval(tid).activewindow = 1;
	eval(tid).updatecookie();
}


// ------------------------------------------------------------------------------------
function viewallreset(vwid){

	var x = 1;
	for (x in windowarr)
	{
		wid = windowarr[x];
		if(eval(wid).wenable == 1 && eval(wid).wminimize == 0)
		{
			document.getElementById(wid+'overlay').style.visibility = 'hidden';
			sth = document.getElementById(wid).style.height;
			stw = document.getElementById(wid).style.width;
			stt = document.getElementById(wid).style.top;
			stl = document.getElementById(wid).style.left;
			stw = stw.substring(0,stw.indexOf("px"));
			sth = sth.substring(0,sth.indexOf("px"));
			stt = stt.substring(0,stt.indexOf("px"));
			stl = stl.substring(0,stl.indexOf("px"));
			var tmpsy,tmpsx,tmpwx,tmpwy;

			tmpsy = eval(wid).sy;
			tmpsx	= eval(wid).sx;
			tmpwx = eval(wid).wx;
			tmpwy = eval(wid).wy;

			i=0;

			if (MvAnimations == 1){
				for (z=1; z<10; z++)
				{
					i++;
					string="sizedownallanim('"+wid+"','"+z+"','"+i+"','"+sth+"','"+stw+"','"+stt+"','"+stl+"','"+tmpwy+"','"+tmpwx+"','"+tmpsy+"','"+tmpsx+"');";
					setTimeout(string,50*i);
				}
			} else {
				string="sizedownallanim('"+wid+"','9','"+i+"','"+sth+"','"+stw+"','"+stt+"','"+stl+"','"+tmpwy+"','"+tmpwx+"','"+tmpsy+"','"+tmpsx+"');";
				setTimeout(string,15);
			}

		}
	}

	ontop(vwid);

}

// ------------------------------------------------------------------------------------
function viewall(){
	var openwindows = 0;
	var browserwidth = document.body.clientWidth;
	var browserheight = document.body.clientHeight-20;

	var windowwidth;
	var windowheight;

	for (x in windowarr)
	{
		wid = windowarr[x];
		if(eval(wid).wenable == 1 && eval(wid).wminimize==0){
		openwindows++;
		}
	}

	if (openwindows < 4){
	 	windowheight = browserheight-10;
	 	windowwidth = Math.round((browserwidth-(openwindows*10))/openwindows);
	} else {
	 	windowheight = Math.round((browserheight/Math.ceil(openwindows/3))-(Math.ceil(openwindows/3)*10));
	 	windowwidth = Math.round((browserwidth-(30))/3);
	}


		var w = 0;
		var l = 0;
		for (x in windowarr)
		{
			wid = windowarr[x];
			if(eval(wid).wenable == 1 && eval(wid).wminimize==0)
			{
				sth = document.getElementById(wid).style.height;
				stw = document.getElementById(wid).style.width;
				stt = document.getElementById(wid).style.top;
				stl = document.getElementById(wid).style.left;
				stw = stw.substring(0,stw.indexOf("px"));
				sth = sth.substring(0,sth.indexOf("px"));
				stt = stt.substring(0,stt.indexOf("px"));
				stl = stl.substring(0,stl.indexOf("px"));
				var tmpsy,tmpsx,tmpwx,tmpwy;
				var zeilenum = 0;

				tmpsy = windowheight; //höhe
				tmpsx	= windowwidth-5; //breite

				if (openwindows < 4) {
					tmpwx = 10; //x
					tmpwy = (windowwidth*w)+10; //y
				} else {
					zeilenum = Math.ceil((w+1)/3);
					tmpwx = (windowheight*(zeilenum-1))+(5*zeilenum-1);
					tmpwy = (windowwidth*l)+10; //y
					l++;
					if (l==3){	l=0 }
				}

				document.getElementById(wid+'overlay').innerHTML = '<table width="100%" height="100%" cellpadding="0" cellpadding="0"><tr><td align="center" valign="middle" class="mvw_alloverdiv_txt">'+eval(wid).wtitle+'</td></tr></table>';

				i=0;
				if (MvAnimations == 1){
					for (var z=1; z<10; z++)
					{
						i++;
						string="showallupanim('"+wid+"','"+z+"','"+i+"','"+sth+"','"+stw+"','"+stt+"','"+stl+"','"+tmpwy+"','"+tmpwx+"','"+tmpsy+"','"+tmpsx+"');";
						setTimeout(string,50*i);
					}
				} else {
					string="showallupanim('"+wid+"','9','"+i+"','"+sth+"','"+stw+"','"+stt+"','"+stl+"','"+tmpwy+"','"+tmpwx+"','"+tmpsy+"','"+tmpsx+"');";
					setTimeout(string,15);
				}
				w++;
			}
		}

}

// ------------------------------------------------------------------------------------
function updateminimized(){

	for (z=0; z<10; z++){
		windowsminimizedanz[z] = 0;
	}

	var z=0;
	for (x in windowarr)
	{
	 wid = windowarr[x];

	 if(eval(wid).wminimize == 1){
	 if(eval(wid).wdisable == 0) {

		windowsminimizedanz[z] = 1;
		eval(wid).minimizepos = z;

		leftpos = mbarleftpos + (z*101);
		toppos = document.body.clientHeight - mbarbottompos;

		document.getElementById(wid).style.width = '100px';
		document.getElementById(wid).style.height = '20px';
		document.getElementById(wid).style.top = toppos + 'px';
		document.getElementById(wid).style.left = leftpos + 'px';

		z++;
	 }
	 }
	}

}

// ------------------------------------------------------------------------------------
function maximinisize(wid){

	eval(wid).draw();
	ontop(wid);

	var tmpsize = document.getElementById(wid).style.height;

	if (eval(wid).wminimize > 0)
	{
		eval(wid).wminimize = 0;
		windowsminimizedanz[eval(wid).minimizepos] = 0;
		eval(wid).minimizepos = 0;
		eval(wid).draw();
	}

	if(	ismaximized == 1 ){

		ismaximized=0;

		eval(wid).wmaximize = 0;
		eval(wid).wminimize = 0;

		sth = document.getElementById(wid).style.height;
		stw = document.getElementById(wid).style.width;
		stt = document.getElementById(wid).style.top;
		stl = document.getElementById(wid).style.left;
		stw = stw.substring(0,stw.indexOf("px"));
		sth = sth.substring(0,sth.indexOf("px"));
		stt = stt.substring(0,stt.indexOf("px"));
		stl = stl.substring(0,stl.indexOf("px"));
		var tmpsy,tmpsx,tmpwx,tmpwy;

		tmpsy = eval(wid).sy;
		tmpsx	= eval(wid).sx;
		tmpwx = eval(wid).wy;
		tmpwy = eval(wid).wx;

		i=0;

		if (MvAnimations == 1){
			for (z=1; z<10; z++)
			{
				i++;
				string="sizedownanim('"+wid+"','"+z+"','"+i+"','"+sth+"','"+stw+"','"+stt+"','"+stl+"','"+tmpwy+"','"+tmpwx+"','"+tmpsy+"','"+tmpsx+"');";
				setTimeout(string,50*i);
			}
		} else {
			string="sizedownanim('"+wid+"','9','"+i+"','"+sth+"','"+stw+"','"+stt+"','"+stl+"','"+tmpwy+"','"+tmpwx+"','"+tmpsy+"','"+tmpsx+"');";
			setTimeout(string,15);
		}

	} else {

		ismaximized=1;

		eval(wid).wmaximize = 1;
		eval(wid).wminimize = 0;

		sth = document.getElementById(wid).style.height;
		stw = document.getElementById(wid).style.width;
		stt = document.getElementById(wid).style.top;
		stl = document.getElementById(wid).style.left;
		stw = stw.substring(0,stw.indexOf("px"));
		sth = sth.substring(0,sth.indexOf("px"));
		stt = stt.substring(0,stt.indexOf("px"));
		stl = stl.substring(0,stl.indexOf("px"));
		var tmpsy,tmpsx,tmpwx,tmpwy;

		tmpsy = (eval(wid).maxy - eval(wid).miny);
		tmpsx	= (eval(wid).maxx - eval(wid).minx);
		tmpwx = eval(wid).miny;
		tmpwy = eval(wid).minx;

		i=0;

		if (MvAnimations == 1){
			for (var z=1; z<10; z++)
			{
				i++;
				string="sizeupanim('"+wid+"','"+z+"','"+i+"','"+sth+"','"+stw+"','"+stt+"','"+stl+"','"+tmpwy+"','"+tmpwx+"','"+tmpsy+"','"+tmpsx+"');";
				setTimeout(string,50*i);
			}
		} else {

			string="sizeupanim('"+wid+"','9','"+i+"','"+sth+"','"+stw+"','"+stt+"','"+stl+"','"+tmpwy+"','"+tmpwx+"','"+tmpsy+"','"+tmpsx+"');";
			setTimeout(string,15);
		}
	}
}

// ------------------------------------------------------------------------------------
function showallupanim(wid,z,i,sth,stw,stt,stl,wy,toppos,eh,ew){

	document.getElementById(wid).style.width = Math.round(ew-((ew-stw)/z) + (ew-stw)/9)+ 'px';
	document.getElementById(wid).style.height = Math.round(eh-((eh-sth)/z) + (eh-sth)/9)+ 'px';
	document.getElementById(wid+"content").style.height = Math.round(eh-((eh-sth)/z) + (eh-sth)/9)-20+ 'px';
	document.getElementById(wid).style.top = Math.round(toppos-0+((stt-toppos)/z) - (stt-toppos)/9) + 'px';
	document.getElementById(wid).style.left = Math.round(wy-0+((stl-wy)/z) - (stl-wy)/9) + 'px';

	document.getElementById(wid+'overlay').style.width = Math.round(ew-((ew-stw)/z) + (ew-stw)/9)-1 + 'px';
	document.getElementById(wid+'overlay').style.height = Math.round(eh-((eh-sth)/z) + (eh-sth)/9)+1 + 'px';
	document.getElementById(wid+'overlay').style.top = Math.round(toppos-0+((stt-toppos)/z) - (stt-toppos)/9) + 'px';
	document.getElementById(wid+'overlay').style.left = Math.round(wy-0+((stl-wy)/z) - (stl-wy)/9) + 'px';
	document.getElementById(wid+'overlay').style.zIndex = maxZ+1 ;
	document.getElementById(wid+'overlay').style.visibility = 'visible';

}

// ------------------------------------------------------------------------------------
function sizedownallanim(wid,z,i,sth,stw,stt,stl,wy,toppos,eh,ew){

	document.getElementById(wid).style.width = Math.round(ew-((ew-stw)/z) + (ew-stw)/9)+ 'px';
	document.getElementById(wid).style.height = Math.round(eh-((eh-sth)/z) + (eh-sth)/9)+ 'px';
	document.getElementById(wid+"content").style.height = Math.round(eh-((eh-sth)/z) + (eh-sth)/9)-20+ 'px';
	document.getElementById(wid).style.top = Math.round(toppos-0+((stt-toppos)/z) - (stt-toppos)/9) + 'px';
	document.getElementById(wid).style.left = Math.round(wy-0+((stl-wy)/z) - (stl-wy)/9) + 'px';

}

// ------------------------------------------------------------------------------------
function sizeupanim(wid,z,i,sth,stw,stt,stl,wy,toppos,eh,ew){

	document.getElementById(wid).style.width = Math.round(ew-((ew-stw)/z) + (ew-stw)/9)+ 'px';
	document.getElementById(wid).style.height = Math.round(eh-((eh-sth)/z) + (eh-sth)/9)+ 'px';
	document.getElementById(wid+"content").style.height = Math.round(eh-((eh-sth)/z) + (eh-sth)/9)-20+ 'px';
	document.getElementById(wid).style.top = Math.round(toppos-0+((stt-toppos)/z) - (stt-toppos)/9) + 'px';
	document.getElementById(wid).style.left = Math.round(wy-0+((stl-wy)/z) - (stl-wy)/9) + 'px';

	if(z == 1){

		eval(wid).wmaximize = 1;
		eval(wid).wminimize = 0;
		eval(wid).draw();

		updateminimized();

		eval(wid).updatecookie();
	}
}

// ------------------------------------------------------------------------------------
function sizedownanim(wid,z,i,sth,stw,stt,stl,wy,toppos,eh,ew){

	document.getElementById(wid).style.width = Math.round(ew-((ew-stw)/z) + (ew-stw)/9)+ 'px';
	document.getElementById(wid).style.height = Math.round(eh-((eh-sth)/z) + (eh-sth)/9)+ 'px';
	document.getElementById(wid+"content").style.height = Math.round(eh-((eh-sth)/z) + (eh-sth)/9)-20+ 'px';
	document.getElementById(wid).style.top = Math.round(toppos-0+((stt-toppos)/z) - (stt-toppos)/9) + 'px';
	document.getElementById(wid).style.left = Math.round(wy-0+((stl-wy)/z) - (stl-wy)/9) + 'px';

	if(z==1){
		eval(wid).draw();
		eval(wid).wmaximize = 0;
		eval(wid).wminimize = 0;
		eval(wid).updatecookie();
		updateminimized();
	}

}

// ------------------------------------------------------------------------------------
function minimizeanim(wid,z,i,sth,stw,stt,stl,leftpos,toppos){

	document.getElementById(wid).style.width = Math.round(stw-((stw-100)/z)) + 'px';
	document.getElementById(wid).style.height = Math.round(sth-((sth-20)/z)) + 'px';
	document.getElementById(wid+"content").style.height = Math.round(sth-((sth-20)/z))-20 + 'px';
	document.getElementById(wid).style.top = Math.round((stt-0+((toppos-stt)/z))) + 'px';
	document.getElementById(wid).style.left = Math.round((stl-0+((leftpos-stl)/z))) + 'px';

	if(z==1){

		eval(wid).wminimize = 1;
		eval(wid).wmaximize = 0;
		eval(wid).draw();
		eval(wid).updatecookie();
	}

}

// ------------------------------------------------------------------------------------
function maximizeanim(wid,z,i,sth,stw,stt,stl,wy,toppos,eh,ew){

	document.getElementById(wid).style.width = Math.round(100+((ew-stw)/z)) + 'px';
	document.getElementById(wid).style.top = Math.round(stt-0+((toppos-stt)/z)) + 'px';
	document.getElementById(wid).style.left = Math.round(stl-0+((wy-stl)/z)) + 'px';

	if(z==12){
		eval(wid).wminimize = 0;
		eval(wid).wmaximize = 0;
		eval(wid).draw();
	}

	if(z==1){
		eval(wid).updatecookie();
		eval(wid).wminimize = 0;
		eval(wid).wmaximize = 0;
		eval(wid).draw();
		updateminimized();
	}

	if((z > 0) & (z < 13)){
			document.getElementById(wid+"content").style.height = Math.round((20+((eh-sth)/z)))-20;
			document.getElementById(wid).style.height = Math.round(20+((eh-sth)/z)) + 'px';
	}
}

// ------------------------------------------------------------------------------------
function minimize(wid){

	ismaximized = 0;
	ontop(wid);

	var tmpsize = document.getElementById(wid).style.height;


	if (eval(wid).wminimize == 0) {


		leftpos = 0;

		for (z=0; z<10; z++)
		{
		 if( windowsminimizedanz[z] == 0 )
		 {
		 	leftpos = mbarleftpos + (z*102);
			windowsminimizedanz[z] = 1;
			eval(wid).minimizepos = z;
			break;
		 }
		}

		sth = document.getElementById(wid).style.height;
		stw = document.getElementById(wid).style.width;
		stt = document.getElementById(wid).style.top;
		stl = document.getElementById(wid).style.left;

		stw = stw.substring(0,stw.indexOf("px"));
		sth = sth.substring(0,sth.indexOf("px"));
		stt = stt.substring(0,stt.indexOf("px"));
		stl = stl.substring(0,stl.indexOf("px"));
		toppos = document.body.clientHeight - mbarbottompos;

		i=0;

		if (MvAnimations == 1){
			for (z=15; z>0; z--)
			{
				i++;
				string="minimizeanim('"+wid+"','"+z+"','"+i+"','"+sth+"','"+stw+"','"+stt+"','"+stl+"','"+leftpos+"','"+toppos+"');";
				setTimeout(string,15*i);
			}
		} else {
			string="minimizeanim('"+wid+"','1','"+i+"','"+sth+"','"+stw+"','"+stt+"','"+stl+"','"+leftpos+"','"+toppos+"');";
			setTimeout(string,1);
		}

	} else {

		sth = document.getElementById(wid).style.height;
		stw = document.getElementById(wid).style.width;
		stt = document.getElementById(wid).style.top;
		stl = document.getElementById(wid).style.left;
		stw = stw.substring(0,stw.indexOf("px"));
		sth = sth.substring(0,sth.indexOf("px"));
		stt = stt.substring(0,stt.indexOf("px"));
		stl = stl.substring(0,stl.indexOf("px"));
		var tmpsy,tmpsx,tmpwx,tmpwy;

		tmpsy = eval(wid).sy;
		tmpsx	= eval(wid).sx;
		tmpwy = eval(wid).wx;
		tmpwx = eval(wid).wy;

		i=0;

		if (MvAnimations == 1){
			for (z=15; z>0; z--)
			{
				i++;
				string="maximizeanim('"+wid+"','"+z+"','"+i+"','"+sth+"','"+stw+"','"+stt+"','"+stl+"','"+tmpwy+"','"+tmpwx+"','"+tmpsy+"','"+tmpsx+"');";
				setTimeout(string,15*i);
			}
		} else {
			string="maximizeanim('"+wid+"','1','"+i+"','"+sth+"','"+stw+"','"+stt+"','"+stl+"','"+tmpwy+"','"+tmpwx+"','"+tmpsy+"','"+tmpsx+"');";
			setTimeout(string,1);
		}

		windowsminimizedanz[eval(wid).minimizepos] = 0;
		eval(wid).minimizepos = 0;
	}

	eval(wid).draw();
	eval(wid).updatecookie();

}

// ------------------------------------------------------------------------------------
function ontop(wid){
	maxZ++;

	document.getElementById(wid).style.zIndex = maxZ;

	eval(wid).zindex = maxZ;
	eval(wid).update;
	eval(wid).updatecookie();

	setstyle(wid);
}

// ------------------------------------------------------------------------------------
function startdrag(xy,wid)
{
 windowname = wid;

	if (xy == 'x' || xy == 'xy')
	{
		dragx=1;
	 	xnow = document.getElementById(windowname).style.left;
 	 	if (xnow != ''){
 			xwert = xnow.substring(0,xnow.indexOf("px"));
 	 	}

	}
	if (xy == 'y' || xy == 'xy')
	{
		dragy=1;
	 	ynow = document.getElementById(windowname).style.top;
		if (ynow != ''){
			ywert = ynow.substring(0,ynow.indexOf("px"));
 		}

	}
}

// ------------------------------------------------------------------------------------
function stopdrag(){
	dragx=0;
	dragy=0;
}

// ------------------------------------------------------------------------------------
function startmove(wid,e){

	ontop(wid);

	windowname = wid;
	setstyle(wid);


	if (!e) var e = window.event;

	if (e.pageX || e.pageY)
	{
		mousex = e.pageX;
		mousey = e.pageY;
	}
	else if (e.clientX || e.clientY)
	{
		mousex = e.clientX + document.body.scrollLeft;
		mousey = e.clientY + document.body.scrollTop;
	}

	ynow = document.getElementById(windowname).style.top;
	ywert = mousey - ynow.substring(0,ynow.indexOf("px"));

	xnow = document.getElementById(windowname).style.left;
	xwert = mousex - xnow.substring(0,xnow.indexOf("px"));

	document.getElementById(windowname).style.zIndex = maxZ;

	move=1;
	windowname = wid;
}

// ------------------------------------------------------------------------------------
function stopmove(wid){
	move=0;
	stopdrag();

	if (ismaximized == 0)
	{

		if (wid != null){

			if (eval(wid).wminimize == 0)
			{
				tmpsx = document.getElementById(wid).style.width;
				tmpsx = tmpsx.substring(0,tmpsx.indexOf("px"));

				tmpsy = document.getElementById(wid).style.height;
				tmpsy = tmpsy.substring(0,tmpsy.indexOf("px"));

				tmpwx = document.getElementById(wid).style.left;
				tmpwx = tmpwx.substring(0,tmpwx.indexOf("px"));

				tmpwy = document.getElementById(wid).style.top;
				tmpwy = tmpwy.substring(0,tmpwy.indexOf("px"));

				eval(wid).sy = tmpsy;
				eval(wid).sx = tmpsx;
				eval(wid).wx = tmpwx;
				eval(wid).wy = tmpwy;

				eval(wid).updatecookie();
			}
		}
	}

}

// ------------------------------------------------------------------------------------
function moveit(e){

 if (windowname){

	if (ismaximized == 0 && eval(windowname).wminimize == 0) {

	if(dragx){
		var posx = 0;

		if (!e) var e = window.event;

		if (e.pageX)
		{
			posx = e.pageX;
		}
		else if (e.clientX)
		{
			posx = e.clientX + document.body.scrollLeft;
		}

		wndwidth = posx - xwert;

		if ( posx <= eval(windowname).maxx)
		{
			if (wndwidth >= 1 && wndwidth > 150) {
				document.getElementById(windowname+"content").style.width = wndwidth + 'px';
				document.getElementById(windowname).style.width = wndwidth + 'px';
			}
			eval(windowname).setsx(wndwidth);
		}

		eval(windowname).updatecookie();

	}

	if(dragy){

		var posy = 0;

		if (!e) var e = window.event;

		if (e.pageY)
		{
			posy = e.pageY;
		}
		else if (e.clientY)
		{
			posy = e.clientY + document.body.scrollTop;
		}

		wndheight = posy - ywert;

		if ( (posy) <= eval(windowname).maxy)
		{
			if (wndheight >= 1) {
				document.getElementById(windowname).style.height = wndheight + 'px';
				document.getElementById(windowname+"content").style.height = (wndheight-20) + 'px';
			}
			eval(windowname).setsy(wndheight);
		}

		eval(windowname).updatecookie();

	}

	if(move){

		var posx = 0;
		var posy = 0;

		if (!e) var e = window.event;

		if (e.pageX || e.pageY)
		{
			posx = e.pageX;
			posy = e.pageY;
		}
		else if (e.clientX || e.clientY)
		{
			posx = e.clientX + document.body.scrollLeft;
			posy = e.clientY + document.body.scrollTop;
		}

		posx = posx - xwert;
		posy = posy - ywert;

			// check the right pos and set the new window position
		if (posx >= eval(windowname).minx && ((posx-0)+(eval(windowname).sx-0)) <= eval(windowname).maxx) {
			if (posx >= 1) {
				document.getElementById(windowname).style.left = posx + 'px';
			}
			eval(windowname).wx = posx;
		}

		// check the bottom pos and set the new window position
		if ( posy >= eval(windowname).miny && ((posy-0)+(eval(windowname).sy-0)) <= eval(windowname).maxy)
		{
			if (posy >= 1 ) {
				document.getElementById(windowname).style.top = posy + 'px';
			}
			eval(windowname).wy = posy;
		}

		eval(windowname).updatecookie();

	}

	}
 }
}

//////////////////////////////////////////////////////////////////////////////////////////////////
//------------------------------------- MVWINDOW CLASS -------------------------------------------
//////////////////////////////////////////////////////////////////////////////////////////////////


function mvwindow(id) {

	this.wid = id;

	this.wx = 0;				//window top position
	this.wy = 0;				//window left position
	this.sx = 0;				//window width Fenster
	this.sy = 0;				//window height Fenster
	this.zindex = 1500;			//zindex
	this.minimizepos = 0; 		//minimized window pos

	//if(!ie7){
	if(!isIExplorer){
		this.maxx = document.getElementsByTagName("body")[0].clientWidth -10;	// Maxi x Position
		this.maxy = document.getElementsByTagName("body")[0].clientHeight -10;	// Max y Position
	}else{
		this.maxx = document.documentElement.clientWidth;
			this.maxy = document.documentElement.clientHeight;
	}

	this.minx = 10;				// Minimale x Position
	this.miny = 10;				// Minimale y Position

	this.ContentInfo = "";
	this.activewindow = 0;		//is this window active

	this.titleclass;			//css titelbar
	this.titleclassb;			//css titelbar background
	this.contentclass;			//css content
	this.mainclass;				//css main Window

	this.wtitle	 = '<nobr>settitle() is missing</nobr>' ;
	this.wcontent = '<center><p>Cargando datos.</p><p>Espere por favor...</p></center>' ;

	this.wenable = 0;			//show window
	this.wdisable = 0;			//hide window
	this.wminimize = 0;			//minimized
	this.wmaximize = 0;			//maximized

	windowarr.push(this.wid);

	document.write('<div id="'+this.wid+'" style="position:absolute;	top: 10px;	left: 10px;	z-index:0;"></div>');
	document.write('<div id="'+this.wid+'overlay" class="mvw_alloverdiv" onclick=viewallreset("'+this.wid+'") onmouseout="Javascript:this.className=mvw_alloverdiv" onmouseover="Javascript:this.className=mvw_alloverdiv_over" style="position:absolute; visibility:hidden;	top: 10px;	left: 10px;	z-index:0;"></div>');

}

mvwindow.prototype.startdrag = function(){ // start window drag
		wmove = 1;
	}

mvwindow.prototype.stopall = function(){
		wmove = 0;
		wresizex = 0;
		wresizey = 0;
	}

mvwindow.prototype.main = function()		// draw the window main html content
	{
		if( this.wminimize == 0 ){

		this.ContentInfo = " "+
		"<table cellpadding=0 cellspacing=0 onmouseup=stopmove(); width=100% height=100% > " +

			"<tr><td width=100% height=100% align=top>" +
				"<table class=mvw_maintable cellpadding=0 cellspacing=0 onmouseup=stopmove(); width=100% height=100% >" +
				"<tr onmouseup=stopmove('"+this.wid+"'); ondblclick=maximinisize('"+this.wid+"')> " +
					"<td onmousedown=startmove('"+this.wid+"',event); colspan=2 width=100% height=20 valign=top> " +
						"<table cellpadding=0 cellspacing=0 width=100% height=20> " +
							"<tr id=title"+this.wid+" class=mvw_title> " +
							 "<td class=mvw_title_space><div id="+this.wid+"title>"+this.wtitle+"</div></td> " +
							 "<td class=mvw_title_space valign=middle align=right><a href=# onclick=minimize('"+this.wid+"')><img src=imagesMvWin/spacer.gif class=mvw_min_btn border=0 /></a><a href=# onclick=maximinisize('"+this.wid+"')><img src=imagesMvWin/spacer.gif class=mvw_max_btn border=0 /></a><a href=# onclick="+this.wid+".hide();><img src=imagesMvWin/spacer.gif class=mvw_close_btn border=0 /></a></td> " +
							"</tr> " +
						"</table> " +
					"</td> " +

				"</tr> " +
				"<tr><td width=100% height=100% id="+this.wid+"contentbgtable class=mvw_inhalt onclick=ontop('"+this.wid+"');>" +
						"<div id="+this.wid+"content class=mvw_contentdiv>"+ this.wcontent +"</div>"+
				"</td></tr>" +
			"</table>" +
			"</td>" +
			"<td height=100%>" +
				"<table cellpadding=0 cellspacing=0 onmouseup=stopmove(); height=100%>"+
				"<tr><td class=mvw_resizebarx width=1 onmousedown=startdrag('x','"+this.wid+"');><img src=imagesMvWin/spacer.gif width=1 height=1></td></tr>" +
			"</table>" +
		 "</td></tr>" +

		"</table>" +

		"<table cellpadding=0 cellspacing=0 width=100% height=1px>" +
			"<tr> " +
				"<td width=98% class=mvw_resizebary onmousedown=startdrag('y','"+this.wid+"');><img src=imagesMvWin/spacer.gif width=1 height=1></td> " +
				"<td width=2% class=mvw_resizebarxy onmousedown=startdrag('xy','"+this.wid+"');><img src=imagesMvWin/spacer.gif width=1 height=1></td> " +
			"</tr> " +
		"</table>";

		} else {

		this.ContentInfo = " "+
		"<table class=mvw_maintable_minimized cellpadding=0 cellspacing=0 onmouseup=stopmove(); width=100% height=100% > " +
			"<tr onmousedown=startmove('"+this.wid+"',event); onmouseup=stopmove('"+this.wid+"'); ondblclick=minimize('"+this.wid+"')> " +
				"<td colspan=2 width=100%> " +
					"<table cellpadding=0 cellspacing=0 width=100%> " +
						"<tr id=title"+this.wid+" class=mvw_title> " +
						 "<td class=mvw_title_space><div id="+this.wid+"title>"+this.wtitle.substring(0,4)+"..</div></td> " +
						 "<td class=mvw_title_space valign=middle align=right><a href=# onclick=minimize('"+this.wid+"')><img src=imagesMvWin/spacer.gif class=mvw_min_btn_minimized border=0 /></a><a href=# onclick=maximinisize('"+this.wid+"')><img src=imagesMvWin/spacer.gif class=mvw_max_btn_minimized border=0 /></a><a href=# onclick="+this.wid+".hide();><img src=imagesMvWin/spacer.gif class=mvw_close_btn_minimized border=0 /></a></td> " +
						"</tr> " +
					"</table> " +
				"</td> " +
			"</tr> " +
		"</table> ";

		}

	}

mvwindow.prototype.draw = function(wert){ 		// draw the window and the div

	//document.write('<div id="'+this.wid+'" style="position:absolute;	top: 10px;	left: 10px;	z-index:0;"></div>');
	//document.write('<div id="'+this.wid+'overlay" class="mvw_alloverdiv" onclick=viewallreset("'+this.wid+'") onmouseout="Javascript:this.className=mvw_alloverdiv" onmouseover="Javascript:this.className=mvw_alloverdiv_over" style="position:absolute; visibility:hidden;	top: 10px;	left: 10px;	z-index:0;"></div>');


		this.main();
		document.getElementById(this.wid).innerHTML = this.ContentInfo;
		if(this.wenable == 0){
			document.getElementById(this.wid).style.visibility = 'hidden';
		}
	}

mvwindow.prototype.updatecookie = function(){ 	// renew the window cookie
		setCookie(this.wid);
	}

mvwindow.prototype.setsize = function(sx,sy,wy,wx){ // set the window size (width,height,top,left)

		this.wx = wx;
		this.wy = wy;
		this.sx = sx;
		this.sy = sy;

		if (document.getElementById(this.wid)){
			document.getElementById(this.wid).style.height = sy;
			if (document.getElementById(this.wid+"content")){
				document.getElementById(this.wid+"content").style.height = sy-20;
			}
			document.getElementById(this.wid).style.width = sx;
			document.getElementById(this.wid).style.top = wy;
			document.getElementById(this.wid).style.left = wx;
		}

	}

mvwindow.prototype.hide = function() 				// hide the window
	{
		document.getElementById(this.wid).style.visibility = "hidden";
		document.getElementById(this.wid).style.display = "none";
		ontop(this.wid);
		this.wenable = 0;
		this.wdisable = 1;
		setCookie(this.wid);

		if (this.wmaximize == 1){
		 ismaximized = 0;
		}

		if (this.wminimize == 1){
			updateminimized();
		}
	}

mvwindow.prototype.show = function() 				// show and draw the window
	{
		document.getElementById(this.wid).style.visibility = "visible";
		document.getElementById(this.wid).style.display = "block";
		ontop(this.wid);

		if (this.wmaximize == 1){
			ismaximized = 1;
		}

		this.wenable = 1;
		this.wdisable = 0;
		setCookie(this.wid);

		if (this.wminimize == 1){
			minimize(this.wid);
			updateminimized();
		} else {

			if (document.getElementById(this.wid)){
				document.getElementById(this.wid).style.height = this.sy;
				if (document.getElementById(this.wid+"content")){
					document.getElementById(this.wid+"content").style.height = this.sy-20;
				}
				document.getElementById(this.wid).style.width = this.sx;
				document.getElementById(this.wid).style.top = this.wy;
				document.getElementById(this.wid).style.left = this.wx;
			}
		}

	}

mvwindow.prototype.setcontent = function(wert) 		// set the window content
	{
		this.wcontent = wert;
		this.replacecontent();
	}

mvwindow.prototype.replacecontent = function() 		// replace the window content
	{
		document.getElementById(this.wid+"content").innerHTML = this.wcontent;
	}

mvwindow.prototype.settitle = function(wert) 			// set window title
	{
		this.wtitle = wert;
		this.replacetitle();
	}

mvwindow.prototype.replacetitle = function() 			// relpace the window title
	{
		document.getElementById(this.wid+"title").innerHTML = this.wtitle;
	}

mvwindow.prototype.setwx = function(wert)				//window postiton top
	{
		this.wx = wert;
	}

mvwindow.prototype.setwy = function(wert)				//window postiton left
	{
		this.wy = wert;
	}

mvwindow.prototype.setsx = function(wert)				//window width
	{
		this.sx = wert;
	}
mvwindow.prototype.setsy = function(wert)				//window height
	{
		this.sy = wert;
	}

mvwindow.prototype.setmaxx = function(wert)			//window max right position
	{
		this.maxx = wert;
	}

mvwindow.prototype.setminx = function(wert)			//window max left position
	{
		this.minx = wert;
	}

mvwindow.prototype.setmaxy = function(wert)			//window max top position
	{
		this.maxy = wert;
	}

mvwindow.prototype.setminy = function(wert)			//window max bottom position
	{
		this.miny = wert;
	}

mvwindow.prototype.setmax = function(w1,w2,w3,w4) //set all window max positions
		{
		this.minx = w1;
		this.maxx = w2;
		this.miny = w3;
		this.maxy = w4;
	}

mvwindow.prototype.loadcontent = function(url) //set all window max positions
		{
		var windowid = this.wid;
		var root=window.location.href;

		if (window.XMLHttpRequest)
		{
			this.page_request = new XMLHttpRequest();
		}
		else if (window.ActiveXObject)
		{
			try { this.page_request = new ActiveXObject("Msxml2.XMLHTTP");	}
			catch (e)
			{
				try{ this.page_request = new ActiveXObject("Microsoft.XMLHTTP");	}
				catch (e){ }
			}

		} else {
			return false;
		}

		//this.page_request.open('GET', root+url, true);
		this.page_request.open('GET', url, true);

		this.page_request.onreadystatechange = function(){
				if (eval(windowid).page_request.readyState==4) {
					eval(windowid).wcontent = eval(windowid).page_request.responseText;
					eval(windowid).replacecontent();
				}
		}

		this.page_request.send(null);
	}


function mvwindowSoloCierre(id) {
	var mvw = new mvwindow(id);
	inherit(this, mvw);

	this.main = function()		// draw the window main html content
	{
		if( this.wminimize == 0 ){

		this.ContentInfo = " "+
		"<table cellpadding=0 cellspacing=0 onmouseup=stopmove(); width=100% height=100% > " +

			"<tr><td width=100% height=100% align=top>" +
				"<table class=mvw_maintable cellpadding=0 cellspacing=0 onmouseup=stopmove(); width=100% height=100% >" +
				"<tr onmouseup=stopmove('"+this.wid+"');> " +
					"<td onmousedown=startmove('"+this.wid+"',event); colspan=2 width=100% height=20 valign=top> " +
						"<table cellpadding=0 cellspacing=0 width=100% height=20> " +
							"<tr id=title"+this.wid+" class=mvw_title> " +
							 "<td class=mvw_title_space><div id="+this.wid+"title>"+this.wtitle+"</div></td> " +
							 "<td class=mvw_title_space valign=middle align=right><a href=# onclick="+this.wid+".hide();><img src=imagesMvWin/spacer.gif class=mvw_closeAislado_btn border=0 /></a></td> " +
							"</tr> " +
						"</table> " +
					"</td> " +

				"</tr> " +
				"<tr><td width=100% height=100% id="+this.wid+"contentbgtable class=mvw_inhalt onclick=ontop('"+this.wid+"');>" +
						"<div id="+this.wid+"content class=mvw_contentdiv>"+ this.wcontent +"</div>"+
				"</td></tr>" +
			"</table>" +
			"</td>" +
			"<td height=100%>" +
				"<table cellpadding=0 cellspacing=0 onmouseup=stopmove(); height=100%>"+
				"<tr><td class=mvw_noresizebarx width=1 ><img src=imagesMvWin/spacer.gif width=1 height=1></td></tr>" +
			"</table>" +
		 "</td></tr>" +

		"</table>" +

		"<table cellpadding=0 cellspacing=0 width=100% height=1px>" +
			"<tr> " +
				"<td width=98% class=mvw_noresizebary ><img src=imagesMvWin/spacer.gif width=1 height=1></td> " +
				"<td width=2% class=mvw_noresizebarxy ><img src=imagesMvWin/spacer.gif width=1 height=1></td> " +
			"</tr> " +
		"</table>" ;

		} else {

		this.ContentInfo = " "+
		"<table class=mvw_maintable_minimized cellpadding=0 cellspacing=0 onmouseup=stopmove(); width=100% height=100% > " +
			"<tr onmousedown=startmove('"+this.wid+"',event); onmouseup=stopmove('"+this.wid+"');> " +
				"<td colspan=2 width=100%> " +
					"<table cellpadding=0 cellspacing=0 width=100%> " +
						"<tr id=title"+this.wid+" class=mvw_title> " +
						 "<td class=mvw_title_space><div id="+this.wid+"title>"+this.wtitle.substring(0,4)+"..</div></td> " +
						 "<td class=mvw_title_space valign=middle align=right><a href=# onclick="+this.wid+".hide();><img src=imagesMvWin/spacer.gif class=mvw_closeAislado_btn_minimized border=0 /></a></td> " +
						"</tr> " +
					"</table> " +
				"</td> " +
			"</tr> " +
		"</table> ";

		}

	}

	return this;

}
function mvwindowSinBotones(id) {
	var mvw = new mvwindow(id);
	inherit(this, mvw);

	this.main = function()		// draw the window main html content
	{
		if( this.wminimize == 0 ){

		this.ContentInfo = " "+
		"<table cellpadding=0 cellspacing=0 onmouseup=stopmove(); width=100% height=100% > " +

			"<tr><td width=100% height=100% align=top>" +
				"<table class=mvw_maintable cellpadding=0 cellspacing=0 onmouseup=stopmove(); width=100% height=100% >" +
				"<tr onmouseup=stopmove('"+this.wid+"');> " +
					"<td onmousedown=startmove('"+this.wid+"',event); colspan=2 width=100% height=20 valign=top> " +
						"<table cellpadding=0 cellspacing=0 width=100% height=20> " +
							"<tr id=title"+this.wid+" class=mvw_title> " +
							 "<td class=mvw_title_space><div id="+this.wid+"title>"+this.wtitle+"</div></td> " +
							"</tr> " +
						"</table> " +
					"</td> " +

				"</tr> " +
				"<tr><td width=100% height=100% id="+this.wid+"contentbgtable class=mvw_inhalt onclick=ontop('"+this.wid+"');>" +
						"<div id="+this.wid+"content class=mvw_contentdiv>"+ this.wcontent +"</div>"+
				"</td></tr>" +
			"</table>" +
			"</td>" +
			"<td height=100%>" +
				"<table cellpadding=0 cellspacing=0 onmouseup=stopmove(); height=100%>"+
				"<tr><td class=mvw_noresizebarx width=1 ><img src=imagesMvWin/spacer.gif width=1 height=1></td></tr>" +
			"</table>" +
		 "</td></tr>" +

		"</table>" +

		"<table cellpadding=0 cellspacing=0 width=100% height=1px>" +
			"<tr> " +
				"<td width=98% class=mvw_noresizebary ><img src=imagesMvWin/spacer.gif width=1 height=1></td> " +
				"<td width=2% class=mvw_noresizebarxy ><img src=imagesMvWin/spacer.gif width=1 height=1></td> " +
			"</tr> " +
		"</table>" ;

		} else {

		this.ContentInfo = " "+
		"<table class=mvw_maintable_minimized cellpadding=0 cellspacing=0 onmouseup=stopmove(); width=100% height=100% > " +
			"<tr onmousedown=startmove('"+this.wid+"',event); onmouseup=stopmove('"+this.wid+"');> " +
				"<td colspan=2 width=100%> " +
					"<table cellpadding=0 cellspacing=0 width=100%> " +
						"<tr id=title"+this.wid+" class=mvw_title> " +
						 "<td class=mvw_title_space><div id="+this.wid+"title>"+this.wtitle.substring(0,4)+"..</div></td> " +
						"</tr> " +
					"</table> " +
				"</td> " +
			"</tr> " +
		"</table> ";

		}

	}

	return this;

}

function inherit(sub,zuper) {
	sub.zuper = zuper;
	for (var i in zuper) {
		sub[i] = zuper[i];
	}
	return sub;
}

