
		window.onload = onLoad;

        function onLoad()
        {
        var sa = document.getElementById("chkViewAll");
        sa.checked=false;
        var urlString = window.location.href;
        if(urlString.indexOf('pf=true')!=-1)
        {
        toggleQuestions(true);
        sa.checked=true;
        }
        var targetLoc = urlString.indexOf('#');
        if(targetLoc!=-1 && urlString.indexOf('top')==-1)
        {
        targetLoc++;
        urlString=urlString.substr(targetLoc);
        var qString=new String(urlString);
        qString=qString.replace('q','');
        qString='q'+qString;
        
        urlString=urlString.replace('q','');
        
        if(document.getElementById(urlString)!=null)
        {
        var exItem=document.getElementById(urlString).firstChild.data;
        expandQuestion('title'+exItem,'question'+exItem,'answer'+exItem);
        }
        window.location='#'+qString;
        }
        var states=document.getElementsByName('datedGraphic');
        var nowDate=new Date();
        var month=nowDate.getMonth();
        month=month-1;
        nowDate.setMonth(month);
        //alert(nowDate.toString());
        for(var i=0;i<states.length;i++)
        {
        var strId=new String(states.item(i).id);
        var thenDate=new Date(strId.substring(0,4)+'/'+strId.substring(4,6)+'/'+strId.substring(6,8));
        //alert(thenDate.toString());
        if(thenDate>nowDate)states.item(i).style.display='inline';
        }
        }

        function showHide(subText)
        {
        var textBlock=document.getElementById(subText);
        var imgSign=document.getElementById('g'+subText);
        if(textBlock.style.display=='block')
        {
        textBlock.style.display='none';
        imgSign.src='img/whplus.gif';
        imgSign.title='click para ver encabezados'
        }
        else
        {
        textBlock.style.display='block';
        imgSign.src='img/whminus.gif';
        imgSign.title='click para ocultar encabezados'
        }

        }

        function toggleAll()
        {
        var sa = document.getElementById("chkViewAll");
        var ch = sa.checked;
        toggleQuestions(ch);
        }

        function toggleQuestions(checked)
        {
        var secCount = 1;
        var faqEntryCount = 10;
        for(var j=1; j<=secCount; j++)
        {
        for (var i=1; i<=faqEntryCount; i++)
        {
        var title = document.getElementById("title" + j + i);
        if(checked == true)
        expandQuestion("title" + j + i, "question" + j +i, "answer" + j + i);
        else
        collapseQuestion("title" + j + i, "question" + j +i, "answer" + j + i);
        }
        }
        if(checked == false)
        {
        var sa = document.getElementById("chkViewAll");
        sa.checked = false;
        }
        }

        function toggleQuestion(tName, qName, aName)
        {
        var title = document.getElementById(tName);
        if (title == null) return;
        var ans = document.getElementById(aName);
        if (ans == null) return;
        var que = document.getElementById(qName);
        if (ans.style.display == '')
        {
        if (que != null) que.style.display = 'none';
        ans.style.display = 'none';
        var sa = document.getElementById("chkViewAll");
        sa.checked = false;
        }
        else
        {
        if (que != null) que.style.display = '';
        ans.style.display = '';
        }
        }

        function expandQuestion(tName, qName, aName)
        {
        var title = document.getElementById(tName);
        if (title == null) return;
        var ans = document.getElementById(aName);
        if (ans == null) return;
        var que = document.getElementById(qName);
        if (que != null) que.style.display = '';
        ans.style.display = '';
        }


        function collapseQuestion(tName, qName, aName)
        {
        var title = document.getElementById(tName);
        if (title == null) return;
        var ans = document.getElementById(aName);
        if (ans == null) return;
        var que = document.getElementById(qName);
        if (que != null) que.style.display = 'none';
        ans.style.display = 'none';
        }

