function situateObj(id,x,y)		{
	//	 Resitua un objecto en el lugar deseado de la pantalla  
	var obj = document.getElementById(id);
	obj.style.position='absolute';
	obj.style.left=x+'px';
	obj.style.top=y+'px';
}
function writeObj(text,id)		{
	//		Reescribe un objecto, preferiblemente DIV, con texto cualquiera (incluso HTML)
	if (document.getElementById)	{
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = text;
	}	else if (document.all)			{
		x = document.all[id];
		x.innerHTML = text;
	}	else if (document.layers)		{
		x = document.layers[id];
		text2 = '<P CLASS="testclass">' + text + '</P>';
		x.document.open();
		x.document.write(text2);
		x.document.close();
	}
}
function changeVisibility(who,action) {
	var oWho;
	if (!document.getElementById|document.all) {
		return;
	} else {
		if (document.getElementById){ 
			oWho = eval ("document.getElementById('" + who + "')");
		} else { 
			oWho = eval ("document.all." + who);
		}
	}
	window.focus();
	if (action == 'show'){
		oWho.style.display="";
	} else if (action == 'hide'){
		oWho.style.display="none";
	}
}

function hideWindow(){
	changeVisibility('simu_pi','hide');
	writeObj('','simu_pi');
}

/* onmousedown="coordinates(event)"
function coordinates(event){
	x=event.x;
	y=event.y;
//	x1=document.getElementById('simu_pi').event.x;
//	y1=document.getElementById('simu_pi').event.y;
	alert(x+'\n'+y+'\n'+x1+'\n'+y1)
	//situateObj('simu_pi',x,y);
}*/

function generaOverWin(header,closeTxt,content,target,x,y){
	//position:absolute; top:260px;
txt='<div id="simu_pi" style="z-index:3; width:566; height:356px;  background-color:#FFFFFF; padding:4px;">';
txt+='<div style="z-index:3; width:558; height:348px; background-color:#999999; padding:2px;">';
txt+='<div style="z-index:3; width:551; height:342px; background-color:#E5E5E5; padding:3px;">';
txt+='<table cellpadding="0" cellspacing="0" border="0" width="548px" id="pi_condiciones_opc">';
txt+='<tr>';
txt+='<td style="color:#1F688B; font-size:11px;" height="22" id="titulo_pi" width="530px" align="center">'  //width="100%" 
	 +     '<b>'+ header+'</b>'
	 +  '</td>';
txt+= '<td align="right" valign="middle">';
txt+= '<a class="enlace_pi" href="#" onclick="hideWindow();return false;">'
	+ closeTxt + '</a>&#160;&#160;';
txt+='</td>';
txt+= '<td align="right" valign="middle" >';
txt+='&#160;<img src="../../../en/img/cerrar_ayuda_2.gif" style="cursor:pointer;" onclick="hideWindow();"/>';
txt+='</td>';

txt+= '<td align="right" valign="middle">'
	+       '<img src="../../../en/img/cerrar_ayuda.gif" style="cursor:pointer;" onclick="hideWindow();"/>'
	+'</td>';
txt+='</tr>';
txt+='<tr>';
txt+='<td colspan="4">'
	 + '<div style="z-index:3; width:530; height:310px; background-color:#999999; padding:1px;" >'
	 +  '<div style="z-index:3; width:528; height:308px; background-color:#FFFFFF; padding:1px; overflow: auto;">';
txt+= content ;
txt+='</div>';
txt+='</div>';
txt+='</td>';
txt+='</tr>';
txt+='</table>';
txt+='</div>';
txt+='</div>';
txt+='</div>';
writeObj(txt,target);
changeVisibility(target,'show');
situateObj(target,x,y);
/*this.write(txt);
changeVisibility('simu_pi','show');
situateObj('simu_pi',x,y);*/
}

function generaOverWinBooking(header,closeTxt,content,target,x,y){
	//position:absolute; top:260px;
txt='<div id="simu_pi" style="z-index:3; width:566; height:410px;  background-color:#FFFFFF; padding:4px;">';
txt+='<div style="z-index:3; width:558; height:408px; background-color:#999999; padding:2px;">';
txt+='<div style="z-index:3; width:551; height:402px; background-color:#E5E5E5; padding:3px;">';
txt+='<table cellpadding="0" cellspacing="0" border="0" width="548px" id="pi_condiciones_opc">';
txt+='<tr>';
txt+='<td style="color:#1F688B; font-size:11px;" height="22" id="titulo_pi" width="530px" align="center">'  //width="100%" 
	 +     '<b>'+ header+'</b>'
	 +  '</td>';
txt+= '<td align="right" valign="middle">';
txt+= '<a class="enlace_pi" href="#" onclick="hideWindow();return false;">'
	+ closeTxt + '</a>&#160;&#160;';
txt+='</td>';
txt+= '<td align="right" valign="middle" >';
txt+='&#160;<img src="../../../en/img/cerrar_ayuda_2.gif" style="cursor:pointer;" onclick="hideWindow();"/>';
txt+='</td>';

txt+= '<td align="right" valign="middle">'
	+       '<img src="../../../en/img/cerrar_ayuda.gif" style="cursor:pointer;" onclick="hideWindow();"/>'
	+'</td>';
txt+='</tr>';
txt+='<tr>';
txt+='<td colspan="4">'
	 + '<div style="z-index:3; width:530; !width:545; height:364px; background-color:#999999; padding:1px;" >'
	 +  '<div style="z-index:3; width:528;!width:543; height:362px; background-color:#FFFFFF; padding:1px; overflow: auto;">';
txt+= content ;
txt+='</div>';
txt+='</div>';
txt+='</td>';
txt+='</tr>';
txt+='</table>';
txt+='</div>';
txt+='</div>';
txt+='</div>';
writeObj(txt,target);
changeVisibility(target,'show');
situateObj(target,x,y);
/*this.write(txt);
changeVisibility('simu_pi','show');
situateObj('simu_pi',x,y);*/
}


