window.Procesar = function () {
	
	var monto = document.getElementById("monto");
	var saldo = document.getElementById("saldo");
	var pin = document.getElementById("PIN");
	if (monto.value == "") {
		alert (unescape ("Debe ingresar la cantidad del monto a pagar"));
		document.pagobanco.monto.focus ();
		return;
	}

	if (isNaN(monto.value)) {
		alert (unescape ("El campo de monto a pagar debe ser un dato numerico"));
		monto.focus ();
		return;
	}
	if (monto.value > saldo.value) {
		alert (unescape ("Debe ingresar una cantidad menor al saldo"));
		monto.focus ();
		return;
	}
	
	if (pin.value == "") {
		alert (unescape ("Debe ingresar el PIN recibido"));
		document.pagobanco.pin.focus ();
		return;
	}
	requestAJAX (PrePath + 'index.php?function=pago_facturas_bg&idServicio=' + document.pagobanco.idServicio.value + '&nip=' + document.pagobanco.nip.value +'&enviado=' + document.pagobanco.enviado.value + '&listabancos=' + document.pagobanco.listabancos.value + '&telefono=' + document.pagobanco.telefono.value + '&saldo=' + document.pagobanco.saldo.value + '&monto=' + document.pagobanco.monto.value + '&PIN=' + document.pagobanco.PIN.value+'&idinstitucion='+document.pagobanco.idinstitucion.value+'&idcanal='+document.pagobanco.idcanal.value+'&idterminal='+document.pagobanco.idterminal.value+'&idcliente='+document.pagobanco.idcliente.value+'&idordenpagoporta='+document.pagobanco.idordenpagoporta.value+'&fechatransaccion='+document.pagobanco.fechatransaccion.value+'&horatransaccion='+document.pagobanco.horatransaccion.value+'&fechamaximapago='+document.pagobanco.fechamaximapago.value+'&nombrepropietario='+document.pagobanco.nombrepropietario.value,'tu_cuenta_content');
	
}

function AgregarAmigo(nip,idservicio,idfeature) 
{
	//numero = prompt('Introduzca el Numero del Mejor Amigo','Numero del mejor amigo');
	Ext.Msg.prompt('Introduzca el Numero del Mejor Amigo','Numero del mejor amigo',
	function(btn,value)
	{	if(btn!='ok')
		{	return;
		}
		else
		{	
		}
		numero=value;
		if (!esNumero(numero)) {
		Ext.Msg.alert("Error",unescape ("No es un numero valido")
		,function(){AgregarAmigo();}
		);
		
		return;
	}
	if (numero.length<9 || numero.length>9){
		Ext.Msg.alert("Error",unescape ("Debe ser un numero de 9 digitos")
		,function(){AgregarAmigo();}
		); 
		   
		return;
	}
	requestAJAX (PrePath + 'index.php?function=services&nip='+nip+'&idServicio='+idservicio+'&state=A&feature='+idfeature+'&mejoramigo='+numero,'tu_cuenta_content');
	});
	
	return;
	
}

