
function hide_flash(){
    document.getElementById('swf').style.display = 'none';
}

function unhide_flash(){
    document.getElementById('swf').style.display = '';
}


var addthis_pub="bluebarracuda2";
var addthis_config =
{
   username: "bluebarracuda2"
}

var oInterval;

function popupAddThis(shareURL, title)
{
	addthis_share.url = shareURL;
	addthis_share.title = title;
	addthis_sendto();
	hide_flash();
	oInterval = setInterval("clock()",500)
}			

function createFunc(obj, param)
{
    obj.onclick = function(event) {
		unhide_flash();
		return addthis_sendto(param);
    }
}


function clock()
{
	var closeBtn;
	var container;

	
	if ( null != document.getElementById('at16ptx') )
	{
		window.clearInterval(oInterval);
		// clicking on close button
		closeBtn = document.getElementById('at16ptx');
		closeBtn.onclick = function() {
			unhide_flash();
			return _atw.clb();
				
		}
		// clicking on background
		container = document.getElementById('at16lb');				
		container.onclick = function() {
			unhide_flash();
			return _atw.clb();
		}
		
		// clicking on service names
		var nodes = document.getElementById('at16ps').childNodes;
		for(var i = 0;i < nodes.length;++i) 
		{
			var match = /ati_(.*)/i.exec(nodes[i].id);
			if ( match )				
				createFunc( nodes[i], match[1] );
		}	
		
	}
	
}
			