// JavaScript Document
function readCookie(cookieName){
   var searchName = cookieName + "="
   var cookies = document.cookie
   var start = cookies.indexOf(cookieName)
   if (start == -1){ // cookie not found 
     return ""
     }
   start += searchName.length //start of the cookie data
   var end = cookies.indexOf(";", start)
   if (end == -1){
     end = cookies.length
     }
   return cookies.substring(start, end)
   }

function getCookieExpireDate(noDays){
  var today = new Date()
  var expr = new Date(today.getTime()+noDays*24*60*60*1000)
  return  expr.toGMTString()
  }

function makeCookie(name, data, noDays){
  var cookieStr = name + "="+ data
  if (makeCookie.arguments.length > 2){
    cookieStr += "; expires=" + getCookieExpireDate(noDays) + "; path=/"
    }
  document.cookie = cookieStr
  }


function changeme(id, action) {
	var x=document.getElementById(id);
	if (x) {
       if (action=="hide") {
		  
            document.getElementById(id).style.display = "none";
       } else {
            document.getElementById(id).style.display = "block";
       }
	}
}

function checkCookie()
{
	//alert("Checking Cookie");
  var mycookie = readCookie('cart_not_empty')
	   	if	(mycookie == 1)
		{
			changeme('myCart1', 'show');
			changeme('myCart2', 'show');
			changeme('myCart3', 'show');
			changeme('myCart4', 'show');
			changeme('myCart5', 'show');
		}
}
