if(typeof ARTSPLANET46 == "undefined") {
    var ARTSPLANET46 = {};
}
ARTSPLANET46.uniqueID = (new Date).getTime();
ARTSPLANET46.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 = "140";
	var flashVars = "uniqueID=" + ARTSPLANET46.uniqueID;
	var swf = "http://artsplanet.biz/data/swf/bp046.swf";

	var html = "";
	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='" + width + "' height='" + height + "' ";
	html += "align='middle' id='artsplanet_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_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);
})();
ARTSPLANET46.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 = "";
};
ARTSPLANET46.FloatingLayer.prototype.create = function() {
	var html = "";
	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='100%' height='100%' id='artsplanet_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='scale' value='noscale' />";
	html += "<param name='salign' value='lt' />";
	html += "<param name='quality' value='high' />";
	html += "<param name='wmode' value='transparent' />";
	html += "<embed src='" + this.swf + "' quality='high' scale='noscale' salign='lt' "; 
	html += "wmode='transparent' width='100%' height='100%' name='artsplanet_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>";
	
	this.div = document.createElement("div");
	this.div.setAttribute("id", this.id);
	this.div.innerHTML = html;
	this.div.style.position = "absolute";
	this.div.style.zIndex = 200;
	document.body.appendChild(this.div);
};
ARTSPLANET46.FloatingLayer.prototype.setWidth = function(w) {
	if(w != -1) {
		this.w = w;
		this.div.style.width = this.w + 'px';
		return;
	}
	if(ARTSPLANET46.browser == "MSIE") {
		this.w = this.body.clientWidth;
	} else {
		this.w = window.innerWidth - 17;
	}
	this.div.style.width = this.w + 'px';
	return;
};
ARTSPLANET46.FloatingLayer.prototype.setHeight = function(h) {
	if(h != -1) {
		this.h = h;
		this.div.style.height = this.h + 'px';
		return;
	}
	if(ARTSPLANET46.browser == "MSIE") {
		this.h = this.body.clientHeight;
	} else if(ARTSPLANET46.browser == "Netscape") {
		this.h = window.innerHeight - 17;
	} else {
		this.h = window.innerHeight;
	}
	this.div.style.height = this.h + 'px';
	return;
};
ARTSPLANET46.FloatingLayer.prototype.setSize = function(w, h) {
	this.setWidth(w);
	this.setHeight(h);
};
ARTSPLANET46.FloatingLayer.prototype.setPosition = function(x, y) {
	this.x = x;
	this.y = y;
	if(ARTSPLANET46.browser == "MSIE") {
		this.div.style.left = this.x + this.body.scrollLeft + 'px';
		this.div.style.top = this.y + this.body.scrollTop + 'px';
	} else {
		this.div.style.left = this.x + pageXOffset + 'px';
		this.div.style.top = this.y + pageYOffset + 'px';
	}
};
ARTSPLANET46.FloatingLayer.prototype.setdPosition = function(x, y) {
	this.x += x;
	this.y += y;
	this.setPosition(this.x, this.y);
};
ARTSPLANET46.FloatingLayer.prototype.setAlign = function(str) {
	if(str == 'right') {
		if(ARTSPLANET46.browser == "MSIE") {
			this.x = this.body.clientWidth - this.w;
		} else {
			this.x = window.innerWidth - this.w;
			this.x -= 17;
		}
	} else if(str == 'left') {
		this.x = 0;
	} else if(str == 'bottom') {
		if(ARTSPLANET46.browser == "MSIE") {
			this.y = this.body.clientHeight - this.h;
		} else {
			this.y = window.innerHeight - this.h;
			this.y -= 17;
		}
	} else if(str == 'top') {
		this.y = 0;
	}
	this.setPosition(this.x, this.y);
};
ARTSPLANET46.FloatingLayer.prototype.correctWindowSize = function(str) {
	if(this.wFullFlag && this.hFullFlag) {
		this.setSize("full","full");
	}
	else if(this.wFullFlag) {
		this.setSize("full",this.h);
	}
	else if(this.hFullFlag) {
		this.setSize(this.w,"full");
	}
};

ARTSPLANET46.floatingLayer = new ARTSPLANET46.FloatingLayer();
ARTSPLANET46.firstFloat = true;
ARTSPLANET46.hideFloating = function(){
	ARTSPLANET46.floatingLayer.div.style.display = "none";
};
ARTSPLANET46.showFloating = function() {
    if(ARTSPLANET46.firstFloat) {
        ARTSPLANET46.createFloat();
        ARTSPLANET46.firstFloat = false;
    }
	ARTSPLANET46.floatingLayer.div.style.display = "block";
};
ARTSPLANET46.createFloat = function() {
    var layer = ARTSPLANET46.floatingLayer;
	layer.zIndex = 1;
	layer.swf = "http://artsplanet.biz/data/swf/bp046_float.swf";
	layer.id = "artsplanet_floating_layer";
	layer.flashVars = "uniqueID=" + ARTSPLANET46.uniqueID;
	layer.create();
	if(ARTSPLANET46.browser == "MSIE") {
		layer.setSize(-1, -1);
	} else {
		layer.setSize(-1, 100);
	}
	layer.setPosition(0, 0);
};
ARTSPLANET46.eventObserve = function(obj,e, func, bool) {
	if(obj.addEventListener) {
		obj.addEventListener(e, func, bool)
	} else if (obj.attachEvent) {
		obj.attachEvent("on" + e, func)
	}
};
ARTSPLANET46.eventObserve(window, 'resize', function() {
	if(ARTSPLANET46.firstFloat) {
		return;
	}
	var layer = ARTSPLANET46.floatingLayer;
	if(ARTSPLANET46.browser == "MSIE") {
		layer.setSize(-1, -1);
	} else {
		layer.setSize(-1, 100);
	}
	layer.setPosition(0, 0);
}, false);

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

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

