$(document).ready(function (){
	$(".PHO").tipsy({gravity:'s'});
});

function centerize(wid){maskin();var yoff=window.pageYOffset; var divWidth=$("#"+wid).width();var w=window.document.body.clientWidth;var h=window.document.body.clientHeight;	var lpos=(w-divWidth)/2;
	$("#"+wid).css({left:lpos+"px",top:yoff+30+"px"}).show();
	/* $("#"+wid).animate({
		top: yoff+30+5+"px"
	},"fast"); */
}
function closewin(divid){
	$("#"+divid).hide();
	maskout();
}

function maskin(){var w=window.document.body.clientWidth;var h=window.document.body.clientHeight;$(".mask").css({ width: w, height: h}).show();}
function maskout(){$(".mask").hide();}

function gotophoto(p,file){
	$("#photo_proper").html("").addClass("photo_proper");
	$(".tipsy").hide();
	$("#profiler").fadeOut(500);
	$("#quick-nav").slideDown(400);
	
	setTimeout(function(){
		var im=new Image();
		//http://jqueryfordesigners.com
		$(im).load(function () {
			//$(this).css('display', 'none'); // .hide() doesn't work in Safari when the element isn't on the DOM already            
			$(this).hide();
			$('#photo_proper').removeClass('photo_proper').html(this);
			$(this).fadeIn();
		})
		.error(function () {
			// notify the user that the image could not be loaded
		}).attr('src', 'images/photos/xl'+file);	
		document.location.hash='images/photos/xl'+file;
	},1000);
}

function twitterShare(status){
	window.open("http://twitter.com/home?status="+status,"_twitter","width=500,height=500");
}

function FBshare(l){
	window.open("http://www.facebook.com/sharer.php?"+l,"_fbshared","width=500,height=500");
}

function filterTo(memtype){
	document.location.href='listmembers.php?mtype='+memtype;
	// /* var qmark=/\?/;
	// var add=document.location.href;
	// var present=add.search(qmark);
	// if(present!= -1){
		// document.location.href=(add.replace(/&mtype=[0-9]*/,""))+"&mtype="+memtype;
	// }else{
		// document.location.href=(add.replace(/&mtype=[0-9]*/,""))+"?&mtype="+memtype;
	// }
}