function VentanaErrores(error) 
{	
	var myDiv = Ext.get('ventana');
	if(myDiv)
	{
		var mis_soluciones = new Array(arguments.length) 
		
		panelTabs=new Ext.TabPanel({renderTo: 'tabs', activeTab:0, deferredRender:false, border:false, closable:false});
		Ext.Ajax.request({
                url: '/ws/getError.php',
                method: 'POST',
				params: {'iderror': error},
				success: function(resp) {
					var d = Ext.decode(resp.responseText);
                    if(d.success == true)
                    {
						var arr = d.data.soluciones, len = arr.length, i;
						for(i = 0; i < len; i++)
						{
							var solucion='<div class="fondo_ventana" align="center">';
							solucion=solucion+'<div class="espacio"></div>';
							solucion=solucion+'<div class="interna_solucion"><div class="texto_solucion2" align="left">'+replaceAllPoints(arr[i].descripcion)+'</div></div>';
							solucion=solucion+'<div class="inferior_botones" align="left"><span class="pregunta">¿Le sirvi&oacute; esta soluci&oacute;n?</span><button class="boton_respuesta" onclick="saveSolucion('+i+','+arr[i].id+',1);">SI</button>&nbsp;<button class="boton_respuesta" onclick="saveSolucion('+i+','+arr[i].id+',2);">NO</button></div>';
							solucion=solucion+'</div>';
							panelTabs.add({closable:false, title: 'Solucion '+(i+1), html: solucion});
						}
						var solucion='<div class="fondo_ventana" align="center">';
						solucion=solucion+'<div class="espacio"></div>';
						solucion=solucion+'<div class="interna_solucion">';
						solucion=solucion+'<div class="texto_solucion2" align="left">En caso de mantenerse la inconsistencia ingrese al siguiente link para que su caso sea analizado por uno de nuestros asesores.</div>';
						solucion=solucion+'<div class="inferior_botones" align="center"><button class="boton_respuesta_enviar" onclick="enviarCaso('+error+');">ENVIAR</button>&nbsp;<button class="boton_respuesta_enviar" onclick="noenviarCaso();">NO ENVIAR</button></div>';
						solucion=solucion+'</div>';
						solucion=solucion+'</div>';
						panelTabs.add({closable:false, title: 'Solucion '+(len+1), html: solucion});
						panelTabs.setActiveTab(0);
					}
					},
				failure: function(responseObject) {
                     Ext.Msg.alert('Error','No se ha podido conectar al servidor de errores, por favor notifique a un administrador');
                 }
				});
		win = new Ext.Window({applyTo:'ventana', layout:'fit', width:500, height:300, plain: true, items: panelTabs});
		win.show();
	
	}
}

function replaceAllPoints(text)
{
  while (text.toString().indexOf(".") != -1)
      text = text.toString().replace(".","<br/>");
  return text;
}


function enviarCaso(error)
{
	win.hide();
	caso=document.getElementById("caso_errores").value;
	Ext.Ajax.request({
                url: '/ws/enviarCaso.php',
                method: 'POST',
				params: {'iderror': error, 'respuesta': caso},
				success: function(resp) {
					Ext.Msg.show({
							  title:'Solucion',
							  msg: 'Gracias por darnos tus comentarios',
							  buttons: Ext.Msg.OK,                   
							  icon: Ext.MessageBox.INFO});
						},
				failure: function(responseObject) {
                     Ext.Msg.alert('Error','No se ha podido conectar al servidor de correos, por favor notifique a un administrador');
                 }});
		
}

function noenviarCaso()
{
	win.hide();
}

function saveSolucion(tab,id_solucion,respuesta)
{
	if(respuesta==1)
	{
		win.hide();
		Ext.Ajax.request({
                url: '/ws/setSolucion.php',
                method: 'POST',
				params: {'idsolucion': id_solucion, 'respuesta':'SI'},
				success: function(resp) {
					Ext.Msg.show({
							  title:'Solucion',
							  msg: 'Gracias por darnos tu respuesta',
							  buttons: Ext.Msg.OK,                   
							  icon: Ext.MessageBox.INFO});
						},
				failure: function(responseObject) {
                     Ext.Msg.alert('Error','No se ha podido conectar al servidor de errores, por favor notifique a un administrador');
                 }});
		
	}
	if(respuesta==2)
	{
		panelTabs.remove(tab);
			Ext.Ajax.request({
                url: '/ws/setSolucion.php',
                method: 'POST',
				params: {'idsolucion': id_solucion, 'respuesta':'NO'},
				success: function(resp) {
					Ext.Msg.show({
							  title:'Solucion',
							  msg: 'Gracias por darnos tu respuesta',
							  buttons: Ext.Msg.OK,                   
							  icon: Ext.MessageBox.INFO});
						},
				failure: function(responseObject) {
                     Ext.Msg.alert('Error','No se ha podido conectar al servidor de errores, por favor notifique a un administrador');
                 }});
	}
}

