function PSTPopup()
{
	// Styles
	this.title_style = "font-family:verdana,arial,helvetica; font-size:10px; font-weight:bold; color:#000000; background-color:#AAAAAA;";
	this.content_style = "font-family:verdana,arial,helvetica; font-size:9px; font-weight:normal; color:#000000; background-color:#FFFFFF;";
	this.width = 169;
	this.height = 100;
	this.border = 1;
	this.border_color = "#DDDDDD";
	this.shadow = 0;
	this.shadow_color = "#DDDDDD";

	this.skin = 0;

	this.absolutx = 0;
	this.absoluty = 0;
	this.offsetx = -165;
	this.offsety = 10;

	this.movepopup=1;
	this.nomove=0;

	// Values
	this.x = 0;
	this.y = 0;
	this.snow = 0;
	this.sw = 0;
	this.cnt = 0;
	this.dir = "right";

	// reg Values
	this.id = 0;
	this.layname = "";
	this.layobj = null;
	this.laystyle= null;

	// Functions
	this.init			= PSTPopup_init;
	this.popup 			= PSTPopup_popup;
	this.write 			= PSTPopup_write;
	this.display 		= PSTPopup_display;
	this.show			= PSTPopup_show;
	this.hide			= PSTPopup_hide;
	this.mousemove		= PSTPopup_mousemove;
	this.move			= PSTPopup_move;
	this.close 			= PSTPopup_close;

	// Init
	this.init();
}

function PSTPopup_init()
{
	// Add to Stack
	this.id=PST_stack.add(this);

	// Layer
	this.layname='fupPSTlayer'+this.id;
	document.write('<style type="text/css">#'+this.layname+' {position:absolute; left:0; top:0; width:'+this.width+'; height:'+this.height+'; z-index:1; visibility: hidden;}</style>');

	document.write('<div id="'+this.layname+'"></div>');

	this.layobj=(ns6)? document.getElementById(this.layname) : document.all[this.layname];
	this.laystyle=this.layobj.style;
}

// PST popup
function PSTPopup_popup(title_text,content_text)
{
	with (this)
	{

		html='';

		if(skin)
		{
			html+='<table cellspacing=0 cellpadding=0><tr><td colspan=2><img src="./klammer_blue_oben.jpg" border="0"></td></tr><tr><td>';
		}

		if (shadow)
		{
			html+='<table width='+width+' cellspacing=0 cellpadding=0 border=0>';
			html+='<tr height='+(shadow)+'>';
			html+='<td colspan=2 rowspan=2>';
		}

		html+='<table width='+(width-shadow)+' cellspacing=0 cellpadding='+border+' border=0><tr><td bgcolor="'+border_color+'">';
		//if (title_text) {html+='<table width="100%" cellspacing=0 cellpadding=2 border=0><tr><td style="'+title_style+'">'+title_text+'</td></tr></table>';}
		html+='<table width="100%" cellspacing=0 cellpadding=5 border=0><tr><td style="'+content_style+'">'+content_text+'</td></tr></table>';
		html+='</td></tr>';
		html+='</table>';

		if (shadow)
		{
			html+='</td>';
			html+='<td><img src="/_images/spacer.gif" width='+(shadow)+' height='+(shadow)+'></td>';
			html+='</tr>';
			html+='<tr>';
			html+='<td bgcolor="'+(shadow_color)+'"><img src="/_images/spacer.gif" width='+(shadow)+' height=20></td>';
			html+='</tr>';
			html+='<tr height='+(shadow)+'>';
			html+='<td><img src="/_images/spacer.gif" width='+(shadow)+' height='+(shadow)+'></td>';
			html+='<td bgcolor="'+(shadow_color)+'"><img src="/_images/spacer.gif" width='+(width-(2*shadow))+' height='+(shadow)+'></td>';
			html+='<td bgcolor="'+(shadow_color)+'"><img src="/_images/spacer.gif" width='+(shadow)+' height='+(shadow)+'></td>';
			html+='</tr>';
			html+='</table>';
		}

		if(skin)
		{
			html+='</td></tr><tr><td colspan=2><img src="./klammer_blue_unten.jpg" border="0"></td></tr></table>';
		}
		write(html);
		display();
	}
}

