//////////////////////////////////////////////////////////////////////////////////
// Apx Helpers V1.0.1
// (c) 2011 by Apx Solutions. <http://www.apxsolutions.co.uk>
//
// Please retain this copyright header in all versions of the software
//////////////////////////////////////////////////////////////////////////////////
$.fn.serializeObject = function () { var arrayData, objectData; arrayData = this.serializeArray(); objectData = {}; $.each(arrayData, function () { var value; if (this.value != null) { value = this.value; } else { value = ''; } if (objectData[this.name] != null) { if (!objectData[this.name].push) { objectData[this.name] = [objectData[this.name]]; } objectData[this.name].push(value); } else { objectData[this.name] = value; } }); return objectData; };
$.fn.apxBookmarkButton = function () {if (window.opera) { if (this.attr("rel") != "") { this.attr("rel", "sidebar"); } }; this.click(function (event) { event.preventDefault(); var url = this.href; var title = this.title; if (window.sidebar) { window.sidebar.addPanel(title, url, ""); } else if (window.external) { window.external.AddFavorite(url, title); } else if (window.opera) { return false; } else { alert('Unfortunately, this browser does not support the requested action, please bookmark this page manually.'); } });}
$.fn.apxTagCloud = function () { var _max = 0; this.each(function (i) { var _fStart = this.innerText.indexOf(" ("); var _fEnd = this.innerText.indexOf(")"); var _freq = parseFloat(this.innerText.substring(_fStart + 2, _fEnd)); $(this).attr("frequency", _freq); this.innerText = this.innerText.substring(0, _fStart); _max = _freq > _max ? _freq : _max; }); this.each(function (i) { var _freq = $(this).attr("frequency"); var _size = 0.8 + ((_freq / _max) * 1.2); $(this).css("fontSize", _size + "em"); $(this).css("white-space", _size > 1.5 ? "normal" : "nowrap"); }); }
