$(document).ready(/* This code was edited by Dave Navarro; dave@officeautomatedsystems.com */
	function(){
		var pageTypeId = 0;
		var tText = $('title').get(0).text;
		
		if(tText.search(/Patients/) > 0){pageTypeId = 2;}
		if(tText.search(/Physicians/) > 0){pageTypeId = 2;}		
		
		if(pageTypeId == 0){//Common Dialog Box
			$('div#name').hide();
			$('div#phone').hide();
			$('div#city').hide();
			$('div#state').hide();
			$('div#zip').hide();
			$('div#title').hide();
			//$('div#email').hide();
			//$('div#subject').hide();
			$('#dialog').dialog({
				autoOpen: false,
				height: 265
			});
		}else if(pageTypeId == 1){//Patients Dialog Box
			$('div#name').hide();
			$('div#phone').hide();
			$('div#city').hide();
			$('div#state').hide();
			//$('div#zip').hide();
			$('div#title').hide();
			//$('div#email').hide();
			$('div#subject').hide();
			$('#dialog').dialog({
				autoOpen: false,
				height: 265
			});
		}else if(pageTypeId == 2){//Physicians Dialog Box
			//$('div#name').hide();
			//$('div#phone').hide();
			//$('div#city').hide();
			//$('div#state').hide();
			$('div#zip').hide();
			$('div#title').hide();
			$('div#email').hide();
			$('div#subject').hide();
			$('#dialog').dialog({
				autoOpen: false,
				height: 320
			});
		}
		$(function(){
			$('#dialog').dialog({
				autoOpen: false,
				width: 430,
				buttons: {
					"Submit": function() {
						document.getElementById('form').submit();
						$(this).dialog("close");
					},
				}
			});
			$('#dialog_link').click(function(){
				$('#dialog').dialog('open');
				return false;
			});
		});
	}
);