var disappeardelay=250,enableanchorlink=0,hidemenu_onclick=1,ie5=document.all,ns6=document.getElementById&&!document.all;function getposOffset(a,b){for(var c="left"==b?a.offsetLeft:a.offsetTop,d=a.offsetParent;null!=d;)c="left"==b?c+d.offsetLeft:c+d.offsetTop,d=d.offsetParent;return c}function showhide(a,b,c,d){if(ie5||ns6)dropmenuobj.style.left=dropmenuobj.style.top=-500;if("click"==b.type&&a.display==d||"mouseover"==b.type)a.display=c;else if("click"==b.type)a.display=d}
function iecompattest(){return document.compatMode&&"BackCompat"!=document.compatMode?document.documentElement:document.body}
function clearbrowseredge(a,b){var c=0;if("rightedge"==b){var d=ie5&&!window.opera?iecompattest().scrollLeft+iecompattest().clientWidth-15:window.pageXOffset+window.innerWidth-15;dropmenuobj.contentmeasure=dropmenuobj.offsetWidth;d-dropmenuobj.x<dropmenuobj.contentmeasure&&(c=dropmenuobj.contentmeasure-a.offsetWidth)}else{var e=ie5&&!window.opera?iecompattest().scrollTop:window.pageYOffset,d=ie5&&!window.opera?iecompattest().scrollTop+iecompattest().clientHeight-15:window.pageYOffset+window.innerHeight-
18;dropmenuobj.contentmeasure=dropmenuobj.offsetHeight;d-dropmenuobj.y<dropmenuobj.contentmeasure&&(c=dropmenuobj.contentmeasure+a.offsetHeight,dropmenuobj.y-e<dropmenuobj.contentmeasure&&(c=dropmenuobj.y+a.offsetHeight-e))}return c}
function dropdownmenu(a,b,c){window.event?event.cancelBubble=!0:b.stopPropagation&&b.stopPropagation();if("undefined"!=typeof dropmenuobj)dropmenuobj.style.display="none";clearhidemenu();if(ie5||ns6){a.onmouseout=delayhidemenu;dropmenuobj=document.getElementById(c);if(hidemenu_onclick)dropmenuobj.onclick=function(){dropmenuobj.style.display="none"};dropmenuobj.onmouseover=clearhidemenu;dropmenuobj.onmouseout=ie5?function(){dynamichide(event)}:function(a){dynamichide(a)};showhide(dropmenuobj.style,
b,"block","none");dropmenuobj.x=getposOffset(a,"left");dropmenuobj.y=getposOffset(a,"top");dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(a,"rightedge")+"px";dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(a,"bottomedge")+6+a.offsetHeight+"px"}return clickreturnvalue()}function clickreturnvalue(){return(ie5||ns6)&&!enableanchorlink?!1:!0}function contains_ns6(a,b){for(;b.parentNode;)if((b=b.parentNode)==a)return!0;return!1}
function dynamichide(a){ie5&&!dropmenuobj.contains(a.toElement)?delayhidemenu():ns6&&a.currentTarget!=a.relatedTarget&&!contains_ns6(a.currentTarget,a.relatedTarget)&&delayhidemenu()}function delayhidemenu(){delayhide=setTimeout("dropmenuobj.style.display='none'",disappeardelay)}function clearhidemenu(){"undefined"!=typeof delayhide&&clearTimeout(delayhide)}
function Verif_recherche(){if(""==document.recherche.q.value)return alert("Merci de bien vouloir saisir un texte \u00e0 rechercher."),document.recherche.q.value="",document.recherche.q.focus(),!1;return"Tapez ici..."==document.recherche.q.value?(alert("Merci de bien vouloir saisir un texte \u00e0 rechercher."),document.recherche.q.value="",document.recherche.q.focus(),!1):!0}
$(function(){$("#q").SearchForm();$("#q3").SearchForm();$("#recherche_menu").VerifSearchForm("#q");$("#recherche_main").VerifSearchForm("#q2");$("#recherche_comp").VerifSearchForm("#q3");$("#bookmark").AddBookmark()});$.fn.SearchForm=function(){return this.focus(function(){if(this.value==this.defaultValue)this.value=""}).blur(function(){if(!this.value.length)this.value=this.defaultValue})};
$.fn.VerifSearchForm=function(a){return this.submit(function(){if($(a).val()==$(a).prop("defaultValue")||""==$(a).val())return alert("Saissez la r\u00e9f\u00e9rence de la cartouche ou de l'imprimante que vous recherchez."),$(a).focus(),!1})};
$.fn.AddBookmark=function(){return this.click(function(){try{window.sidebar?window.sidebar.addPanel("Tinkco, cartouches \u00e0 prix discount !","http://www.tinkco.com",""):window.external?window.external.AddFavorite("http://www.tinkco.com","Tinkco, cartouches \u00e0 prix discount !"):window.opera?($(this).attr("rel","sidebar"),$(this).attr("href","http://www.tinkco.com"),$(this).attr("title","Tinkco, cartouches \u00e0 prix discount !"),$(this).click()):alert("Votre navigateur ne supporte pas cette fonction. Merci de bien vouloir ajouter manuellement notre site \u00e0 vos sites pr\u00e9f\u00e9r\u00e9s.")}catch(a){alert("Une erreur est survenue lors de l'ajout aux favoris.")}return!1})};
