﻿// --- Klasse vlink --- PS 10.3.08 ---

function vlink( node )
{
	this.node			= node;
	this.node.vlink	= this;
	this.vlink			= this;
	this.pfeil			= null;
	this.pfeiltyp		= 0;
	
	this.mouseover	= vlinkMouseover;
	this.mouseout	= vlinkMouseout;

	// --- Bild einfügen ---
	
	var src = "";

	if( node.title == "link" || node.title == "linkn" )
	{
		this.pfeiltyp = 1;
		src = "/img/link.gif";
	}
	else if( node.title == "ilink" || node.title == "ilinkn" )
	{
		this.pfeiltyp = 2;
		src = "/img/ilink.gif";
	}
	else if( node.title == "bio" )
	{
		this.pfeiltyp = 3;
		src = "/img/person.png";
	}
	else if( node.title == "weiter" )
	{
		this.pfeiltyp = 4;
		src = "/img/weiter.png";
	}
	else if( node.title == "amazon" )
	{
		this.pfeiltyp = 5;
		src = "/img/amazon.png";
	}
	
	if( src.length > 0 )
	{
		this.pfeil = document.createElement("img");
		
		this.pfeil.border = "0";
		this.pfeil.src = src;
		this.pfeil.style.marginRight = "3px";
		
		if( node.title == "link" )
			this.pfeil.style.marginBottom = "-3px";
		else if( node.title == "ilinkn" )
			this.pfeil.style.marginBottom = "2px";
		else if( node.title == "bio" )
			this.pfeil.style.marginBottom = "-6px";
		else if( node.title == "weiter" )
			this.pfeil.style.marginBottom = "20px";
		else if( node.title == "amazon" )
			this.pfeil.style.marginBottom = "-3px";

		node.insertBefore( this.pfeil, node.firstChild );
		node.title = "";
		
		this.pfeil.vlink = this;
		node.onmouseover	= this.mouseover;
		node.onmouseout	= this.mouseout;
	}
	
}

function vlinkMouseover(e)
{
	e ? evt = e : evt = event;
	target = evt.target ? evt.target : evt.srcElement;
	
	if( this.vlink.pfeiltyp == 1 )
		this.vlink.pfeil.src = "/img/hlink.gif"
	else if( this.vlink.pfeiltyp == 2 )
		this.vlink.pfeil.src = "/img/hilink.gif"
	else if( this.vlink.pfeiltyp == 3 )
		this.vlink.pfeil.src = "/img/hperson.png"
	else if( this.vlink.pfeiltyp == 4 )
		this.vlink.pfeil.src = "/img/hweiter.png"
	else if( this.vlink.pfeiltyp == 5 )
		this.vlink.pfeil.src = "/img/amazon.png"
}

function vlinkMouseout(e)
{
	e ? evt = e : evt = event;
	target = evt.target ? evt.target : evt.srcElement;
	
	if( this.vlink.pfeiltyp == 1 )
		this.vlink.pfeil.src = "/img/link.gif"
	else if( this.vlink.pfeiltyp == 2 )
		this.vlink.pfeil.src = "/img/ilink.gif"
	else if( this.vlink.pfeiltyp == 3 )
		this.vlink.pfeil.src = "/img/person.png"
	else if( this.vlink.pfeiltyp == 4 )
		this.vlink.pfeil.src = "/img/weiter.png"
	else if( this.vlink.pfeiltyp == 5 )
		this.vlink.pfeil.src = "/img/amazon.png"
}
