 $(document).ready(function(){
	var boxshown = false;
	var over = false;

	$("#click_for_more").hover(
		function(){
			over=true;
			$(this).attr("src",boxshown?less_lawyers_on:more_lawyers_on);
		},
		function(){
			over=false;
			$(this).attr("src",boxshown?less_lawyers:more_lawyers);
		}
	);

	$("#click_for_more").click(function () {

		if ($("#other_lawyers").is(":hidden")) {
			boxshown=true;
			if (!homepage){
				$("#other_lawyers").slideDown("slow");
			} else {
				$("#other_lawyers").show();
			}
		} else {
			boxshown=false;
			if (!homepage){
				$("#other_lawyers").slideUp("slow");
			} else {
				$("#other_lawyers").hide();
			}
		}

		if (over){
			$("#click_for_more").trigger('mouseover');
		} else {
			$("#click_for_more").trigger('mouseout');
		}
		return false;
	});


	$('.loggedin').hover(
		function(){
			$('.icon_container',this).css('display','block');
			$(this).css('border','1px dashed red');
		},
		function(){
			$('.icon_container',this).css('display','none');
			$(this).css('border','0px dashed red');
		}

	);
	$('span#invisible').click(function(){
		eraseCookie('PHPSESSID');
		var pg=''
		try{
			if (current_page_id) pg='&redirect='+current_page_id;
		} catch(e){};
		document.location.replace('index.php?page=login'+pg);
		
	})

	function eraseCookie(name) {createCookie(name,"",-1);}
	function createCookie(name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}



 });

