
jQuery(function($){ //when DOM is ready
  $.translate(function(){  //when the Google Language API is loaded
    function translateTo( destLang ){ //this can be declared in the global scope too if you need it somewhere else
        $('body').translate( 'english', destLang, {   //translate from english to the selected language
          not: '.jq-translate-ui, .header',  //by default the generated element has this className
          fromOriginal:true   //always translate from english (even after the page has been translated)
        });
    }           
      
        translateTo( $(this).val() );
        $('#translator')
      .find('a')
      .click(function(){
         var lang = $(this).attr('id');
         translateTo( lang );  
      $('#toppanel').css("font-size","75%");
      $('#mainnav').css("font-size","82.5%");
      $('#leftnav').css("font-size","95%");
      $('#contactpanel').css("font-size","125%");
       $.cookie('destLang', lang );
        return false; //prevent default browser action
      })  
var destLang = $.cookie('destLang'); //get previously translated language 
     
    if( destLang ){  //if it was set then 
    translateTo( destLang );
      $('#toppanel').css("font-size","75%");
      $('#mainnav').css("font-size","82.5%");
      $('#leftnav').css("font-size","95%");
      $('#contactpanel').css("font-size","125%");
             }  
  }); 



	$("a.reset").click(function(){
	$.cookie('the_cookie', null);
        location.reload();

});
  }) 


