var isset = function(obj)
{
	try
	{
		if (typeof(eval(obj)) != 'undefined')
		if (eval(obj) != null)
		return true;
	} catch(e)
	{
		alert(e)
	}
	alert ("false");
	return false;
}



var toggleLoad = function(){
	var hasClass = document.getElements(".loading");
	if (hasClass.length)
		document.getElements(".loading").removeClass("loading");
	else
	{
		document.getElementById("loadID").addClass("loading");
		document.body.addClass("loading");
	}
};

// Set default value in inputs with the rel value
var dwDefaults = new Class({
	//implements
	Implements: [Options],

	//options
	options: {
		collection: $$('input[type=text]')
	},

	//initialization
	initialize: function(options) {
		//set options
		this.setOptions(options);
		this.defaults();
	},

	//a method that does whatever you want
	defaults: function() {
		this.options.collection.each(function(el) {
			el.set('value',el.get('rel'));
			el.addEvent('focus', function() { if(el.get('value') == el.get('rel')) { el.set('value',''); /*el.set('style','background:green'); */} });
			el.addEvent('blur', function() { if(el.get('value') == '') { el.set('value',el.get('rel')); /*el.erase('style');*/} });
		});
	}
});

var $console = function(options,method)
{
	try
	{
		options = (typeof(options) == "string") ? "'"+options+"'" : options;
		method = (typeof(method) != "string") ? "log" : method;
		eval("console."+method+"("+options+")"); //"+method+"("+options+")");

	}catch(e){}
}
