$(document).ready(function(){$("#jq_listeUrl").change(function(){var dest=$(this).val();if(dest!=''){window.open(dest,'','');}});
//scroller
var vite=12;var normal=4;var btnTitle="Survoler pour accélérer, cliquer pour accélerer encore";var $currentContent=$("#scroller_content");var btnLId='scroll_leftbtn';var btnRId='scroll_rightbtn';var $btnL=$("<div></div>").attr({id:btnLId,title:btnTitle}).addClass('scroll_leftbtn disabL');var $btnR=$("<div></div>").attr({id:btnRId,title:btnTitle}).addClass('scroll_rightbtn disabR');function revert(dir){$currentContent.attr('direction',dir);$currentContent.attr('scrollAmount',vite);}
function restore(){$currentContent.attr('scrollAmount',normal);}
$btnL.bind("mouseover",function(){revert('right');$btnL.addClass('enabL').removeClass('disabL');}).bind("mouseout",function(){restore();$btnL.addClass('disabL').removeClass('enabL');}).bind("mousedown",function(){vite=vite*2;revert('right');}).bind("mouseup",function(){vite=vite/2;restore();}).end();$btnR.bind("mouseover",function(){revert('left');$btnR.addClass('enabR').removeClass('disabR');}).bind("mouseout",function(){restore();$btnR.addClass('disabR').removeClass('enabR');}).bind("mousedown",function(){vite=vite*2;revert('left');}).bind("mouseup",function(){vite=vite/2;restore();}).end();$currentContent.bind("mouseover",function(){this.stop();}).bind("mouseout",function(){this.start();}).end();$currentContent.before($btnL);$currentContent.before($btnR);var extendButton=function(){$actudefil=$('#actudefil');$scroller=$('#scroller');if($.browser.msie && $.browser.version<=7.0){$liswi=0;$scroller.find('li').each(function(){$liswi+=$(this).width();});$scroller.find('ul').css({'width':($liswi+($liswi*0.04))+'px'});}
else{var isWebkit=$.browser.safari;}
var btnTopId='scroll_topbtn';var $btnR2=$("<a href='#'></a>").attr({id:btnTopId,title:'Déplier/Replier'}).addClass('topClosed');$actudefil.prepend($btnR2);var scht_closed=$scroller.height();var scht_opened=scht_closed+150;var actp_closed=$actudefil.offset().top;var actp_opened=actp_closed-145;var scwh=$scroller.width()-50;var extended_css_main={'overflow-y':'scroll','overflow-x':'hidden','white-space':'normal','height':scht_opened+'px'};var contracted_css_main={'overflow':'hidden','white-space':'nowrap','height':scht_closed+'px'};var extended_css_lis={'float':'none'};var contracted_css_lis={'float':'left'};$marquee_html=$('#scroller_content');$static_html='<div id="scroller_content" class="scroller_content"><ol>'+$marquee_html.find('ul').html()+'</ol></div>';function etendre(){$scroller.stop().show().animate({"height":scht_opened},600);$actudefil.stop().animate({"top":actp_opened},600);$('#scroller_content').replaceWith($static_html);$('#scroller_content').css(extended_css_main).find('li').css(extended_css_lis);$btnL.hide();$btnR.hide();$('#'+btnTopId).addClass('topOpened').removeClass('topClosed');}
function contracter(){$scroller.stop().animate({"height":scht_closed},600);$actudefil.stop().animate({"top":actp_closed},600);$('#scroller_content').replaceWith($marquee_html);$('#scroller_content').css(contracted_css_main).find('li').css(contracted_css_lis).end().bind("mouseover",function(){this.stop();}).bind("mouseout",function(){this.start();});$btnL.show();$btnR.show();$('#'+btnTopId).addClass('topClosed').removeClass('topOpened');if(isWebkit){$('div.scroller .scroller_content').css({'overflow':'-webkit-marquee'});}}
$btnR2.toggle(etendre,contracter);}();$("#jq_fancybox").fancybox({'overlayOpacity':0.7,'zoomSpeedIn':500,'zoomSpeedOut':500,'overlayShow':false,'frameWidth':390,'frameHeight':205,'callbackOnStart':function(){$("#jq-fancy-button").css('visibility','hidden');},'callbackOnShow':function(){$("#jq-fancy-button").css('visibility','hidden');},'callbackOnClose':function(){$("#jq-fancy-button").css('visibility','visible');}}).click();
//CAST
$connection=$('#connection');LayerConnection=function(DepuisQuelCalque)
{$connection.toggle(DepuisQuelCalque==="connection");};$("#jq_showconn").mouseover(function(){LayerConnection('connection');});verif=function(){var $login=$('#login');if($login.val()===''||$login.val().length<=3){alert("Veuillez saisir votre login.");$login.focus();return false;}
var $pass=$('#pass');if($pass.value===''||$pass.val().length<=3){alert("Veuillez saisir votre mot de passe.");$pass.focus();return false;}};
});
