2007-10-30 13:05:36 +00:00
|
|
|
// Javascript functions that most pages need.
|
|
|
|
// Note: this is included by all pages, so only put functions in this file that most/all pages need.
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2007-12-11 19:44:21 +00:00
|
|
|
function setCookie(name, value, path) {
|
|
|
|
value = escape(value); // this is needed if value contains spaces, semicolons, or commas
|
|
|
|
document.cookie = name + '=' + value
|
|
|
|
+ ';expires=' + (new Date("December 31, 2023")).toGMTString()
|
|
|
|
+ ';path=' + path;
|
2007-10-26 22:44:33 +00:00
|
|
|
}
|
|
|
|
|
2007-12-11 19:44:21 +00:00
|
|
|
// Return a hash of the cookie names and values
|
|
|
|
function getCookies() {
|
|
|
|
//alert('"'+document.cookie+'"');
|
|
|
|
var cookies = document.cookie.split(/; */);
|
|
|
|
//alert(cookies[0]);
|
|
|
|
var cookret = new Object(); // this is the return value
|
|
|
|
for (i in cookies) { var pair = cookies[i].split('='); cookret[pair[0]] = unescape(pair[1]); }
|
|
|
|
return cookret;
|
2007-10-26 22:44:33 +00:00
|
|
|
}
|
|
|
|
|
2008-10-23 17:54:02 +00:00
|
|
|
// Check or uncheck all checkboxes that start with objectName
|
|
|
|
function selectAllCheckBoxes(element, objectName)
|
2007-10-26 22:44:33 +00:00
|
|
|
{
|
2008-10-23 17:54:02 +00:00
|
|
|
//todo: use jQuery to accomplish this
|
2007-10-26 22:44:33 +00:00
|
|
|
var sel = element.checked;
|
|
|
|
var form = element.form;
|
2008-10-23 17:54:02 +00:00
|
|
|
var searchstr = '^' + objectName + '\d';
|
2007-10-26 22:44:33 +00:00
|
|
|
for(var i = 0; i < form.length; i++)
|
|
|
|
{
|
|
|
|
var e = form.elements[i];
|
|
|
|
if (e.type == "checkbox" && e.name.search(searchstr) > -1) { e.checked = sel; }
|
|
|
|
}
|
|
|
|
}
|