//--------------------------------------------------------------------------
//GENERAL API//
function BrowserSystemCheck() {
	var brwtype = navigator.appName
	if (brwtype=="Netscape") this.brwtype = "ns"
	else if (brwtype=="Microsoft Internet Explorer") this.brwtype = "ie"
	else this.brwtype = brwtype
	this.brwvers = navigator.appVersion
	this.brwversion = parseInt(this.brwvers)
		
	this.ns = (this.brwtype=="ns" && this.brwversion>=4)
	this.ns4 = (this.brwtype=="ns" && this.brwversion==4)
	this.ns6 = (this.brwtype=="ns" && this.brwversion==5)
	this.ie = (this.brwtype=="ie" && this.brwversion>=4)
	this.ie4 = (this.brwvers.indexOf('MSIE 4')>0)
	this.ie5 = (this.brwvers.indexOf('MSIE 5')>0)
	this.min = (this.ns||this.ie)
	
	this.winos = (this.brwvers.lastIndexOf('Win')!= -1)
	this.macos = (this.brwvers.lastIndexOf('Win') == -1)
	this.macosie = this.macos && this.ie
	this.macosns = this.macos && this.ns
	this.winosie = this.winos && this.ie
	this.winosns = this.winos && this.ns
}

var isNav, isIE, isMoz;
var collStart = "";
var collEnd = "";
var styleObj = "";

if (parseInt(navigator.appVersion) >= 4){
	if (navigator.appName == "Netscape"){
		if (parseInt(navigator.appVersion) >= 5){
			isMoz = true;
			collStart = "getElementById('";
			collEnd = "')";
			styleObj = ".style";
		}
		else{
			isNav = true;
		}
	}
	else{
		isIE = true;
		collStart = "all.";
		styleObj = ".style";
	}
}

function getObject(obj){
	var theObj;
	
	if (typeof obj == "string"){
		theObj = eval("document." + collStart + obj + collEnd + styleObj);
	}
	else{
		theObj = obj;
	}
	return theObj;
}

function shiftTo(obj, x, y){
	var theObj = getObject(obj);
	
	if (isNav){
		theObj.moveTo(x,y);
	}
	else if(isMoz){
		theObj.left = x;
		theObj.top = y;
	}
	else{
		theObj.pixelLeft = x;
		theObj.pixelTop = y;
	}
}

function shiftBy(obj, deltaX, deltaY){
	var theObj = getObject(obj);

	if (isNav){
		theObj.moveBy(deltaX, deltaY);
	}
	else if(isMoz){
		theObj.left = parseInt(theObj.left) + deltaX;
		theObj.top = parseInt(theObj.top) + deltaY;
	}
	else{
		theObj.pixelLeft += deltaX;
		theObj.pixelTop += deltaY;
	}
}

function setZIndex(obj, zOrder){
	var theObj = getObject(obj);
	
	theObj.zIndex = zOrder;
}

function setBGColor(obj, color){
	var theObj = getObject(obj);
	
	if(isNav){
		theObj.bgColor = color;
	}
	else{
		theObj.backgroundColor = color;
	}
}

function setBorderColor(obj, color){
	obj.borderColor = color;
}

function show(obj){
	var theObj = getObject(obj);
	
	if(isNav){
		theObj.visibility = "show";
	}
	else{
		theObj.visibility = "visible";
	}
}

function hide(obj){
	var theObj = getObject(obj);
	
	if (isNav){
		theObj.visibility = "hide";
	}
	else{
		theObj.visibility = "hidden";
	}
}

function getObjectLeft(obj){
	var theObj = getObject(obj);
	
	if (isNav){
		return theObj.left;
	}
	else{
		return theObj.pixelLeft;
	}
}

function getObjectTop(obj){
	var theObj = getObject(obj);
	
	if(isNav){
		return theObj.top;
	}
	else if(isMoz){
		return theObj.top;
	}
	else{
		return theObj.pixelTop;
	}
}

// By Torben Larsson @ framfab	
