jQuery(document).ready(function(){
jQuery('#homeTopRightColumn #googleTranslate.rightColTopHome').prepend("<div id='translateBlock' class='rightItem' style='border-bottom:none;'><h3 class='translateHeader'>Translate This Page</h3><div id='transDrop'></div></div>");
jQuery.getScript('http://jquery-translate.googlecode.com/files/jquery.translate-1.3.7.min.js', function(){ //when the script is loaded
jQuery.translate(function(){ //when the Google Language API is loaded
  jQuery.translate.ui('select', 'option') //generate dropdown
    .change(function(){ //when selecting another language
       jQuery("body").prepend("<div id='disclaimer' style='display:none'><h3>Translation Disclaimer</h3><p>This translation is not completely accurate as it was automatically generated by a computer.</p><p>powered by<img src='http://www.google.com/uds/css/small-logo.png'/></p><div class='progressBarBlock' style='text-align:center;margin-top:5px;'>Translating...<div id='progressBar' style='width:215px;margin:10px'></div></div></div>");
    jQuery("#disclaimer").dialog();
     jQuery('#progressBar').progressbar({ value: 0 });
      jQuery('#disclaimer,#content').translate( 'english', jQuery(this).val(), { //translate from english to the selected language
        not: '.option, .jq-translate-ui,#homeTwitterContainter, #source,pre,#demo,#breadCrumb', //exclude these elements
        fromOriginal:true, //always translate from english (even after the page has been translated)
        each: function(){  
         this.progress("#progressBar");
          },
        complete: function(){
         jQuery('.progressBarBlock').fadeOut("slow",function(){jQuery(this).remove();jQuery('#progressBar').progressbar('destroy');});
   pageTracker._trackPageview("/translate/"+jQuery(".jq-translate-ui").val()+"/"+document.title+"/");
       jQuery("#disclaimer").dialog('destroy','close').remove();
          }
      })
    })
    .val('English') //select English as default
    .appendTo('#transDrop'); //insert the dropdown to the page    
});
});
});