function altRows(tableClass, altClass, ignore)
{
	
	var tables, table, rows, arow;
	var rowCount = 0;

	var tables = document.getElementsByTagName('table');
	
	for (var i=0;i<tables.length;i++)
	{
		atable = tables[i];

		rows = atable.getElementsByTagName("tr");
	
		for(var j=ignore;j<rows.length;j++) {
			arow = rows.item(j);
			if(arow.nodeName == "TR") {
				if (rowCount % 2 && arow.className != "highlight") { // do not change row colour if it is hightlighted!
					arow.className = arow.className+" "+altClass;
				} else {
					// default case - leave as it is!
				}
				rowCount++;
			}
		}
	
	}
	
}





function showFlashHeader()
{
	// add flash header
	//
	var so = new SWFObject("assets/flash/home_base.swf","teaser", 880, 370, 8, "#000000");
	so.addParam("wmode", "transparent");
	so.write("content");
	
	// replace headlines
	//
	if(typeof sIFR == "function")
	{
	   sIFR.replaceElement("#shopteaser h3", named({sFlashSrc: "./assets/flash/easyhero.swf", sColor: "#333333", sWmode: "transparent"}));
	   sIFR.replaceElement("h3", named({sFlashSrc: "./assets/flash/easyhero.swf", sColor: "#ffffff", sWmode: "transparent"}));
	};
}






function showFlash($id, $swf, $w, $h, $v, $bgcol)
{
	// add flash header
	//
	var so = new SWFObject("assets/flash/"+$swf,"fl_"+$id, $w, $h, $v, $bgcol);
	//so.addParam("scale", "noscale");
	//so.addParam("allowFullScreen", "true");
	so.write( $id );
}







/*
AjaxRequest Class ----------------------------------------------------------------
*/

/**
 * A XMLHTTPRequest wrapper Class for the AutoComplete Widget.
 *
 * @param   val       String - value in the field at time of request
 * @param   query     String - the complete query
 * @param   onwait    Function - on wait callback. Takes instance of AjaxRequest as argument.
 * @param   ondata    Function - on data callback. Takes instance of AjaxRequest as argument.
 * @param   onerror   Function - on error callback. Takes instance of AjaxRequest as argument.
 */
AjaxRequest = function (val, query, onwait, ondata, onerror, salt)
{
	this.value = val;
	this.query = query;
	this.cb_wait = onwait;
	this.cb_data = ondata;
	this.cb_error = onerror;
	this.salt = salt ? true : false;

	this.req = this.getAJAX();
	this.result = "";
};



AjaxRequest.prototype.doRequest = function ()
{
	var uri = (this.salt) ? this.query + "ts." + new Date().getTime() + "/"  :  this.query;
	var r = this.req;
	var doneWait = false;
	var p = this;

	r.open( "GET", uri, true );

	r.onreadystatechange = function ()
	{
		/*
		0 = uninitialized
		1 = loading
		2 = loaded
		3 = interactive
		4 = complete
		*/


		if (r.readyState < 4)
		{
			if (!doneWait)
			{
				p.onWait( r );
				doneWait = true;
			}
		}
		else
		{
			switch (r.status)
			{
				case 200: // "OK"
					p.onData( r );
					break;

				case 304: // "Not modified" - should happen because we are avoiding the browser cache

					break;

				default:
					p.onError( r );
			}
		}
	};

	r.send( null );
};



AjaxRequest.prototype.getAJAX = function ()
{
	var oXHR;

	// Returns a new Ajax object (cross-browser) if available, false if not.
	try
	{  
		oXHR = new ActiveXObject('Msxml2.XMLHTTP');
	}
	catch (e)
	{
		try
		{
			oXHR = new ActiveXObject('Microsoft.XMLHTTP');
		}
		catch (e2)
		{
			try
			{
				oXHR = new XMLHttpRequest();
			}
			catch (e3)
			{
				oXHR = false;
			}
		}
	}

	return oXHR;
};



AjaxRequest.prototype.onWait = function (oXHR)
{
	this.cb_wait( this );
};



AjaxRequest.prototype.onData = function (oXHR)
{
	this.cb_data( this );
};



AjaxRequest.prototype.onError = function (oXHR)
{
	this.cb_error( this );
};



AjaxRequest.prototype.getResponseXML = function ()
{
	return this.req.responseXML;
};






/*
Tween Class ----------------------------------------------------------------
*/


Tween = function (ele, prop, unit, from, to, fadetime, callback)
{	
	this.ele = ele;
	this.prop = prop;
	this.unit = (unit != "") ? unit : this._getUnit();
	this.from = (from != "") ? from-0 : this._getFrom();
	this.to = to-0;

	this.callback = callback;

	this.nDur = fadetime;

	this.nInt = 10;
	this.nTime = 0;

	var p = this;
	this.nID = setInterval(function() { p._do() }, this.nInt);
}




Tween.prototype._getFrom = function()
{
	var str = this.ele.style[this.prop];
	var c, v="";
	var arr = str.split("");

	for (var i=0, l=arr.length; i<l; i++)
	{
		c = (arr[i]-0).toString();
		if (c != "NaN")
		{
			v += c;
		}
	}

	return Number(v);
}




Tween.prototype._getUnit = function()
{
	var str = this.ele.style[this.prop];
	var c, n, v="";
	var arr = str.split("");

	for (var i=0, l=arr.length; i<l; i++)
	{
		c = arr[i]
		n = (c-0).toString();
		if (n == "NaN")
		{
			v += c;
		}
	}

	return v;
}




Tween.prototype._do = function()
{
	this.nTime += this.nInt;

	var n = this._easeInOut(this.nTime, this.from, this.to, this.nDur);
	this.ele.style[this.prop] = n + this.unit;

	if (this.nTime == this.nDur)
	{
		clearInterval( this.nID );
		if (this.callback != undefined)
			this.callback();
	}
}



Tween.prototype._easeInOut = function(count, start, end, time)
{
	// return b + ( (c-b) * (t/d) );
	var n = Math.sin( (count / time) * Math.PI / 2 );
	return start + (( end-start ) * n);
}