// A simple script to turn any HTML element into a virtual frame.
// See README for documentation
// License: Public Domain, use how you want
(function(){
	var func = function() {
		$$('a.vframe[target][href]').each(function(element) {
			Event.observe(element, 'click', function(event) {
				var e = Event.element(event);
				while( e.tagName.toLowerCase() != 'a' &&
					!e.hasClassName('vframe') )
					e = e.parentNode;
				new Ajax.Updater(e.getAttribute('target'),
					e.getAttribute('href'), {
						method: 'get',
						evalScripts: true
					});
				Event.stop(event);
			});
		});
	}
	var oldonload = window.onload;
	window.onload = typeof window.onload != 'function' ?
		func : function() {oldonload();func();};
})();

