var arrow_prev = "left";
dojo.require("dojo.fx");
dojo.require("dijit.Dialog");
dojo.require("dijit.form.TextBox");
dojo.require("dijit.form.Button");
dojo.require("dojo.parser");

dojo.addOnLoad(function(){
	dojo.connect(document.getElementById("prev_search_button"), 'onclick', perv_search);
});

function perv_search(){
	if(document.getElementById("prev_search").hasChildNodes()){
		var wipeOut = dojo.fx.wipeOut({node: "prev_search",duration: 500});
		var wipeIn = dojo.fx.wipeIn({node: "prev_search",duration: 500});
		var currentAnimation;
		if(arrow_prev == "left"){ //on change la flèche et on met down
			var button = document.getElementById("prev_search_button");
			var img = button.getElementsByTagName("img")[0];
			img.setAttribute("src","../images/puce_down.gif");
			arrow_prev = "down";
			currentAnimation = wipeIn;
		}
		else{
			var button = document.getElementById("prev_search_button");
			var img = button.getElementsByTagName("img")[0];
			img.setAttribute("src","../images/puce.gif");
			arrow_prev = "left";
			currentAnimation = wipeOut;
		}
		currentAnimation.play();
	}
}
