 
/****************************************************************************
* This function will get the Cookie values and displays then in the form.   *
****************************************************************************/
 
 function getCookie(cookiename)
 {
     var the_info = new Array();

 	if (document.cookie != '')
	{ 
 		var the_cookie = document.cookie;
		var the_cookie = unescape(the_cookie);
		var broken_cookie = the_cookie.split("=");
		var property = broken_cookie[0];
		var the_values = broken_cookie[1];
		var separated_values = the_values.split("&");
		var property_value = "";
		
		if (property != "JSESSIONID")
		{
			for (var loop = 0; loop < separated_values.length; loop++)
				{
					property_value = separated_values[loop]
					var broken_info = property_value.split(";");
					var the_property = broken_info[0];
					var the_value = broken_info[1];
					the_info[the_property] = the_value;
				}
				
			//department = the_info["department"];
  			document.form1.request.value = the_info["userName"];
			document.form1.phone.value = the_info["userPhone"];
			document.form1.email.value = the_info["email"];
		}
		else
		{
			return false;
		}		
	}
	else
	{
		return false;
	}


 }



/***************************************************************************
* This function will create a cookie and save it to the client computer.   *
***************************************************************************/

 function setCookie()
 {
  	var userName = document.form1.request.value;
	var userPhone = document.form1.phone.value;
	var email = document.form1.email.value;

	var the_cookie = "ITMDHelpdeskcookie=" + escape("userName;" +userName+ "&userPhone;" +userPhone+ "&email;" +email);
	var the_date = new Date(); //"December 31, 2050"
	the_date.setMonth(the_date.getMonth()+6);
	var the_cookie_date = the_date.toGMTString();
	the_cookie += "; expires=" + the_cookie_date + "; &path=/";
	document.cookie = the_cookie;

 }
