Hmmm Kay.....
this was kinda ripped from this site...
http://javascript.internet.com/passwords/cookie-in.html
Code:
<button type="button" onclick="do_click()">Login</button>
<script language="javascript">
function do_click() {
SetCookie('FreeStuffL', FreeStuffL_Name, expdate);
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
I suspect it needs changing as the function have 2 arguements but three are passed but it should get you started.