function jsw_useragent()
{
	this.ver = new function() {
		this.appV = navigator.appVersion;
		this.major = parseInt(this.appV);
		this.minor = parseFloat(this.appV) % parseInt(this.appV, 10);
	}
	this.ua = navigator.userAgent.toLowerCase();
	this.dom = document.getElementById ? 1 : 0;
	this.ns = null;
	this.op = this.ua.indexOf("opera");
	this.moz = ((this.ua.indexOf("gecko") > -1) || window.sidebar);
	this.ie = (this.ua.indexOf("msie") > -1) && !this.op;
	if(this.op)
		{
			this.op5 = ((this.ua.indexOf("opera 5") > -1) || (this.ua.indexOf("opera/5") > -1));
			this.op6 = ((this.ua.indexOf("opera 6") > -1) || (this.ua.indexOf("opera/6") > -1));
			this.op7 = this.dom && !this.op5 && !this.op6;
		}
	else if(this.moz) 
		this.ns6 = 1;
	else if(this.ie)
		{
			this.ie4 = !this.dom && document.all;
			this.ie5 = (this.ua.indexOf("msie 5") > -1);
			this.ie55 = (this.ie5 && this.agent.indexOf("msie 5.5") > -1);
			this.ie6 = this.dom && !this.ie4 && !this.ie5 && ! this.ie55;
		}
		
	this.mac = (this.ua.indexOf("mac")>-1);
	this.bw = (this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.op5 || this.op6 || this.op7 || this.ff);
  this.usedom = this.ns6 || this.op7;
  this.px = this.dom && !this.op5 ? "px" : "";
	return this;
}
var ua = new jsw_useragent();

function jsw_getElementById(o)
{
	var obj = null;
	
	if(ua.dom) 
		obj = document.getElementById(o);
	else if(ua.ns4) 
		obj = eval("document.layers." + o);
	else if(ua.ie4) 
		obj = document.all[o];
		
	return obj ? obj : 0;
}

function jsw_register_img_rollover(ob, n, ov)
{
	var o = jsw_getElementById(ob);
	o.norm = new Image(); o.norm.src = n;
	o.over = new Image(); o.over.src = ov;
	o.onmouseover = function() { this.src =  this.over.src }
	o.onmouseout = function() { this.src = this.norm.src }
}

function jsw_register_layer_rollover(ob, n, ov)
{
	var o = document.getElementById(ob);
	o.lnorm = n ? document.getElementById(n) : null;
	o.lover = ov ? document.getElementById(ov) : null;
	o.onmouseout = function() { 
		if(this.norm) this.src = this.norm.src; 
		if(this.lover) { this.lover.style.visibility = "hidden"; this.lover.style.position = "absolute"; }
		if(this.lnorm) { this.lnorm.style.position = "static"; this.lnorm.style.visibility = "visible"; }
	}
	o.onmouseover = function() {
		if(this.over) this.src = this.over.src;
		if(this.lnorm) { this.lnorm.style.visibility = "hidden"; this.lnorm.style.position = "absolute"; }
		if(this.lover) { this.lover.style.position = "static"; this.lover.style.visibility = "visible"; }
	}
	if(o.lnorm) { o.lnorm.style.visibility = "hidden"; o.lnorm.style.position = "absolute"; }
	if(o.lover) { o.lover.style.visibility = "hidden"; o.lover.style.position = "absolute"; }
}

function jsw_multi_img_roll(ovobj, imgobj, n, ov)
{
	var io = jsw_getElementById(imgobj);
	var oo = jsw_getElementById(ovobj);
	
	if(!oo.irolls)
		oo.irolls = new Array();
	
	len = oo.irolls.length;
	oo.irolls[len] = new Object();
	oo.irolls[len].norm = new Image();
	oo.irolls[len].norm.src = n;
	oo.irolls[len].over = new Image();
	oo.irolls[len].over.src = ov;
	oo.irolls[len].img = io;
	
	oo.onmouseover = function() 
		{ 
			for(i = 0; i < this.irolls.length; i++)
				this.irolls[i].img.src = this.irolls[i].over.src;
		}
	oo.onmouseout = function() 
		{
	 		for(i = 0; i < this.irolls.length; i++)
				this.irolls[i].img.src = this.irolls[i].norm.src;
		}
}




