if(typeof ARTSPLANET_042 == "undefined") {
    var ARTSPLANET_042 = {};
}
ARTSPLANET_042.browser = (function() {
	var ua = navigator.userAgent;
	if (ua.indexOf("Safari") > -1) {
		return "Safari";
	}
	if (ua.indexOf("MSIE") > -1){
		return "MSIE";
	}
	return "Netscape";
})();
(function() {
	var width = "160";
	var height = "240";
	var swf = "http://artsplanet.biz/data/swf/bp042.swf";
	var flashVars = "";

	var html = "";
	html += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' ";
	html += "width='" + width + "' height='" + height + "' ";
	html += "align='middle' id='ARTSPLANET_042_sidebar_swf'>";
	html += "<param name='movie' value='" + swf + "' />";
	html += "<param name='allowScriptAccess' value='always' />";
	html += "<param name='quality' value='high' />";
	html += "<param name='wmode' value='transparent' />";
	html += "<param name='allowFullScreen' value='false' />";
	html += "<param name='flashvars' value='" + flashVars + "'>";
	html += "<embed src='" + swf + "' quality='high' wmode='transparent' ";
	html += "width='" + width + "' height='" + height + "' ";
	html += "name='ARTSPLANET_042_sidebar_swf' align='middle' ";
	html += "allowScriptAccess='always' allowFullScreen='false' ";
	html += "type='application/x-shockwave-flash' ";
	html += "pluginspage='http://www.macromedia.com/go/getflashplayer' ";
	html += "flashvars='" + flashVars + "' /></object>";
	document.write(html);
})();
ARTSPLANET_042.FloatingLayer = function() {
	this.swf = "";
	this.id = "";
	this.x = 0;
	this.y = 0;
	this.w = 1;
	this.y = 1;
	this.body = document['CSS1Compat' == document.compatMode ? 'documentElement' : 'body'];
	this.flashVars = "";
};
ARTSPLANET_042.FloatingLayer.prototype.create = function() {
	var html = "";
	html += "<div id='" + this.id + "' >";
	html += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' ";
	html += "width='320' height='440' id='ARTSPLANET_042_floating_swf' align='middle'>";
	html += "<param name='movie' value='" + this.swf + "' />";
	html += "<param name='allowScriptAccess' value='always' />";
	html += "<param name='flashvars' value='" + this.flashVars + "'>";
	html += "<param name='quality' value='high' />";
	html += "<param name='wmode' value='transparent' />";
	html += "<embed src='" + this.swf + "' quality='high' "; 
	html += "wmode='transparent' width='320' height='440' name='ARTSPLANET_042_floating_swf' ";
	html += "align='middle' allowScriptAccess='always' ";
	html += "type='application/x-shockwave-flash' ";
	html += "pluginspage='http://www.macromedia.com/go/getflashplayer' ";
	html += "flashvars='" + this.flashVars + "' /></object>";
	html += "</div><div style='margin-top: 10px'><a href='javascript: ARTSPLANET_042.hideFloating();' ><font color='#000000'>Close</font></a>";
	
	this.div = document.createElement("div");
	this.div.style.position = "absolute";
	this.div.style.zIndex = 200;
	this.div.style.backgroundColor = "#000000";
	this.div.style.filter = "Alpha(opacity=75)";
	this.div.style.opacity = "0.75";

	this.div2 = document.createElement("div");
	this.div2.style.zIndex = 201;
	this.div2.style.padding = "10px";
	this.div2.style.backgroundColor = "#FFFFFF";
	this.div2.style.position = "absolute";
	this.div2.innerHTML = html;

	document.body.appendChild(this.div);
	document.body.appendChild(this.div2);
};
ARTSPLANET_042.FloatingLayer.prototype.setWidth = function(w) {
	if(w != -1) {
		this.w = w;
		this.div.style.width = this.w + 'px';
		return;
	}
	if(ARTSPLANET_042.browser == "MSIE") {
		this.w = this.body.clientWidth;
	} else {
		this.w = window.innerWidth - 17;
	}
	this.div.style.width = this.w + 'px';
	return;
};
ARTSPLANET_042.FloatingLayer.prototype.setHeight = function(h) {
	if(h != -1) {
		this.h = h;
		this.div.style.height = this.h + 'px';
		return;
	}
	if(ARTSPLANET_042.browser == "MSIE") {
		this.h = this.body.clientHeight;
	} else if(ARTSPLANET_042.browser == "Netscape") {
		this.h = window.innerHeight - 17;
	} else {
		this.h = window.innerHeight;
	}
	this.div.style.height = this.h + 'px';
	return;
};
ARTSPLANET_042.FloatingLayer.prototype.setSize = function(w, h) {
	this.setWidth(w);
	this.setHeight(h);
};
ARTSPLANET_042.FloatingLayer.prototype.setPosition = function(x, y) {
	this.x = x;
	this.y = y;
	if(ARTSPLANET_042.browser == "MSIE") {
		this.div.style.left = this.x + this.body.scrollLeft + 'px';
		this.div.style.top = this.y + this.body.scrollTop + 'px';
		this.div2.style.left = this.x + this.body.scrollLeft + (this.w - 330) / 2 + 'px';
		this.div2.style.top = this.y + this.body.scrollTop + (this.h - 450) / 2 + 'px';
	} else {
		this.div.style.left = this.x + pageXOffset + 'px';
		this.div.style.top = this.y + pageYOffset + 'px';
		this.div2.style.left = this.x + pageXOffset + (this.w - 320) / 2 + 'px';
		this.div2.style.top = this.y + pageYOffset + (this.h - 440) / 2 + 'px';
	}
};

