$(document).ready(function(){
	initSwitchedLists();

/*
	var langToolTip = $(".region .lang .lang-tooltip");
	var langForm = $(".jNiceSelectWrapper .jNiceSelectOpen");
	var langSelectOpen = 0;

	$(langForm).hover(
		function () {
		 $(langForm).click(
			 function (){
				langFormClicked = 1;
				alert(langFormClicked);
			 }
		 );
			if(langFormClicked){
				langToolTip.hide();
			}
			else{
				langToolTip.show();
				
			}
		}, 
		function () {
			if(langFormClicked){
				langToolTip.show();
			}
			else{
				langToolTip.hide();
			}
		}
	);
*/

});


function change_language_version(){
  var version = document.getElementById("id_change_language_version");
  document.location = document.location.protocol + '//' + document.location.host + '/' + version.value + '/';
}


function initSwitchedLists() {
	var switched = $('ul.switched li a');
	switched.click( function( event ){
	var href_attr = $( this ).attr('href');
	if( href_attr != "javascript:void(0);" ){
			if( $( this ).hasClass( 'dashed_off' ) ) {
					event.preventDefault();
			}
	}

	if ( !$( this ).hasClass( 'simplelink' ) ) {
			$( this ).toggleClass( 'dashed_off' )
	}

	$( this )
	.find( 'span' ).toggleClass( 'visible_inline' ).end()
	.next().toggleClass( 'visible' );
	});
}

