
var btn_pre_src = "";

function actimg(img_name) {
	if (document.images["btn_"+ img_name]) {
		btn_pre_src = document.images["btn_"+ img_name].src;
		document.images["btn_"+ img_name].src = eval("btn_"+ img_name +"_on").src;
	}
}

function deactimg(img_name) {
	if (document.images["btn_"+ img_name]) {
		if (btn_pre_src=="") btn_pre_src = eval("btn_"+ img_name +"_off").src;
		document.images["btn_"+ img_name].src = btn_pre_src;
		btn_pre_src = "";
	}
}


function openimgwin(imgurl) {
	imgwin=window.open(imgurl, "cgbigimg", "top=10,left=10,width=600,height=580,scrollbars=yes,resizable=yes")
}

function openglossar(searchterm) {
	window.open("../shop/glossar.asp?t="+searchterm, "cgglossar", "width=360,height=260,scrollbars=yes");
}

function openpictures(id) {
	window.open("../shop/bilder.asp?id="+ id, "ipcglossar", "width=580,height=470,scrollbars=yes,resizable=yes");
}

function openmsjumppage() {
	window.open("/shop/msgjp.asp", "msjumppage", "top=50,left=50,width=900,height=580,scrollbars=yes,resizable=yes");
}


function hl(elem) {
	if (elem.style) elem.style.backgroundColor="#ffffff";
}

function dl(elem) {
	if (elem.style) elem.style.backgroundColor="";
}


function ekpopup(param) {
	var strParam = "";
	if (param.length>0) var strParam = "?"+ param;
	window.open("/shop/popup.asp"+ strParam, "_blank", "dependent=yes, width=440, height=260, menubar=no, location=no, resizable=no, scrollbars=no, status=no, toolbar=no");
}


var btn_produkte_off = new Image(); btn_produkte_off.src = "/gfx/btn_produkte_off.gif";
var btn_produkte_on = new Image(); btn_produkte_on.src = "/gfx/btn_produkte_on.gif";
var btn_service_off = new Image(); btn_service_off.src = "/gfx/btn_service_off.gif";
var btn_service_on = new Image(); btn_service_on.src = "/gfx/btn_service_on.gif";
var btn_kontakt_off = new Image(); btn_kontakt_off.src = "/gfx/btn_kontakt_off.gif";
var btn_kontakt_on = new Image(); btn_kontakt_on.src = "/gfx/btn_kontakt_on.gif";
var btn_vertriebspartner_off = new Image(); btn_vertriebspartner_off.src = "/gfx/btn_vertriebspartner_off.gif";
var btn_vertriebspartner_on = new Image(); btn_vertriebspartner_on.src = "/gfx/btn_vertriebspartner_on.gif";
var btn_company_off = new Image(); btn_company_off.src = "/gfx/btn_company_off.gif";
var btn_company_on = new Image(); btn_company_on.src = "/gfx/btn_company_on.gif";
var btn_neukunden_off = new Image(); btn_neukunden_off.src = "/gfx/btn_neukunden_off.gif";
var btn_neukunden_on = new Image(); btn_neukunden_on.src = "/gfx/btn_neukunden_on.gif";



/*
	Klasse ImageToggler (für automatisierte Dia-Show)
*/

function ImageToggler_addImage(url) {
	this.imageList[this.imageList.length] = url;
}

function ImageToggler_run() {
	if (this.imageList.length>0) {
		if (document.all && document.images[this.imageName].filters) document.images[this.imageName].filters.blendTrans.Apply();
		document.images[this.imageName].src = this.imageList[this.nextImage];
		if (document.all && document.images[this.imageName].filters) document.images[this.imageName].filters.blendTrans.Play();
		
		this.nextImage++;
		if (this.nextImage>=this.imageList.length) this.nextImage = 0;
	}
	window.setTimeout(this.variableName +'.run();', this.duration);
}

function ImageToggler(varname, imagename, duration) {
	this.variableName = varname;
	this.imageName = imagename;
	this.imageList = new Array();
	this.nextImage = 0;
	if (duration) this.duration = duration; else this.duration = 5000;
	
	this.addImage = ImageToggler_addImage;
	this.run = ImageToggler_run;
	this.run();
}



/*
	Microsoft "genuine Windows"-Tooltip Code
*/

/* 
Netscape 4, Ice, Escape, Omniweb 4.2- 
    if( document.layers ) 

Explorer 4+, Opera 6+, iCab, Ice, Omniweb 4.2- 
    if( document.all ) 	

Mozilla, Explorer 5+, Opera 5+, Konqueror, Safari, iCab, Ice, OmniWeb 4.5 
    if( document.getElementById ) 
*/
var divLayer = 'genuineTooltip';
var mouseX   = 0;
var mouseY   = 0;

var arrTimers = new Array(21);
arrTimers[0] = 0;


if( document.layers ) 
{
	document.captureEvents( Event.MOUSEMOVE );
}

document.onmousemove = GetCursor; 


function GetCursor( e ) 
{
	if( document.layers ) 
	{
		mouseX = e.pageX;
		mouseY = e.pageY;
	}
	else if( document.all ) 
	{
		mouseX = event.clientX + document.body.scrollLeft;
		mouseY = event.clientY + document.body.scrollTop;
	}
	else if( document.getElementById )
	{
	    mouseX = e.pageX;
		mouseY = e.pageY;
	}
	
	var tip = GetHandle( "imageToolTip" );
	if (arrTimers[0] == 0 &&
			(	(document.layers && tip.visibility == "show") ||
				(document.all && tip.visibility == "visible") ||
				(document.getElementById && tip.visibility == "visible"))
		)
	{
		tip.left = mouseX;
		tip.top  = mouseY + 24;
	}
	
	
	return true;
}

