function setPic( lnk )
{ 
	var img = lnk.children[0];

	return true;	
}

function initImages(){
	
		var img = document.images;
		var i=0;
		var IE = navigator.appName=="Microsoft Internet Explorer";
		var lastThumb;
		if ( !img ) return;			
			
		var stylePath = "_styles/" + curretStyleName;
	
		while (i < img.length){			
			switch (img[i].className){
				case "galleryThumbnail":
					img[i].thumb = img[i].alt;
					img[i].alt="";
					if (lastThumb){
						img[i].prevLoad = lastThumb;
						lastThumb.nextLoad = img[i];
						lastThumb.onload = function() {this.nextLoad.src = this.nextLoad.thumb;}
					}
					lastThumb = img[i];
					break;
				case "roll":
				case "mnu":
					
					//Apply the style path now
					img[i].src = img[i].src.replace( "_STYLEPATH_", stylePath );
				
					img[i].out = img[i].src;
					img[i].over = img[i].out.replace('_a','_b');
					if (!IE || !img[i].filters.blendTrans)
					{
						img[i].onmouseover= function() { this.src= this.over;}
						img[i].onmouseout= function() { this.src= this.out;}						
					} 
					else 
					{
						img[i].onmouseover = function(){								
							this.filters.blendTrans.stop()
							this.filters.blendTrans.apply();
							this.src=this.over;
							this.filters.blendTrans.play();}
						img[i].onmouseout = function(){
							this.filters.blendTrans.stop()
							this.filters.blendTrans.apply();						
							this.src=this.out;
							this.filters.blendTrans.play();}
						
					}	
					
					//If the image has a link/ancjor as a parent that will take the mouse event so pass it onto the image
					if ( img[i].parentNode.nodeName == "A" )
					{
						img[i].parentNode.onmouseover = function() { var img = this.getElementsByTagName('img')[0];
						if ( img.src != img.over ) img.onmouseover(); }
						img[i].parentNode.onmouseout = function() { var img = this.getElementsByTagName('img')[0];
						if( img.src != img.out ) img.onmouseout(); }							
					}
					
					preloadImage(img[i].over);
					break;
				case "png":
					if (IE) {
						img[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + img[i].src + "',sizingMethod='scale')"
						img[i].src="../images/spacer.gif"
					}
					break;
			}
			
			img[i].src = img[i].src.replace( "_STYLEPATH_", stylePath );
			i++
		}
	
}

function preloadImage(imgpath){
	var pic1 = new Image(100,25); 
	pic1.src= imgpath; 
}
