function productEnqPopulate() {
 // 'hireenqcontent' should be the id of the tag on the product screen which contains the text you want on the form.
 if (content = document.getElementById('hireenqcontent')) {
        // 7 here means store the cookie for 7 days. Adjust if you like.
  createCookie('ipc_services',content.innerHTML,7);
 }
 else {
        // 'productenquiry' should be changed to the id of the form field you want to enter the data into.
  field = document.getElementById('productenquiry');
  if (field) {
   field.value = readCookie('ipc_services');
  }
 }
}

function createCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
    var nameEQ = name + "=";
    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,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}