function trace(str) {
	if(typeof(console) == 'object') {
		console.log(str);
	} else {
		window.status = str;
	}
}

function isBrowser() {
	return !(jQuery.browser.msie && parseInt(jQuery.browser.version.substr(0,1)) < 8);
}

function isWorst() {
	return !isBrowser() && parseInt(jQuery.browser.version.substr(0,1)) < 7;
}

function goto(path) {
	window.location.href = path;
}

function get(name, href, def){
	var mainParts = href ? href.split('?') : window.location.href.split('?');
	if(mainParts.length > 1) {
		mainParts[1] = mainParts[1].split('#')[0];
		var subParts = mainParts[1].split('&');
		for(i=0; i<subParts.length; i++) {
			var subSubParts = subParts[i].split('=');
			if(subSubParts[0] == name) {
				return subSubParts[1];
			}
		}
	}
	return def ? def : '';
}

(function($){
	jQuery.fn.allWidth = function(method, flag) {
		var size = 0;
		jQuery(this).each(function() {
			size += jQuery(this)[method == 'outer' || method == 'inner' ? method + 'Width' : 'width'](flag);
		});
		return size;
	};
	jQuery.fn.allHeight = function(method, flag) {
		var size = 0;
		jQuery(this).each(function() {
			size += jQuery(this)[method == 'outer' || method == 'inner' ? method + 'Height' : 'height'](flag);
		});
		return size;
	};
})(jQuery);
