
function userSettings(name)
{
	this.name = name;
	this.ns = (navigator.appName == "Netscape");
	this.ie = (navigator.appVersion.indexOf("MSIE") != -1);
	this.dom = (document.getElementById ? true : false);
	this.ns4 = (this.ns && (navigator.appVersion.charAt(0) == "4"));
	this.ns6 = (document.getElementById && !document.all);
	this.nsVersion = parseFloat(navigator.appVersion);
	this.ie4 = (this.ie && !this.dom);
	this.ie5 = (this.ie && this.dom);
	this.webtv = (navigator.appName.indexOf("WebTV") != -1);
	this.win = (navigator.appVersion.indexOf("Win") != -1);
	this.mac = (navigator.appVersion.indexOf("Mac") != -1);
	this.unix = (navigator.appVersion.indexOf("X11") != -1);
	this.opera = ((navigator.userAgent.indexOf("Opera 6") != -1) ? true : (navigator.userAgent.indexOf("Opera/6") != -1));
}

is=new userSettings('is');
var sMainDir='/';

function NoOp(){return;}

function getStyle(o, style1, style2)
{
	if(o.style)
	{
		var result = o.style[style1];
		if(result != '')
			return result;
		if(o.currentStyle)
			return o.currentStyle[style1];
		if(style2 == null)
			style2 = style1;
		if(window.getComputedStyle)
			return window.getComputedStyle(o, "").getPropertyValue(style2)
	}
	return '';
}

function getElem(id, l)
{
	if(document.getElementById)
	{
		return document.getElementById(id);
	}
	if(document.all)
	{
		return document.all[id];
	}
	if(is.ns4)
	{
		if(!l)
			l=self;
		var conditions=new Array();
		conditions[0]='embeds';
		conditions[1]='applets';
		conditions[2]='images';
		conditions[3]='layers';
		for(var i = 0; i < conditions.length; i++)
		{
			e = l.document[conditions[i]][id];
			if(e)
			{
				return e;
			}
			else
			{
				if(i == 3)
				{
					for(var h = 0; h < l.document[conditions[i]].length; h++)
					{
						e = getElem(id, l.document[conditions[i]][h]);
						if(e)
						{
							return e;
						}
					}
				}
			}
		}
	}
}

newWins = new Array();
function openWindow(winSrc, winName, winHeight, winWidth, winOptions)
{
	if(!winHeight)
		winHeight=300;
	if(!winWidth)
		winWidth=350;
	if(!winName)
		winName = "detail";
	if(!winOptions)
	{
		winOptions = "scrollbars=yes";
	}
	else
	{
		winOptions += ",scrollbars=yes";
	}
	winOptions += ",height=" + winHeight;
	winOptions += ",width=" + winWidth;
	if(!newWins[winName] || newWins[winName].closed)
	{
		newWins[winName] = window.open(winSrc, winName, winOptions)
	}
	else
	{
		newWins[winName].location = winSrc;
		newWins[winName].focus();
	}
	return false;
}

function getCookie(name)
{
	var result="";
	var cookie=" " + document.cookie + ";";
	var search = name + "=";
	if(cookie.indexOf(search) != -1)
	{
		result = cookie.slice(cookie.indexOf(search) + search.length);
		result = result.slice(0, result.indexOf(";"));
	}
	return unescape(result);
}

function setCookie(name, value, days)
{
	var expr = days * 24 * 60 * 60 * 1000;
	var exprDate = new Date();
	exprDate.setTime(exprDate.getTime() + expr);
	document.cookie = name + "=" + escape(value) + ";expires=" + exprDate.toGMTString();
}

function getPos(e, prop)
{
	if(is.ie4)
	{
		if(e.parentElement != e.parentElement.tagName != 'BODY')
		{
			return getPos(e.parentElement, prop) + e[prop];
		}
		else
		{
			return e[prop];
		}
	}
	else
	{
		if(e.offsetParent.tagName != 'BODY')
		{
			return getPos(e.offsetParent, prop) + e[prop];
		}
		else
		{
			return e[prop];
		}
	}
}

function imgFlip(name, img1, img2, alt)
{
	this.name = name;
	this.img1 = new Image();
	this.img1.src = img1;
	this.img2 = new Image();
	this.img2.src = img2;
	this.status = new setStatus((alt ? alt : ''));
}

imgFlip.prototype.flip=function(s)
{
	switch(s)
	{
		case 1: 
			document.images[this.name+'_img'].src=this.img2.src;
			return this.status.show();
			break;
		case 2: 
			document.images[this.name+'_img'].src = this.img1.src;
			return this.status.hide();
			break;
		}
	}

function imgFlip3(name,img2,img3){this.img=document.images[name+'_img'];this.img1=new	Image();this.img2=new	Image();this.img3=new	Image();this.img1.src=this.img.src;this.img2.src=img2;this.img3.src=img3;return this;}
imgFlip3.prototype.flip=function(i){switch(i){case 1: this.img.src=this.img1.src;break;case 2: this.img.src=this.img2.src;break;case 3: this.img.src=this.img3.src;break;}}

function setStatus(text)
{
	this.text = text;
	return this;
}
setStatus.prototype.show = function()
{
	window.status = this.text;
	return true;
}
setStatus.prototype.hide = function()
{
	window.status = '';
	return true;
}

window.onerror = function(aMessage, aURL, sLine)
{
	var sUrl = "/error_handle.aspx?";
	sUrl += "msg=" + escape(aMessage) + "&";
	sUrl += "refer=" + escape(aURL) + "&";
	sUrl += "sLine=" + sLine;
	//alert('Message:\n' + aMessage + '\n\nLine:\n' + sLine);
	//window.open(sUrl,"err","height=100,width=100,left=2000,top=2000");
	return true;
}


function highlighting(){}

