function deleteCookie(name, path, domain) {
	if (getCookie(name)) {
		document.cookie = name + "=" +
			((path) ? "; path=" + path : "") +
			((domain) ? "; domain=" + domain : "") +
			"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

function showAll(){
    deleteCookie("ss.messages.shown","/");
    alert("Messages restored");
}

function search(){

	var queryString = 	document.getElementById('insearch').value;
	var formEl = document.getElementById('realSearch');
	formEl.value=queryString;
	var realForm = document.getElementById('searchForm');
	realForm.submit();
}

function getCookie(name) {
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) {
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	} else
		begin += 2;
	var end = document.cookie.indexOf(";", begin);
	if (end == -1)
		end = dc.length;
	return unescape(dc.substring(begin + prefix.length, end));
}
String.prototype.trim = function(){
	// this functions trims the string from left & right;
	return this.replace(/^\s*/,"").replace(/\s*$/,"");
}

function validateCancel(formOb){

var agree=confirm("You are about to delete this registration. Do you wish to continue?");
if (agree)
	formOb.submit();
}

function printDate(timestamp){
  var 	d=new Date();
	d.setTime(new Number(timestamp));
	var fmt = "%d %b %Y %H:%M";
	document.write("<span class='faqDate' title='"+d.toUTCString()+"'>");
	document.write(d.print(fmt));
	document.write("</span>");
 }
 
 var Calendar={};
// short month names
Calendar._SMN = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
 
/** Prints the date in a string according to the given format. */
Date.prototype.print = function (str) {
	var m = this.getMonth();
	var d = this.getDate();
	var y = this.getFullYear();
	var w = this.getDay();
	var s = {};
	var hr = this.getHours();
	var pm = (hr >= 12);
	var ir = (pm) ? (hr - 12) : hr;
	if (ir == 0)
		ir = 12;
	var min = this.getMinutes();
	var sec = this.getSeconds();
	s["%b"] = Calendar._SMN[m]; // abbreviated month name [FIXME: I18N]
	s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31)
	s["%H"] = (hr < 10) ? ("0" + hr) : hr; // hour, range 00 to 23 (24h format)
	s["%M"] = (min < 10) ? ("0" + min) : min; // minute, range 00 to 59
	s["%Y"] = y;		// year with the century
	s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99)

	var re = /%./g;
	if (!Calendar.is_ie5 && !Calendar.is_khtml)
		return str.replace(re, function (par) { return s[par] || par; });

	var a = str.match(re);
	for (var i = 0; i < a.length; i++) {
		var tmp = s[a[i]];
		if (tmp) {
			re = new RegExp(a[i], 'g');
			str = str.replace(re, tmp);
		}
	}

	return str;
};
 