function newWindow(mypage, myname, w, h, scroll) {     var winLeft = (screen.width - w) / 2;     var winTop = (screen.height - h) / 2;     winProps = "height=" + h + ",width=" + w + ",top=" + winTop + ",left=" + winLeft + "," + scroll;     win = window.open(mypage, myname, winProps);     if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }      return win;    }var posicX =0;var posicY =0;	if (!document.all) document.captureEvents(Event.MOUSEMOVE)document.onmousemove = get_mouse_xy;function get_mouse_xy(e) {	posicX =(document.all)? event.x : e.pageX;	posicY =(document.all)? event.y : e.pageY;	posicX += 10;	posicY += 12;		return true;}function showToolTip(text){	idToolTip = "toolTip";	w = Math.min((text.length * 5),250);	//w = 300;	if(!document.getElementById(idToolTip)){		divholder = document.createElement("div");		divholder.id = idToolTip;		divholder.style.width = w + 'px';		divholder.style.height = "auto";		divholder.style.border = "1px solid #CCCCCC";		divholder.style.backgroundColor = "#FCFCBD";		divholder.style.position = "absolute";		divholder.style.color = "#222222";		divholder.style.padding = "2px";		divholder.style.fontSize = "10px";		divholder.style.zIndex = "200";		document.body.appendChild(divholder);	}else{		divholder = document.getElementById(idToolTip);		divholder.style.width = w + 'px';	}	x = posicX;	y = posicY;	if(document.body.offsetWidth < posicX+w+20){		x = document.body.offsetWidth - (w+20);	}		divholder.style.left = x+"px";	divholder.style.top = y+"px";	document.getElementById(idToolTip).innerHTML = ""+text+"";	document.getElementById(idToolTip).style.visibility = "visible";}function hideToolTip(){	document.getElementById("toolTip").style.visibility = "hidden";}function showDivDateChoose(form,campo){	idDiv = "DateChoose";	w = 300;	if(!document.getElementById(idDiv)){		divholder = document.createElement("div");		divholder.id = idDiv;		divholder.style.width = "auto";		divholder.style.height = "auto";		divholder.style.border = "1px solid #CCCCCC";		divholder.style.backgroundColor = "#DBEDF0";		divholder.style.position = "absolute";		divholder.style.color = "#222222";		divholder.style.padding = "2px";		divholder.style.fontSize = "10px";		divholder.style.zIndex = "200";		document.body.appendChild(divholder);	}else{		divholder = document.getElementById(idDiv);	}	//x = posicX;	//y = posicY;	x = findPosX(document.f.elements[campo]) + 110;	y = findPosY(document.f.elements[campo]) - 40;		if(document.body.offsetWidth < posicX+w){		//x = document.body.offsetWidth - w;	}		divholder.style.left = x+"px";	divholder.style.top = y+"px";	 	content = 	"<div id='dateChoose'>"; 	content += 	"<ul id='navlist'>";	content += 	"<li class='sigue hand'><a href='javascript:showCalendar(\""+form+"\",\""+campo+"\");javascript:hideDivDateChoose();'>Elegir</a></li>";	content += 	"<li class='sigue hand'><a href='javascript:hideDivDateChoose();'>Cerrar</a></li>";	content += 	"</ul>";	content += 	"</div>"; 	content += 	"<div id='dateChoose'>";	content += 	"<ul id='navlist'>";	content += 	"<li class='sign'><a href='javascript:addDayToDate(-1,\""+form+"\",\""+campo+"\");'><b>-</b></a></li>";	content += 	"<li><a href='javascript:calculateDate(0,\""+form+"\",\""+campo+"\");javascript:hideDivDateChoose();'>Hoy</a></li>";	content += 	"<li class='sign'><a href='javascript:addDayToDate(1,\""+form+"\",\""+campo+"\");'><b>+</b></a></li>";	content += 	"</ul>";	content += 	"</div>"; 	content += 	"<div id='dateChoose'>";	content += 	"<ul id='navlist'>";	content += 	"<li class='sign'><a href='javascript:calculateDate(-7,\""+form+"\",\""+campo+"\");javascript:hideDivDateChoose();'><b>-</b></a></li>";	content += 	"<li><a href='#'>Semana</a></li>";	content += 	"<li class='sign'><a href='javascript:calculateDate(7,\""+form+"\",\""+campo+"\");javascript:hideDivDateChoose();'><b>+</b></a></li>";	content += 	"</ul>";		content += 	"</div>";	content += 	"";		document.getElementById(idDiv).innerHTML = ""+content+"";	document.getElementById(idDiv).style.visibility = "visible";}function hideDivDateChoose(){	document.getElementById("DateChoose").style.visibility = "hidden";}function calculateDate(dif,form,campo){	MINUTE = 60 * 1000; 	HOUR = MINUTE * 60; 	DAY = HOUR * 24;		today = (new Date()).getTime(); 	newFecha = new Date(today + (DAY * (dif))); 	newFechaFormat = newFecha.getDate() + '-' + (newFecha.getMonth()+1) + '-' + (newFecha.getFullYear()); 		setDate(form,campo,newFechaFormat);}function addDayToDate(dif,form,campo){	MINUTE = 60 * 1000; 	HOUR = MINUTE * 60; 	DAY = HOUR * 24;	elInputVal = eval("document." + form + "['" + campo + "'].value");	if (elInputVal == ''){		today = (new Date()).getTime();	}else{		fecha = elInputVal.split("-");		d = fecha[0];		m = fecha[1]-1;		y = fecha[2];		today = (new Date(y,m,d)).getTime();	} 	newFecha = new Date(today + (DAY * (dif))); 	newFechaFormat = newFecha.getDate() + '-' + (newFecha.getMonth()+1) + '-' + (newFecha.getFullYear()); 		setDate(form,campo,newFechaFormat);}function setPointer(theRow, thePointerColor){    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {        return false;    }		var theCells = null;    if (typeof(document.getElementsByTagName) != 'undefined') {        theCells = theRow.getElementsByTagName('td');    }else if (typeof(theRow.cells) != 'undefined') {        theCells = theRow.cells;    }else {        return false;    }    var rowCellsCnt  = theCells.length;    for (var c = 0; c < rowCellsCnt; c++) {        theCells[c].style.backgroundColor = thePointerColor;    }    return true;} // end of the 'setPointer()' functionfunction changeHeightTextArea(elName,inc){	tArea = document.getElementById(elName);	if(parseInt(tArea.style.height) <= 30 && inc < 0) return;	tArea.style.height = parseInt(tArea.style.height) + inc +'px';}function setActiveStyleSheet(title) {  var i, a, main;  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {      a.disabled = true;      if(a.getAttribute("title") == title) a.disabled = false;    }  }}var detect = navigator.userAgent.toLowerCase();function checkIt(string){	place = detect.indexOf(string) + 1;	return place;}// encuentra la posicion x en pixels del objeto pasadofunction findPosX(obj){	var curleft = 0;	if (obj.offsetParent){		while (obj.offsetParent){			curleft += obj.offsetLeft			obj = obj.offsetParent;		}	} else if (obj.x){		curleft += obj.x;	}	return curleft;}// encuentra la posicion y en pixels del objeto pasadofunction findPosY(obj){	var curtop = 0;	if (obj.offsetParent){		while (obj.offsetParent){			curtop += obj.offsetTop			obj = obj.offsetParent;		}	} else if (obj.y){		curtop += obj.y;	}		if (checkIt('safari')){		curtop += 25;	}		return curtop;}
