var isNav4, isIE, isDOM
var str1 = "";
var str2 = "";
var styleObj = "";

if (parseInt(navigator.appVersion) >= 4) {
	if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
		isNav4 = true
		str1 = "document.layers['";
		str2 = "']";
		styleObj = "";
	} 
	if (document.all) {
		isIE = true;
		str1 = "document.all['";
		str2 = "']";
		styleObj = ".style";
	}
	if (document.getElementById) {
		isDOM = true
		isIE = false;
		isNav4 = false
		str1 = "document.getElementById('";
		str2 = "')";
		styleObj = ".style";
	}
}
// Convert object name string or object reference
// into a valid object reference
function getObject(obj) {
	var theObj;
	if (typeof obj == "string") {
		theObj = eval(str1 + obj + str2 + styleObj);
	} else {
		theObj = obj;
	}
	return theObj
}

// Utility function returns height of object in pixels
function getObjHeight(obj) {
	var theObj = getObject(obj)
	if (isNav4) {
		return theObj.clip.height
	} else if (isIE) {
		return theObj.pixelHeight
	} else {
		return parseInt(theObj.height)
	}
}

// Utility function returns width of object in pixels
function getObjWidth(obj) {
	var theObj = getObject(obj)
	if (isNav4) {
		return theObj.clip.width
	} else if (isIE) {
		return theObj.pixelWidth
	} else {
		return parseInt(theObj.width)
	}
}

// Utility function returns width of window
function getInsideWindowWidth() {
	if (isNav4) {
		return window.innerWidth
	} else if (isIE) {
		return document.body.clientWidth
	} else {
		if (document.body.clientWidth == 0) {
			return window.innerWidth
		} else {
			return document.body.clientWidth;
		}
	}
}

// Utility function returns the x coordinate of a positionable object
function getObjLeft(obj) {
	var theObj = getObject(obj)
	if (isNav4) {
		return theObj.left
	} else if (isIE) {
		return theObj.pixelLeft
	} else {
		return parseInt(theObj.left)
	}
}

// Utility function returns the y coordinate of a positionable object
function getObjTop(obj)  {
	var theObj = getObject(obj)
	if (isNav4) {
		return theObj.top
	} else if (isIE) {
		return theObj.pixelTop
	} else {
		return parseInt(theObj.top)
	}
}

// Utility function to position an element at a specific x,y location
function shiftTo(obj, x, y) {
	var theObj = getObject(obj)
	if (isNav4) {
		theObj.moveTo(x,y)
	} else if (isIE) {
alert ('?');
		theObj.pixelLeft = x
		theObj.pixelTop = y
	} else {
		theObj.left = x + "px"
		theObj.top = y + "px"
	}
}

// Utility function to move an object by x and/or y pixels
function shiftBy(obj, deltaX, deltaY) {
	var theObj = getObject(obj)
	if (isNav4) {
//		theObj.moveBy(deltaX,deltaY)
		theObj.left += deltaX
		theObj.top += deltaY
	} else if (isIE) {
		theObj.pixelLeft += deltaX
		theObj.pixelTop += deltaY
	} else {
		theObj.left = parseInt(theObj.left) + parseInt(deltaX) + "px"
		theObj.top = parseInt(theObj.top) + parseInt(deltaY) + "px"
	}
}

// Utility function sets the visibility of an object to visible
function show(obj) {
	var theObj = getObject(obj)
	theObj.visibility = "visible";
}

// Utility function sets the visibility of an object to hidden
function hide(obj) {
	var theObj = getObject(obj)
	theObj.visibility = "hidden";
}

function team_popup(arg) {
	popupwin = window.open("popup.php?arg="+arg,"popup","top=100,left=150,width=510,height=550,toolbar=no,location=no,scrollbars=no")
}

function produkt_popup(artikelstamm,color,size,action,qty) {
	popupprod = window.open("popup.php?artikelstamm="+artikelstamm+"&color="+color+"&size="+size+"&action="+action+"&qty="+qty,"prodpopup","top=100,left=150,width=510,height=550,toolbar=no,location=no,scrollbars=no")
}

function center_content() {
	moveto = Math.round(getInsideWindowWidth()/2) - Math.round(getObjWidth('keyv')/2);
	shiftTo('keyv',moveto-250,'160');
	show('keyv');
}

