
jQuery.noConflict();
        jQuery(document).ready(function() {

            jQuery(".signin").click(function(e) {          
				e.preventDefault();
                jQuery("fieldset#signin_menu").toggle();
				jQuery(".signin").toggleClass("menu-open");
            });
			
			jQuery("fieldset#signin_menu").mouseup(function() {
				return false
			});
			jQuery(document).mouseup(function(e) {
				if(jQuery(e.target).parent("a.signin").length==0) {
					jQuery(".signin").removeClass("menu-open");
					jQuery("fieldset#signin_menu").hide();
				}
			});			
			














    jQuery("#signin_submit").click(function() {          
	  var uname 		= jQuery("#username").val();
	  var pass 		   = jQuery("#password").val();
	  jQuery.ajax({  
				type: "POST",  
				url: "http://www.medi4.com/signin.php",
				data: "uname="+uname+"&pass="+pass,  
				dataType:"json",
				beforeSend: function()
				{
				},
				success: function(resp)
				{  
	 				
					if(resp.status == "ok")
					{
					var profile_link = resp.uname.toLowerCase();
					profile_link = profile_link.replace(" ","-");
					jQuery("#ustatus").html("<i>Loged in as: "+resp.uname+"</i> &nbsp; - &nbsp; <a href='javascript:void(0);' class='my_link' onclick=\"javascript:logout();\">Logout</a>&nbsp; &nbsp; <a href='<?php echo ABSOLUTE_PATH; ?>user/"+profile_link+".html' class='my_link' >Profile</a>");
					jQuery(".signin").removeClass("menu-open");
					jQuery("fieldset#signin_menu").hide();
jQuery("#container").hide();
jQuery(".customsighnup").hide();
					}
					else
					{
						alert("Error: \n User name or passord mismatched.");
					}
				},
				 
				error: function(e){  
				alert('Error: ' + e);  
				}  
		 }); 

	  
			});			
			





    jQuery(function() {
	  jQuery('#forgot_username_link').tipsy({gravity: 'w'});   
    });
    
    });
	function logout()
	{
	  jQuery.ajax({  
				type: "POST",  
				url: "http://www.medi4.com/logout.php",
				//data: ,  

				beforeSend: function()
				{
				},
				success: function(resp)
				{  
					jQuery("#ustatus").html("");
					window.location.reload();
				},
				 
				error: function(e){  
				alert('Error: ' + e);  
				}  
		 }); 
	
	}

	function ratthis(did)
	{
	  jQuery.ajax({  
				type: "POST",  
				url: "http://www.medi4.com/ratthis.php",
				//data: ,  

				beforeSend: function()
				{
				},
				success: function(resp)
				{  
					if(resp == "open")
					{
					jQuery("#ratings"+did).slideDown('slow');
					}
					else
					{
					   jQuery("fieldset#signin_menu").toggle();
				       jQuery(".signin").toggleClass("menu-open");

					}
				},
				 
				error: function(e){  
				alert('Error: ' + e);  
				}  
		 }); 
	
	}
//////////////////////////////////////////////////
	function rateit()
	{
	  jQuery.ajax({  
				type: "POST",  
				url: "http://www.medi4.com/ratthis.php",
				//data: ,  

				beforeSend: function()
				{
				},
				success: function(resp)
				{  
					if(resp == "open")
					{
					jQuery("#ratings").show();
					
					jQuery("#overall_appointment").hide();
					jQuery("#ratings_appointment").show();					
					
					jQuery("#overall_promptness").hide();
					jQuery("#ratings_promptness").show();					
					
					jQuery("#overall_Staff").hide();
					jQuery("#ratings_Staff").show();					
					
					jQuery("#overall_diagnosis").hide();
					jQuery("#ratings_diagnosis").show();					
					
					jQuery("#overall_bedside").hide();
					jQuery("#ratings_bedside").show();					
					
					jQuery("#overall_time").hide();
					jQuery("#ratings_time").show();					
					
					jQuery("#overall_follow_up").hide();
					jQuery("#ratings_follow_up").show();					
					
					}
					else
					{
					   jQuery("fieldset#signin_menu").toggle();
				       jQuery(".signin").toggleClass("menu-open");

					}
				},
				 
				error: function(e){  
				alert('Error: ' + e);  
				}  
		 }); 
	
	}
	function show_review()
	{
	  jQuery.ajax({  
				type: "POST",  
				url: "http://www.medi4.com/ratthis.php",
				//data: ,  

				beforeSend: function()
				{
				},
				success: function(resp)
				{  
					if(resp == "open")
					{
					jQuery("#review_box").slideDown();
					
					}
					else
					{
					   jQuery("fieldset#signin_menu").toggle();
				       jQuery(".signin").toggleClass("menu-open");

					}
				},
				 
				error: function(e){  
				alert('Error: ' + e);  
				}  
		 }); 
	
	}
   function areyou(did)
   {
   jQuery.ajax({
				type: "POST",
				url: "http://www.medi4.com/areyou.php",
				data:"did="+did,

				beforeSend: function()
				{
				},
				success: function(resp)
				{
					if(resp == "ok")
					{
                      alert("Your request has submited.");

					}
					else if(resp == "done")
					{
                      alert("You already claimed a profile.");
                    }
                    else if(resp == "p")
                    {
                       alert("Not Registered As A Doctor.");
                    }
                    else
					{
					   jQuery("fieldset#signin_menu").toggle();
				       jQuery(".signin").toggleClass("menu-open");

					}
				},

				error: function(e){
				alert('Error: ' + e);
				}
		 });


   }



function search_test()
{
var cat = document.getElementById("category");
var reg = document.getElementById("region");
var name = document.getElementById("drname");
var zip = document.getElementById("zip");

if(zip.value == "" && name.value =="" && cat.value == 0 && reg.value == 0)
{
alert("Please Enter Proper Search Criteria.")
return false;
}



}

