
function cc(x) {
	if (window.console && console.log)
		console.log(x);
}

Function.prototype.scope = function(scope, args) {
	var f = this;
	return function() {
		return f.apply(scope, args || arguments);
	};
};

function newPopup(url) {

	if (window.MSHTA) {

		new ActiveXObject( 'WSCRIPT.Shell' ).Run( 'iexplore ' + url ) ;
		
	} else {
		if (window.open) {
			window.open(url, 'popup', "height=600,width=1000");
		} else {
			location.href = url;
		}
	}
}

Function.prototype.delay = function(time) {

	var f = this;

	var newF = function() {
		setTimeout(f.scope(window, arguments), time);
	};

	return newF;
};

jQuery.fn.textNotEmpty = function() {

	var element = this;

	var elements = element.find('*').filter(function() {
		var el = $(this);

		var html = $.trim(el.html());
		var text = $.trim(el.text());

		var rx = /[^<>]{1,}/;

		if (rx.test(html) && rx.test(text)) {
			var h = html.substring(0, 2);
			var t = text.substring(0, 2);

			// cc([h, t]);

			return h == t ? true : false;
		}

		return false;

	});

	return elements;
};
