jQuery(document).ready(

	/*
	This function gets loaded when all the HTML, not including the portlets, is
	loaded.
	*/

	function() {
        $.translate(function(){ //when the Google Language API is loaded

           $.translate.ui('select', 'option') //generate dropdown
             .change(function(){ //when selecting another language
               $('body').translate( 'english', $(this).val(), { //translate from english to the selected language
                 not: '.option, #demo, #source, pre, .jq-translate-ui', //exclude these elements
                 fromOriginal:true //always translate from english (even after the page has been translated)
               })
             })
             .val('English') //select English as default
             .appendTo('#language'); //insert the dropdown to the page
        });

	}
);

