var myAccordion;
var pageName = '';

window.addEvent('domready', function() {
	
	//create our Accordion instance
	myAccordion = new Accordion($('accordion'), 'h3.toggler', 'div.element', {
		opacity: false,
		display: 'all-closed',
		onActive: function(toggler, element){
			
		},
		onBackground: function(toggler, element){
			
		}
	});
  
    showDiv();
    if(document.getElementById("ctl00_posAcordion").value != '')
    {
        if(document.getElementById("ctl00_posAcordion").value != '0')
        {
            myAccordion.display(document.getElementById("ctl00_posAcordion").value);
        }
        
    }

});

function showDiv()
{
    
    var arrayOfDivs = document.getElementsByTagName('div');
    var howMany = arrayOfDivs.length - 1;

    for (var i=0; i < howMany; i++) {
        var thisDiv = arrayOfDivs[i];
        var styleClassName = thisDiv.className;
        if (styleClassName == 'element') {
            thisDiv.style.display='';
        }
    };

}

function navegar(url,accordion){
    //window.location=url;
    document.aspnetForm.action = url;
    document.aspnetForm.ctl00$posAcordion.value = accordion;
    document.aspnetForm.submit();
    //document.getElementById("ctl00_posAcordion").value = accordion;
}

function OpenWindow(sURL,sName)
{
window.open(sURL,sName,'toolbar,width=600,height=400,resizable,scrollbars=yes');
}


function OpenWindowBig(sURL,sName)
{
	window.open(sURL,sName,'toolbar,width=790,height=590,resizable,scrollbars=yes');
	
}
function OpenWindowDefault(sURL,sName)
{
	window.open(sURL,sName,'toolbar,resizable,scrollbars=yes');
	
}
function OpenWindowThin(sURL,sName)
{
	window.open(sURL,sName,'toolbar,width=420,height=600,resizable,scrollbars=yes');
}


