1function getCookie(cname) {
2 var name = cname + "=";
3 var ca = document.cookie.split(';');
4 for(var i = 0; i <ca.length; i++) {
5 var c = ca[i];
6 while (c.charAt(0)==' ') {
7 c = c.substring(1);
8 }
9 if (c.indexOf(name) == 0) {
10 return c.substring(name.length,c.length);
11 }
12 }
13 return "";
14}
15