function trim(str){str=str.replace(/^\s+/,'');for(var i=str.length-1;i>=0;i--){if(/\S/.test(str.charAt(i))){str=str.substring(0,i+1);break}}return str};$(document).ready(function(){if(window.attachEvent){sfHover()}loginAnimInit();initSearchPopUp();deroulerAuto();popunderLinks();var theHeight=$(".tx-sgemissions-pi1 .content_box").innerHeight();var myPadding=$(".tx-sgwarrantssearch-pi1 .content_box:eq(0)").innerHeight()-$(".tx-sgwarrantssearch-pi1 .content_box:eq(0)").height();$(".tx-sgwarrantssearch-pi1 .content_box").css('height',theHeight-myPadding+'px');$("form[class*='form1']").jForms({listSize:20,imagePath:'fileadmin/templates/images/form1/'});$("form[class*='form2']").jForms({listSize:10,imagePath:'fileadmin/templates/images/form2/'});$("form[class*='form3']").jForms({listSize:10,imagePath:'fileadmin/templates/images/form3/'});$("form[class*='form4']").jForms({listSize:10,imagePath:'fileadmin/templates/images/form4/'});$("form[class*='form5']").jForms({listSize:10,imagePath:'fileadmin/templates/images/form5/'});$("span[class*='form5']").jForms({listSize:10,imagePath:'fileadmin/templates/images/form5/'});$("form[class*='form9']").jForms({listSize:10,imagePath:'fileadmin/templates/images/form9/'});$("form[class*='form_date']").jForms({listSize:10,imagePath:'fileadmin/templates/images/form5_5/'});$("div[class*='form4']").jForms({listSize:10,imagePath:'fileadmin/templates/images/form4/'});$("div[class*='inpt_pass']").jForms({listSize:20,imagePath:'fileadmin/templates/images/form1/'});$("div[class*='login_input']").jForms({listSize:20,imagePath:'fileadmin/templates/images/login/'});$('.popover').cluetip({cluetipClass:'default tipgoright',sticky:true,closePosition:'title',closeText:'<img src="fileadmin/templates/images/css/cluetip-close-default.gif" />',showTitle:true,ajaxCache:true,dropShadow:false,positionBy:'mouse',width:500,height:300,leftOffset:-15,waitImage:true,cluezIndex:'2001',local:false,fx:{open:'fadeIn',openSpeed:'fast'}});$('.tx-damsglieniframe-pi1 iframe').load(function(){var arrPageSizes=___getPageSize();var hauteur=parseInt(arrPageSizes[3]*95/100);$(this).height(hauteur)});$(window).resize(function(){var arrPageSizes=___getPageSize();var hauteur=parseInt(arrPageSizes[3]*95/100);$('.tx-damsglieniframe-pi1 iframe').height(hauteur)})});function popunderLinks(){$('a[@class*="popunder"]').click(function(){var width=500;var height=0;var rel=$(this).attr('rel');if(rel.length>0){var reg=new RegExp("[,]+","g");var tab=rel.split(reg);if(tab.length==2){if(tab[0]>0)width=tab[0];if(tab[1]>0)height=tab[1]}}popunder('',$(this).attr('href'),width,height);return false})};function sfHover(){$('#menu_haut li').hover(function(){$(this).addClass('sfhover')},function(){$(this).removeClass('sfhover')})};var showSearchPopUpLastVal='';var showSearchPopUpTicket=0;function initSearchPopUp(){$('#recherche_val').cluetip({cluetipClass:'default tipgoleft',activation:'keyup',attribute:'alt',positionBy:'fixed',leftOffset:'-385',topOffset:'27',width:'400',sticky:true,closePosition:'top',closeText:'<img src="fileadmin/templates/images/css/cluetip-close-default.gif" />',showTitle:false,ajaxCache:false,dropShadow:false,cluezIndex:'1011',waitImage:true,onActivate:function(e){var searchText=$(e).val();searchText=searchText.replace(new RegExp("'",'g'),"\\'");switch(showSearchPopUpTicket){case 0:setTimeout('showSearchPopUp(\''+searchText+'\')',500);return false;break;case 1:showSearchPopUpTicket=0;return true;break}return false},fx:{open:'fadeIn',openSpeed:'fast'},globalFilterLength:true,globalFilterLengthMin:3,globalFilterLengthError:$('#recherche_form legend.tooshort').html(),globalFilterIsin:true,globalFilterIsinLengthMin:8,globalFilterIsinLengthError:$('#recherche_form legend.isintooshort').html(),globalShortWordsAllowed:$('#recherche_form legend.shorters').html()})};function showSearchPopUp(searchText){if(searchText.toString()==$('#recherche_val').val().toString()&&showSearchPopUpLastVal.toString()!=$('#recherche_val').val().toString()){showSearchPopUpLastVal=searchText;showSearchPopUpTicket=1;$('#recherche_val').keyup()}};function switchTab(objClick){var objParentLi=$(objClick).parents('li:eq(0)');var objParentTab=$(objClick).parents('div[class*="tabbedParent"]:eq(0)');var classe=$(objParentLi).attr('class');$(objParentTab).find('a').removeClass('actif');$(objClick).addClass('actif');$(objParentTab).find('div[class*="tabbedMain"]:visible').fadeOut(400,function(){$(objParentTab).find('div[class*="tabbedMain '+classe+'"]').fadeIn(300)});return false};function numberedLoad(clickedObj,urlStr){var containerObj=$(clickedObj).parents('div[class*="numberedParent"]').get(0);urlStr=urlStr.replace(new RegExp('&amp;','g'),'&');var height=$(containerObj).height();var width=$(containerObj).width();$(containerObj).html('');$(containerObj).addClass('loading');$(containerObj).height(height);$(containerObj).width(width);$(containerObj).load(urlStr,function(){$(containerObj).hide();$(containerObj).removeClass('loading');$(containerObj).height('');$(containerObj).width('');$(containerObj).fadeIn('fast')});return false};function tabbedLoad(clickedObj,urlStr){var containerObj=$(clickedObj).parents('div[class*="tabbedParent"]').get(0);containerObj=$(containerObj).find('div[class*="tabbedMain"]').get(0);urlStr=urlStr.replace(new RegExp('&amp;','g'),'&');var height=$(containerObj).height();$(containerObj).html('');$(containerObj).addClass('loading');$(containerObj).height(height);var parentObj=$(clickedObj).parents('ul').get(0);$(parentObj).find('a').removeClass('actif');$(clickedObj).addClass('actif');$(clickedObj).blur();$(containerObj).load(urlStr,function(){$(containerObj).hide();$(containerObj).removeClass('loading');$(containerObj).height('');$(containerObj).fadeIn('fast')});return false};function loginAnimInit(){$('#Login').one("focus",function(){loginAnim()}).one("focus",function(){$(this).val('')});$('#loginpassfield input#password').focus(function(){$(this).unbind();var id=$(this).attr('id');var name=$(this).attr('name');var css=$(this).attr('class');var size=$(this).attr('size');$(this).replaceWith('<input type="password" value="" id="'+id+'" size="'+size+'" name="'+name+'" class="'+css+'" />');$('#'+id).focus()});return true};function loginAnim(){$('label[for="Login"]').hide();$('label[for="Login"]').after('<label id="LoginJquery"><img src="fileadmin/templates/images/contenu/login_close.gif" /></label>');$('#recherche_form').hide();$('#loginpassfield:hidden').fadeIn('slow');$('.form form.login').width('350px');$('label#LoginJquery').click(function(){$('#loginpassfield').hide();$('.form form.login').width('220px');$('#recherche_form').fadeIn('slow');$(this).remove();$('label[for="Login"]').show();$('#Login').one("focus",function(){loginAnim()})})};function deroulerAuto(){$('div[class*="lien_droulant"]').hover(function(){$(this).next('ul').show()},function(){$(this).next('ul').hide()});$('ul[class*="menu_deroulant"]').hover(function(){$(this).show()},function(){$(this).hide()});return true};function loginStatus(){var div=$('div[class="loginStatus"]');$(div).find('script').remove();var content=$(div).html();$(div).remove();popunder(content,'','500');return true};function paginationActu(objParent,nbr,page){page=parseInt(page,0);nbr=parseInt(nbr,0);$(objParent).find('ul li').show();$(objParent).find('ul li:lt('+((page*nbr)-1)+')').hide();$(objParent).find('ul li:gt('+(((page+1)*nbr)-1)+')').hide();var total=$(objParent).find('ul li').length;var pages=Math.ceil(total/nbr);$(objParent).find('div[class*="pagination_biz"]').each(function(){if(pages==1){$(this).remove()}$(this).find('img').unbind().css('cursor','auto').show().each(function(){$(this).attr('src',$(this).attr('src').replace(new RegExp('-disabled.gif','g'),'.gif'))});$(this).find('img:eq(0)').click(function(){paginationActu(objParent,nbr,0)}).css('cursor','pointer');$(this).find('img:eq(3)').click(function(){paginationActu(objParent,nbr,(pages-1))}).css('cursor','pointer');if(page==0){$(this).find('img:lt(2)').each(function(){$(this).attr('src',$(this).attr('src').replace(new RegExp('.gif','g'),'-disabled.gif'))}).css('cursor','auto')}else{$(this).find('img:eq(1)').click(function(){paginationActu(objParent,nbr,(page-1))}).css('cursor','pointer')}if((page+1)==pages){$(this).find('img:gt(1)').each(function(){$(this).attr('src',$(this).attr('src').replace(new RegExp('.gif','g'),'-disabled.gif'))}).css('cursor','auto')}else{$(this).find('img:eq(2)').click(function(){paginationActu(objParent,nbr,(page+1))}).css('cursor','pointer')}$(this).find('select').unbind().html('');for(i=0;i<pages;i++){$(this).find('select').append('<option value="'+i+'">'+(i+1)+'</option>')}$(this).find('select option:eq('+page+')').attr('selected','selected');$(this).find('select').change(function(){paginationActu(objParent,nbr,this.value)})})};function popunder(content,url,width,height){var style='';var arrPageSizes=___getPageSize();if(typeof(width)!="undefined"&&width>0){style='width:'+width+'px;'}if(typeof(height)!="undefined"&&height>0){if(height>arrPageSizes[1])height=arrPageSizes[1];style=style+'height:'+height+'px;'}$('embed, object, select').css({'visibility':'hidden'});if(typeof(url)!="undefined"&&url!=""){url=url.replace(new RegExp('&amp;','g'),'&');$('body').prepend('<div id="popunder-overlay"></div><div id="popunder-lightbox"><iframe src="" frameborder="0" scrolling="yes" id="popunder-container" name="popunder-container" style="'+style+'"></iframe><a href="#" id="popunder-close" style="'+style+'"><span class="right_sub">&nbsp;</span><span class="center_sub">Fermer</span><span class="left_sub">&nbsp;</span></a></div>');$('#popunder-lightbox iframe').attr('src',url)}else{$('body').prepend('<div id="popunder-overlay"></div><div id="popunder-lightbox"><div id="contentbox" style="'+style+'">'+content+'</div><a href="#" id="popunder-close" style="'+style+'"><span class="right_sub">&nbsp;</span><span class="center_sub">Fermer</span><span class="left_sub">&nbsp;</span></a></div>')}$('#popunder-overlay').css({backgroundColor:'#050000',opacity:'0.7',width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn('slow');var arrPageScroll=___getPageScroll();$('#popunder-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#popunder-overlay,#popunder-close').click(function(){popunder_kill();return false});$(window).resize(function(){popunder_overlayresize()});$('#popunder-lightbox iframe').load(function(){var hauteur=parseInt(this.contentWindow.document.body.offsetHeight,10);if(hauteur>parseInt(8*arrPageSizes[3]/10,10)){hauteur=parseInt(8*arrPageSizes[3]/10,10)}$(this).animate({height:hauteur+'px'},400)});$(document).ready(function(){popunder_overlayresize()});return false};function popunder_kill(){$('#popunder-lightbox').slideUp('fast',function(){$('#popunder-overlay').fadeOut('fast',function(){$('embed, object, select').css({'visibility':'visible'});$('#popunder-lightbox').remove();$('#popunder-overlay').remove()})})};function popunder_overlayresize(){var arrPageSizes=___getPageSize();$('#popunder-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#popunder-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});var hauteur=$('#popunder-lightbox #contentbox').height();if(hauteur>parseInt(8*arrPageSizes[3]/10,10)){hauteur=parseInt(8*arrPageSizes[3]/10,10)}$('#popunder-lightbox #contentbox').animate({height:hauteur+'px'},400)};function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight}var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth}else{windowWidth=self.innerWidth}windowHeight=self.innerHeight}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight}if(yScroll<windowHeight){pageHeight=windowHeight}else{pageHeight=yScroll}if(xScroll<windowWidth){pageWidth=xScroll}else{pageWidth=windowWidth}arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize};function ___getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft}arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll};