if(document.images){
	preloadImage = new Image();
	preloadImage.src = "/images/load.gif";
}

function createToolTip(content, id){
	$(id).onclick = function() {
		return false;
	};
	
	new Tip(id, content, { className: 'tip'});
	
}

var sliderControl = function(links, divs){
	var toggles = $$(links);
	var content = $$(divs);
	var AccordionObject = new Accordion(toggles, content, { 
		onActive: function(toggler, element) {
			toggler.addClass('active');
		},
		onBackground: function(toggler, element) {
	        toggler.removeClass('active');
		},
		opacity: true,
		alwaysHide: true,
		show: -1
	});
};

function website(url){
	popupWindow = window.open(url, '_blank','');
	popupWindow.focus();
}

var external = function(){
	var anchors = $$("a");
	anchors.each(function(anchor, i) {
		var relAttribute = String(anchor.getAttribute('rel'));
		if (anchor.id=='print'){
			anchor.onclick = function() {
				print();
				return false;
			};
		}else if (anchor.getAttribute('href') && (relAttribute=='external')){
			anchor.onclick = function() {
				website(this);
				return false;
			};
		}
	});
};

window.addEvent('domready', function(){
	new external();
});