function generaOverWinSize(header,closeTxt,content,target,x,y,h,w){
//position:absolute; top:260px;
txt='<div id="simu_pi" style="z-index:3; width:566; height:356px;  background-color:#FFFFFF; padding:4px;">';
txt+='<div style="z-index:3; width:558; height:348px; background-color:#999999; padding:2px;">';
txt+='<div style="z-index:3; width:551; height:342px; background-color:#E5E5E5; padding:3px;">';
txt+='<table cellpadding="0" cellspacing="0" border="0" width="548px" id="pi_condiciones_opc">';
txt+='<tr>';
txt+='<td style="color:#1F688B; font-size:11px;" height="22" id="titulo_pi" width="530px" align="center">'  //width="100%" 
	 +     '<b>'+ header+'</b>'
	 +  '</td>';
txt+= '<td align="right" valign="middle">';
txt+= '<a class="enlace_pi" href="#" onclick="hideWindow();return false;">'
	+ closeTxt + '</a>&#160;&#160;';
txt+='</td>';
txt+= '<td align="right" valign="middle" >';
txt+='&#160;<img src="../../../en/img/cerrar_ayuda_2.gif" style="cursor:pointer;" onclick="hideWindow();"/>';
txt+='</td>';

txt+= '<td align="right" valign="middle">'
	+       '<img src="../../../en/img/cerrar_ayuda.gif" style="cursor:pointer;" onclick="hideWindow();"/>'
	+'</td>';
txt+='</tr>';
txt+='<tr>';
txt+='<td colspan="4">'
	 + '<div style="z-index:3; width:530; height:310px; background-color:#999999; padding:1px;" >'
	 +  '<div style="z-index:3; width:528; height:308px; background-color:#FFFFFF; padding:1px; overflow: auto;">';
txt+= content ;
txt+='</div>';
txt+='</div>';
txt+='</td>';
txt+='</tr>';
txt+='</table>';
txt+='</div>';
txt+='</div>';
txt+='</div>';
writeObj(txt,target);
changeVisibility(target,'show');
situateObj(target,x,y);
/*this.write(txt);
changeVisibility('simu_pi','show');
situateObj('simu_pi',x,y);
*/ 
}
function generaOverWinCond(header,closeTxt,content,target,x,y){
	//position:absolute; top:260px;
txt='<div id="simu_pi" style="z-index:3; width:300;   background-color:#FFFFFF; padding:4px;">';
/*txt+='<div style="z-index:3; width:288;  background-color:#999999; padding:2px;">';*/
txt+='<div style="z-index:3; width:290;  background-color:#E5E5E5; padding:3px; border:2px solid #999999;">';
txt+='<table cellpadding="0" cellspacing="0" border="0" width="290px" id="pi_condiciones_opc">';
txt+='<tr>';
txt+='<td style="color:#1F688B; font-size:11px;" height="22" id="titulo_pi" width="230px" align="center">'  //width="100%" 
	 +     '<b>'+ header+'</b>'
	 +  '</td>';
txt+= '<td align="right" valign="middle">';
txt+= '<a class="enlace_pi" href="#" onclick="hideWindow();return false;">'
	+ closeTxt + '</a>&#160;&#160;';
txt+='</td>';
txt+= '<td align="right" valign="middle" >';
txt+='&#160;<img src="../../../en/img/cerrar_ayuda_2.gif" style="cursor:pointer;" onclick="hideWindow();"/>';
txt+='</td>';

txt+= '<td align="right" valign="middle">'
	+       '<img src="../../../en/img/cerrar_ayuda.gif" style="cursor:pointer;" onclick="hideWindow();"/>'
	+'</td>';
txt+='</tr>';
txt+='<tr>';
/*txt+='<td colspan="4">'
	 + '<div style="z-index:3; width:290; height:70px; background-color:#999999; padding:1px;" >'
	 +  '<div style="z-index:3; width:286; height:68px; background-color:#FFFFFF; padding:1px; overflow: auto;">';
txt+= content ;
txt+='</div>';
txt+='</div>';
txt+='</td>';*/
txt+='<td colspan="4" style="border:1px solid #999999; background-color:#FFFFFF; overflow: auto; padding:1px; heigh:40px;">';
txt+= content ;
txt+='</td>'
txt+='</tr>';
txt+='</table>';
/*txt+='</div>';*/
txt+='</div>';
txt+='</div>';
writeObj(txt,target);
changeVisibility(target,'show');
situateObj(target,x,y);
/*this.write(txt);
changeVisibility('simu_pi','show');
situateObj('simu_pi',x,y);*/
}
