﻿var wrapperDiv;

//droppy---------------------------------------------------------------------------------
$(function() {
    $('#nav').superfish();
});

//ifixPNG--------------------------------------------------------------------------------
$(document).ready(function(){
    // apply ifixpng
    $('img[@src$=.png]').ifixpng(); 
    $('div.selected').ifixpng();
    $('div.input.field').ifixpng();
    $('div.input.fieldS').ifixpng();		
});

//font resizer---------------------------------------------------------------------------
$(document).ready(function(){
    // Reset Font Size
    //var originalFontSize = $('body').css('font-size');
        wrapperDiv = document.getElementById('wrapper');  

    /*
    $(".resetFont").click(function(){
        $('body').css('font-size', '11.2px');
    });
    // Increase Font Size
    $(".increaseFont").click(function(){
        var currentFontSize = $('body').css('font-size');
        var currentFontSizeNum = parseFloat(currentFontSize, 5);
        var newFontSize = currentFontSizeNum*1.2;
        $('body').css('font-size', newFontSize);
        return false;
    });
    // Decrease Font Size
    $(".decreaseFont").click(function(){
        var currentFontSize = $('body').css('font-size');
        var currentFontSizeNum = parseFloat(currentFontSize, 5);
        var newFontSize = currentFontSizeNum*0.8;
        $('body').css('font-size', newFontSize);
        return false;
    });
    */
});

var min=9;
var max=13;
var norm=11;

function resetFontSize(){
    wrapperDiv.style.fontSize = norm +"px";
}

function increaseFontSize() {
  if(wrapperDiv.style.fontSize)
  {
     var s = parseInt(wrapperDiv.style.fontSize.replace("px",""));
  } 
  else 
  {
     var s = norm;
  }
  if(s<=max)
  {
     s += 1;
  }
  wrapperDiv.style.fontSize = s+"px"
}

function decreaseFontSize() {
   
    if(wrapperDiv.style.fontSize)
    {
       var s = parseInt(wrapperDiv.style.fontSize.replace("px",""));
    } 
    else 
    {
       var s = norm;
    }
    if(s>=min)
    {
       s -= 1;
    }
    wrapperDiv.style.fontSize = s+"px"
}   