// sdkButtonize - apply an onclick event handler to all matching elements, which will find their containing form and submit it..
(function($) {
	$.fn.sdkButtonize = function () {
		return this.bind('click',function(event) {
			var e = this;
			while(true) {	// loop up the elements until we find a form or hit the body element..
				if (e.tagName == 'FORM') { return e.submit(); }
				if (e.tagName == 'BODY') { return false; }
				e = e.parentNode;
			}
		}).css("cursor","pointer");	// also make the cursor display as a pointer when hovering over element..
	}
})(jQuery);



function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}


