function swap( img, to )
{
	img = document.images[ img ];
	if ( !img.old )
	{
		img.old = img.src;
	}
	img.src = to;
}
function swap_back( img )
{
	img = document.images[ img ];
	img.src = img.old;
}

function swapClass( elem, className )
{
	if ( !elem.oldClass ) 
	{
		elem.oldClass = elem.className;
	}
	elem.className = className;
}

function swapClassBack( elem )
{
	elem.className = elem.oldClass;	
}

function redirect( href )
{
	document.location.href = href;
}

function open_window( location, name /*[, params ]*/ )
{
	var params = open_window.arguments[2];
	window.win = window.win || new Object;
	window.win[ name ] = window.open( location, name, params );
	window.win[ name ].focus();
	return window.win[ name ];
}

function is_defined()
{
	var val = is_defined.arguments[0];
	return undefined !== val;
}