function GetHandle( name ) 
{
	if( document.layers ) 
	{
		return ( document.layers[name] );
	}
	
	if( document.getElementById ) 
	{
	    return document.getElementById( name ).style;
	}
	
	if( document.all ) 
	{
		var block = eval( 'document.all.' + name + '.style' );
		
		return ( block );
	}
	
}

function ShowToolTip() 
{
	var tip = GetHandle( divLayer );
	
	tip.left = mouseX;
	tip.top  = mouseY + 20;
	
	if( document.layers )
	{
		tip.visibility = "show";
	}
	else if( document.all )
	{
		tip.visibility = "visible";
	}
	else if( document.getElementById )
	{
	    tip.visibility = "visible";
	}
}

function HideToolTip()
{
	window.setTimeout( 'HideToolTip2(\''+ divLayer +'\')', 4000 );	
}

function HideToolTip2(name)
{
	var tip = GetHandle( name );
	
	if( document.layers )
	{
		tip.visibility = "hide";
	}
	else if( document.getElementById )
	{
	    tip.visibility = "hidden";
	}
	else if( document.all )
	{
		tip.visibility = "hidden";
	}
}



function ShowImageToolTip(url)
{
	var tip = GetHandle( "imageToolTip" );
	
	tip.left = mouseX;
	tip.top  = mouseY + 24;
	
	for (var i = 0; i<arrTimers.length; i++)
	{
		window.clearTimeout(arrTimers[i]);
		arrTimers[i] = 0;
	}
	
	document.images["imageToolTipImg"].src = url;
	
	if( document.layers )
	{
		tip.visibility = "show";
	}
	else if( document.getElementById )
	{
		tip.visibility = "visible";
		document.getElementById("imageToolTip").className = 'o100';
	}
	else if( document.all )
	{
		tip.visibility = "visible";
	}
}

function HideImageToolTip2(name)
{
	var tip = GetHandle( name );
	
	if( document.layers )
	{
		tip.visibility = "hide";
	}
	else if( document.getElementById )
	{
	    tip.visibility = "hidden";
	}
	else if( document.all )
	{
		tip.visibility = "hidden";
	}
	
	arrTimers[0] = 0;
}

function HideImageToolTip()
{
	if (document.getElementById)
	{
		fadeOut("imageToolTip");
	}
	else
	{
		arrTimers[0] = window.setTimeout( 'HideImageToolTip2(\'imageToolTip\')', 500 );
	}
}


function fadeOut(name)
{
	var step = 20;
	
	arrTimers[0] = window.setTimeout("document.getElementById('"+ name +"').className = 'o100'", step*1);
	arrTimers[1] = window.setTimeout("document.getElementById('"+ name +"').className = 'o095'", step*2);
	arrTimers[2] = window.setTimeout("document.getElementById('"+ name +"').className = 'o090'", step*3);
	arrTimers[3] = window.setTimeout("document.getElementById('"+ name +"').className = 'o085'", step*4);
	arrTimers[4] = window.setTimeout("document.getElementById('"+ name +"').className = 'o080'", step*5);
	arrTimers[5] = window.setTimeout("document.getElementById('"+ name +"').className = 'o075'", step*6);
	arrTimers[6] = window.setTimeout("document.getElementById('"+ name +"').className = 'o070'", step*7);
	arrTimers[7] = window.setTimeout("document.getElementById('"+ name +"').className = 'o065'", step*8);
	arrTimers[8] = window.setTimeout("document.getElementById('"+ name +"').className = 'o060'", step*9);
	arrTimers[9] = window.setTimeout("document.getElementById('"+ name +"').className = 'o055'", step*10);
	arrTimers[10] = window.setTimeout("document.getElementById('"+ name +"').className = 'o050'", step*11);
	arrTimers[11] = window.setTimeout("document.getElementById('"+ name +"').className = 'o045'", step*12);
	arrTimers[12] = window.setTimeout("document.getElementById('"+ name +"').className = 'o040'", step*13);
	arrTimers[13] = window.setTimeout("document.getElementById('"+ name +"').className = 'o035'", step*14);
	arrTimers[14] = window.setTimeout("document.getElementById('"+ name +"').className = 'o030'", step*15);
	arrTimers[15] = window.setTimeout("document.getElementById('"+ name +"').className = 'o025'", step*16);
	arrTimers[16] = window.setTimeout("document.getElementById('"+ name +"').className = 'o020'", step*17);
	arrTimers[17] = window.setTimeout("document.getElementById('"+ name +"').className = 'o015'", step*18);
	arrTimers[18] = window.setTimeout("document.getElementById('"+ name +"').className = 'o010'", step*19);
	arrTimers[19] = window.setTimeout("document.getElementById('"+ name +"').className = 'o005'", step*20);
	arrTimers[20] = window.setTimeout("HideImageToolTip2('"+ name +"');", step*21);
}


function show_listentext(posnr) {
	document.getElementById("listenText"+posnr).style.display="block";
	document.getElementById("detailText"+posnr).style.display="none";
	
}

function show_detailtext(posnr) {
	document.getElementById("detailText"+posnr).style.display="block";
	document.getElementById("listenText"+posnr).style.display="none";
}


function show_alt_Lieferadresse(id)
{
	$("#alt"+id).show();
	$("#neu"+id).hide();
}

function show_neu_Lieferadresse(id)
{
	$("#neu"+id).show();
	$("#alt"+id).hide();
}

function hide_divs(id)
{
	$("#neu"+id).hide();
	$("#alt"+id).hide();
}