var tab="#puzzles";
var confObject = {
		iconMinSide : 75,
		iconMaxSide : 150,
		distAttDock : 150,
		coefAttDock : 2,	
		veloOutDock : 500,
		valign: 'middle'
	}

function Logout(){
if (confirm("Voulez-vous vraiment vous déconnecter ?")) { 
document.location="puzzles.php?mod=users&page=login&action=logout&nextpage=home";
}

}

function toggle(){

if (document.f.skip.value>0) { setCookie('skiphome',1,'','/');}
else {setCookie('skiphome',0,'','/');}

}


function random(){
document.location='puzzles.php?page=detail&puzzle=puzzleday';
return false;
}

function searchpuzzle(key){
var url='http://www.rue-des-puzzles.com/catalogue/search.php?motcle=';
if (key) url=url+key;
document.location="http://action.metaffiliation.com/suivi.php?mclic=S31CF4255317&IDENT=&redir="+escape(url);
return false;
}


function afftab(item){

$('#cards').hide();
$('#puzzles').hide();
$('#tags').hide();

$(item).show();

tab=item;

}
		


function sendform(){

if (tab=="#tags") {searchpuzzle(document.f.key.value) ; return false;}
if (tab=="#cards") {document.f.displaymode.value=2 ; document.f.submit();}
if (tab=="#puzzles") {document.f.displaymode.value=0 ; 

if (!document.f.key.value) {document.f.page.value='';}

document.f.submit();}

}

function sf(){document.f.key.focus()}
window.gbar={};(function(){var b=window.gbar,c,g,h;function n(d,f,e){d.visibility=h?"hidden":"visible";d.left=f+"px";d.top=e+"px"}b.tg=function(d){var f=0,e=0,a,i=0,o,l=window.navExtra,m,j=document,k=0;g=g||j.getElementById("gbar").getElementsByTagName("span");(d||window.event).cancelBubble=!i;if(!c){c=j.createElement(Array.every||window.createPopup?"iframe":"DIV");c.frameBorder="0";c.scrolling="no";c.src="#";g[7].parentNode.appendChild(c).id="gbi";if(l&&g[7])for(o in l){m=j.createElement("span");m.appendChild(l[o]);g[7].parentNode.insertBefore(m,g[7]).className="gb2"}j.onclick=b.close}while(a=g[++i]){if(e){n(a.style,e+1,f+25);k=Math.max(k,a.firstChild.tagName=="A"&&a.offsetWidth);f+=a.firstChild.tagName=="DIV"?9:20}if(a.className=="gb3"){do e+=a.offsetLeft;while(a=a.offsetParent)}}{i=0;while(a=g[++i]){if(a.className=="gb2")a.style.width=k+"px"}c.style.width=k+"px"}c.style.height=f+"px";n(c.style,e,24);h=!h};b.close=function(d){h&&b.tg(d)}})();




jQuery(function() {
	   afftab(tab);
	   jQuery("#Bar").addDockEffect(confObject);
	   });

