// JavaScript Document // Jet-Price var isInstalled = false; $(document).ready(function() { // -- Main - Initialize the width of "#main" -- if ($(window).width() <= 990) { $('#main').width(990); }else{ $('#main').width('auto'); } $('#main').height( $(window).height() ); if( $('#main').height() - $('#header').height() > 0 ) { $('#iframecontainer').height( $('#main').height() - $('#header').height() ); } // -- Main - Setup the width of "#main" on window resize -- $(window).resize( function() { if ($(window).width() <= 990) { $('#main').width(990); }else{ $('#main').width('100%'); } $('#main').height( $(window).height() ); if( $('#main').height() - $('#header').height() > 0 ) { $('#iframecontainer').height( $('#main').height() - $('#header').height() ); } } ); // -- Main - Custom checkbox -- $(".field-checkbox:checked").prev().addClass('checked'); $(".checkbox").live('click', function(){ if( $(this).hasClass('checked')==true ){ var txt = "Tout sélectionner"; $(this).closest('.select-all-checkbox').find('label').html(txt); $(this).removeClass('checked'); $(this).next('.field-checkbox').trigger('click'); $(this).closest('.custom-checkbox').prev('.select-all-checkbox').find('.field-checkbox:checked').trigger('click'); //$(this).closest('.custom-checkbox').prev('.select-all-checkbox').find('label').removeClass('checked'); $(this).closest('.select-all-checkbox').next().find('label').removeClass('checked'); $(this).closest('.select-all-checkbox').next().find('.field-checkbox:checked').trigger('click'); /* Ce code n'est pas utilisé, car on veut déselctionner absolument tout, y compris sous les racines $(this).closest('.select-all-checkbox').next().find('label').each(function(index){ if( $(this).parent().parent()[0].tagName != "DIV" ) { $(this).removeClass('checked'); $(this).next().find($('.field-checkbox:checked')).trigger('click'); } }); */ test_submit(); }else{ var txt = "Tout désélectionner"; $('#btn-compare-00').css('display','block'); $(this).closest('.select-all-checkbox').find('label').html(txt); $(this).addClass('checked'); $(this).next('.field-checkbox').trigger('click'); /* ce code permet de ne pas sélectionner sous les racines */ $(this).closest('.select-all-checkbox').next().find('label').each(function(index){ if( $(this).parent().parent().parent().parent()[0].tagName != "LI" ) { $(this).addClass('checked'); $(this).next().find($('.field-checkbox').not(':checked')).trigger('click'); } }); //$(this).closest('.select-all-checkbox').next().find($('.field-checkbox').not(':checked')).trigger('click'); } } ); // -- Header - Search auto focus -- var txt = 'Recherche'; $('#s').focus( function() { if($(this).attr('value') == txt) $(this).attr('value', ''); } ); $('#s').blur( function() { if($(this).attr('value') == '') $(this).attr('value', txt); } ); // -- Header - Black menu -- /* $('.black-nav-dd').click( function(){ if($(this).parent().find('.scroll-pane').is(':visible')==true){ $(this).parent().find('.scroll-pane').slideUp(); }else{ $(this).parent().find('.scroll-pane').slideDown(); } } ); */ $('#nb-veilles .black-nav-dd').click( function(){ if($(this).parent().find('.scroll-pane').is(':visible')==true){ $(this).parent().find('.scroll-pane').slideUp(); }else{ $(this).parent().closest('.black-nav-dd-wrap').find('.scroll-pane').slideUp(); //si le menu déroulant des sites est ouvert, on le ferme if($('#nb-sites').find('.scroll-pane').is(':visible')==true){ $('#nb-sites').find('.scroll-pane').slideUp(); } //si le menu déroulant des régions est ouvert, on le ferme if($('#nb-regions').find('.scroll-pane').is(':visible')==true){ $('#nb-regions').find('.scroll-pane').slideUp(); } //si le menu déroulant du compte est ouvert, on le ferme if($('#account').find('.scroll-pane').is(':visible')==true){ $('#account').find('.scroll-pane').slideUp(); } //si le menu déroulant de selection de date est ouvert, on le ferme if($('#date-veille').find('.scroll-pane').is(':visible')==true){ $('#date-veille').find('.scroll-pane').slideUp(); } $(this).parent().find('.scroll-pane').slideDown(); } } ); /*$('#nb-veilles li').click( function(){ $('#nb-veilles').find('.scroll-pane').slideUp(); } ); $('#div_lst_veille').mouseleave( function(){ $('#nb-veilles').find('.scroll-pane').slideUp(); } );*/ $('#nb-sites .black-nav-dd').click( function(){ if($(this).parent().find('.scroll-pane').is(':visible')==true){ //$(this).parent().find('.scroll-pane').slideUp(); $(this).parent().find('.scroll-pane').fadeOut('fast'); if( $('#black-nav-dd-sites-region').length > 0) $('#black-nav-dd-sites-region').removeClass('active-nav-search'); }else{ //si le menu déroulant des veilles est ouvert, on le ferme if($('#nb-veilles').find('.scroll-pane').is(':visible')==true){ $('#nb-veilles').find('.scroll-pane').slideUp(); } //si le menu déroulant des régions est ouvert, on le ferme if($('#nb-regions').find('.scroll-pane').is(':visible')==true){ $('#nb-regions').find('.scroll-pane').slideUp(); } //si le menu déroulant du compte est ouvert, on le ferme if($('#account').find('.scroll-pane').is(':visible')==true){ $('#account').find('.scroll-pane').slideUp(); } //si le menu déroulant de selection de date est ouvert, on le ferme if($('#date-veille').find('.scroll-pane').is(':visible')==true){ $('#date-veille').find('.scroll-pane').slideUp(); } //$(this).parent().find('.scroll-pane').slideDown(); $(this).parent().find('.scroll-pane').fadeIn('fast'); if( $('#black-nav-dd-sites-region').length > 0) { $('#black-nav-dd-sites-region').addClass('active-nav-search'); $('#black-nav-dd-sites-region').find('.scroll-pane-profil').jScrollPane(); } if( $('#black-nav-dd-region').length > 0) { $('#black-nav-dd-region').removeClass('active-nav-search'); } } } ); $('#top-grey-nav a').click( function(){ //si le menu déroulant des veilles est ouvert, on le ferme if($('#nb-veilles') && $('#nb-veilles').find('.scroll-pane').is(':visible')==true){ $('#nb-veilles').find('.scroll-pane').slideUp(); } //si le menu déroulant des régions est ouvert, on le ferme if($('#nb-regions') && $('#nb-regions').find('.scroll-pane').is(':visible')==true){ $('#nb-regions').find('.scroll-pane').slideUp(); } //si le menu déroulant du compte est ouvert, on le ferme if($('#account') && $('#account').find('.scroll-pane').is(':visible')==true){ $('#account').find('.scroll-pane').slideUp(); } //si le menu déroulant de selection de date est ouvert, on le ferme if($('#date-veille').find('.scroll-pane').is(':visible')==true){ $('#date-veille').find('.scroll-pane').slideUp(); } //si le menu déroulant de selection des sites est ouvert, on le ferme if($('#nb-sites').find('.scroll-pane').is(':visible')==true){ $('#nb-sites').find('.scroll-pane').slideUp(); } if( $('#black-nav-dd-sites-region').length > 0) { $('#black-nav-dd-sites-region').removeClass('active-nav-search'); } if( $('#black-nav-dd-region').length > 0) { $('#black-nav-dd-region').removeClass('active-nav-search'); } } ); $('#nb-regions .black-nav-dd').click( function(){ if($(this).parent().find('.scroll-pane').is(':visible')==true){ $(this).parent().find('.scroll-pane').slideUp(); $('#black-nav-dd-region').removeClass('active-nav-search'); }else{ //si le menu déroulant des sites est ouvert, on le ferme if($('#nb-sites').find('.scroll-pane').is(':visible')==true){ $('#nb-sites').find('.scroll-pane').slideUp(); } //si le menu déroulant des veilles est ouvert, on le ferme if($('#nb-veilles').find('.scroll-pane').is(':visible')==true){ $('#nb-veilles').find('.scroll-pane').slideUp(); } //si le menu déroulant du compte est ouvert, on le ferme if($('#account').find('.scroll-pane').is(':visible')==true){ $('#account').find('.scroll-pane').slideUp(); } //si le menu déroulant de selection de date est ouvert, on le ferme if($('#date-veille').find('.scroll-pane').is(':visible')==true){ $('#date-veille').find('.scroll-pane').slideUp(); } $(this).parent().find('.scroll-pane').slideDown(); if( $('#black-nav-dd-sites-region').length > 0) { $('#black-nav-dd-sites-region').removeClass('active-nav-search'); } if( $('#black-nav-dd-region').length > 0) { $('#black-nav-dd-region').addClass('active-nav-search'); $('#black-nav-dd-region').find('.scroll-pane-profil').jScrollPane(); } } } ); /*$('#nb-regions li').click( function(){ $('#nb-regions').find('.scroll-pane').slideUp(); } ); $('#div_lst_region').mouseleave( function(){ $('#nb-regions').find('.scroll-pane').slideUp(); } );*/ $('#account .black-nav-dd').click( function(){ if($(this).parent().find('.scroll-pane').is(':visible')==true){ $(this).parent().find('.scroll-pane').slideUp(); }else{ //si le menu déroulant des sites est ouvert, on le ferme if($('#nb-sites').find('.scroll-pane').is(':visible')==true){ $('#nb-sites').find('.scroll-pane').slideUp(); } //si le menu déroulant des régions est ouvert, on le ferme if($('#nb-regions').find('.scroll-pane').is(':visible')==true){ $('#nb-regions').find('.scroll-pane').slideUp(); } //si le menu déroulant des veilles est ouvert, on le ferme if($('#nb-veilles').find('.scroll-pane').is(':visible')==true){ $('#nb-veilles').find('.scroll-pane').slideUp(); } //si le menu déroulant de selection de date est ouvert, on le ferme if($('#date-veille').find('.scroll-pane').is(':visible')==true){ $('#date-veille').find('.scroll-pane').slideUp(); } $(this).parent().find('.scroll-pane').slideDown(); } } ); /*$('#account li').click( function(){ $('#account').find('.scroll-pane').slideUp(); } ); $('#div_lst_param').mouseleave( function(){ $('#account').find('.scroll-pane').slideUp(); } );*/ $('#date-veille .black-nav-dd').click( function(){ if($(this).parent().find('.scroll-pane').is(':visible')==true){ $(this).parent().find('.scroll-pane').slideUp(); }else{ //si le menu déroulant des sites est ouvert, on le ferme if($('#nb-sites').find('.scroll-pane').is(':visible')==true){ $('#nb-sites').find('.scroll-pane').slideUp(); } //si le menu déroulant des régions est ouvert, on le ferme if($('#nb-regions').find('.scroll-pane').is(':visible')==true){ $('#nb-regions').find('.scroll-pane').slideUp(); } //si le menu déroulant des veilles est ouvert, on le ferme if($('#nb-veilles').find('.scroll-pane').is(':visible')==true){ $('#nb-veilles').find('.scroll-pane').slideUp(); } //si le menu déroulant du compte est ouvert, on le ferme if($('#account').find('.scroll-pane').is(':visible')==true){ $('#account').find('.scroll-pane').slideUp(); } $(this).parent().find('.scroll-pane').slideDown(); } } ); /*$('#date-veille li').click( function(){ $('#date-veille').find('.scroll-pane').slideUp(); } ); $('#div_lst_date').mouseleave( function(){ $('#date-veille').find('.scroll-pane').slideUp(); } );*/ // -- Header - Select like -- $('.b-dd li').click( function(){ var txt = $(this).html(); $(this).closest('.black-nav-dd-wrap').find('.black-nav-dd').html(txt); $(this).closest('.black-nav-dd-wrap').find('.scroll-pane').slideUp(); } ); // -- Header - Scrollers -- $('#date-veille .scroll-pane').width($('#date-veille .black-nav-dd-wrap').width() - 14); $('#account .scroll-pane').width($('#account').width() - 14); $('.scroll-pane').jScrollPane(); $('.scroll-pane').css('display','none'); $('.scroll-pane-profil').jScrollPane(); //$('.dd-top').css('display','none'); // -- Header - Tabs main nav -- $('#main-nav li').hover( function (){ //$(this).find('.dd-top').stop(true, true).fadeIn(300); $(this).addClass('active-nav-tab'); }, function (){ //$(this).find('.dd-top').stop(true, true).fadeOut(100); $(this).removeClass('active-nav-tab'); } ); $('#main-nav li').click( function (){ // ne permet pas de cliquer sur les elements non clicables if( !$(this).hasClass('noclick') ) { $(this).parent('#main-nav').find('li').each( function (){ $('#main-nav li').removeClass('selected-nav-tab'); $('#main-nav li').removeClass('active-nav-tab'); } ); $(this).addClass('selected-nav-tab'); } } ); $('#nav-sec li').click( function (){ // ne permet pas de cliquer sur les elements non clicables if( !$(this).hasClass('noclick') ) { $(this).parent('#nav-sec').find('li').each( function (){ $('#nav-sec li').removeClass('selected-nav-tab'); $('#nav-sec li').removeClass('active-nav-tab'); } ); $(this).addClass('selected-nav-tab'); } } ); // Add on tip coding $('#main-nav li#jet-price-nav').hover( function (){ if(isInstalled == false) { $(this).find('#tip_addon').css('display', 'block'); } }, function (){ $(this).find('#tip_addon').css('display', 'none'); } ); // -- Header - Search profil nav -- $('#nav-search-p').hover( function (){ //$(this).find('.dd-top').stop(true, true).fadeIn(300); $(this).addClass('active-nav-search'); }, function (){ //$(this).find('.dd-top').stop(true, true).fadeOut(100); $(this).removeClass('active-nav-search'); } ); $('#nav-search-p2').hover( function (){ //$(this).find('.dd-top').stop(true, true).fadeIn(300); $(this).addClass('active-nav-search'); }, function (){ //$(this).find('.dd-top').stop(true, true).fadeOut(100); $(this).removeClass('active-nav-search'); } ); $('#nav-addprofil-p').hover( function (){ //$(this).find('.dd-top').stop(true, true).fadeIn(300); $(this).addClass('active-nav-search'); $(this).find('.scroll-pane-profil').jScrollPane(); }, function (){ //$(this).find('.dd-top').stop(true, true).fadeOut(100); $(this).removeClass('active-nav-search'); } ); // -- Tooltip /*$('table.table-01 a').tooltip({ track: true, delay: 0, showURL: false, showBody: " - ", fade: 250 }); */ //Gestion du placement de la div de matching selon le scroll // -- Home - Family profils -- $('.profils-content li').hover( function (){ $(this).addClass('selected-p'); $(this).find('.del-p').css('display','block'); $(this).find('.edit-p').css('display','block'); }, function (){ $(this).removeClass('selected-p'); $(this).find('.del-p').css('display','none'); $(this).find('.edit-p').css('display','none'); } ); //pareil pour les profils région $('#nb-regions span').hover( function (){ $(this).addClass('selected-p'); $(this).find('.del-p').css('display','block'); $(this).find('.edit-p').css('display','block'); }, function (){ $(this).removeClass('selected-p'); $(this).find('.del-p').css('display','none'); $(this).find('.edit-p').css('display','none'); } ); // -- Home - Animation open/hide tip -- var tip_width = $('#tip-slide-wrap').width(); var tip_slider_width = $('.tip-slider').width(); $('#tab-highlights').width($('#container').width() - 30 - tip_width); // defaut : ouvert $(window).resize( function() { $('#tab-highlights').width($('#container').width() - 30 - tip_width); } ); $('.tip-slider').toggle( function() { // ferme "le saviez-vous" if(top.setCookie) { top.setCookie("TIPSLIDE_CLOSED",1); } $('.slider-wrapper').fadeOut(300); $('#tip-slide-wrap').animate({width:39}, function() { $('.tip-slider').addClass('open'); }); $('#tab-highlights').animate({width:$('#container').width() - 30 - tip_slider_width}); $(window).resize( function() { $('#tab-highlights').width($('#container').width() - 30 - tip_slider_width); } ); }, function() { // ouvre "le saviez-vous" if(top.setCookie) { top.setCookie("TIPSLIDE_CLOSED",0); } $('.slider-wrapper').fadeIn(100); $(this).removeClass('open'); $('#tab-highlights').animate({width:$('#container').width() - 30 - tip_width}); $('#tip-slide-wrap').animate({width:tip_width},800); $(window).resize( function() { $('#tab-highlights').width($('#container').width() - 30 - tip_width); } ); } ); if(top.getCookie && top.getCookie("TIPSLIDE_CLOSED") == 1) { // ferme $('.tip-slider').trigger( "click" ); } // -- Home - Tips slider -- $(function(){ $('#slides').slides({ preload: true, generateNextPrev: true, generatePagination :false }); }); // -- Home - Tabs profiles -- //$('.profils-content-wrap .profils-content:eq(0)').fadeIn('fast'); $('.profils-hdngs-wrap a').live('click', function (){ var index = $(this).index(); $(this).closest('.profils-hdngs-wrap').find('a').removeClass('active'); $(this).addClass('active'); $('.profils-content-wrap .profils-content').hide(); $('.profils-content-wrap .profils-content:eq('+index+')').fadeIn('fast'); }); // -- Comparatif - Width of #container -- //$('#cont-comp').width($('#main').width() - $('#aside-left').width() - 37 ); var cont_comp_padtop = 20; var container_padtop = 0;//NE SERT A RIEN, pb sur la page panier. jQuery.support.boxModel ? 0 : cont_comp_padtop; $('#cont-comp').width($('#container').width() - $('#aside-left').width() - 27); if( $('#iframecontainer',window.parent.document).length > 0) { var iframe_height = $('#iframecontainer',window.parent.document).height() - container_padtop; $('#aside-left-nav-wrap').height( iframe_height + container_padtop); $('#cont-comp').height( iframe_height ); var fresultat_height = iframe_height - cont_comp_padtop; if( $('#nav-sec')[0] ) fresultat_height -= $('#nav-sec')[0].offsetHeight; if( $('#compare-product-list')[0] ) { $('#compare-product-list').height( $('#cont-comp').height() * 0.4 ); fresultat_height -= $('#compare-product-list')[0].offsetHeight; } if( $('#aside-top-toggler')[0] ) fresultat_height -= $('#aside-top-toggler')[0].offsetHeight; if( $('#tools')[0] ) fresultat_height -= $('#tools')[0].offsetHeight; if( $('#sumup-compare')[0] ) fresultat_height -= $('#sumup-compare')[0].offsetHeight; if( $('#enteteresultat')[0] ) fresultat_height -= $('#enteteresultat')[0].offsetHeight; $('#fresultat').height( fresultat_height ); } $(window).resize(function() { $('#cont-comp').width($('#container').width() - $('#aside-left').width() - 27); //$('#cont-comp').width($('#main').width() - $('#aside-left').width() - 37 ); if( $('#iframecontainer',window.parent.document).length > 0) { var iframe_height = $('#iframecontainer',window.parent.document).height() - container_padtop; $('#aside-left-nav-wrap').height( iframe_height + container_padtop); $('#cont-comp').height( iframe_height ); var fresultat_height = iframe_height - cont_comp_padtop; if( $('#nav-sec')[0] ) fresultat_height -= $('#nav-sec')[0].offsetHeight; if( $('#compare-product-list')[0] ) { $('#compare-product-list').height( $('#cont-comp').height() * 0.4 ); fresultat_height -= $('#compare-product-list')[0].offsetHeight; } if( $('#aside-top-toggler')[0] ) fresultat_height -= $('#aside-top-toggler')[0].offsetHeight; if( $('#tools')[0] ) fresultat_height -= $('#tools')[0].offsetHeight; if( $('#sumup-compare')[0] ) fresultat_height -= $('#sumup-compare')[0].offsetHeight; if( $('#enteteresultat')[0] ) fresultat_height -= $('#enteteresultat')[0].offsetHeight; $('#fresultat').height( fresultat_height ); } }); // -- Comparatif - Scrollers -- $('.scroll-pane-00').jScrollPane(); // -- Comparatif - Height of #aside-left -- /* var cont_height = $('#cont-comp').height(); // + 10 ? var aside_height = $('#aside-left').height(); var header_height = $('#header').height(); if ((cont_height > ($('html').height() - header_height)) || (aside_height > ($('html').height() - header_height))) { if (cont_height > aside_height) { $('#aside-left').height(cont_height); }else{ $('#aside-left').height(aside_height); } }else{ $('#aside-left').height($('html').height() - header_height); } */ // NON : $('#aside-left').height( $('#iframecontainer',window.parent.document).height() ); // -- Comparatif - Open/close the td / $('.will-show-hide').click( function() { /* $(this).nextAll('.to-show-hide').toggle(function() { if (($('#cont-comp').height() + 10) < ($('html').height() - header_height)) { if (aside_height < ($('html').height() - header_height)){ $('#aside-left').height($('html').height() - header_height); }else{ $('#aside-left').height(aside_height); } }else{ if (($('#cont-comp').height() + 10) > aside_height) { $('#aside-left').height($('#cont-comp').height() + 10); }else{ $('#aside-left').height(aside_height); } } cont_height = $('#cont-comp').height() + 10; }); $(this).toggleClass('opened-line'); */ } ); // -- Panier produit - Cart Accordion $('#compare-product-list .f-title').click(function() { $(this).parent().parent().find('ul').slideToggle('fast', function() { /* if (($('#cont-comp').height() + 10) < ($('html').height() - header_height)) { if (aside_height < ($('html').height() - header_height)){ $('#aside-left').height($('html').height() - header_height); }else{ $('#aside-left').height(aside_height); } }else{ if (($('#cont-comp').height() + 10) > aside_height) { $('#aside-left').height($('#cont-comp').height() ); //+ 10); }else{ $('#aside-left').height(aside_height); } } cont_height = $('#cont-comp').height(); // + 10; */ }); }); // -- Comparatif - Open/close the left column -- /*$('#aside-left-toggler').toggle( function() { $('#aside-left-nav-wrap').animate({width:0}); $('#aside-left').animate({width:17}).addClass('collapse-aside'); $('#cont-comp').animate({width:$('#container').width() - 44}, {complete:function(){ $('#sumup-compare').fadeIn('slow', function() { if (($('#cont-comp').height() + 10) < ($('html').height() - header_height)) { if (aside_height < ($('html').height() - header_height)){ $('#aside-left').height($('html').height() - header_height); } }else{ if (($('#cont-comp').height() + 10) > aside_height) { $('#aside-left').height($('#cont-comp').height() + 10); }else{ $('#aside-left').height(aside_height); } } cont_height = $('#cont-comp').height() + 10; }); }}); }, function() { $('#aside-left').animate({width:203}).removeClass('collapse-aside'); $('#aside-left-nav-wrap').animate({width:186}); $('#cont-comp').animate({width:$('#container').width() - 230}, {complete:function(){ $('#brands span, #brands i, #nmbrsites span, #nmbrsites i').html(''); // to clear the HTML inside on opening the left bar $('#sumup-compare').fadeOut('slow', function() { if (($('#cont-comp').height() + 10) < ($('html').height() - header_height)) { if (aside_height < ($('html').height() - header_height)){ $('#aside-left').height($('html').height() - header_height); } }else{ if (($('#cont-comp').height() + 10) > aside_height) { $('#aside-left').height($('#cont-comp').height() + 10); }else{ $('#aside-left').height(aside_height); } } cont_height = $('#cont-comp').height() + 10; }); }}); } );*/ $('#aside-left-toggler').toggle( function() { $('#aside-left-nav-wrap').animate({width:0}); $('#aside-left').animate({width:17}); $('#cont-comp').animate({width:$('#container').width() - 44}, {complete:function(){ $('#aside-left-toggler a').css('background','url("images/bgd_asideArrow4.gif") no-repeat scroll left 50%'); /*$('#sumup-compare').fadeIn('slow', function() { if (($('#cont-comp').height() + 10) < ($('html').height() - header_height)) { if (aside_height < ($('html').height() - header_height)){ $('#aside-left').height($('html').height() - header_height); } }else{ if (($('#cont-comp').height() + 10) > aside_height) { $('#aside-left').height($('#cont-comp').height() ); //+ 10); }else{ $('#aside-left').height(aside_height); } } cont_height = $('#cont-comp').height(); // + 10; });*/ }}); }, function() { // + 20 pour le scroll horizontal $('#aside-left').animate({width:323}); $('#aside-left-nav-wrap').animate({width:306}); $('#cont-comp').animate({width:$('#container').width() - 350}, {complete:function(){ $('#aside-left-toggler a').css('background','url("images/bgd_asideArrow.gif") no-repeat scroll left 50%'); /*$('#sumup-compare').fadeOut('slow', function() { if (($('#cont-comp').height() + 10) < ($('html').height() - header_height)) { if (aside_height < ($('html').height() - header_height)){ $('#aside-left').height($('html').height() - header_height); } }else{ if (($('#cont-comp').height() + 10) > aside_height) { $('#aside-left').height($('#cont-comp').height() );//+ 10); }else{ $('#aside-left').height(aside_height); } } cont_height = $('#cont-comp').height();// + 10; });*/ }}); } ); $('#aside-top-toggler').toggle( function() { var h1=$('#compare-product-list').height(); var h2=$('#fresultat').height(); $('#compare-product-list').animate({height:0}); $('#fresultat').animate({height:h2+h1},{complete:function() { $('#compare-product-list').css('display','none'); $('#aside-top-toggler a').css('background','url("images/bgd_asideArrow3.gif") no-repeat scroll center 50%'); }}); }, function() { var h=$('#cont-comp').height()*0.4; $('#compare-product-list').css('display','block'); $('#compare-product-list').animate({height:h}); $('#fresultat').animate({height:$('#fresultat').height()-h},{complete:function() { $('#aside-top-toggler a').css('background','url("images/bgd_asideArrow2.gif") no-repeat scroll center 50%'); }}); } ); // BEGIN script for data fetching from left bar above the table -- by NM $('#fmultimarques').load(function (){ $('#aside-left-toggler').bind('click', function(){ $('#brands span, #brands i, #nmbrsites span, #nmbrsites i, #reference span, #reference i').html(''); // to clear the HTML inside on closing the left bar if( $('#fmultimarques').attr('src')!='undefined'){ var prodName = $('#fmultimarques').contents().find('#expander-brand-wrap-wrap h4').text(); $('#prod').html(''+prodName+''); $('#fmultimarques').contents().find('#expander-brand-wrap input:checked').each(function(i){ var selectedBrands = $(this).prev('.checked').html(); var totalMarques = parseInt(i+1)+' marques : '; $('#brands i').html(totalMarques); $('#brands span').append(selectedBrands+','); }); $('#fmultimarques').contents().find('#expander-site-siteref input:checked ').each(function (i){ var selectedsites= $(this).prev('.checked').html(); var totalsites = parseInt(i+1)+' sites : '; $('#nmbrsites i').html(totalsites); $('#nmbrsites span').append(selectedsites+','); }); //start referencePosition script var referencePosition = $('#fmultimarques').contents().find('#amount').val(); var totalSites = $('#fmultimarques').contents().find('#vis_liste_npid li').size(); var currentPointer = totalSites-referencePosition; var currentSite = $('#fmultimarques').contents().find('#vis_liste_npid li:eq('+currentPointer+')').text(); $('#reference span').html('Référence : '+currentSite); // end } }) }) // END script for data fetching from left bar above the table // -- Global - Resize window -- if( $('#iframecontainer',window.parent.document).length > 0) { // +1 pour IE7, sinon probleme if( jQuery.support.boxModel ) $('#aside-left').height( $('#iframecontainer',window.parent.document).height() ); else $('#aside-left').height( $('#iframecontainer',window.parent.document).height() + 1); } $(window).resize(function() { $('#aside-left').height( $('#iframecontainer',window.parent.document).height() ); /* if ((cont_height > ($('html').height() - header_height)) || (aside_height > ($('html').height() - header_height))) { if (cont_height > aside_height) { $('#aside-left').height(cont_height); }else{ $('#aside-left').height(aside_height); } }else{ $('#aside-left').height($('html').height() - header_height); }*/ }); // -- Comparatif - On click on a family name in the left column -- $('#expander-family li a').click( function(){ //var txt = $(this).html(); //$(this).closest('#expander-family-brand').find('#expander-brand-wrap-wrap h4').html(txt); $('#expander-family-wrap-wrap').fadeOut('fast'); $('#fmultimarques').fadeIn('slow'); //$('#expander-brand-wrap-wrap').fadeIn('slow'); } ); // -- Comparatif - On click on back -- $('#expander-brand-wrap-wrap p').click( function(){ //var txt = ' '; $('#fmultimarques',window.parent.document).fadeOut('fast'); //$('#expander-brand-wrap-wrap').fadeOut('fast'); $('#span_profil_name',window.parent.parent.document).fadeOut('fast'); $('#expander-family-wrap-wrap',window.parent.document).fadeIn('slow'); //$('#expander-family-brand',window.parent.document).find('#expander-brand-wrap-wrap h4').html(txt); } ); // -- Comparatif - Tabs sec nav -- $('#nav-sec li').hover( function (){ $(this).addClass('active-nav-tab'); }, function (){ $(this).removeClass('active-nav-tab'); } ); // -- Comparatif - Hide div //$('#expander-brand-wrap-wrap').css('display','none'); // -- Panier produit - Hide div //$('#expander-brand-wrap-wrap-2').css('display','none'); //$('#expander-prodlist-wrap-wrap-2').css('display','none'); // -- Panier produit - On click on a family name in the left column -- $('#expander-family-2 li a').click( function(){ //var txt = $(this).html(); //$(this).closest('#expander-family-brand-2').find('#expander-brand-wrap-wrap-2 h4').html(txt); //$(this).closest('#expander-family-brand-2').find('#expander-prodlist-wrap-wrap-2 h4').html(txt); $('#expander-family-wrap-wrap-2').fadeOut('fast'); $('#marques').fadeIn('slow'); $('#expander-brand-wrap-wrap-2').fadeIn('slow'); } ); // -- Panier produit - On click on a brand name in the left column -- $('#expander-brand-wrap-wrap-2 li a').click( function(){ //var txt = $(this).html(); //$(this).closest('#expander-family-brand-2').find('#expander-prodlist-wrap-wrap-2 h5').html(txt); $('#marques',window.parent.document).fadeOut('fast'); //$('#expander-brand-wrap-2').fadeOut('fast'); $('#fproduits',window.parent.document).fadeIn('slow'); //$('#expander-prodlist-wrap-wrap-2',window.parent.document).fadeIn('slow'); } ); // -- Panier produit - On click on back -- $('#expander-brand-wrap-wrap-2 #expander-brand-retour').click( function(){ //var txt = ' '; $('#marques',window.parent.document).fadeOut('fast'); //$('#expander-brand-wrap-2').fadeOut('fast'); $('#expander-family-wrap-wrap-2',window.parent.document).fadeIn('slow'); //$(this).closest('#expander-family-brand-2').find('#expander-brand-wrap-wrap-2 h4').html(txt); //$(this).closest('#expander-family-brand-2').find('#expander-prodlist-wrap-wrap-2 h4').html(txt); } ); $('#expander-prodlist-wrap-wrap-2 #expander-prodlist-retour').click( function(){ //var txt = ' '; $('#fproduits',window.parent.document).fadeOut('fast'); //$('#expander-prodlist-wrap-wrap-2').fadeOut('fast'); //alert($('#expander-brand-wrap-2',window.parent.document)); //$('#expander-brand-wrap-2',window.parent.document).fadeIn('slow'); $('#marques',window.parent.document).fadeIn('slow'); //$(this).closest('#expander-family-brand-2').find('#expander-prodlist-wrap-wrap-2 h5').html(txt); } ); //pour fermer les popup de la toolbar $('.fancybox-close-btn').click( function(){ $('#fancybox-close').trigger('click'); } ); $('.btn-dl').click( function(){ $('#fancybox-close').trigger('click'); } ); // -- Global - Lightbox Popup -- if($("#various1").length > 0) { $("#various1").fancybox({ 'autoDimensions' : false, 'width' : 470, 'height' : 'auto', 'titleShow' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'overlayOpacity' : 0.75 }); } if($("#variousfdp").length > 0) { $("#variousfdp").fancybox({ 'autoDimensions' : false, 'width' : 470, 'height' : 'auto', 'titleShow' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'overlayOpacity' : 0.75 }); } if($("#variousxls").length > 0) { $("#variousxls").fancybox({ 'autoDimensions' : false, 'width' : 470, 'height' : 'auto', 'titleShow' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'overlayOpacity' : 0.75 }); } if($("#variousnvmenucontent").length > 0) { $("#variousnvmenucontent").fancybox({ 'autoDimensions' : false, 'width' : 470, 'height' : 'auto', 'titleShow' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'overlayOpacity' : 0.75 }); } if($("#variouscsv").length > 0) { $("#variouscsv").fancybox({ 'autoDimensions' : false, 'width' : 470, 'height' : 'auto', 'titleShow' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'overlayOpacity' : 0.75 }); } if($("#variouslettre").length > 0) { $("#variouslettre").fancybox({ 'autoDimensions' : false, 'width' : 470, 'height' : 'auto', 'titleShow' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'overlayOpacity' : 0.75 }); } // -- Header - Hide the div at the loading $(".black-nav-dd-wrap").css('overflow','visible'); }); // -- Comparatif - Vertical slider -- function nbsites() { if($("#nbsites").length > 0) { var nbsites = $("#nbsites").html(); $( "#slider-vertical" ).height($( "#expander-site" ).height() - 32 ); $( "#slider-vertical" ).slider({ orientation: "vertical", range: "min", min: 1, max: nbsites, value: nbsites, slide: function( event, ui ) { $( "#amount" ).val( ui.value ); } }); $( "#amount" ).val( $( "#slider-vertical" ).slider( "value" ) ); } }