// Reads cookie and returns a null value if it's not there

function readCookie(cName) {

 var val="";
 if (document.cookie.indexOf(cName) != -1) {
    strt = (document.cookie.indexOf(cName)+cName.length)+1;
    end = document.cookie.indexOf(";",strt);
    if (end == -1) {
      end = document.cookie.length;
    }
    val += unescape(document.cookie.substring(strt,end));
 }
 return val;

}

