
function stopError() {
	return true;
}
//window.onerror=stopError;


isIE = (navigator.appName.indexOf ("Microsoft") != -1) ? 1 : 0;
op5 = (navigator.userAgent.indexOf("Opera 5")!=-1) ||(navigator.userAgent.indexOf("Opera/5")!=-1)
oX=0
oY=0

PAST_show=0

function PAST() {
	if (PAST_show==0) {
		PAST_show=1
		var obj=getStyle('the_past')
		obj.display='block'
	} else {
		PAST_show=0
		var obj=getStyle('the_past')
		obj.display='none'
	}
	var obj=getObj('pastlink')
	obj.blur()
	
}

function showWork(id) {
	
	var obj=getStyle('WORK'+id)
	obj.display='block'
	
}

function hideWork(id) {
	
	var obj=getStyle('WORK'+id)
	obj.display='none'
	
}

function getStyle(n){
	return getObj(n).style;
}

function noSpam(who,domain) {
	str = "mailto:" + who + "@" + domain;
	window.location = str;
}

function getObj(n){
	if(document.getElementById){
		return document.getElementById(n);
	}else if(document.all){
		return document.all[n];
	}
}

function deleteSpiral(id) {
	obj=getStyle('spiral'+id)
	obj.display='none'
	
}

function clickedMenu(id) {
	alert(id)
	
}



function setXY(t) {
	var oH=getOBJHeight(t)
	var oW=getOBJWidth(t)
	oX=Math.round(getOBJLeft(t)+oW/2)
	oY=Math.round(getOBJTop(t)+oH/2)
}


function spO(e) {
	var m=getMouse(e)
	obj=getStyle('spiral555')
	obj.left=(m[0]-100)+"px"
	obj.top=(m[1]-100)+"px"
	obj.display="block"
	var r=Math.random()
	
	//flashProxy555.call("startMe", {newF:1});
}

function spOT() {
	obj=getStyle('spiral555')
	obj.display="none"
	//flashProxy555.call("stopMe", {newF:1});
}

function getMouse(e){
	var posx=0,posy=0
	if (e==null) {
		e=window.event
	}
	if (e==null) { 
		return new Array(oX, oY)
	}
	
	if (e.pageX || e.pageY){
		posx=e.pageX; posy=e.pageY
	} else if (e.clientX || e.clientY) {
		if(document.documentElement.scrollTop){
			posx=e.clientX+document.documentElement.scrollLeft
			posy=e.clientY+document.documentElement.scrollTop
		} else {
			posx=e.clientX+document.body.scrollLeft
			posy=e.clientY+document.body.scrollTop
		}
	}
	
	return new Array(posx, posy)
}

function correctPNG(iii) {
	if (document.all && (navigator.appName.indexOf("MSIE")!=-1)) {
		
		var img = document.images[''+iii]
		var imgName = img.src.toUpperCase()
		var imgName = img.src.toUpperCase()
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
			 var imgID = (img.name) ? "id='" + img.name + "' " : ""  // spezial hier.. der name wird die ID !!
			 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
			 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
			 var imgStyle = "display:inline-block;" + img.style.cssText 
			 if (img.align == "left") imgStyle = "float:left;" + imgStyle
			 if (img.align == "right") imgStyle = "float:right;" + imgStyle
			 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
			 var strNewHTML = "<span " + imgID + imgClass + imgTitle
			 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			 + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
			 img.outerHTML = strNewHTML
		 }
	}
}

function showSpiral() {
	flashProxy555.call("moveLines", {newW:newWW, newH:newHH});
	
}


function getOBJWidth(obj) {
	var xPos
	if (op5) {
		xPos = obj.style.pixelWidth;
	} else {
		xPos = obj.offsetWidth;
	}
	return xPos
}



function getOBJLeft(obj) {
	
	var xPos = 0
	if (obj.offsetParent) {
		xPos = obj.offsetLeft;
		tempEl = obj.offsetParent;
		while (tempEl != null) {
			xPos += tempEl.offsetLeft;
			tempEl = tempEl.offsetParent;
		}
	} else if (obj.x) {
		xPos+=obj.x
	}
	return xPos

}


function getOBJTop(obj) {
		var yPos = 0;

		if (obj.offsetParent) {
			yPos = obj.offsetTop
			tempEl = obj.offsetParent
			while (tempEl != null) {
				yPos += tempEl.offsetTop
				tempEl = tempEl.offsetParent
			}
		} else if (obj.y) {
			yPos+=obj.y
		}
		return yPos;
}

function getOBJHeight(obj) {
	var yPos
	if (op5) { 
		yPos = obj.style.pixelHeight;
	} else {
		yPos = obj.offsetHeight;
	}
	return yPos
}

function winW() {
	if (document.all) {
		return document.body.offsetWidth	
	} else {
		return window.innerWidth
	}
}

function winH() {
	if (window.innerWidth) {
		  return window.innerHeight;
	} else if (document.documentElement && document.documentElement.offsetHeight) {
		return document.documentElement.offsetHeight
	} else if (document.body) {
		  return document.body.offsetHeight
	}
}


function bl(t) {
	if (!isIE) {
		t.blur()
	}
}


function logIT(what, detail) {
	
	
	var xmlHttp;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e) {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			try {
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {
				return false;
			}
		}
	}
	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
			// logged!
		}
	}
	xmlHttp.open("GET","incl/log.php?what="+what+"&d="+detail, true);
	xmlHttp.send(null);
}
