/* The getCookie function retrieves the current document cookie and extracts a specific value from it. The value to be extracted is contained within the variable name. */
function getCookie(name) {
	if (document.cookie) {
               		index = document.cookie.indexOf(name);
                 	if (index != -1) {
                   		countbegin = (document.cookie.indexOf("=", index) +1);
                    		countend = document.cookie.indexOf(";", index);
		                if (countend == -1) {
                    			countend = document.cookie.length;
                    		}
                   		return(document.cookie.substring(countbegin, countend));
               		}
             		return("");
           	}
 	return("");
 }
