var slideShow=function(){
	var bxs,bxe,fxs,fxe,ys,ye,ta,ia,ie,st,ss,ft,fs,xp,yp,ci,t,tar,tarl;
	ta=document.getElementById(thumbid); ia=document.getElementById(imgid);
	t=ta.getElementsByTagName('li'); ie=document.all?true:false;
	st=3; ss=3; ft=10; fs=5; xp,yp=0;
	return{
		init:function(){
			//document.onmousemove=this.pos; 
			window.onresize=function(){setTimeout("slideShow.lim()",500)};
			ys=this.toppos(ta); ye=ys+ta.offsetHeight;
			len=t.length;tar=[];
			for(i=len-1;i>=0;i--){
				var id=t[i].value; tar[i]=id; id = 7 - id;
				t[i].onclick=new Function("slideShow.getimg('"+id+"')");
				if(i==0){this.getimg(id)}
			}
			document.getElementById('infoDiv').innerHTML = '';
			tarl=tar.length;
		},
		scrl:function(d){
			clearInterval(ta.timer);
			var l=(d==-1)?0:(t[tarl-1].offsetRight-(ta.parentNode.offsetWidth-t[tarl-1].offsetWidth)+10)
			ta.timer=setInterval(function(){slideShow.mv(d,l)},st);
		},
		mv:function(d,l){
			ta.style.right=ta.style.right||'0px';
			var right=ta.style.right.replace('px','');
			if(d==1){
				if(l-Math.abs(right)<=ss){
					this.cncl(ta.id); ta.style.right='-'+l+'px';
				}else{ta.style.right=right-ss+'px'}
			}else{
				if(Math.abs(right)-l<=ss){
					this.cncl(ta.id); ta.style.right=l+'px';
				}else{ta.style.right=parseInt(right)+ss+'px'}
			}
		},
		cncl:function(){clearTimeout(ta.timer)},
		getimg:function(id){
			if(auto){clearTimeout(ia.timer)}
			if(ci!=null){
				var ts,tsl,x;
				ts=ia.getElementsByTagName('img'); tsl=ts.length;x=0;
				for(x;x<tsl;x++){
					if(ci.id!=id){var o=ts[x]; clearInterval(o.timer); o.timer=setInterval(function(){slideShow.fdout(o)},fs)}
				}
			}
			if(!document.getElementById(id)){
				var i=document.createElement('img');
				ia.appendChild(i);
				i.id=id; i.av=0; i.style.opacity=0;
				i.style.filter='alpha(opacity=0)';
				i.width='899';
				i.height='236';
				i.src=imgdir + photos[id-1];
			}else{
				i=document.getElementById(id); clearInterval(i.timer);
			}
			document.getElementById('infoDiv').innerHTML = '';
			
			
			
			
			for(x=1;x<=6;x++)
			{
			    document.getElementById('img' + x).src =  'images/' + x + '.jpg';
			}
			
			if(isfirst == 1)
			{
			    isfirst =2;
			    setTimeout("setInfo(6)", 500);
			    t[0].getElementsByTagName('img')[0].src = 'images/1.jpg';
			    t[5].getElementsByTagName('img')[0].src = 'images/6a.jpg';
			}
			else
			{
			    setTimeout("setInfo(" + parseInt(id) +")", 500);
			    t[id - 1].getElementsByTagName('img')[0].src = 'images/' + id + 'a.jpg';
			}
			
			i.timer=setInterval(function(){slideShow.fdin(i)},fs);
		},
		nav:function(d){
			var c=0;
			for(key in tar){if(tar[key]==ci.id){c=key}}
			if(tar[parseInt(c)+d]){
				this.getimg(tar[parseInt(c)+d]);
			}else{
				if(d==1){
					this.getimg(tar[0]);
				}else{this.getimg(tar[tarl-1])}
			}
		},
		auto:function(){ia.timer=setInterval(function(){slideShow.nav(1)},autodelay*1000)},
		fdin:function(i){
			if(i.complete){i.av=i.av+fs; i.style.opacity=i.av/100; i.style.filter='alpha(opacity='+i.av+')'}
			if(i.av>=100){if(auto){this.auto()}; clearInterval(i.timer); ci=i}
		},
		fdout:function(i){
			i.av=i.av-fs; i.style.opacity=i.av/100;
			i.style.filter='alpha(opacity='+i.av+')';
			if(i.av<=0){clearInterval(i.timer); if(i.parentNode){i.parentNode.removeChild(i)}}
		},
		lim:function(){
			var taw,taa,len; taw=ta.parentNode.offsetWidth; taa=taw/4; 
			bxs=slideShow.rightpos(ta); bxe=bxs+taa; fxe=bxs+taw; fxs=fxe-taa;
		},
		pos:function(e){
			xp=ie?event.clientX+document.documentElement.scrollRight:e.pageX; 
			yp=ie?event.clientY+document.documentElement.scrollTop:e.pageY;
			if(xp>bxs&&xp<bxe&&yp>ys&&yp<ye){
				slideShow.scrl(-1);
			}else if(xp>fxs&&xp<fxe&&yp>ys&&yp<ye){
				slideShow.scrl(1);
			}else{slideShow.cncl()}
		},
	
		rightpos:function(t){
			var l=0;
			if(t.offsetParent){
				while(1){l+=t.offsetRight; if(!t.offsetParent){break}; t=t.offsetParent}
			}else if(t.x){l+=t.x}
			return l;
		},
		toppos:function(t){
			var p=0;
			if(t.offsetParent){
				while(1){p+=t.offsetTop; if(!t.offsetParent){break}; t=t.offsetParent}
			}else if(t.y){p+=t.y}
			return p;
		}
	};
}();

var isfirst=1;

    function setInfo(id)
    {
        document.getElementById('infoDiv').innerHTML = info[id-1];
    }

  function setPage()
        {   
             var cPage = window.location.href;
             if(cPage.indexOf('index.aspx') != -1)
            {  
                document.getElementById('HomePagetr').style.display='block';
                document.getElementById('InnerPagetr').style.display='none';               
            }
            else
            { 
                document.getElementById('HomePagetr').style.display='none';
                document.getElementById('InnerPagetr').style.display='block';               
            }
       if(getBrowser() == "IE")
        {
          document.getElementById('fireboxissuetr1').style.display='block';
         document.getElementById('borderleft').className ='lft-side'
         document.getElementById('borderright').className ='ryt-side'
         document.getElementById('borderbottom').className ='btm-side'
         document.getElementById('infoDiv1').style.paddingTop='42px';
         document.getElementById('listDiv').style.paddingRight='120px';
           document.getElementById('testimonialsfirefox').style.display='none';
         
        }
        else
        { document.getElementById('fireboxissuetr1').style.display='none';
          document.getElementById('borderleft').className ='lft-side_firefox'
         document.getElementById('borderright').className ='ryt-side_firefox'
         document.getElementById('borderbottom').className ='btm-side_firefox'
          document.getElementById('infoDiv1').style.paddingTop='29px';
          document.getElementById('listDiv').style.paddingRight='70px';
           document.getElementById('testimonialsfirefox').style.display='block';
        }
        }
window.onload=function(){setPage(); slideShow.init(); slideShow.lim()}; //moveTxt();