function closeBox() {
		$("#boxTab").show('slide', {direction: 'right'});
	}
function openBox() {
	$("#newPoly").dialog( 'open' );
	$("#boxTab").hide('slide', {direction: 'right'});
	var boxTab = document.getElementById("boxTab");
	if(boxTab)
		boxTab.style.display = "none";

}
function noMargin() {
	

}
jQuery.fn.delay = function(time,func){
	this.each(function(){
		setTimeout(func,time);
	});
	
	return this;
};
function fillModal(content){
	$("#modal").html("<img id='modalImg' src='" + content + "' />");
	$(this).delay(1000, function(){
	
	$("#modal").show().bind('click', function() {emptyModal();});
	var myW = $("#modal").width();
	var nW = (myW/2)*(-1);
	$("#modal").css("margin-left", nW);
	});
}

function emptyModal() {

	$("#modal").hide("slow");
}

