﻿
function changeFonts() {
    var imgs = document.getElementsByTagName("input");
   for (i = 0; i < imgs.length; i++) {
       if (imgs[i].className == "bigger_smaller")
            changeFont(imgs[i]);
    }
    ToggleFont();
    return false;
}

function changeFont(input) {
    
    if (input.src.match("bigger") == "bigger") {
        input.src = input.src.replace("bigger", "smaller");
        if (input.src.match("_b.gif") == "_b.gif") {
            input.onmouseout = function() { swapButtonImage(this, "/images/buttons/smaller_btn_b.gif"); };
            input.onmouseover = function() { swapButtonImage(this, "/images/buttons/smaller_btn_on_b.gif"); };
        }
        else {
            input.onmouseout = function() { swapButtonImage(this, "/images/buttons/smaller_btn.gif"); };
            input.onmouseover = function() { swapButtonImage(this, "/images/buttons/smaller_btn_on.gif"); };
        }
    }
    else {
        input.src = input.src.replace("smaller", "bigger");
        if (input.src.match("_b.gif") == "_b.gif") {
            input.onmouseout = function() { swapButtonImage(this, "/images/buttons/bigger_btn_b.gif"); };
            input.onmouseover = function() { swapButtonImage(this, "/images/buttons/bigger_btn_on_b.gif"); };
        }
        else {
            input.onmouseout = function() { swapButtonImage(this, "/images/buttons/bigger_btn.gif"); };
            input.onmouseover = function() { swapButtonImage(this, "/images/buttons/bigger_btn_on.gif"); };
        }
    }
    return false;
}

 var fontBig = false;
function ToggleFont(){

    // make it small again
    
//     if (document.getElementById('blueContainer')==null){
//        return;
//     }

     var h1size, h2size, h3size, h4size, h5size, blueContainerSize;
     if (fontBig){
       h1size = "font-size:21px;";
       h2size = "font-size:18px;";
       h3size = "font-size:18px;";
       h4size = "font-size:12px;";
       h5size = "font-size:12px;";
       h6size = "font-size:18px;";
       blueContainerSize = "font-size:12px;";
     }else{
       h1size = "font-size:34px;line-height:32px;";
       h2size = "font-size:20px;";
       h3size = "font-size:20px;";
       h4size = "font-size:15px;";
       h5size = "font-size:16px;";
       h6size = "font-size:20px;";
       blueContainerSize = "font-size:15px;"
     }
     
     createCSS("h1",h1size);
     createCSS("h2",h2size);
     createCSS("h3",h3size);
     createCSS("h4",h4size);
     createCSS("h5",h5size);
     createCSS("h6",h5size);
     createCSS("blue_container",blueContainerSize);
     createCSS("body",blueContainerSize);
     fontBig = !fontBig;   
     
     //alert("css created added class");
     
     return;
};


function createCSS(selector, declaration) {
        // test for IE
        var ua = navigator.userAgent.toLowerCase();
        var isIE = (/msie/.test(ua)) && !(/opera/.test(ua)) && (/win/.test(ua));

        // create the style node for all browsers
        var style_node = document.createElement("style");
        style_node.setAttribute("type", "text/css");
        style_node.setAttribute("media", "screen");

        // append a rule for good browsers
        if (!isIE) style_node.appendChild(document.createTextNode(selector + " {" + declaration + "}"));

        // append the style node
        document.getElementsByTagName("head")[0].appendChild(style_node);

        // use alternative methods for IE
        if (isIE && document.styleSheets && document.styleSheets.length > 0) {
                var last_style_node = document.styleSheets[document.styleSheets.length - 1];
                if (typeof(last_style_node.addRule) == "object") last_style_node.addRule(selector, declaration);
        }
};
 
function PopUp(url, name) {
	var win = window.open(url, name, 'toolbar=0,status=0,height=450,width=650,scrollbars=yes,resizable=yes');
}