<!--

/* Random products Javascript for GM Supplies */
/* Instructions in top part of script down to STOP EDITING HERE */



/* Add products in formation as below */
/* Product variable names are as ProductURL0 etc to keep things simple */
/* Any " in the output needs to be written as \" */



var ProductUrl0 = "<A HREF='/shop/4/11/index.htm#COOKSLR9'>";
var ProductImg0 = "<IMG SRC='/rand-products-images/cookslr9.jpg' border='0' ALT='Click here for more information'></A><br>";
var ProductDesc0 = "<A HREF='/shop/4/11/index.htm#COOKSLR9' class='RandomProdLink'>Lincat SLR9 6 Burner</a>";
var Product0 = ProductUrl0 + ProductImg0 + ProductDesc0;



var ProductUrl1 = "<A HREF='/shop/6/17/sub_1.htm#WASHCLASSICH850'>";
var ProductImg1 = "<IMG SRC='/rand-products-images/hydro850-dishwasher.jpg' border='0' ALT='Click here for more information'></A><br>";
var ProductDesc1 = "<A HREF='/shop/6/17/sub_1.htm#WASHCLASSICH850' class='RandomProdLink'>Classic Hydro 850 Dishwasher</a>";
var Product1 = ProductUrl1 + ProductImg1 + ProductDesc1;



var ProductUrl2 = "<A HREF='/shop/6/17/index.htm#WASHECO2'>";
var ProductImg2 = "<IMG SRC='/rand-products-images/eco2-dishwasher.jpg' border='0' ALT='Click here for more information'></A><br>";
var ProductDesc2 = "<A HREF='/shop/6/17/index.htm#WASHECO2' class='RandomProdLink'>Classic ECO2 Glasswasher</a>";
var Product2 = ProductUrl2  + ProductImg2 + ProductDesc2;



var ProductUrl3 = "<A HREF='/shop/9/22/index.htm#REFKICPR40'>";
var ProductImg3 = "<IMG SRC='/rand-products-images/refkicpr40.jpg' border='0' ALT='Click here for more information'></A><br>";
var ProductDesc3 = "<A HREF='/shop/9/22/index.htm#REFKICPR40' class='RandomProdLink'>KICPR40 Refrigerator</a>";
var Product3 = ProductUrl3 + ProductImg3 + ProductDesc3;




var ProductUrl4 = "<A HREF='/shop/8/index.htm#MICROEMS1000'>";
var ProductImg4 = "<IMG SRC='/rand-products-images/microems1000.jpg' border='0' ALT='Click here for more information'></A><br>";
var ProductDesc4 = "<A HREF='/shop/8/index.htm' class='RandomProdLink'>EMS 1000 Microwave</a>";
var Product4 = ProductUrl4 + ProductImg4 + ProductDesc4;




var ProductUrl5 = "<A HREF='/shop/2/index.htm#BCZ20'>";
var ProductImg5 = "<IMG SRC='/rand-products-images/bcz20.jpg' border='0' ALT='Click here for more information'></A><br>";
var ProductDesc5 = "<A HREF='/shop/2/index.htm#BCZ20' class='RandomProdLink'>Infrico Z20 Bottle Cooler</a>";
var Product5 = ProductUrl5 + ProductImg5 + ProductDesc5;





/* Add the product names into an array and number upwards from 0        */
/* Also update the number of elements in the list just after "new Array */


var mainlocate = new Array (6)
mainlocate[0]=Product0
mainlocate[1]=Product1
mainlocate[2]=Product2
mainlocate[3]=Product3
mainlocate[4]=Product4
mainlocate[5]=Product5




/* Add to this array indicating whether products are tall (eg: freezers) */
/* 1 = tall (shown on it's own) and 0 = small */


var isLarge = new Array (6)
isLarge[0] = 0;
isLarge[1] = 0;
isLarge[2] = 0;
isLarge[3] = 1;
isLarge[4] = 0;
isLarge[5] = 1;




/* **** STOP EDITING HERE **** */





var RandNumb = (new Date()).getTime();
var RandNumb2 = RandNumb + 7;

var randomNum = 0;
var randomNum2 = 0;

arraylength = mainlocate.length;



/* Do the random maths until the 2 random products chosen aren't the same */

var a = 0;
while (a < 1) {

	randomNum = Math.floor ((Math.random() * arraylength));
	randomNum2 = Math.floor ((Math.random() * arraylength));


	if (randomNum == randomNum2) {
		a = 0;
	}
	else {
		a = 1;
	}

}




/* Create the output */
/* Output written as document.write(printoutput) in HTML page */

printoutput = mainlocate[randomNum];
printoutput2 = mainlocate[randomNum2];





/* If large products are selected, make sure only the large product appears          */
/*                                                                                   */
/* If product 1 and product 2 are both large, remove product 2 and only print prod_1 */
/* Else:                                                                             */
/*   If only product 1 is large, remove product 2                                    */
/*   Else if only product 2 is large, collect prod 2 into prod 1 and remove prod 2   */
/*   (this prevents extra space appearing above the single product)                  */


if ((isLarge[randomNum] != 0) && (isLarge[randomNum2] != 0)) {
	printoutput = printoutput2;
	printoutput2 = '';
}
else {


	if (isLarge[randomNum] != 0) {
		printoutput2 = '';
	}
	else if (isLarge[randomNum2] != 0) {
		printoutput = printoutput2;
		printoutput2 = '';
	}
	else {}


}



//-->


