change two buttons into one (toggle)
<p>I have this code, which swich 2 different external .css after click on one of two buttons and it works fine, but I need to change it and make only one button with toggling between these two .css files. Thank you</p>

<pre><code>&lt;script type="text/javascript"&gt;

    function changeCSS(cssFile, cssLinkIndex) {

    var oldlink = document.getElementsByTagName("link").item(cssLinkIndex);

    var newlink = document.createElement("link")
    newlink.setAttribute("rel", "stylesheet");
    newlink.setAttribute("type", "text/css");
    newlink.setAttribute("href", cssFile);

    document.getElementsByTagName("head").item(0).replaceChild(newlink, oldlink);
  }
&lt;/script&gt;

&lt;a href="#" onclick="changeCSS('css/main.css', 1);"&gt;STYLE 1&lt;/a&gt;
&lt;a href="#" onclick="changeCSS('css/main2.css', 1);"&gt;STYLE 2&lt;/a&gt;
&lt;div class="box"&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit.&lt;/div&gt;
</code></pre>
