function ResizeProducts(){
	/* Calculate Page Width */
	var pageWidth = document.body.clientWidth;
	var bannerWidth = 315;
	var linksWidth = 175;
	var miscWidth = 30;
	var tableWidth = pageWidth - bannerWidth - linksWidth - miscWidth;
	if (tableWidth < 460){ tableWidth = 460; }
	//----------------------------------------------------------------
	
	var product_wrapper_width = 150;
	var maxProducts = Math.floor(tableWidth / product_wrapper_width);
	
	document.getElementById("products1_wrap").setAttribute("width", tableWidth);
	document.getElementById("products2_wrap").setAttribute("width", tableWidth);
	
		HideProducts("newest", maxProducts, tableWidth);
	
}



 function HideProducts ( productType, maxCurrentProducts, tableWidth ){
	  var isIE=/*@cc_on!@*/false;//IE detector
	  var elStyle=isIE?'cssText':'style'; 	  
	  var maxInColumn = 10;
	  var productsShowing = Math.floor(tableWidth / 155);
	  if (productsShowing < 3){ productsShowing = 3; }
	  maxInColumn++;
	  
		
	  var i;
	  if (productsShowing <= 3 && tableWidth <= 460){ var productWidth = 138; } else {
	  var productWidth = (tableWidth / productsShowing) - 15; }
  			  
	  for (i = 1; i <= maxInColumn; i++){
			   			   
			  var productID_1 = "newest" + "_" + i;
			  var productID_2 = "education" + "_" + i;
			  
			  
			  productID = document.getElementById(productID_1);
			  productID2 = document.getElementById(productID_2);
			  
			 if (i <= productsShowing){
				 
					if (isIE){   
					if (productID){ productID.style.cssText = "display: inline; width: " + productWidth + "px"; }
					if (productID2){ productID2.style.cssText = "display: inline; width: " + productWidth + "px"; }
						} else {
					if (productID){ _setStyle(productID, "display: inline;  width: " + productWidth + "px"); }
					if (productID2){ _setStyle(productID2, "display: inline;  width: " + productWidth + "px"); }
					}
					
			  } else {
				  
				if (i != 3){
				    if (isIE){   
					    if (productID){ productID.style.cssText = "display: none;"; }
					    if (productID2){ productID2.style.cssText = "display: none;"; }
				     } else {
					     if (productID){ _setStyle(productID, 'display: none;'); }
					     if (productID2){ _setStyle(productID2, 'display: none;'); }
					 }
				 }
			  } 
			  
		  } // end of for loop
 }
 
 function ChangeProductWidth(productID, productID2, productWidth){
	 productID.style.cssText = "display: inline; width: " + productWidth + "px";
	 productID2.style.cssText = "display: inline; width: " + productWidth + "px";
 }



