var product_panes = new Array("classification_info_pane","product_details_pane", "images_pane","product_notes_pane", "pricing_pane");


//---------------------------------------------------------------------------------------------------------
function ProductImageError( img )
{
	ImageError( img, "/images/spacer.gif" );
} 


//---------------------------------------------------------------------------------------------------------
function CategoryImageError( img )
{
	ImageError( img, "/images/spacer.gif" );
} 


//---------------------------------------------------------------------------------------------------------
function LineImageError( img )
{
	ImageError( img, "/images/spacer.gif" );
} 

//---------------------------------------------------------------------------------------------------------
function NewsImageError( img )
{
	ImageError( img, "/images/spacer.gif" );
} 

//---------------------------------------------------------------------------------------------------------
function EventsImageError( img )
{
	ImageError( img, "/images/spacer.gif" );
} 

//---------------------------------------------------------------------------------------------------------
function ImageError( img, onerror_image )
{
	var failover_order = new Array("gif","jpg","jpeg","png");
	var re;

	if (img.src != onerror_image) 	
	{

		for (var i=0;i<failover_order.length-1;i++)
		{
		
			re = new RegExp("."+ failover_order[i] +"$", "i");

			if (img.src.search(re)!=-1) 
				{
				img.src = img.src.replace(re,"." + failover_order[i+1]);
				//alert(img.src);
				return;
				}
		}
	
		img.src = onerror_image 

	}
}


//---------------------------------------------------------------------------------------------------------
function SubmitProduct()
{
if (confirm("Are you sure?"))
	{
	 SelectAll( document.productform.ProductLines );
	 SelectAll( document.productform.ProductCategories );
	 document.productform.submit();
	}
}
