/**********************************************************************************
    Nombre del Sistema:   Pagina Web - Sección de JavaScript del SITIO
    Fecha de entrega:     16 de Agosto de 2007
    No. versión:          1.0
    Líder del proyecto:   LI. Yury Mayanin Perez Alcocer
    Técnico programador:  TPI. Santiago Alonso Cortes Molina
    Derechos reservados:  H. Poder Legislativo del Estado de Quintana Roo
    Ultima Actualización: 24 de Marzo de 2011
***********************************************************************************/

// FUNCIÓN QUE LLAMA AL CONTADOR Y SU CONFIGURACIÓN PARA SU FUNCIONAMIENTO
function estadistica()
{
document.write("<script type='text/javascript'>");
document.write("var _gaq = _gaq || [];");
document.write("_gaq.push(['_setAccount', 'UA-22252090-1']);");
document.write("_gaq.push(['_trackPageview']);");
document.write("(function() {");
document.write("var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;");
document.write("ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';");
document.write("var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);");
document.write("})();");
document.write("</script>");
}

/*
// IMPEDIR LA SELECCIÓN DE TEXTO Y FUENTES DE LA PAGINA WEB
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
//////////////////////////////////////////////////////////////////////////////
*/

// Selección de la imagen a mostrar segun configuración de la Pantalla
function resize()
{
if (screen.width<=800) 
   document.write("<img src=images/banner_3_1.jpg>")

//Archivo de imagen para 1024
else if (screen.width<=1152) 
   document.write("<img src=images/banner_3_1.jpg>")

//para otras resoluciones
else 
   document.write("<img src=images/banner_3_3.jpg>")
}
//////////////////////////////////////////////////////////////////////////////

// Selección de la imagen a de navidad
function navidad()
{
if (screen.width<=800) 
   document.write("<img src=historial/12_legislatura/images/navidad2010/navidad1.jpg>")

//Archivo de imagen para 1024
else if (screen.width<=1024) 
   document.write("<img src=historial/12_legislatura/images/navidad2010/navidad2.jpg>")

//para otras resoluciones
else 
   document.write("<img src=historial/12_legislatura/images/navidad2010/navidad3.jpg>")
}
//////////////////////////////////////////////////////////////////////////////

// Imagen de Fondo de Documentos en marco de agua
function fondo()
{
if (document.all||document.getElementById)
document.body.style.background="url('../images/log_XII_blank.jpg') white center no-repeat fixed"
}

