<?php
if (defined('GOOGLE_ADSENSE')) {
?>
<div class="box controller adsense ui-widget-content">
	<div id="google-adsense"></div>
<script type="text/javascript">
<?php echo GOOGLE_ADSENSE; ?>
if (navigator.userAgent.toLowerCase().match(/opera/)) {
	var script = document.createElement("script");
	script.src = "http://pagead2.googlesyndication.com/pagead/show_ads.js";
	document.getElementById("google-adsense").appendChild(script);
} else {
	$(function() {
		google_backup = document.write;
		document.write = function(v) {
			google_content = v;
		}
		$.getScript("http://pagead2.googlesyndication.com/pagead/show_ads.js", function() {
			document.write = google_backup;
			$("#google-adsense").html(google_content);
			delete google_content;
			delete google_backup;
		});
	});
}
</script>
</div>
<?php
}
?>