function setCookie(cookieName, cookieValue)
{
  var nextyear = new Date();
  nextyear.setFullYear(nextyear.getFullYear() + 1);
  document.cookie = cookieName + "=" + cookieValue; 
  // omit expiry detail to make session cookie
  //+ "; expires=" + nextyear.toGMTString();
}

function deleteCookie(cookieName)
{
  document.cookie = cookieName + "=''; expires=Fri, 02-Jan-1970 00:00:00 GMT";
}

function showLocale()
{
  var allcookies = document.cookie;
  var pos = allcookies.indexOf("tdr_query");

  if (pos != -1)
  {
    var start = pos + 7;
    var end = allcookies.indexOf(";",start);
    if (end == -1) end = allcookies.length;
    var value = allcookies.substring(start, end);
    value = unescape(value);

    alert(value);

  }

}

function getCookie( name ) {
	
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) &&
( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}
