initCalled=false;

if (! initCalled) {init()}

function init ()
{
	 zindexStart = 1000;  
	initCalled=true;
}

	     

 function setzindex(element, effect)
 {
	
	if (effect[0].effect.direction == 1)
	{
	element.style.zIndex=zindexStart;
	
		//seems that IE needs a seperate solution
		if(/MSIE 6.0/.test(navigator.userAgent) && /Windows NT 5.1/.test(navigator.userAgent))
		{
				Spry.Effect.setStyleProp(	element.parentNode, 'zIndex', zindexStart);
				//element.parentNode.style.zIndex = zindexStart;
		}

	}
	zindexStart++;
 }


 function resetzindex(element, effect)
 {
	if (effect[0].effect.direction == 2)
	{
 		 element.style.zIndex=1;
		
		if(/MSIE 6.0/.test(navigator.userAgent) && /Windows NT 5.1/.test(navigator.userAgent))
		 {
			Spry.Effect.setStyleProp(	element.parentNode, 'zIndex', 1);
		 }
	}
	
}

function toggleThumb(targetElement)
{
	Spry.Effect.GrowShrink(targetElement, {duration: 600, from: '100%', to: '120%', toggle: true, setup:setzindex, finish:resetzindex});
}