window.Encuesta = function ()
{
	bandera_encuesta=false;
	cadena_respuesta="";
	for (e=0; e<arguments.length; e++)
	{
		btn = valButton(document.form_r[arguments[e]]);
		if (btn == null) 
		{
			bandera_encuesta=true;
		}
		else
		{
			pregunta=arguments[e].replace("group_","");
			cadena_respuesta=cadena_respuesta+"&pregunta"+pregunta+"="+btn;
		}
	}
	if(bandera_encuesta)
	{
		alert('Se necesita que seleccione una respuesta');
		return;
	}else
	{
		requestAJAXEncuesta ('/porta_web/WebSerTmp/index.php?function=encuesta'+cadena_respuesta,'formularioencuesta');
	}
	
}

window.EncuestaSeccion = function ()
{
	bandera_encuesta=false;
	cadena_respuesta="";
	for (e=0; e<arguments.length; e++)
	{
		grupo=document.getElementsByName(arguments[e]);
		btn = valButton(grupo);
		if (btn == null) 
		{
			bandera_encuesta=true;
		}
		else
		{
			pregunta=arguments[e].replace("group_","");
			cadena_respuesta=cadena_respuesta+"&pregunta"+pregunta+"="+btn;
		}
	}
	if(bandera_encuesta)
	{
		alert('Se necesita que seleccione una respuesta');
		return;
	}else
	{
		requestAJAXEncuesta ('/porta_web/WebSerTmp/index.php?function=encuesta_seccion'+cadena_respuesta,'formularioencuestaseccion');
	}
	
}

window.Subencuesta = function ()
{
	bandera_encuesta=false;
	cadena_respuesta="";
	for (e=0; e<arguments.length; e++)
	{
		grupo=document.getElementsByName(arguments[e]);
		btn = valButton(grupo);
		if (btn == null) 
		{
			bandera_encuesta=true;
		}
		else
		{
			pregunta=arguments[e].replace("group_","");
			cadena_respuesta=cadena_respuesta+"&pregunta"+pregunta+"="+btn;
		}
	}
	if(bandera_encuesta)
	{
		alert('Se necesita que seleccione una respuesta');
		return;
	}else
	{
		requestAJAXEncuesta ('/porta_web/WebSerTmp/index.php?function=encuesta'+cadena_respuesta,'formularioencuesta');
	}
	
}

window.SubencuestaSeccion = function ()
{
	bandera_encuesta=false;
	cadena_respuesta="";
	for (e=0; e<arguments.length; e++)
	{
		grupo=document.getElementsByName(arguments[e]);
		btn = valButton(grupo);
		if (btn == null) 
		{
			bandera_encuesta=true;
		}
		else
		{
			pregunta=arguments[e].replace("group_","");
			cadena_respuesta=cadena_respuesta+"&pregunta"+pregunta+"="+btn;
		}
	}
	if(bandera_encuesta)
	{
		alert('Se necesita que seleccione una respuesta');
		return;
	}else
	{
		requestAJAXEncuesta ('/porta_web/WebSerTmp/index.php?function=encuesta_seccion'+cadena_respuesta,'formularioencuestaseccion');
	}
	
}

function valButton(btn) 
{
    var cnt = -1;
    for (var i=btn.length-1; i > -1; i--) {
        if (btn[i].checked) {cnt = i; i = -1;}
    }
    if (cnt > -1) return btn[cnt].value;
    else return null;
}

function requestAJAXEncuesta (url, idObj)
{
	var objLayer = document.getElementById (idObj);
	objLayer.innerHTML = '<img src="/porta_web/site/images/busy.gif" width="14" height="14" hspace="5"><span class="verdanabasica">Cargando .... <br />Por favor espere</span>';
	var ht = HTTPRequest.get (
	{
	'url' : url,
	'cache' : true,
	'onSuccess' : function ( request ){
	objLayer.innerHTML = request.responseText;
	executeScript ( request.responseText );
	showElement( objLayer );
	},
	'onError' : function ( obj ){
	objLayer.innerHTML = '<span class="verdanabasicarojo"><b>En este momento el servicio requerido no est&aacute; disponible.</b></span><br /><span class="verdanabasica"><b>Puedes recargar esta p&aacute;gina para intentarlo otra vez.</b></span>';
	showElement( objLayer );
	}
	}
	);
} 

