function captureReturnKey(func)
	{
		if (this.event)
			{
			var key=(this.event.charCode) ? this.event.charCode : ((this.event.keyCode) ? this.event.keyCode : (( this.event.which) ? this.event.which : 0 ));
			if(key=="13") { func(); }
			}
	}	
	
	

function killframes() { if (window != top) top.location.href = location.href; }
	
	
function $submit(obj)
	{
		if ($el(obj)) {$el(obj).submit(); return true;}
		return false;
	}
	
	

function $go(obj)
	{
		if (typeof obj == 'string')	{window.location.href = obj;}
		else if (typeof obj == 'object')
			{
			var destination = obj[0];
			if (destination.indexOf('?') == 0)
				{
					 window.location.href = destination + '?' + obj[1] + '=' + obj[2];
				}
			else
				{
					var querystring = destination.substring(destination.indexOf('?')+1,destination.length);
					var params = querystring.split("&");
					var j = 0;
			        while (j < params.length)
			        	{
				            if (params[j].split("=")[0] == obj[1]) { params.splice(j, 1); } 
					        else { j++; }
				        }
					querystring = params.join("&");
					window.location.href = destination.substring(0,destination.indexOf('?')) + '?' + querystring + "&" + obj[1] + '=' + obj[2];
					
				}
			}
		else
			{
				return false;
			}
	}
	
	
$focus = function(el) {
		if ($el(el))
			{
				$el(el).focus();
				return $el(el);
			}
		else {return false;}
	};


$addEvent = function(obj, evt, func) {
	if(obj[evt])
		{
		obj[evt]=function(f,g){
			return function(){
				f.apply(this,arguments);
				return g.apply(this,arguments);
				};
			}(func, obj[evt]);
		}
	else {obj[evt]=func;}
};


$el = function(el) {return document.getElementById(el);};