ARTSPLANET_042.floatingLayer = new ARTSPLANET_042.FloatingLayer();
ARTSPLANET_042.firstFloat = true;
ARTSPLANET_042.hideFloating = function(){
	ARTSPLANET_042.floatingLayer.div.style.display = "none";
	ARTSPLANET_042.floatingLayer.div2.style.display = "none";
};
ARTSPLANET_042.showFloating = function() {
    if(ARTSPLANET_042.firstFloat) {
        ARTSPLANET_042.createFloat();
        ARTSPLANET_042.firstFloat = false;
    }
	ARTSPLANET_042.floatingLayer.div.style.display = "block";
	ARTSPLANET_042.floatingLayer.div2.style.display = "block";
};
ARTSPLANET_042.createFloat = function() {
    var layer = ARTSPLANET_042.floatingLayer;
	layer.zIndex = 1;
	layer.swf = "http://artsplanet.org/toolbar/peso_fortune/fortune.swf";
	layer.id = "ARTSPLANET_042_floating_layer";
	layer.flashVars = "";
	layer.create();
	layer.setSize(-1, -1);
	layer.setPosition(0, 0);
};
ARTSPLANET_042.eventObserve = function(obj,e, func, bool) {
	if(obj.addEventListener) {
		obj.addEventListener(e, func, bool)
	} else if (obj.attachEvent) {
		obj.attachEvent("on" + e, func)
	}
};
ARTSPLANET_042.eventObserve(window, 'resize', function() {
	if(ARTSPLANET_042.firstFloat) {
		return;
	}
	var layer = ARTSPLANET_042.floatingLayer;
	layer.setSize(-1, -1);
	layer.setPosition(0, 0);
}, false);

ARTSPLANET_042.eventObserve(window, 'scroll', function() {
	if(ARTSPLANET_042.firstFloat) {
		return;
	}
	var layer = ARTSPLANET_042.floatingLayer;
	layer.setPosition(0, 0);
}, false);

if(ARTSPLANET_042.browser == "Safari") {
	window.resizeBy(1, 0);
} else {
	document.getElementsByTagName("html")[0].style.overflow = "scroll";
}