function executeScript( source )
{
	script = '';
	start = 0;
	end = 0;

	start = source.indexOf( unescape ( "%3Cscript%3E" ) );
	while ( start >= 0 )
	{
		end = source.indexOf( unescape ( "%3C/script%3E" ), start );
		script += source.substring( start + 8, end );
		start = source.indexOf( unescape ( "%3Cscript%3E" ), end );
	}
	if ( script != '' )
	eval ( script );
} 

function esNumero(cadena)
{
   k="0123456789";
   for (j=0;j<cadena.length;j++)
   {
	 if (k.indexOf(cadena.charAt(j)) == -1)
	 {
	   return false;
	 }
   }
   return true;
}

function Excel()
{ 
	var settings = 'height=' + '300' + ',';  
	settings += 'width=' + '300' + ',';  
	settings += 'top=' + '200' + ',';  
	settings += 'left=' + '200';
	
	win = window.open('https://www.porta.net/porta_web/WebSerTmp/calldetails_dl.php','Excel',settings);
	win.document.write('<?php header( "Content-Type: application/xls", true );?>');
	win.document.write('<?php header( "Content-Disposition: attachment; filename="detalle_llamada_xls"");?>');
	win.document.write('<?php header("Pragma: public");?>');
	win.document.write('<?php header("Cache-Control: max-age=0");?>');
	win.document.write('<html><head><title>Excel</title>');  
	win.document.write('</head><body>');  
	win.document.write('<table><tr><td><?php echo "Prueba de Html";?> prueba 2</td></tr></table>');  
	win.document.write('</body></html>');  
	win.document.close();  
	
	win.window.focus();  
}

function showDate(idFecha,idservice,fechaactual) {

var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}

if (!document.getElementById("divBgLegal")) {
var nodeDiv = document.createElement ("div");
nodeDiv.setAttribute ("id", "divBgLegal");
nodeDiv.setAttribute ("class", "nlegal_css");
nodeDiv.setAttribute ("style", "display: none");
document.body.appendChild (nodeDiv);
document.getElementById("divBgLegal").className = "nlegal_css";
}

if (document.getElementById(idFecha).parentNode != document.body)
document.body.appendChild(document.getElementById(idFecha));

document.getElementById("divBgLegal").style.width = myWidth + "px";
//document.body.style.overflow = "hidden";
document.getElementById("divBgLegal").style.display = "";
document.getElementById(idFecha).style.top = "200px";
document.getElementById(idFecha).style.left = (parseInt(myWidth)/2 - 200) + "px";
document.getElementById(idFecha).style.display = "";
id_service_roaming=idservice;
fechanueva(fechaactual);
}

function showRoamingBlackberryMensual(idFecha,idservice,fechaactual){

var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}

if (!document.getElementById("divBgLegal")) {
var nodeDiv = document.createElement ("div");
nodeDiv.setAttribute ("id", "divBgLegal");
nodeDiv.setAttribute ("class", "nlegal_css");
nodeDiv.setAttribute ("style", "display: none");
document.body.appendChild (nodeDiv);
document.getElementById("divBgLegal").className = "nlegal_css";
}

if (document.getElementById(idFecha).parentNode != document.body)
document.body.appendChild(document.getElementById(idFecha));

document.getElementById("divBgLegal").style.width = myWidth + "px";
//document.body.style.overflow = "hidden";
document.getElementById("divBgLegal").style.display = "";
document.getElementById(idFecha).style.top = "200px";
document.getElementById(idFecha).style.left = (parseInt(myWidth)/2 - 200) + "px";
document.getElementById(idFecha).style.display = "";
id_service_roaming=idservice;
//fechanueva(fechaactual);
//alert('aki');
//alert('hola');
//alert(Ext.get(idFecha).getWidth());
}

