$.create = function(tag) { return $(document.createElement(tag)); }
$.redirect = function(url,mode) {
	if(mode=='302') {
		window.location.replace(url);
	} else {
		window.location.href = url;
	}
}

var flow = {
	items : [],
	go : function() { if(flow.items.length>0) { flow.items.shift().call(); } },
	append : function(_f) { flow.items.push(_f); },
	prepend : function(_f) { flow.items.unshift(_f); },
	shift : function() { flow.items.shift(); }
};

//serializeJSON function
(function( $ ){
$.fn.serializeJSON=function() {
var json = {};
jQuery.map($(this).serializeArray(), function(n, i){
json[n['name']] = n['value'];
});
return json;
};
})( jQuery );
