var shiftPictureTimer;$(document).ready(init);function init()
{ensureSize();shiftPicture(SHIFT_URL,true);defer_ads();}
$(window).resize(function()
{defer_ads();});function switchPod()
{id=$(this).attr("id").split("_")[1];popPodA=$("#popPodContent").children('a')[id-1];if(popPodA.title){popPodA.innerHTML='';dossierImg=document.createElement('img');dossierImg.width='232';dossierImg.src=popPodA.title;popPodA.appendChild(dossierImg);$("#poppod_"+id).children('img').addClass('linkImage');popPodA.removeAttribute('title');}
$(".popPodMainPic").css("display","none");$("#poppod_"+id).css("display","block");}
function ensureSize()
{c1Height=$("#majojColumn1").height();c2Height=$("#majorColumn2").height();if(c1Height<c2Height)
$("#majojColumn1").height($("#majorColumn2").height());}
function closepopup(url)
{if(opener)
{opener.location.href=url;self.close();return false;}else{document.location=url;return true;}}
function goFakeLink()
{closepopup($(this).children("a.fakeLink").attr("href"));}
function shiftPicture(url,isAutomated)
{shiftDelay=5000;if(isAutomated)
shiftPictureTimer=setTimeout("window.location.href = '"+url+"'",shiftDelay);else
clearTimeout(shiftPictureTimer);}
function defer_ads()
{$('div.defer_ads').each(function()
{var id=$(this).attr('id').replace(/_DEFER_ADS/,'');var pos=$("#"+id).offset();if(pos)
{$(this).css({"left":pos.left+"px","top":pos.top+"px"});$("#"+id).height($(this).height()+5);$("#"+id).width($(this).width());}});}
function ensure_ads()
{count_ensure_ads++;if(count_defer_ads<count_ensure_ads&&window.location.pathname!="/jail_publicite.php")
{window.location="/jail_publicite.php?origine="+encodeURIComponent(window.location.href);}}
function truncate_kelkoo_description(emplacement,longueur)
{$(emplacement+' .name').each(function(){if($(this).children('a').text().length>longueur)
{$(this).children('a').text($(this).children('a').text().toUpperCase().substring(0,1)+$(this).children('a').text().toLowerCase().substring(1,longueur)+'...');}else{$(this).children('a').text($(this).children('a').text().toLowerCase());}});}
var count_defer_ads=0;var count_ensure_ads=0;$(".fakeClickZone").click(goFakeLink);$(".picItem").mouseover(switchPod);$("#dsArrows #pause").click(shiftPicture);