function BlackBerryMensualRoaming(nip,idservicio)
{
 var today = new Date();
 opcion=document.getElementById('dp-svg').value;
 if(opcion=='-1')
 {
 alert('Por favor elija una cantidad de días'); 
 return;
 }
 //alert(id_service_roaming);
 closeDate('8520');
 req=PrePath + 'index.php?function=services&nip='+nip+'&idServicio='+idservicio+'&state=A&feature='+id_service_roaming/*+'&fecha_roaming='+fecha*/+'&vigencia_dias='+opcion;
 //alert(req);
 requestAJAX (req,'tu_cuenta_content');
}

function closeSubencuesta() 
{
	document.getElementById('subencuesta').style.display = "none";
	document.getElementById('guardar_encuesta').style.display = "";
}

function showSubencuesta() 
{
	document.getElementById('subencuesta').style.display = "";
	document.getElementById('guardar_encuesta').style.display = "none";
}

function closeSubencuestaSeccion() 
{
	document.getElementById('subencuesta_seccion').style.display = "none";
	document.getElementById('guardar_encuesta_seccion').style.display = "";
}

function showSubencuestaSeccion() 
{
	document.getElementById('subencuesta_seccion').style.display = "";
	document.getElementById('guardar_encuesta_seccion').style.display = "none";
}

function closeDate(idFecha) {
document.body.style.width = "auto";
document.body.style.height = "auto";
document.body.style.overflow = "auto";
document.getElementById("divBgLegal").style.display = "none";
document.getElementById(idFecha).style.display = "none";
document.getElementById('dp-s2').value='';
}

function closeEncuesta(idFecha) {
document.body.style.width = "auto";
document.body.style.height = "auto";
document.body.style.overflow = "auto";
document.getElementById("divBgLegal").style.display = "none";
document.getElementById(idFecha).style.display = "none";
}

function closeEncuestaSeccion(idSeccion) {
document.body.style.width = "auto";
document.body.style.height = "auto";
document.body.style.overflow = "auto";
document.getElementById("divBgSeccion").style.display = "none";
document.getElementById(idSeccion).style.display = "none";
}

function pad(value, length) {
       length = length || 2;
       return "0000".substr(0,length - Math.min(String(value).length, length)) + value;
};

function fechanueva(fechaactual)
{
	var today = new Date(),
            lastMonth = new Date(today.getFullYear(), today.getMonth(), 1),
            nextMonth = new Date(today.getFullYear(), today.getMonth()+1, 1),
            opts = {                            
                formElements:{"dp-s2":"d-sl-m-sl-Y"},
                showWeeks:true,
                statusFormat:"l-cc-sp-d-sp-F-sp-Y",
                staticPos:true,
				positioned:"idcalendario",
               // rangeHigh:nextMonth.getFullYear() + "" + pad(nextMonth.getMonth()+1) + "10",
               // rangeLow:lastMonth.getFullYear() + "" + pad(lastMonth.getMonth()) + "01"       
			   rangeLow:fechaactual
                };           
    datePickerController.createDatePicker(opts);
}

