
	queue(function()
	{
		// init tabs
		var els = document.getElementsByTagName('div') ;
		for(var i=0, l=els.length; i<l; i++){
			if(els[i].className.indexOf('tabs') != -1) tabset_init(els[i]) ;
		}
	}) ;
	
	function tabset_init(el)
	{
		el.tab_heads	= [] ;
		for(var i=0, l=el.childNodes.length; i<l; i++){
			if(el.childNodes[i].className && el.childNodes[i].className.indexOf('tab_head') != -1){
				var tab_head					= el.childNodes[i] ; 
				el.tab_heads[el.tab_heads.length]	= el.childNodes[i] ;
				tab_head.childNodes[0].onclick	= function(){tab_select(this.parentNode); return false; }
			}
		}
	}
	
	function tab_select(el)
	{		
		var tab_heads = el.parentNode.tab_heads ;
		for(var i=0, l=tab_heads.length; i<l ;i++){
			if(tab_heads[i] != el){
				tab_unselect(tab_heads[i]) ;
			}
		}
		
		var h		= el ;
		var c		= document.getElementById(el.id.replace('_head', '_content')) ;
		h.className	= 'tab_head_selected' ;
		c.className	= 'tab_content_selected' ;
	}

	function tab_unselect(el)
	{
		var h		= el ;
		var c		= document.getElementById(el.id.replace('_head', '_content')) ;
		h.className	= 'tab_head' ;
		c.className	= 'tab_content' ;
	}
	
	function send_article(title)
	{
		var body	= 'I thought you might be interested in this article on Business Traveller:\n\n' + title + ' - ' + location.href + '\n\n' ;
		var subject	= 'Business Traveller - ' + title ;	
		location.href = 'mailto:?subject=' + escape(subject) + '&body=' + escape(body) ;
	}

	function write_bookmark_link()
	{		
		if(window.external || window.sidebar){
			document.write('<a href="#" onclick="bookmark();return false;">Bookmark</a>') ;
		}
	}
	
	function bookmark()
	{
		if(window.external.AddFavorite)	window.external.AddFavorite(location.href, document.title) ;
		else if(window.sidebar)		window.sidebar.addPanel(document.title, location.href, '') ; //ff
	}

	function bookmark_with(a)
	{
		window.focus() ; // so not to leave focus on link
		if(window.open){
			try {
				var url		= a.href ;
				var width	= 600 ;
				var height	= 450 ;
				var name	= 'bookmark' ;
				var left		= (screen.width - width)/2 ;
				var top		= (screen.height - height - 100)/2 ;
				var tools	= 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',resizable=yes,scrollbars=yes,toolbar=no,location=no' ;
				var popup	= window.open(url, name, tools) ;
				popup.focus() ;
				return false ;
			} catch(e){}
		}
		return true ;
	}
