function InstallPanel(obj, bOff, bSecure) {
	
	
	if (!is_firefox) {
		alert('The Amplify Add-on is only available for Firefox. Please install the Bookmarklet instead.');
		return false;
	}
	
	if (obj.className == 'ToolbarInstalled') {
		alert('You have already installed the Amplify toolbar in this browser.');
		return false;
	}
	
	if (bOff) {
		//Effect.Fade($('dvInstallPanel'), { duration: 0.4, from: 0.9, to: 0 } );
		if (!!$('aDPYourClogs')) {
			$('aDPYourClogs').style.display = 'inline';
		}
		if (!!$('aDPSettings')) {
			$('aDPSettings').style.display = 'inline';
		}
		$('dvInstallPanel').style.display='none';
		document.body.removeChild($('dvInstallPanel'));
		return false;
	}
	
	
	//alert('here');
	
	var oDiv = document.createElement('div');
	oDiv.className = 'InstallPanel';
	// setattribute instead?
	oDiv.id = 'dvInstallPanel';
	oDiv.innerHTML += '<div class="BackDrop"><div class="InstallBox"><h3>Install Amplify</h3><ol><li>Click <em>Allow</em></li><li>Click <em>Install Now</em></li><li>Restart Firefox</li></ol></div></div>';
			
	
	oDiv.style.filter = 'alpha(opacity=0)';
	oDiv.style.opacity = '0.0';
	oDiv.style.zIndex = '999999';

	oDiv.style.display = 'block';
	if (!!$('aDPYourClogs')) {
		$('aDPYourClogs').style.display = 'none';
	}
	
	if (!!$('aDPSettings')) {
		$('aDPSettings').style.display = 'none';
	}


	Event.observe(oDiv, 'click', function(event) { InstallPanel(obj, true); });
	
	document.body.appendChild(oDiv);
	
	Effect.Fade(oDiv, { duration: 0.4, from: 0, to: 0.9, afterFinish: function() { window.location.href = (bSecure ? 'https://addons.mozilla.org/en-US/firefox/downloads/latest/13263' : 'https://addons.mozilla.org/en-US/firefox/downloads/latest/13263'); } } );

	return false;
}


function InstallBmkltClick(sBtnLabel) {
	//alert('Please drag this button to your Bookmarks Bar to install the bookmarklet.');
	alert('To use Amplify, please drag the \"' + (sBtnLabel ? sBtnLabel : 'Share with Amplify') + '\" button to the bookmarks bar at the top of your browser.');
	
	return false;
}

