var SlideShow=
{
	imageStripTop : -100,
	minValue : -700,
	maxValue : 0,
	largeImage : document.getElementById("imgLarge"),
	SourceImage : 0,
	timerId : 0,
	opacity: 1,
	scrollTimerId:0,
	scrollInterval:100,
	scrollAmount:10,

    Init: function(stripTop,stripHeight)
    {
        this.imageStripTop=stripTop;
        this.minValue=-stripHeight;
    },
    
	StopScroll : function()
	{
		clearInterval(this.scrollTimerId);
	},
		

	MoveUp : function()
	{
		this.scrollTimerId=setInterval("SlideShow.ScrollUp()",this.scrollInterval);
	},

	ScrollUp : function()
	{
		var imageStrip=document.getElementById('ImageStrip');
		
		//alert(this.imageStripTop);
		
		if(this.imageStripTop < this.maxValue)
		{
			this.imageStripTop+=this.scrollAmount;		
		}
		else
		{
			clearInterval(this.scrollTimerId);
		}
		imageStrip.style.top=this.imageStripTop + "px";
	},

	MoveDown: function()
	{
		this.scrollTimerId=setInterval("SlideShow.ScrollDown()",this.scrollInterval);
	},

	ScrollDown : function()
	{
		//alert(this.imageStripTop);
		var imageStrip=document.getElementById('ImageStrip');
		if(this.imageStripTop > this.minValue)
		{
			this.imageStripTop-=this.scrollAmount;		
		}
		else
		{
			clearInterval(this.scrollTimerId);
		}
		imageStrip.style.top=this.imageStripTop + "px";
	},
	
	movetocollor: function ()
	{
	this.imageStripTop = 0;
	document.getElementById("ImageStrip").style.top = "0px";
	},
	
	movetoCuffs: function ()
	{
	this.imageStripTop = -640;
	document.getElementById("ImageStrip").style.top = "-640px";
	},
	movetossleves: function ()
	{
	this.imageStripTop = -1050;
	document.getElementById("ImageStrip").style.top = "-1050px";
	},
	
	movetopocket: function ()
	{
	this.imageStripTop = -1230;
	document.getElementById("ImageStrip").style.top = "-1230px";
	},
	
	movetomono: function ()
	{
	this.imageStripTop = -1410;
	document.getElementById("ImageStrip").style.top = "-1410px";
	},
	
	
	
	
	
	

	ShowImage : function()
	{
		this.largeImage.style.MozOpacity=this.opacity;
		this.largeImage.style.filter="alpha(opacity=" + this.opacity*100 + ")";
		
		if(this.opacity < 1 )
		{
			this.opacity+=.1;
		}
		else
		{
			clearInterval(this.timerid);
		}
		
	},

	DisplayLargeImage : function(src)
	{
		clearInterval(this.timerid);
		this.largeImage = document.getElementById("imgLarge");
		this.imgSource=src;
		var objAncImgLarge=document.getElementById("ancImgLarge");
        objAncImgLarge.href=src;
		this.timerid=setInterval("SlideShow.FadeImage()",40);	

	},
	
	SpecialImage:function(src)
	{
	    if(src=='Images/Shirts/Rshirts1small.jpg')
	    {
	        var Image=document.getElementById('imgLarge');
	        Image.style.width="300px";
	        Image.style.height="280px";
	        var divText=document.getElementById('divContentText');
	        divText.style.display="none";
	    }
	    else
	    {
	        var Image=document.getElementById('imgLarge');
	        Image.style.height="280px";
	        Image.style.border="0px";
	        Image.style.width="170px";
	        var divText=document.getElementById('divContentText');
	        divText.style.display="block";
	    }
	},
	
	ShowImageTitle:function(title)
	{
	    var lblTitle=document.getElementById("lblTitle");
	    lblTitle.innerHTML=title;
	    
	},
	
	FadeImage : function()
	{
		this.largeImage = document.getElementById("imgLarge");

		this.largeImage.style.MozOpacity=this.opacity;
		this.largeImage.style.filter="alpha(opacity=" + this.opacity*100 + ")";
		if(this.opacity > .1 )
		{
			this.opacity-=.1;
		}
		else
		{
			clearInterval(this.timerid);
			this.largeImage.src=this.imgSource;
			this.timerid=setInterval("SlideShow.ShowImage()",40);
		}
	}
}
















var xmlHttp=null;
var AjaxPageLoad=
{
	url:'',
	
	LoadPage: function(srcUrl)
	{
	      var zoomImages=document.getElementsByTagName("div");
		for(zoomCount=0;zoomCount<zoomImages.length;zoomCount++)
		{
			if(zoomImages[zoomCount].id=="ZoomBox" || zoomImages[zoomCount].id=="ShadowBox" || zoomImages[zoomCount].id=="ZoomClose")
			{
				zoomImages[zoomCount].style.visibility='hidden';
			}
		}
		this.url=srcUrl;
		xmlHttp=AjaxPageLoad.GetXmlHttpObject();
		if (xmlHttp==null)
 		{
  			alert ("Your browser does not support AJAX!");
  			return;
		} 
		xmlHttp.onreadystatechange=AjaxPageLoad.StateChanged;
		xmlHttp.open("GET",this.url,true);
		xmlHttp.send(null);
	}, 

	StateChanged:function()
	{ 
		if (xmlHttp.readyState==4)
		{ 
			document.getElementById("ajaxContent").innerHTML=xmlHttp.responseText;
			setupZoom();
			//Initialize the thickbox for links in content loaded through thickbox
			tb_init('a.thickboxCustom');
			it_StopAnimation();
			//Transparentpng.correctpng();
		}
	},

	GetXmlHttpObject:function()
	{
		var xmlHttp=null;
		try
  		{
  			// Firefox, Opera 8.0+, Safari
  			xmlHttp=new XMLHttpRequest();
  		}
		catch (e)
		{
  			// Internet Explorer
  			try { return new ActiveXObject("Msxml2.XMLHTTP.6.0") } catch(e) {}
  			try { return new ActiveXObject("Msxml2.XMLHTTP.3.0") } catch(e) {}
  			try { return new ActiveXObject("Msxml2.XMLHTTP") } catch(e) {}
  			try { return new ActiveXObject("Microsoft.XMLHTTP") } catch(e) {}
  		}
  		return xmlHttp;
	}
}



















var Transparentpng=
{
	correctpng:function() // correctly handle PNG transparency in Win IE 
	{
		var arVersion = navigator.appVersion.split("MSIE")
  		var version = parseFloat(arVersion[1])
   		if ((version >= 5.5) && (document.body.filters)) 
   		{
    			  for(var i=0; i<document.images.length; i++)
      			  {
         			var img = document.images[i]
         			var imgName = img.src.toUpperCase()
         			if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         			{
            				var imgID = (img.id) ? "id='" + img.id + "' " : ""
            				var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            				var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            				var imgStyle = "display:inline-block;" + img.style.cssText 
            				if (img.align == "left") imgStyle = "float:left;" + imgStyle
            				if (img.align == "right") imgStyle = "float:right;" + imgStyle
            				if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            				var strNewHTML = "<span " + imgID + imgClass + imgTitle
            				+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            				+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            				+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            				img.outerHTML = strNewHTML
            				i = i-1
         			}
      			}
   		}    

	}
}
 
var prevLinkId="aHome";
function ChangeLinkClass(senderId)
{
    document.getElementById(senderId).className="ActivePage";
    if(prevLinkId !="aHome")
    {
        document.getElementById(prevLinkId).className="MenuItem";   
    }
    prevLinkId=senderId;
} 

