/**********************************************************************************
    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: 25 de Agosto de 2010
***********************************************************************************/

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

// 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>")
}
//////////////////////////////////////////////////////////////////////////////

// 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 */
function WindowIndex() /* Ventana Emergente Pagina Web */
{
 x = ((screen.width)/2)-325;
 y = ((screen.height)/2)-250;
 //open('historial/12_legislatura/convocatorias/2010/09/05/convocatoria.pdf', 'convocatoria', 'toolbar=0,scrollbars=0,location=0,statusbar=no,status=0,menubar=0,resizable=1,width=650,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')
}
/*************************************************************************/

/* VENTANAS SECUNDARIAS */
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 sesion_solemne(URL) /* evento 30 de Julio de 2010 */
{
x = ((screen.width)/2)-220;
y = ((screen.height)/2)-225;
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=440,height=450,left ="+ x +",top ="+ y +"');");
}

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 doc_img(URL) /* Función para todos los documentos legislativos "INICIATIVAS, DICTAMENES, MINUTAS, DECRETOS, ACUERDOS, LEYES, CÓDIGOS" */
{
  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 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 eventos(URL) /* Función para abrir ventanas secundarias de eventos en general */
{
  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');");
}

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');");
}

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');");
}

function RM2009(URL)
{
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=550,height=400,left = 0,top = 0');");
}

function RM2006(URL)
{
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=600,height=450,left = 0,top = 0');");
}