function InitMLMDP( mlmdpid , a ) {
	mlmdp = $("#"+mlmdpid );
	mlmdp.data( "languages" , a );
	for (i in a) {
		site_language_id = a[i];
		tabhdrid = mlmdpid+"_tabhdr" + site_language_id;
		tabhdr = $("#"+tabhdrid );
		tabhdr.data( "parent" , mlmdp );
		tabhdr.data( "site_language_id" , site_language_id );
		tabhdr.click( function() {
				MLMDPTabClick( $(this) );
			}
		);
	}
}

function MLMDPTabClick( o ) {
	site_language_id=o.data( "site_language_id" );
	mlmdp = o.data("parent");
	languages = mlmdp.data("languages");
	for (i in languages) {
		current_language = languages[i];
		tabhdrid = mlmdp.attr("id")+"_tabhdr"+current_language;
		tabhdr = $("#"+tabhdrid );
		tabcntid = mlmdp.attr("id")+"_tabcnt"+current_language;
		tabcnt = $("#"+tabcntid );
		if (site_language_id==current_language) {
			tabhdr.addClass( "active" );
			tabcnt.addClass( "active" );
		} else {
			tabhdr.removeClass( "active");
			tabcnt.removeClass( "active" );
		}
	}
}
