/*
	UniteU Express Checkout Feature
	MSR 10/17/07
	
	Usage:
		
	1. Set ImagePath to the path from the site root to the checkout images
	2. If necessary, customize the Steps[] array to add/remove steps
	3. Include this .js file on on all checkout pages
	4. Call DrawExpressCheckout(CurrentStep) on all checkout pages where CurrentStep is the number of the step you want to display
	
	Notes:
	
	- The images are enclosed in a div with the class ExpressCheckout
*/

function DrawExpressCheckout(CurrentStep){
	
	// Configure output var
	var UU_Output = "";
	
	// Configure image path
	var ImagePath = 'assets/images/bobbyjones/CheckoutSteps/';
	
	// Setup steps array
	var Steps = new Array();
	
	// Configure steps
	// Format: CheckoutStep(RegularImage,OnImage,LinkURL)
	Steps[0] =  new CheckoutStep('checkout_step1.gif', 'checkout_step1_on.gif', '');
	Steps[1] =  new CheckoutStep('checkout_step2.gif', 'checkout_step2_on.gif', '');
	Steps[2] =  new CheckoutStep('checkout_step3.gif', 'checkout_step3_on.gif', '');
	Steps[3] =  new CheckoutStep('checkout_step4.gif', 'checkout_step4_on.gif', '');

//	Steps[0] =  new CheckoutStep('checkout_step1.gif', 'checkout_step1_on.gif', 'basket.asp');
//	Steps[1] =  new CheckoutStep('checkout_step2.gif', 'checkout_step2_on.gif', 'shopper_lookup.asp');
//	Steps[2] =  new CheckoutStep('checkout_step3.gif', 'checkout_step3_on.gif', 'shipping.asp');
//	Steps[3] =  new CheckoutStep('checkout_step4.gif', 'checkout_step4_on.gif', 'payment.asp');
	
	// Start feature comment
	UU_Output += '<!-- FEATURE BEGIN ExpressCheckout -->';

	// Start the div
	UU_Output += '<div class="ExpressCheckout">';
	
	// For each image...
	for(i=0; i < Steps.length; i++){
		
		// If we're on the specified step...
		if(i+1 == CurrentStep){
			
			// Show the on image
			UU_ImagePath = ImagePath + Steps[i].OnImage;
		
		} else {

			// Show the regular image
			UU_ImagePath = ImagePath + Steps[i].RegularImage;

		}
		
		// Build the <a> (if link is defined) and <img> tags
		// commented out, no link needed - RIMKUS

		if(Steps[i].LinkURL){
			UU_Output += '<a href="' + Steps[i].LinkURL + '" onClick="return(visitargs(\'' + Steps[i].LinkURL + '\', \'\', \'URL\'));">';
		}
		UU_Output += '<img src="' + UU_ImagePath + '">';
		if(Steps[i].LinkURL){
			UU_Output += '</a>';
		}
	}

	// End the div
	UU_Output += '</div>';

	// Start feature comment
	UU_Output += '<!-- FEATURE END ExpressCheckout -->';


	// Show output
	document.write(UU_Output);
}

// 110909 - Changed so steps are not linked - RIMKUS

function CheckoutStep(RegularImage,OnImage,LinkURL){	
	
	// Constructor
	this.RegularImage = RegularImage;
	this.OnImage = OnImage;
	this.LinkURL = LinkURL;
	
}