// <script type="text/javascript">
<!--  to hide script contents from old browsers

// Determine when to ask consumer/provider question
// If cookies have not expired, continue on to requested page
// If cookies have expired, redirect to users.php


/***
// Removed 7/1/2009. No longer need users to declare if they're provider or consumer
var cookie_1 = readCookie('salud_provider_consumer_browser');
var cookie_2 = readCookie('salud_provider_consumer_4_hours');
var cookie_3 = readCookie('salud_provider_consumer_8_hours');

// Get url
var path = unescape(window.location.pathname);
var x = path.indexOf("C:");
var y = path.indexOf("G:");

// Added for Sara to use DW F12 key. Looks to see if path is a directory
// If so, don't bother checking cookies
if (x > -1 || y > -1)
	;
// If 8 hours have passed, ask consumer/provider question
else if (cookie_3 == null)

	window.location = 'client/users.php?ask=TRUE';
// If logged out of browser AND 4 hours have passed, ...
else if (cookie_1 == null && cookie_2 == null)
	window.location = 'client/users.php?ask=TRUE';
else
	; //alert("cookie is set " + x + "  " + document.cookie);
***/


function readCookie(name) 
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	
	for(var i=0; i < ca.length; i++) 
	{
		var c = ca[i];
		while (c.charAt(0) == ' ') 
			c = c.substring(1, c.length);
		if (c.indexOf(nameEQ) == 0) 
			return c.substring(nameEQ.length,c.length);
	}
	return null;
}


// end hiding contents from old browsers  -->
// </script>