var arrRecords = new Array(); var arrCookie = new Array(); var recCount = 0; var strRecord=""; function cookieVal(cookieName) { thisCookie = document.cookie.split("; ") for (i = 0; i < thisCookie.length; i++) { if (cookieName == thisCookie[i].split("=")[0]) { return thisCookie[i].split("=")[1]; } } return 0; } function loadCookie() { if(document.cookie != "") { if(cookieVal("Records") != 0) { arrRecords = cookieVal("Records").split(","); recCount = arrRecords.length; } } } function addToCookie(id) { /* * Comments needs to writen * * */ strRecord = ""; strRemove = ""; if(document.getElementById(id).checked == true) { strRecord = strRecord + document.getElementById(id).value; arrRecords[recCount] = strRecord; recCount = arrRecords.length; } else { strRemove = document.getElementById(id).value; strRecord = remove(strRecord, strRemove); arrRecords.splice(arrRecords.indexOf(strRemove), 1); recCount = arrRecords.length; } if (arrRecords.length != 0) { document.cookie = "Records="+arrRecords+";expires=;path=/"; } else { eraseCookie("Records"); } document.getElementById('myArticleCount').innerHTML = countRecords(); document.getElementById('myArticleCountTop').innerHTML = countRecords(); } function selectAll(start, end) { var arrCheckbox = new Array(); if(cookieVal("Records") != 0) { var noOfRecords = (end - start) + 1; var k = start; for (var i = 0; i < noOfRecords ; i++) { var checkbox = document.getElementById('checkbox'+ k); checkbox.checked = true; k = k+1; arrCheckbox[i] = checkbox.value; } for(i=0;i