/*
	$Copyright Trinity Mirror $Date: 2009-08-11 16:28:00 +0100 (Tue, 11 Aug 2009) $
	$Revision: 52471 $
*/
// parse document.cookie
// returns a string or null.

function getCookieVal(key){var pos=document.cookie.indexOf(key+"=");if(pos!=-1){var start=pos+key.length+1;var end=document.cookie.indexOf(";",start);if(end==-1)end=document.cookie.length;var value=document.cookie.substring(start,end);return unescape(value);}
return null;}
function setCookieVal(key,value,duration_sec,path){var theCookie=key+"="+escape(value);if(duration_sec&&duration_sec>0){var exp=new Date();exp.setTime(exp.getTime()+(duration_sec*1000));theCookie+='; expires='+exp.toGMTString();}
if(path){theCookie+=';path='+path;}
document.cookie=theCookie;}