// PST close
function PSTPopup_close()
{
	if (this.cnt>=1) {this.sw=0;}
	if (this.sw==0)
	{
		this.snow=0;
		this.hide(this.laystyle);
	}
	else
	{
		this.cnt++;
	}
	this.nomove=0;
}

function PSTPopup_write(html)
{
	this.layobj.innerHTML=html;
}

function PSTPopup_display()
{
	if (this.snow==0)
	{
		if (this.dir=="center")
		{
			this.move(this.laystyle,this.x+this.offsetx-(this.width/2),this.y+this.offsety);
		}
		else if (this.dir=="left")
		{
			this.move(this.laystyle,this.x-this.offsetx-this.width,this.y+this.offsety);
		}
		else
		{
			this.move(this.laystyle,this.x+this.offsetx,this.y+this.offsety);
		}
		this.show(this.laystyle);
		this.snow=1;
	}
}

function PSTPopup_mousemove(e)
{
	if(this.nomove)return;
	if (e)
	{
		// NS
		this.x=e.pageX; this.y=e.pageY;
	}
	else
	{
		// IE
		this.x=event.x+document.body.scrollLeft; this.y=event.y+document.body.scrollTop;
	}
	// alert(this.x);

	if (this.snow)
	{
		if (this.dir=="center")
		{
			if (this.absolutx) {newx=this.absolutx;} else {newx=this.x+this.offsetx-(this.width/2);}
		}
		else if (this.dir=="left")
		{
			if (this.absolutx) {newx=this.absolutx;} else {newx=this.x-this.offsetx-this.width;}
		}
		else
		{
			if (this.absolutx) {newx=this.absolutx;} else {newx=this.x+this.offsetx}
		}
		if (this.absoluty) {newy=this.absoluty;} else {newy=this.y+this.offsety;}
		newx=Math.max(0,newx);
		newy=Math.max(0,newy);
		this.move(this.laystyle,newx,newy);
		if(!this.movepopup)this.nomove=1;
	}
}

function PSTPopup_show(obj)
{
	obj.visibility = "visible";
}

function PSTPopup_hide(obj)
{
	obj.visibility = "hidden"
}

function PSTPopup_move(obj,x,y)
{
	obj.left = x
	obj.top = y
}

function PSTPopup_stack()
{
	this.PST	= new Array();
	this.add		= PSTPopup_stack_add;
}

function PSTPopup_stack_add(addPST)
{
	id=this.PST.length
	this.PST[id]=addPST;
	return id;
}

function fup_mousemove(e)
{
	if (PST_stack)
	{
		for (a=0; a<PST_stack.PST.length; a++)
		{
			PST_stack.PST[a].mousemove(e);
		}
	}
}

function fup_infopac_screenshot_popup(id,width,height)
{
	var max_width=Math.max(screen.width,800);
	var max_height=Math.max(screen.height,600);
	var pop_width=Math.min(width,max_width);
	var pop_height=Math.min(height,max_height);
	if ((width>pop_width)||(height>pop_height))
	{
		var additionals=",scrollbars=yes,resizable=yes";
	}
	else
	{
		var additionals=",scrollbars=no,resizable=no";
	}
	var screenshot=window.open("/infopac/infopac_screenshot.php?id="+id,"screenshot","width="+pop_width+",height="+pop_height+additionals);
	if (screenshot) {screenshot.focus();}
}



// Browsercheck
var ie4=document.all?1:0;
var ns6=document.getElementById&&!document.all?1:0;

// Vars4MouseOver
var on_img="";
var on_txt="";
var preload_complete=0;
var button=new Array();
var button_lo=new Array();
var button_hi=new Array();
var txt=new Array();
var swap_timer=null;

// Global Inits
var PST_stack=new PSTPopup_stack();

// EventHandler
if (ns6||ie4)
{
	document.onmousemove = fup_mousemove;
	if (ns6) document.captureEvents(Event.MOUSEMOVE);
}
