function wrapProductContent(){
					$(".whiteBox").each(function(){
						if($(this).children(".productContent").length != 0)
						{
							productContent = $(this).children(".productContent");
							productImage = $(this).children("div.productThumbnailImage").find("img");
							if(productImage.length != 0){
								$(productContent).css("width", $(productContent).parent().width() - $(productImage).width() - Number($(".productContent").css("margin-left").replace(/px/g, "")) - 2);
							}
						}
					});					
			}
			
			$(document).ready(function() {
				if($("#bannerCycle").length)
					$("#bannerCycle").cycle({ 
						fx:    'fade', 
						speed:  4000 
					});

				if($("#newsticker ul").length)
					$("#newsticker ul").cycle({
						fx:    'fade', 
						speed:  2500,
						timeout: 8000 
					});
					
				if(	$("img.purchaseButton").length )
					$("img.purchaseButton").css('cursor','pointer')
										   .click(function(){
												//$("a[href='#purchase']").click();
												location.href = "#/purchase";
											});
				if( $("img.seeSpecs").length )				   
					$("img.seeSpecs").css('cursor','pointer')
										   .click(function(){
											//	$("a[href='#tab1']").click();
												location.href = "#/tab1";
											});	
				if( $("img.viewFAQs") )		
					$("img.viewFAQs").css('cursor','pointer')
										   .click(function(){
											//	$("a[href='#tab2']").click();
												location.href = "#/tab2";
											});							   


				if( $('a.new-window') )
					$('a.new-window').click(function(){
						window.open(this.href,null,"height=450,width=450,status=yes,toolbar=no,menubar=no,location=no");
						return false;
					 });


		

				// go through and check if there are any <a> tags with "purchaseButton" class.
				// if there are,  grab their text,  and thier href,  fill them with the purchase image
				// set their new href to the #/purchase tab with the product number so that the link will take
				// you directly to the product on the purchase tab. if there is no text,  just send them to the
				// purchase tab.
				if( $("a.purchaseButton").length )
					$("a.purchaseButton").each(function(i,e){
						baseUrl=$(e).attr("href");
						productNumber = $(e).text();
						$(e).html('<img style="border:none;" width="90" height="38" alt="add to cart" src="/images/purchase-btn.jpg"/>');
					   if(baseUrl){
							if(! productNumber)
								$(e).attr("href", baseUrl + "#/purchase");
							else
								$(e).attr("href", baseUrl + "#/purchase/" + productNumber);
						}
					});

				//a little JS to make sure that if there is a product Image on the JS page that the
				//productContent Div has a calculated width,  that way it can wrap up to the same
				//"line"  as the image.
				if($("#purchase").css("display") != "none")
					wrapProductContent();
				
				if( $("a[href='#purchase']").length )
					$("a[href='#purchase']").click(wrapProductContent);
				
			});
