
function var_dump(obj) {
	if(typeof obj == "object") {
		return "Type: "+typeof(obj)+((obj.constructor) ? "\nConstructor: "+obj.constructor : "")+"\nValue: " + obj;
	} else {
		return "Type: "+typeof(obj)+"\nValue: "+obj;
	}
	return false;
}

function alpha_dash(str,item)
{
	if(str)
	{
		var regex=/^[0-9A-Za-z]+$/; //^[a-zA-z]+$/
		//convert str to alpha_numeric_dash text for the path field
		str = str.toLowerCase();
		str = str.replace(/[^a-zA-Z 0-9]+/g,'');
		str = str.replace(/[\s]+/g,'_');
		if(item = document.getElementById(item))
			item.value = str;
		else
			document.getElementById("path").value = str;
		
	}
	return false;
}

function vconfirm(text,url) {
	if(text && url)
	{
		var r=confirm(text);
		if (r==true)
		{
			// GO TO URL
			window.location = url;
		}
		else
		{
			return false;
		}
	}
	return false;
}

$(function(){
	$.extend($.fn.disableTextSelect = function() {
		return this.each(function(){
			if($.browser.mozilla){//Firefox
				$(this).css('MozUserSelect','none');
			}else if($.browser.msie){//IE
				$(this).bind('selectstart',function(){return false;});
			}else{//Opera, etc.
				$(this).mousedown(function(){return false;});
			}
		});
	});
	$('.noselect').disableTextSelect();//No text selection on elements with a class of 'noselect'
	// Velin addition: Apply it to children of that element too - takes up too many resources
	//$('.noselect').children().each(function(){$(this).disableTextSelect();});
});