// Funciones de Sustituciones de imagenes
function restaurar() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function index(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=index(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function cambio() { //v3.0
  var i,j=0,x,a=cambio.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=index(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//////////////////////////////////////////////////////////////////////////////

/* Fechador de Ultima Actualizacion */
function fecha()
{
        fecha = new Date()
        mes = fecha.getMonth()
        diaMes = fecha.getDate()
     /* diaMes = fecha.getDate()-2 // Se le restan dos dias a la fecha actual. */
        diaSemana = fecha.getDay()
        anio = fecha.getFullYear()
        dias = new Array('Domingo','Lunes','Martes','Miercoles','Jueves','Viernes','Sábado')
        meses = new Array('Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre')

	//Validación de los días de la semana	
		if ( dias[diaSemana] == "Sábado" )
		{
		  dias[diaSemana] = "Viernes";
		  diaMes = diaMes -1;
		}
		
		if ( dias[diaSemana] == "Domingo" )
		{
		  dias[diaSemana] = "Viernes";
		  diaMes = diaMes -2;
		}
		
	    document.write('<span id="fecha">')
        document.write ('Actualizado el dia ' + dias[diaSemana] + ' ' + diaMes + ' de ' + meses[mes] + ' de ' + anio)
        document.write ('</span>')
}

/* INDEFINIDO */
function show_hide(id)
{
 disp = document.all(id).style.display;
  if(disp == "block")
    document.all(id).style.display = "none";
  else
    document.all(id).style.display = "block";
}
/*************************************************************************/

/* VENTANAS SECUNDARIAS EMERGENTES DE INDEX PRINCIPALES */
function WindowIndex() /* Ventana Emergente Pagina Web */
{
 x = ((screen.width)/2)-350;
 y = ((screen.height)/2)-250;
 open('historial/13_legislatura/convocatorias/2012/01/24/convocatoria.pdf', 'convocatoria', 'toolbar=0,scrollbars=0,location=0,statusbar=no,status=0,menubar=0,resizable=0,width=700,height=500,left = '+x+',top ='+y)
}
function WindowUV() /* Ventana Emergente Unidad de Vinculación */
{
 //open('URL', 'OBJETO', 'toolbar=0,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=380,height=280,left = 0,top =0')
}
/********************************************************************************************************************/
/* EVENTOS EN LA PRINCIPAL */

function videoteca(URL) /* Abrir videos de la Videoteca */
{
x = ((screen.width)/2)-222;
y = ((screen.height)/2)-174;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=444,height=348,left ="+ x +",top ="+ y +"');");
}

function contacto(URL) /* Parlamemto de niños - 28 de junio de 2011 */
{
x = ((screen.width)/2)-250;
y = ((screen.height)/2)-267;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=500,height=590,left ="+ x +",top ="+ y +"');");
}

function xxxvii(URL) /* Parlamemto de niños - 28 de junio de 2011 */
{
x = ((screen.width)/2)-350;
y = ((screen.height)/2)-250;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=700,height=500,left ="+ x +",top ="+ y +"');");
}

function envivo(URL) /* Parlamemto de niños - 28 de junio de 2011 */
{
x = ((screen.width)/2)-235;
y = ((screen.height)/2)-145;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=470,height=260,left ="+ x +",top ="+ y +"');");
}

function parlamento(URL) /* Parlamemto de niños - 28 de junio de 2011 */
{
x = ((screen.width)/2)-375;
y = ((screen.height)/2)-275;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=750,height=550,left ="+ x +",top ="+ y +"');");
}

function julio08(URL) /* Conferencia Magistral América Latina - 08 de julio de 2011 */
{
x = ((screen.width)/2)-325;
y = ((screen.height)/2)-256;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=650,height=512,left ="+ x +",top ="+ y +"');");
}
/********************************************************************************************************************/

/* VARIAS VENTANAS SECUNDARIAS */
function diputados(URL) /* Ventana Secundaria para el curricilum de los Diputados */
{
x = ((screen.width)/2)-350;
y = ((screen.height)/2)-250;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,status=0,menubar=0,resizable=1,width=780,height=500,left ="+ x +",top ="+ y +"');");
}

function eventos(URL) /* Eventos en General */
{
x = ((screen.width)/2)-350;
y = ((screen.height)/2)-250;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=700,height=500,left ="+ x +",top ="+ y +"');");
}

function slide(URL) /* Micrositio de biblioteca */
{
x = ((screen.width)/2)-360;
y = ((screen.height)/2)-260;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=720,height=512,left ="+ x +",top ="+ y +"');");
}

function bienvenida(URL) /* Micrositio de biblioteca */
{
x = ((screen.width)/2)-375;
y = ((screen.height)/2)-275;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=770,height=550,left ="+ x +",top ="+ y +"');");
}

function biblioteca(URL) /* Micrositio de biblioteca */
{
x = ((screen.width)/2)-375;
y = ((screen.height)/2)-275;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=750,height=550,left ="+ x +",top ="+ y +"');");
}

function doc(URL) /* Función para todos los documentos legislativos "INICIATIVAS, DICTAMENES, MINUTAS, DECRETOS, ACUERDOS, LEYES, CÓDIGOS" */
{
  x = (screen.width);
  y = (screen.height);
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,status=0,menubar=0,resizable=1,width=" + x + ",height=" + y + ",left = 0,top = 0');");
}


function bases(URL) /* INDEFINIDO */
{
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=700,height=500,left = 10,top = 50');");
}

function gaceta(URL) /* Funcion para abrir la ventana secundaria de las Gacetas Legislativas */
{
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=700,height=500,left = 30,top = 80');");
}

function comision(URL) /* Función para las comisiones legislativas */
{
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=700,height=500,left = 120,top = 5');");
}

function CA(URL) /* INDEFINIDO */
{
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=700,height=500,left = 0,top = 0');");
}
/********************************************************************************************************************/

/* VENTANAS SECUNDARIAS AGENDAS LEGISLATIVAS */
function agenda13(URL) /* Función para abrir ventana secundaria de la agenda legislativa de la XII Legislatura */
{
  x = (screen.width);
  y = (screen.height);
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,status=0,menubar=0,resizable=1,width=" + x + ",height=" + y + ",left = 0,top = 0');");
}

function agenda12(URL) /* Función para abrir ventana secundaria de la agenda legislativa de la XII Legislatura */
{
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=auto,location=0,statusbar=0,status=0,menubar=0,resizable=0,directories=0,width=700,height=500,left = 0,top = 0');");
}

function agenda11(URL) /* Función para abrir ventana secundaria de la agenda legislativa de la XI Legislatura */
{
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=765,height=477,left = 10,top = 50');");
}

function agenda10(URL) /* Función para abrir ventana secundaria de la agenda legislativa de la X Legislatura */
{
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=680,height=430,left = 10,top = 50');");
}

function buzon(URL) /* Función para abrir ventana secundaria del Buzon de los Diputados */
{
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=333,height=233,left = 5,top = 5');");
}
