leftdisabled=true
rightdisabled=true
widthLength=640

functionfp_ie4(){
	varnav=navigator.appVersion.indexOf("MSIE");
	return(nav>0)&&(parseInt(navigator.appVersion.substring(nav+5,nav+6))>=4);
}

functionfp_ns6(){
	return((navigator.appName=="Netscape")&&
				(parseInt(navigator.appVersion.substring(0,1))>=5))
}

functionfp_ShowImg(src,sWidth,sHeight,sID,iIndex)
{	
	varel=document.images["fpGalleryMainImg_"+sID];
	if(el){
		if(fp_ie4()){
			el.style.visiblity="hidden";
			el.src=src.getAttribute?src.getAttribute("lowsrc"):src.lowsrc;
			el.width=sWidth;
			el.height=sHeight;
				
			varcaption=document.all["fpGalleryCaptions_"+sID].all.tags("div")
			varsCaptionTxt;
			varsCaptionHTML;
			
			if(caption&&caption[iIndex]){
				sCaptionTxt=caption[iIndex].innerText
				sCaptionHTML=caption[iIndex].innerHTML
			}else{
				sCaptionTxt="";
				sCaptionHTML="";
			}
			
			el.title=sCaptionTxt;
			el.style.visiblity="visible";
			
			varel=document.all["fpGalleryCaptionCell_"+sID];
			if(el){
				el.innerHTML=sCaptionHTML;
			}
			
			varel=document.all["fpGalleryDescCell_"+sID];
			if(el){
				varsDesc=document.all["fpGalleryDescriptions_"+sID].all.tags("div")
				el.innerHTML=sDesc&&sDesc[iIndex]?sDesc[iIndex].innerHTML:"";
			}
		}else{
			el.src=src.getAttribute?src.getAttribute("lowsrc"):src.lowsrc
			el.style.width=sWidth
			el.style.height=sHeight

			caption=document.getElementById("fpGalleryCaptions_"+sID).getElementsByTagName("div")			
			if(caption&&caption[iIndex]){
				sCaptionTxt=caption[iIndex].innerText
				sCaptionHTML=caption[iIndex].innerHTML
			}else{
				sCaptionTxt=""
				sCaptionHTML=""
			}
		
			el.title=sCaptionTxt			
			vare=document.getElementById("fpGalleryCaptionCell_"+sID)
			if(e){
				e.innerHTML=sCaptionHTML
			}
			
			vare=document.getElementById("fpGalleryDescCell_"+sID)
			if(e){
				varsDesc=document.getElementById("fpGalleryDescriptions_"+sID).getElementsByTagName("div")
				e.innerHTML=sDesc[iIndex]?sDesc[iIndex].innerHTML:""
			}

		}
	}
}

functionfp_ScrollLeft(sID){
	varel=document.all["fpGalleryListCell_"+sID];
	if(el&&fp_ie4()){
		varcoll=el.children.tags("A");
		varcount=20;

		if(coll){
			for(i=1;i<coll.length;i++){
				if(coll(i).style.display!="none"){
					coll(i-1).style.display="inline";
					break;	
				}
			}
			
			for(i=0;i<coll.length;i++){
				if(coll(i).style.display!="none"){
					varimages=coll[i].children.tags("img");
					count=count+20+images[0].width;
					
					if(count>widthLength)				
						coll(i).style.display="none";
				}
			}

			if((el.scrollWidth-5)>=el.clientWidth){
				varbtn=document.all["fpGalleryRightBtn_"+sID]
				if(btn&&rightdisabled){
					rightdisabled=false;
					te=btn.src
					btn.src=btn.getAttribute?btn.getAttribute("lowsrc"):btn.lowsrc
					btn.lowsrc=te
				}
			}
			
			if(coll(0).style.display!="none"){
				varbtn=document.all["fpGalleryLeftBtn_"+sID]
				if(btn&&!leftdisabled){
					leftdisabled=true;
					te=btn.src
					btn.src=btn.getAttribute?btn.getAttribute("lowsrc"):btn.lowsrc
					btn.lowsrc=te
				}
			}
		}
		
	}
}

functionfp_ScrollRight(sID){
	varel=document.all["fpGalleryListCell_"+sID];
	if(el&&fp_ie4()){
		if(!rightdisabled)
		{
			varcoll=el.children.tags("A");
			if(coll){
			varstate=0;
				varcount=20;
				for(i=0;i<coll.length;i++){
					if(state==0)
					{
						if(coll(i).style.display!="none"){
							coll(i).style.display="none";	
							state=1;
						}
					}
					else{
						varimages=coll[i].children.tags("img");
						count=count+20+images[0].width;
						if(count<=widthLength)
							coll(i).style.display="inline";
						else
							coll(i).style.display="none";
					}
				}
			}
		
			varbtn=document.all["fpGalleryRightBtn_"+sID];
			if(btn&&coll(coll.length-1).style.display!="none"){
				rightdisabled=true
				te=btn.src
				btn.src=btn.getAttribute?btn.getAttribute("lowsrc"):btn.lowsrc
				btn.lowsrc=te
			}
			
			varbtn=document.all["fpGalleryLeftBtn_"+sID];
			if(btn&&leftdisabled){
				te=btn.src
				btn.src=btn.getAttribute?btn.getAttribute("lowsrc"):btn.lowsrc
				btn.lowsrc=te
				leftdisabled=false
			}
		}		
	}
}
