$(document).ready(function() { 

    // malsup.com/jquery/form/#code-samples
    var options = { 
        target:     '#form_echo',   // target element(s) to be updated with server response 
        type:      'post'
    }; 
 
    // bind to the form's submit event 
    $('#myform').submit(function() { 
        $(this).ajaxSubmit(options); 
        return false; 
    }); 
    
    
    //povecava fontov
    var section = new Array('#main_content h2.naslov');  
    section = section.join(',');  
    var section2 = new Array('#main_content');  
    section2 = section2.join(',');
    var section3 = new Array('#main_content h3');  
    section3 = section3.join(',');
   
    // Reset Font Size  
   /* var originalFontSize = $(section).css('font-size');    
         $(".resetFont").click(function(){  
         $(section).css('font-size', originalFontSize);  
     });  */
     // Increase Font Size  
     $(".increaseFont").click(function(){ 
     
        var currentFontSize = $(section).css('font-size');
        if(currentFontSize < '34'){             
         var currentFontSizeNum = parseFloat(currentFontSize, 10);  
         var newFontSize = currentFontSizeNum*1.2;  
         $(section).css('font-size', newFontSize);  
         }
         
         var currentFontSize = $(section2).css('font-size'); 
        // alert(currentFontSize);
         if(currentFontSize < '19'){ 
         var currentFontSizeNum = parseFloat(currentFontSize, 10);  
         var newFontSize = currentFontSizeNum*1.2;  
         $(section2).css('font-size', newFontSize);  
         }

        var currentFontSize = $(section3).css('font-size');  
        if(currentFontSize < '22'){         
         var currentFontSizeNum = parseFloat(currentFontSize, 10);  
         var newFontSize = currentFontSizeNum*1.2;  
         $(section3).css('font-size', newFontSize);
         }
         
         return false;  
     });  
          
     
     // Decrease Font Size  
     $(".decreaseFont").click(function(){ 
      
         var currentFontSize = $(section).css('font-size'); 
         if(currentFontSize > '20'){  
         var currentFontSizeNum = parseFloat(currentFontSize, 10);  
         var newFontSize = currentFontSizeNum*0.8;  
         $(section).css('font-size', newFontSize);  
         }
         
         var currentFontSize = $(section2).css('font-size');
         if(currentFontSize > '13'){   
         var currentFontSizeNum = parseFloat(currentFontSize, 10);  
         var newFontSize = currentFontSizeNum*0.8;  
         $(section2).css('font-size', newFontSize);  
         }
         
         var currentFontSize = $(section3).css('font-size');  
         if(currentFontSize > '13'){  
         var currentFontSizeNum = parseFloat(currentFontSize, 10);  
         var newFontSize = currentFontSizeNum*0.8;  
         $(section3).css('font-size', newFontSize);
         }  
         
         return false;  
     });  
    
    
}); 