function calendarios()
{
	myJSON = { "lang": "es"};
	datePickerController.setGlobalVars(myJSON);
	
	//destruir calendario
	datePickerController.destroyDatePicker("detalle_llamada_inicio");
	datePickerController.destroyDatePicker("detalle_llamada_fin");
	datePickerController.destroyDatePicker("detalle_sms_inicio");
	datePickerController.destroyDatePicker("detalle_sms_fin");
	datePickerController.destroyDatePicker("detalle_mms_inicio");
	datePickerController.destroyDatePicker("detalle_mms_fin");
	datePickerController.destroyDatePicker("detalle_conectividad_inicio");
	datePickerController.destroyDatePicker("detalle_conectividad_fin");
	
	//seleccionar calendarios
	detalle_llamada_inicio=document.getElementById("detalle_llamada_inicio");
	detalle_llamada_fin=document.getElementById("detalle_llamada_fin");
	detalle_sms_inicio=document.getElementById("detalle_sms_inicio");
	detalle_sms_fin=document.getElementById("detalle_sms_fin");
	detalle_mms_inicio=document.getElementById("detalle_mms_inicio");
	detalle_mms_fin=document.getElementById("detalle_mms_fin");
	detalle_conectividad_inicio=document.getElementById("detalle_conectividad_inicio");
	detalle_conectividad_fin=document.getElementById("detalle_conectividad_fin");
	
	//si existe lo creamos
	if(detalle_llamada_inicio)
	{
		datePickerController.createDatePicker({formElements:{"detalle_llamada_inicio":"d-sl-m-sl-Y"}});
	}
	if(detalle_llamada_fin)
	{
		datePickerController.createDatePicker({formElements:{"detalle_llamada_fin":"d-sl-m-sl-Y"}});
	}
	if(detalle_sms_inicio)
	{
		datePickerController.createDatePicker({formElements:{"detalle_sms_inicio":"d-sl-m-sl-Y"}});
	}
	if(detalle_sms_fin)
	{
		datePickerController.createDatePicker({formElements:{"detalle_sms_fin":"d-sl-m-sl-Y"}});
	}
	if(detalle_mms_inicio)
	{
		datePickerController.createDatePicker({formElements:{"detalle_mms_inicio":"d-sl-m-sl-Y"}});
	}
	if(detalle_mms_fin)
	{
		datePickerController.createDatePicker({formElements:{"detalle_mms_fin":"d-sl-m-sl-Y"}});
	}
	if(detalle_conectividad_inicio)
	{
		datePickerController.createDatePicker({formElements:{"detalle_conectividad_inicio":"d-sl-m-sl-Y"}});
	}
	if(detalle_conectividad_fin)
	{
		datePickerController.createDatePicker({formElements:{"detalle_conectividad_fin":"d-sl-m-sl-Y"}});
	}
}

function showEncuesta() {
if(document.getElementById('encuestas_usuario'))
{
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}

if (!document.getElementById("divBgLegal")) {
var nodeDiv = document.createElement ("div");
nodeDiv.setAttribute ("id", "divBgLegal");
nodeDiv.setAttribute ("class", "nlegal_css");
nodeDiv.setAttribute ("style", "display: none");
document.body.appendChild (nodeDiv);
document.getElementById("divBgLegal").className = "nlegal_css";
}

if (document.getElementById("encuesta").parentNode != document.body)
document.body.appendChild(document.getElementById("encuesta"));

document.getElementById("divBgLegal").style.width = myWidth + "px";
document.getElementById("divBgLegal").style.display = "";
document.getElementById("encuesta").style.top = "150px";
document.getElementById("encuesta").style.left = (parseInt(myWidth)/2 - 200) + "px";
document.getElementById("encuesta").style.display = "";
}
}

function showEncuestaSeccion(idencuesta) {
if(document.getElementById(idencuesta))
{
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}

if (!document.getElementById("divBgSeccion")) {
var nodeDiv = document.createElement ("div");
nodeDiv.setAttribute ("id", "divBgSeccion");
nodeDiv.setAttribute ("class", "nlegal_css");
nodeDiv.setAttribute ("style", "display: none");
document.body.appendChild (nodeDiv);
document.getElementById("divBgSeccion").className = "nlegal_css";
}

if (document.getElementById(idencuesta).parentNode != document.body)
{
	document.body.appendChild(document.getElementById(idencuesta));
}

document.getElementById("divBgSeccion").style.width = myWidth + "px";
document.getElementById("divBgSeccion").style.height = "1415px";
document.getElementById("divBgSeccion").style.display = "";
document.getElementById(idencuesta).style.top = "250px";
document.getElementById(idencuesta).style.left = (parseInt(myWidth)/2 - 200) + "px";
document.getElementById(idencuesta).style.display = "";
document.getElementById(idencuesta).focus();
}
}

	
