function getExpDate(days, hours, minutes) {
	var expDate = new Date();
	if (typeof days == "number" && typeof hours == "number" && typeof hours == "number") {
		expDate.setDate(expDate.getDate() + parseInt(days));
		expDate.setHours(expDate.getHours() + parseInt(hours));
		expDate.setMinutes(expDate.getMinutes() + parseInt(minutes));
		return expDate.toGMTString();	
	}
}

function getCookieValue(cookieName)
{
  var cookieValue = document.cookie;
  var cookieStartsAt = cookieValue.indexOf(" " + cookieName + "=");
  if (cookieStartsAt == -1) {cookieStartsAt = cookieValue.indexOf(cookieName + "=");}
  if (cookieStartsAt == -1) {cookieValue = null;}
  else   {
     cookieStartsAt = cookieValue.indexOf("=", cookieStartsAt) + 1;
     var cookieEndsAt = cookieValue.indexOf(";",cookieStartsAt);
     if (cookieEndsAt == -1) {cookieEndsAt = cookieValue.length;}
     cookieValue = unescape(cookieValue.substring(cookieStartsAt,cookieEndsAt));
  }
  return cookieValue;
}


function setCookie(name, value, expires, path, domain ,secure) {
	document.cookie = name + "=" + escape (value) + 
	((expires) ? "; expires=" + expires : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure=" + secure : "") ;
}

function deleteCookie(name,path,domain) {
	if (getCookieValue(name)) {
		document.cookie = name + "=" +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01 Jan 70 00:00:01 GMT";	
	}
}