$(document).ready(function() { /*--------------- Home ---------------*/ if(document.getElementById('home_slide')){ $('#puces_home img.puce_home#0').css({opacity:"0.3"}); $('#puces_home #play_pause .play_home').css({display:"none"}); var play=true; var box_width = $('#home_container .home_box').width(); var slide_width = $('#home_container .home_box #home_slide').width(); var nbr_home = slide_width/box_width; var destination=0; var slide_home=function(direction){ pos_actu_home=destination; speed_home = 1000; if(direction == "left" && pos_actu_home < 0 ){ destination=Number(pos_actu_home)+box_width; }else if(direction == "left" && pos_actu_home >= 0){ destination=-box_width*nbr_home; speed_home = 1500; }else if(direction == "right" && pos_actu_home > -(slide_width-box_width)){ destination=pos_actu_home-box_width; }else if(direction == "right" && pos_actu_home <= -(slide_width-box_width)){ destination=0; speed_home = 2000; }else{ destination=-Number(direction)*box_width; } img_num=Math.abs(destination/box_width); $('.home_box #home_slide').stop(); $('.home_box #home_slide').animate({marginLeft:destination}, speed_home); $('#puces_home img').stop(); $('#puces_home img').animate({opacity:"1"}); //$('#puces_home img').css({filter:"alpha(opacity=100)"}); $('#puces_home img.puce_home#'+img_num).animate({opacity:"0.3"}); //$('#puces_home img.puce_home#'+img_num).css({filter:"alpha(opacity=30)"}); clearTimeout(int_home); if(play==true){ int_home = window.setTimeout(function(){slide_home('right');}, 8000); } }; $('#puces_home img.puce_home').click(function(){slide_home($(this).attr('id'))}); int_home = window.setTimeout(function(){slide_home('right');}, 8000); $('#puces_home #play_pause').toggle(function(){ play=false; clearTimeout(int_home); $('#puces_home #play_pause .pause_home').css({display:"none"}); $('#puces_home #play_pause .play_home').css({display:"inline"}); },function(){ slide_home('right'); play=true; int_home = window.setTimeout(function(){slide_home('right');}, 8000); $('#puces_home #play_pause .play_home').css({display:"none"}); $('#puces_home #play_pause .pause_home').css({display:"inline"}); }); } /*--------------- img ---------------*/ if(document.getElementById('images_slideshow')){ $('#puces_img img.puce_img#0').css({opacity:"0.3"}); $('#puces_img #play_pause .play_img').css({display:"none"}); var play=true; var box_width = $('#images_slideshow_box').width(); var slide_width = $('#images_slideshow_box #slide_images').width(); var nbr_img = slide_width/box_width; var destination=0; var slide_img=function(direction){ pos_actu_img=destination; speed_img = 1250; if(direction == "left" && pos_actu_img < 0 ){ destination=Number(pos_actu_img)+box_width; }else if(direction == "left" && pos_actu_img >= 0){ destination=-box_width*nbr_img; speed_img = 1750; }else if(direction == "right" && pos_actu_img > -(slide_width-box_width)){ destination=pos_actu_img-box_width; }else if(direction == "right" && pos_actu_img <= -(slide_width-box_width)){ destination=0; speed_img = 2250; }else{ destination=-Number(direction)*box_width; } img_num=Math.abs(destination/box_width); $('#images_slideshow_box #slide_images').stop(); $('#images_slideshow_box #slide_images').animate({marginLeft:destination}, speed_img); $('#puces_img img').stop(); $('#puces_img img').animate({opacity:"1"}); //$('#puces_img img').css({filter:"alpha(opacity=100)"}); $('#puces_img img.puce_img#'+img_num).animate({opacity:"0.3"}); //$('#puces_img img.puce_img#'+img_num).css({filter:"alpha(opacity=30)"}); clearTimeout(int_img); if(play==true){ int_img = window.setTimeout(function(){slide_img('right');}, 4000); } }; $('#puces_img img.puce_img').click(function(){slide_img($(this).attr('id'))}); int_img = window.setTimeout(function(){slide_img('right');}, 4000); $('#puces_img #play_pause').toggle(function(){ play=false; clearTimeout(int_img); $('#puces_img #play_pause .pause_img').css({display:"none"}); $('#puces_img #play_pause .play_img').css({display:"inline"}); },function(){ slide_img('right'); play=true; int_img = window.setTimeout(function(){slide_img('right');}, 4000); $('#puces_img #play_pause .play_img').css({display:"none"}); $('#puces_img #play_pause .pause_img').css({display:"inline"}); }); } /*--------------- Right sidebar ---------------*/ var right_sidebar_ajust=function(animate){ if($('#right_sidebar').height() < $('.content .box').height()+20){ var page_height=$('.content .box').height(); if(animate==0){ $('#right_sidebar .sidebar_content').css({height:page_height}); }else{ $('#right_sidebar .sidebar_content').animate({height:page_height}, animate); } } } if(document.getElementById('right_sidebar')){ right_sidebar_ajust(0) } /*--------------- Ajust Scroll Size for Touchscreen ---------------*/ /*var ajustScrollSize=function(){ if($('#scroll_touchscreen').hasClass('scroll-pane')){ newHeightTotal = $('#global').height(); newHautTouch = window.innerHeight; $('div#scroll_touchscreen_total').css({height:newHeightTotal}); $('div#scroll_touchscreen').css({height:newHautTouch}).addClass('scroll-pane'); $('.scroll-pane').jScrollPane(); } }*/ var ajustScrollSize=function(){ if(document.getElementById('touchscreen_body')){ $('#full-page-container').jScrollPane(); } } /*--------------- More infos ---------------*/ if(document.getElementById('right_sidebar')){ var newHeightTotal = 0; var newHautTouch = 0; $('#details_infos_button').toggle(function(){ $('.details_infos').slideDown(1000, function(){ //right_sidebar_ajust(500); ajustScrollSize(); }); $('#details_infos_button #more_infos').hide(); $('#details_infos_button #hide_infos').show(); }, function(){ $('.details_infos').slideUp(1000, function(){ //right_sidebar_ajust(500); ajustScrollSize(); }); $('#details_infos_button #hide_infos').hide(); $('#details_infos_button #more_infos').show(); }); } /*--------------- Search ---------------*/ if(document.getElementById('search_box')){ $('#header #open_search').toggle(function(){ $('#search_box').slideDown(500); $('#identification').slideUp(500); }, function(){ $('#search_box').slideUp(500); }); } /*--------------- Login ---------------*/ if(document.getElementById('identification')){ $('#header #open_login').toggle(function(){ $('#identification').slideDown(500); $('#search_box').slideUp(500); }, function(){ $('#identification').slideUp(500); }); } /*--------------- Kategorien ---------------*/ if(document.getElementById('kategorien')){ $('#button_header2 #kategorien').toggle(function(){ $('#menu_object').slideDown(500); }, function(){ $('#menu_object').slideUp(500); }); } /*--------------- Infos Map ---------------*/ if(document.getElementById('infos_map')){ var height_infos_map = $('#infos_map').height()+20; $('#infos_map').css({marginTop:-height_infos_map}); } /*--------------- scroll menu ---------------*/ var hauteur_smenu=new Array; var pos_deroule_parent=new Array; var pos_deroule_menu=new Array; var menu_deroule=function(i){ hauteur_smenu[i]= $('#navigation div.menu_deroulant.deroule'+i).css("height"); $('#navigation div.menu_deroulant.deroule'+i).parent().hover(function(){ pos_deroule_parent[i]=$('#navigation div.menu_deroulant.deroule'+i).parent().position(); pos_deroule_menu[i]=pos_deroule_parent[i].left; $('#navigation div.menu_deroulant.deroule'+i).css({left:pos_deroule_menu[i]}); $(this).addClass('scroll_selected'); $('#navigation div.menu_deroulant.deroule'+i).stop().css({height:hauteur_smenu[i]}).slideDown(600); },function(){ $('#navigation div.menu_deroulant.deroule'+i).stop().css({height:hauteur_smenu[i]}).slideUp(600, function(){ $('#navigation div.menu_deroulant.deroule'+i).parent().removeClass('scroll_selected'); }); }); } if($('#navigation div').hasClass('menu_deroulant')){ for(i=1; i<=1; i++){ menu_deroule(i); } } /*--------------- Intro ---------------*/ if(document.getElementById('intro_container')){ var ratioIntro = 1680/1050; var widthWin = (document.body.clientWidth); if (self.innerHeight) {// all except Explorer var heightWin = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode var heightWin = document.documentElement.clientHeight; } else if (document.body) { // other Explorers var heightWin = document.body.clientHeight; } $('#intro_container').css({height:heightWin}); var ratioWin = widthWin/heightWin; if(ratioWin>=ratioIntro){ heightWin=widthWin/ratioIntro; }else{ widthWin=heightWin*ratioIntro; } if(widthWin>=1680 || heightWin>=1050){ widthWin=1680; heightWin=1050; } $('#intro_flash').css({marginTop:-(heightWin/2),marginLeft:-(widthWin/2)}); var linkIndex=$('#intro_flash').attr("href"); $('#intro_flash').flash({ swf:'/specific/interface/intro.swf', width: widthWin, height: heightWin, wmode: 'transparent', flashvars: { bg_img: '/specific/files/intro/intro.jpg', /*bg_img: '/specific/interface/intro/intro.jpg',*/ end_link: linkIndex, stageWidth: widthWin, stageHeight: heightWin } }); } /*--------------- Scroll-Pane ---------------*/ if($('.ref_content div').attr('class')=='scroll-pane'){ $('.scroll-pane').jScrollPane(); } /*--------------- LightBox ---------------*/ var lbLinks = $('a.lightbox'); if (lbLinks.length) lbLinks.lightBox(); /*--------------- Flash Presentation ---------------*/ if(document.getElementById('flash_video_presentation')){ $('#flash_video_presentation').flash({ swf:'/specific/interface/video/presentation.swf', width: 364, height: 242, wmode: 'transparent' }); } });