/* Shop-Steuerung */



/* Warenkorb anzeigen */







/* Laufende Rubrikenbilder */

function spPreLoad(images) 
{ 
    for (var loop = 0; loop < images.length; loop++)
    { 
        var buffer = new Image(); 
        buffer.src = images[loop]; 
    } 
}

function spiconfr( iconid, calltype ) {
	
	if (document.getElementById(iconid) != null) {
		
		if (calltype=='start') {
			document.getElementById(iconid).style.backgroundImage='url('+icondata[iconid][1]+')';
			document.getElementById(iconid).style.opacity='1';
			spcurrenticon=1;
			spcurrentrunning = iconid;
			spPreLoad(icondata[iconid]); 
			window.setTimeout('spiconfr( \"'+iconid+'\", \"refresh\")',400);
		}
		if ((calltype=='refresh') && (spcurrenticon>0)) {
			spcurrenticon++;
			if (spcurrenticon>=icondata[iconid].length) {
				spcurrenticon=1;
			}
			document.getElementById(iconid).style.backgroundImage='url('+icondata[iconid][spcurrenticon]+')';
			if (spcurrentrunning == iconid) {
				window.setTimeout('spiconfr( \"'+iconid+'\", \"refresh\")',400);
			}
		}
		if (calltype=='stop') {
			spcurrenticon = 0;
		}
	}
}
var spcurrenticon = 0;
var spcurrentrunning = '';








/* Initialisierung */


function spLoaded() { 
	

	if ($('spHopperShort')) { // Warenkorb-Element gefunden
		
		new Ajax.Updater('spHopperShort', '/cgi-wms2/module/sp/hopper.php?action=hopperShort&caller='+encodeURIComponent(document.URL), { method: 'get' });
	} else { // KeinWarenkorb-Element in der Website
		// alert( "kein Warenkorb" );
	}	
}



Event.observe(window, 'load', spLoaded);