//
// 2006 by bitart; Author: Alexander Graf
//
// Copyright by bitart - Furch & Graf GbR, Gartenstr. 5 56220 St. Sebastian,
// Germany. All rights reserved.
// Copyright in this software is owned by bitart, unless otherwise indicated.
//
// You are not allowed to distribute this software in any form or use it as
// part of another project without asking the owner for permission to use.
//

var sizers = {};

function initSizer()
{
	var es = document.getElementsByTagName('img');
	var ee = es.length;
	for (var ec=0; ec<ee; ec++){
		var ei = es[ec];
		ei.n = new Image();
		ei.n.src = ei.src;
		ei.h = new Image();
		ei.h.src = ei.src.substring(0,ei.src.length-4)+'_f2'+ei.src.substring(ei.src.length-4);
		ei.d = new Image();
		ei.d.src = ei.src.substring(0,ei.src.length-4)+'_f3'+ei.src.substring(ei.src.length-4);
		ei.ondragstart = nodrag;
		ei.onmouseover = mover;
		ei.onmouseout  = mout;
		ei.onmousedown = mdown;
		sizers[ei.id] = ei;
	}
}

function nodrag(e)
{
	return false;
}

function mover()
{
	this.src = this.h.src;
}

function mout()
{
	this.src  = this.n.src;
}

function mdown()
{
	this.src  = this.d.src;
	this.temp = typeof(document.onmouseup)!='undefined'&&typeof(document.onmouseup)!='unknown'?document.onmouseup:'';
	mup.img = this;
	document.onmouseup = mup;
}

function mup()
{
	var ths = mup.img;
	ths.src = ths.n.src;
	if (ths.temp) document.onmouseup = ths.temp;
}

function show(o)
{
	sizers[o].style.display = 'inline';
}

function hide(o)
{
	sizers[o].style.display = 'none';
}
