/* RESEN */
/* Javascript Functions
----------------------------------------------------------------------------- */


	$(document).ready(function() {
	
		replaceSubmitButtons();
		
	});


/* FUNCTION: REPLACE SUBMIT BUTTONS
----------------------------------------------------------------------------- */


	function replaceSubmitButtons() {
	
	
/* Replace Buttons */

	
		$('div.bar input[type=submit]').each(function() {
					
			var language = $(this).attr('value');
			$(this).parent().addClass('submit');
			$(this).after('<a class="action submit" href="#submit">' + language + '</a>');

		});
		

/* Button Click */

	
		$('a.submit').click(function() {

			$(this).parents('form').submit();
			return false;
			
		});
		
		
/* Form Submit */


		$('div.bar form').submit(function() {
			
			if ($(this).attr('action').match('actions')) {
			
				var action = window.location.href.replace(window.location.protocol + "//" + window.location.hostname, '');
				$(this).attr('action', action);
				
			}
			
		});
		
	
	}