var bstpst_toolbar_submitUrl_Internal = window.location.href;

var bstpst_AdsenseID_Internal = '';

var bstpst_toolbar_Direction_Internal = 0;

var bstpst_toolbar_UUID = 0;

//source: http://www.quirksmode.org/js/findpos.html
function bstpst_toolbar_initialize()
{
	if (typeof(bstpst_toolbar_submitUrl) != 'undefined')
		bstpst_toolbar_submitUrl_Internal = bstpst_toolbar_submitUrl;

	if (typeof(bstpst_AdsenseID) != 'undefined')
		bstpst_AdsenseID_Internal = bstpst_AdsenseID;

	var tvsWidth = document.body.clientWidth - 10 + "px";
	var tvsHeight = "100";

	var tvsPage = "";

	var bstpst_toolbar_SourceElement = document.getElementById(bstpst_toolbar_UUID);
	
	var bstpst_toolbar_Frame = document.createElement("DIV");
	
	bstpst_toolbar_Frame.id = "bstpst_toolbar_Frame_this";
		
	bstpst_toolbar_Frame.style.width = tvsWidth;
	bstpst_toolbar_Frame.style.height = tvsHeight;
	
	bstpst_toolbar_Frame.style.border = "0px solid black";
	bstpst_toolbar_Frame.style.zIndex = 100;
	
	var bstpst_toolbar_Script3 = document.createElement("IFRAME");
	
	bstpst_toolbar_Script3.frameBorder = 0;
	bstpst_toolbar_Script3.allowTransparency = "true";

	var bstpst_ServiceList = "";
	for (var i = 0; i<bstpst_toolbar_ServiceArray.length;i++)
	{
		bstpst_ServiceList += bstpst_toolbar_ServiceArray[i] + ".";
		
	}
	bstpst_toolbar_Script3.src = "http://www.boostpost.com/toolbar/v1_0_0/toolbarframe.php?submitUrl="+encodeURIComponent(bstpst_toolbar_submitUrl_Internal) + "&Services=" + bstpst_ServiceList + "&transparent=true" + "&AdsenseID=" + bstpst_AdsenseID_Internal + "&Alignment=" + bstpst_toolbar_Alignment;
	bstpst_toolbar_Script3.width=tvsWidth;
	bstpst_toolbar_Script3.height=tvsHeight;
	
	bstpst_toolbar_Frame.appendChild(bstpst_toolbar_Script3);
	
	bstpst_toolbar_SourceElement.appendChild(bstpst_toolbar_Frame);

	// create timer

	//setInterval( "setToolbarLocation()", 5 );
setToolbarLocation();
}
function setToolbarLocation()
{
	var bstpst_toolbar_SourceElement = document.getElementById(bstpst_toolbar_UUID);
	
	bstpst_toolbar_SourceElement.style.position = "fixed";
	bstpst_toolbar_SourceElement.style.left = "5px";
	
	bstpst_toolbar_SourceElement.style.bottom= "0px";
	bstpst_toolbar_SourceElement.style.height = "90px";
	bstpst_toolbar_SourceElement.style.right = "5px";
	//bstpst_toolbar_SourceElement.style.backgroundImage = 'url(images/toolbar_bg.png)';
	//bstpst_toolbar_SourceElement.style.backgroundRepeat = 'repeat-x';
	bstpst_toolbar_SourceElement.style.border = "0px solid #cecece";

	bstpst_toolbar_SourceElement.style.paddingTop = "15px";
}
function generateToolbarGuid()
{

	var result, i, j;
	result = '';
	for(j=0; j<32; j++)
	{
		if( j == 8 || j == 12|| j == 16|| j == 20)
		result = result + '-';
		i = Math.floor(Math.random()*16).toString(16).toUpperCase();
		result = result + i;
	}
	bstpst_toolbar_UUID = "bstpst_toolbar_" + result;
	return bstpst_toolbar_UUID;
} 
document.write ('<div id="' + generateToolbarGuid() +'"></div>');

bstpst_toolbar_initialize(); 
