var fontSizes = [];
var counter = 0;
var curFont = 0;
var dirFont = 0;
jQuery(document).ready(function() {
    $("#wrapper").children().each(getChildFontSize);
    $("#fontadd").click(function() {
        if (curFont == 3)
            return;
        curFont++;
        dirFont = 1;
        counter = 0;
        $("#wrapper").children().each(setChildFontSize);
    });
    $("#fontminus").click(function() {
        if (curFont == -3)
            return;
        curFont--;
        dirFont = -1;
        counter = 0;
        $("#wrapper").children().each(setChildFontSize);
    });

    if ($(".show").length != 0) {
        theRotator();
        $('div.rotator').fadeIn(1000);
        $('div.rotator ul li').fadeIn(1000); // tweek for IE
        
    }
});
function getChildFontSize(index) {
    var fontSize = $(this).css("font-size");
    fontSizes.push(fontSize);
    $(this).children().each(getChildFontSize);
}
function setChildFontSize(index) {
    var fontSize = $(this).css("font-size");
    if (fontSizes[counter] == fontSize) {
        var actualSize = 0;
        actualSize = fontSize.substring(0, fontSize.length - 2) * 1 + 2 * (dirFont);
        $(this).css("font-size", actualSize + "px");
    }
    fontSizes[counter] = fontSize;
    counter++;
    $(this).children().each(setChildFontSize);
}


function clickToPrint() {
    var disp_setting = "toolbar=yes,location=no,directories=yes,menubar=yes,";
    disp_setting += "scrollbars=yes,width=650, height=600, left=100, top=25";
    var content_value;
    if (document.getElementById("main") == null)
        content_value = document.getElementById("mainWider").innerHTML;
    else
        content_value = document.getElementById("main").innerHTML;

    var docprint = window.open("", "", disp_setting);
    docprint.document.open();
    docprint.document.write('<html><head><title>ORHMA</title>');
    docprint.document.write('</head><body onLoad="self.print()">');
    docprint.document.write(content_value);
    docprint.document.write('<p>&copy; 2010 Ontario Restaurant Hotel & Motel Association</p>');
    docprint.document.write('</body></html>');
    docprint.document.close();
    docprint.focus();
}

function resetInputStyle(obj) {
    obj.style.color = "";
    obj.style.fontStyle = "";
    if (obj.value == "Search ORHMA site" || obj.value == "Member Number" || obj.value == "Your Email Address") {
        obj.value = "";
    }
}

