/* ===================================== */
function MOver (prefix, el)
{
	if (prefix == 'colors')
	{
		$('photo0').hide();
//		$("block_content").getElementsBySelector('div[rel="color'+el+'"]').first().show();
		$("block_content").select('div[rel="color'+el+'"]').first().show();
	}
	else
	{
		$(prefix + '0').hide();
		$(prefix + el).show();
	}
}
function MOut (prefix, el)
{
	if (prefix == 'colors')
	{
//		$("block_content").getElementsBySelector('div[rel="color'+el+'"]').first().hide();
		$("block_content").select('div[rel="color'+el+'"]').first().hide();
		$('photo0').show();
	}
	else
	{
		$(prefix + el).hide();
		$(prefix + '0').show();
	}
}
/* ===================================== */
function show_flash(file, flashvars, width, height, bgcolor)
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="OZ" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="allowFullScreen" value="false" />');
	document.write('<param name="movie" value="'+file+'" /><param name="quality" value="high" /><param name="bgcolor" value="'+bgcolor+'" />');
	document.write('<param name="flashvars" value="'+flashvars+'" />');
	document.write('<embed flashvars ="'+flashvars+'" src="'+file+'" quality="high" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" name="'+file+'" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}
/* ===================================== */
// gives up and down scroll buttons to images, spans, ... named up_name, down_name, respectively.
// will keep the default scroll_box's style overflow if it encounters errors (so make overflow: auto;)
// usage: put this after the scrollbox div:  var div_scroll1 = new TextScroll('div_scroll1', 'scroll_box');
function TextScroll(scrollname, div_name, up_name, down_name)
{
	this.div_name = div_name;
	this.name = scrollname;
	this.scrollCursor = 0;
	this.speed = 5;
	this.timeoutID = 0;
	this.div_obj = null;
	this.up_name = up_name;
	this.dn_name = down_name;

	if (document.getElementById) {
		div_obj = document.getElementById(this.div_name);
		if (div_obj) {
			this.div_obj = div_obj;
			this.div_obj.style.overflow = 'hidden';
		}
		div_up_obj = document.getElementById(this.up_name);
		div_dn_obj = document.getElementById(this.dn_name);
		if (div_up_obj && div_dn_obj) {
			div_up_obj.onmouseover = function() { eval(scrollname + ".scrollUp();") };
			div_up_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };
			div_dn_obj.onmouseover = function() { eval(scrollname + ".scrollDown();") };
			div_dn_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };                
		}
	}

	this.stopScroll = function() { clearTimeout(this.timeoutID); }
	this.scrollUp = function() {
		if (this.div_obj) {
			this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
			this.div_obj.scrollLeft = this.scrollCursor;
			this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
		}
	}
	this.scrollDown = function() {
		if (this.div_obj) {
			this.scrollCursor += this.speed;
			this.div_obj.scrollLeft = this.scrollCursor;
			if (this.div_obj.scrollLeft == this.scrollCursor) {
				this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
			} else {
				this.scrollCursor = this.div_obj.scrollLeft;
			}
		}
	}       
	this.resetScroll = function() {
		if (this.div_obj) {
			this.div_obj.scrollLeft = 0;
			this.scrollCursor = 0;
		}
	}
}
/* ===================================== */
