﻿// JavaScript Document

// Alternador de CSS by http://www.manifesto.blog.br/<br />
// LEIA AQUI!!!!  Copiar os <link href="css....> acima. Atencão para o "rel" o secundario está como "alternate stylesheet" todos os alternativos ficarão assim. O "title" é o nome adotado para o CSS.



	
            function troca(txt) {
                var i, a, main;
                 for(i=0;(a = document.getElementsByTagName("link")[i]);i++) {
                    if (a.getAttribute("type") == "text/css") {
                        a.disabled = true ;
                        a.setAttribute("rel", "alternate stylesheet") ;
                    }
                }
                for(i=0;(a = document.getElementsByTagName("link")[i]);i++) {
                        if (a.getAttribute("type") == "text/css" && a.getAttribute("title") == txt) {
                            a.disabled = false ;
                            a.setAttribute("rel", "stylesheet") ;                
                        }
                    }
                setCookie("estilo",txt,"99");
            }           
            function start() {
                var txt = getCookie("estilo");
                if (txt==null) { txt = colorido;  }

            }           
            function setCookie(c_name,value,expiredays) {
                var exdate=new Date();
                exdate.setDate(exdate.getDate()+expiredays);
                document.cookie=c_name+ "=" +escape(value)+
                ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
            }                                           
            function getCookie(c_name) {
                if (document.cookie.length>0)
                  {
                  c_start=document.cookie.indexOf(c_name + "=");
                  if (c_start!=-1)
                    {
                    c_start=c_start + c_name.length+1;
                    c_end=document.cookie.indexOf(";",c_start);
                    if (c_end==-1) c_end=document.cookie.length;
                    return unescape(document.cookie.substring(c_start,c_end));
                    }
                  }
                return "";
            }               

			
       window.onload = start ; 
