outputted to the page.
function JSSetCookie($CName,$CValue,$CExpr=FALSE){
// $CName is the name of the cookie
// $CValue is the value to be stored in the cookie
// $CXpr is in years
// This function will allow cookies to be set even after
// HTML has been printed on the page. It is a supplement to the
// SetCookie function when you have to output text before a cookie is set.
if($CExpr!=FALSE){
$CookieString="astr= '$CName' + '=' + '$CValue' + ';expires=' + expr + ';path=/';";
$Cookie.="\n\n";
}else{
$Cookie.="\n\n";
}
echo $Cookie;
}