  var today = new Date();
  var expiry = new Date(today.getTime() + 1 * 3600 * 1000); // plus 1 hour

//if(field1 = getCookie("field1")) document.myForm.field1.value = field1;


/*function setCookie()
{   
    deleteAllCookies();
    var clue = "clue";
    name = document.getElementById("userInput").value;
    document.cookie = name +  ";  expires=" + expiry.toGMTString() + "; path=/";
}
*/

/*
function getCookie(cname) {
    var name = cname + "=";
    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);
        }
        if (c.indexOf(name) == 0) {
            return c.substring(name.length, c.length);
        }
    }
    return "";
}
*/
var clueVar = setInterval(function(){ writeCookie() }, 1000);

function myStopFunction() {
    clearInterval(clueVar);
}


function writeCookie()
{
 
        if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        } else {
            // code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange = function() {
            if (this.readyState == 4 && this.status == 200) {
                document.getElementById("bargan").innerHTML = this.responseText;
            }
        };
        xmlhttp.open("GET","/transfer.php",true);
        xmlhttp.send();
    }

/*
function storeValues(form)  
{
    setCookie("field1", form.field1.value);
    return true;
}
function deleteAllCookies() {
    var cookies = document.cookie.split(";");

    for (var i = 0; i < cookies.length; i++) {
        var cookie = cookies[i];
        var eqPos = cookie.indexOf("=");
        var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
        document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
    }
}
*/
/*document.querySelector("#ClueSent").addEventListener('keypress', function (e) {
    var key = e.which || e.keyCode;
    if (key === 13) { // 13 is enter
    var userInput = document.getElementById("ClueSent").value;
    document.getElementById("bargan").innerHTML = userInput;// code for enter
    }
}); 
 */

