////////////////////////////////////////////////////////////////////////////////////
//Standards
////////////////////////////////////////////////////////////////////////////////////
  	  	
  	function cp(pic, newpic)
	{
	 	document.images[pic].src = newpic;
	}

	function clp(lyrId, pic, newpic)
	{
	 	if (document.layers)	//NS 4.x
		{
			if (document.layers[lyrId].document.images[pic]) document.layers[lyrId].document.images[pic].src = newpic;
		}
	    else
   		{
   			document.images[pic].src = newpic;
   		}
    }
    
   	function mObject(name)	
	{
		this.style = eval(doc_start_tag + name + doc_end_tag + sty);
	}


	////////////////////////////////////////////////////////////////////////////////////
    // OpenWindow
    ////////////////////////////////////////////////////////////////////////////////////
	function ow(filename, caption, x, y, w, h, dontForceSize, pos )
	{
		// Assume forced size if not set
		// if ( !forceSize ) forceSize = 1;
		
		if ( !dontForceSize || dontForceSize == 0 ) param = "width=600,height=500,menubar=no,locationbar=no,scrollbars=yes,resizable=no";
		else param = "width=600,height=500,menubar=no,locationbar=no,scrollbars=yes,resizable=yes";
		
		if ( pos == 1 )
		{
			x = screen.width-w-20;
			y = screen.height-h-200;
		}
		
		// Evil position hack :)
		if ( is.ie && caption=="ProdInfo")
		{
			relX = window.screenLeft;
			relY = window.screenTop;
			
			x = relX + 200 - document.body.scrollLeft;
			y = relY + 200 - document.body.scrollTop;
		}
		
		/*
		if ( is.ie && caption=="kontaktfenster")
		{
			relX = window.screenLeft;
			relY = window.screenTop;
			
			x = relX + 785 - document.body.scrollLeft;
			y = relY + 75 - document.body.scrollTop;
		}
		*/
		
		extern = window.open(filename, caption, param);
		extern.resizeTo(w, h);
		extern.moveTo(x, y);
		extern.focus();
	}
	
	////////////////////////////////////////////////////////////////////////////////////
    // OpenWindow Extended
    ////////////////////////////////////////////////////////////////////////////////////
	function ex_ow(filename, caption, x, y, w, h, opt)
	{
		param = "width=600,height=500," + opt;
		extern = window.open(filename, caption, param);
		extern.resizeTo(w, h);
		extern.moveTo(x, y);
		extern.focus();
	}
	
	
	////////////////////////////////////////////////////////////////////////////////////
	// Client Coords
	////////////////////////////////////////////////////////////////////////////////////
	function getClientX()
	{
		if ( is.ie )
			return window.screenLeft;
			
		if ( is.op7 )
			return 0;
			
		return 0;		
	}
	
	function getClientY()
	{		
		if ( is.ie )
			return window.screenTop;
			
		if ( is.op5 )
			return 23;
			
		if ( is.op7 )
			return 27;
			
		return 0;		
	}
	
	////////////////////////////////////////////////////////////////////////////////////
	//	Screen coords
	////////////////////////////////////////////////////////////////////////////////////
	function getScreenX(xOff)
	{
		return getClientX() + xOff;
	}
	
	function getScreenY(yOff)
	{
		return getClientY() + yOff;
	}
	
	
	////////////////////////////////////////////////////////////////////////////////////
	// Position finder
	////////////////////////////////////////////////////////////////////////////////////
	function findPosX(obj)
	{
		var curleft = 0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curleft += obj.offsetLeft
				obj = obj.offsetParent;
			}
		}
		else if (obj.x)
			curleft += obj.x;
		
		return curleft;
	}
	
	function findPosY(obj)
	{
		var curtop = 0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curtop += obj.offsetTop
				obj = obj.offsetParent;
			}
		}
		else if (obj.y)
			curtop += obj.y;
		
		return curtop;
	}
	
	
		
	////////////////////////////////////////////////////////////////////////////////////
	// Open Sitemap
	////////////////////////////////////////////////////////////////////////////////////
	function ow_site(filename, caption, x, y, w, h, offX, offY )
	{
		// Most Browsers shouldn't be here...
		if ( !is.ie )
		{
			ow(filename,caption,x,y,w,h);
			return;
		}
		
		if (!offX ) offX=0;
		if (!offY ) offY=0;
					
		hOrg = h;
		minH = 200;
		sh  = screen.height;
		sha = screen.availHeight;
		sw  = screen.width;
		sys = document.body.scrollTop;
		ih	= document.body.offsetHeight;
				
		
		
		
		// calc screen position
		x = getClientX() + 784;
		y = getClientY() + 74;
		
		// stay in parents area (74=degussa-header offset)
		h = ih - 74;
		
		// not enough space on the right => move to right border and below menu
		// decrement height by 20 to compensate down movement.
		if ( x+w+20 > sw )
		{
			x = sw-w;
			y += 20;
			h -= 20;
		}
		
		if ( h < minH )
			h = minH;
			
		// check if outside screen bottom
		if ( y+h+20 > sh )
		{
			h = sha - y - 20;		// Calculate max possible height...
			if ( h < minH )			// ...but dont get to small
			{
				y = y - minH + h;
				h = minH;
			}			
		}
		
		param = "left="+x+",top="+y+",width="+w+",height="+h+",menubar=no,locationbar=no,scrollbars=yes,resizable=yes,status=no,dependent=yes";
		extern = window.open(filename, caption, param);
		extern.resizeTo(w, h);
		extern.moveTo(x, y);
		extern.focus();
	}
	
	////////////////////////////////////////////////////////////////////////////////////
	// Flash Detector
	////////////////////////////////////////////////////////////////////////////////////
    var bFlash = ((navigator.appName == "Microsoft Internet Explorer") && (navigator.appVersion.indexOf("Mac") == -1) && (navigator.appVersion.indexOf("3.1") == -1)) || ((navigator.plugins && navigator.plugins["Shockwave Flash"]) || (navigator.plugins["Shockwave Flash 2.0"]));

	////////////////////////////////////////////////////////////////////////////////////
	// void
	////////////////////////////////////////////////////////////////////////////////////
	function nop()
	{}
	