$(document).ready( function() { $('a.dial').on('click', function(e){ e.preventDefault(); var title = $(this).attr('title'); var href = $(this).attr('href'); var dlgOpts = { bgiframe: true, title: title, width: 710, height: 530, modal: true, open: function(event, ui) { $(this).html('Chargement...'); $(this).load(href); }, buttons: {'Fermer': function() { $(this).dialog('close'); }}, close: function() { $('#dial').remove(); }}; $('
').dialog(dlgOpts); return false; }); $('.idpr,.id_cr').on('click', function(){ //e.preventDefault(); var n = $(this).attr('id'); if ($('#p'+n).css('display')=='none'){ $('#p'+n).css('display', 'block'); } else { $('#p'+n).css('display', 'none'); } }); $('.tooltip').each(function(){ var title = $(this).attr('title'); var width = $(this).attr('wdth'); $(this).attr('title', ''); $(this).qtip({ solo:true, content: title, style: { width: width }, position: { at: "bottom center", my: "top center" } }); }); $(function() { $( "#radio" ).buttonset(); $("#radio1").trigger('click'); }); $('.radio').on('click', function() { $('.lang_img').fadeOut(); $.alink = this.value.toLowerCase(); $.alink_h = this.value; $(".id_cr").attr("href","/giant/"+$.alink+"/Pays/"+location.pathname.match(/\/Pays\/([^\/]+)/)[1]+"/Type/"+$.alink_h+"/CompanyId/"+location.pathname.match(/\/CompanyId\/([^\/]+)/)[1]+"/Language/"+$('.lang0').text().substr($('.lang0').text().length - 2)); $(".lang").attr("src","/themes/default/images/drapeaux/"+$('.lang0').text().substr($('.lang0').text().length - 2)+".png"); $(".lang_val").val($('.lang0').text().substr($('.lang0').text().length - 2)); $('.'+$.alink+'').fadeIn(500); }); $('select').on('change', function() { $('.lang_img').fadeOut(); $(".id_cr").attr("href","/giant/"+$.alink+"/Pays/"+location.pathname.match(/\/Pays\/([^\/]+)/)[1]+"/Type/"+$.alink_h+"/CompanyId/"+location.pathname.match(/\/CompanyId\/([^\/]+)/)[1]+"/Language/"+this.value); $(".lang").attr("src","/themes/default/images/drapeaux/"+this.value+".png"); $('.'+$.alink+'').fadeIn(500); }); });