//Shopping cart scripts
//3 x .25
var discountPercentage = .25; //current discount percentage
var iMultipleBlinds = 0;
function CalcPrice(checkJS){
	var frmEle = eval("document.shopcart");
	var Price = 0;var OptionsPrice = 0;var HeadrailPrice = 0;var TaxPrice = 0;var TapePrice = 0;var ValancePrice = 0;
	
	discountPercentage = frmEle.DiscountPer.value; //get current discount

	if(frmEle.TapePrice){TapePrice = eval(frmEle.TapePrice.value);}
	var blindWidth = frmEle.WidthInches.value + frmEle.Width8ths.value;
	var blindHeight = frmEle.HeightInches.value + frmEle.Height8ths.value;
	//round sizes to next highest values
    
	if(frmEle.TapeColorID)
	{
		if(blindWidth < 13 && frmEle.TapeColorID.value != 0){
			alert('Sorry, but Cloth Tape is not available on blinds under 13" wide.');
			document.shopcart.TapeColorID.value = 0;
			SetPreviewColor(0,2);
		}
	}
	
	//set check that enabled
	if(checkJS != 1){frmEle.jsBrowserCheck.value = "1";}

	var catID = "";
	if (frmEle.cid) catID = eval(frmEle.cid.value);
	if (catID == "20")
	{
		blindWidth = RoundUp(blindWidth);
		blindHeight = RoundUp(blindHeight);
	}
	else
	{
		blindWidth = RoundUp(blindWidth);
		blindWidth = getPriceBreak(blindWidth,aWidths);
		blindHeight = RoundUp(blindHeight);
		blindHeight = getPriceBreak(blindHeight,aHeights);
	}
	
	//Display Oversize fee
	if((eval(frmEle.WidthInches.value) + eval(frmEle.Width8ths.value)) >= eval(document.shopcart.OverSizeWidth.value)){
		document.getElementById("ShippingFee").innerHTML = "See shopping cart";
	}
	else{
		document.getElementById("ShippingFee").innerHTML = "FREE";
	} 

	//calc base price
	if (catID == "20")
	{
		if (frmEle.FeatureOption31)
		{
			if (frmEle.FeatureOption31.value == '111' || frmEle.FeatureOption31.value == '123')
			{
				blindWidth = blindWidth + 4;
			}
		}
		var basePrice = Math.abs(frmEle.BPrice.value);
		var multiplier = frmEle.PricePer.value;
		Price = basePrice * blindWidth * blindHeight * multiplier;
		if (frmEle.pid.value == 183) Price = (basePrice * blindWidth * blindHeight + 200) * multiplier;
		if (frmEle.pid.value == 186) Price = (basePrice * blindWidth * blindHeight + 250) * multiplier;
	}
	else
	{
		var testWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
		var testHeight = document.shopcart.HeightInches.value + document.shopcart.Height8ths.value;	
		Price = getBasePrice(blindWidth,blindHeight,testWidth,testHeight);
	}	
	
	// Setup option availability prior to setting option pricing.  This is the pricing the
	// user will see when viewing the screen.
	SetOptionStatus();
	
	// Calc option price.  This sets the total price for the product with options.
	OptionsPrice = getOptionPrices(Price);
	//calc option headrail
	HeadrailPrice = getHeadrailPrice(Price);
	//check for rush option
	if(frmEle.RushProduction){
		if(frmEle.RushProduction.checked){
			OptionsPrice += eval(frmEle.RushProduction.value);
		}
	}	
	
	//check for valance trims and lining
	if (document.getElementById('FeatureOption84')) //Lining
	{
		if (document.shopcart.FeatureOption84.value == 229 || document.shopcart.FeatureOption84.value == 230)
		{
			ValancePrice += 25;
		}
	}
	if (document.getElementById('FeatureOption96')) //Lining
	{
		if (document.shopcart.FeatureOption96.value == 416 || document.shopcart.FeatureOption96.value == 417)
		{
			ValancePrice += 25;
		}
	}
	if (document.getElementById('FeatureOption97')) //Lining
	{
		if (document.shopcart.FeatureOption97.value == 419 || document.shopcart.FeatureOption97.value == 420)
		{
			ValancePrice += 25;
		}
	}
	if (document.getElementById('FeatureOption81')) //trim for cornice boards
	{
		if (document.shopcart.FeatureOption81.value == 221 || document.shopcart.FeatureOption81.value == 222 || (document.shopcart.FeatureOption81.value >= 401 && document.shopcart.FeatureOption81.value <= 406))
		{
			ValancePrice += Price * .2; //fringe
		}
		if (document.shopcart.FeatureOption81.value >= 407 && document.shopcart.FeatureOption81.value <= 414)
		{
			ValancePrice += Price * .15; //cord
		}
	}
	if (document.getElementById('FeatureOption86')) //trim for board mounted valances
	{
		if (document.shopcart.FeatureOption86.value == 234 || document.shopcart.FeatureOption86.value == 235 || (document.shopcart.FeatureOption86.value >= 317 && document.shopcart.FeatureOption86.value <= 322))
		{
			ValancePrice += Price * .2; //fringe
		}
		if (document.shopcart.FeatureOption86.value >= 323 && document.shopcart.FeatureOption86.value <= 330)
		{
			ValancePrice += Price * .15; //cord
		}
	}
	if (document.getElementById('FeatureOption87')) //trim for board mounted valances
	{
		if (document.shopcart.FeatureOption87.value == 237 || document.shopcart.FeatureOption87.value == 238 || (document.shopcart.FeatureOption87.value >= 331 && document.shopcart.FeatureOption87.value <= 336))
		{
			ValancePrice += Price * .2; //fringe
		}
		if (document.shopcart.FeatureOption87.value >= 337 && document.shopcart.FeatureOption87.value <= 344)
		{
			ValancePrice += Price * .15; //cord
		}
	}
	if (document.getElementById('FeatureOption88')) //trim for board mounted valances
	{
		if (document.shopcart.FeatureOption88.value == 240 || document.shopcart.FeatureOption88.value == 241 || (document.shopcart.FeatureOption88.value >= 345 && document.shopcart.FeatureOption88.value <= 350))
		{
			ValancePrice += Price * .2; //fringe
		}
		if (document.shopcart.FeatureOption88.value >= 351 && document.shopcart.FeatureOption88.value <= 358)
		{
			ValancePrice += Price * .15; //cord
		}
	}
	if (document.getElementById('FeatureOption89')) //trim
	{
		if (document.shopcart.FeatureOption89.value == 243 || document.shopcart.FeatureOption89.value == 244 || (document.shopcart.FeatureOption89.value >= 359 && document.shopcart.FeatureOption89.value <= 364))
		{
			ValancePrice += 25; //fringe
		}
		if (document.shopcart.FeatureOption89.value >= 365 && document.shopcart.FeatureOption89.value <= 372)
		{
			ValancePrice += 20; //cord
		}
	}
	if (document.getElementById('FeatureOption90')) //trim
	{
		if (document.shopcart.FeatureOption90.value == 246 || document.shopcart.FeatureOption90.value == 247 || (document.shopcart.FeatureOption90.value >= 373 && document.shopcart.FeatureOption90.value <= 378))
		{
			ValancePrice += 25; //fringe
		}
		if (document.shopcart.FeatureOption90.value >= 379 && document.shopcart.FeatureOption90.value <= 386)
		{
			ValancePrice += 20; //cord
		}
	}
	if (document.getElementById('FeatureOption91')) //trim
	{
		if (document.shopcart.FeatureOption91.value == 249 || document.shopcart.FeatureOption91.value == 250 || (document.shopcart.FeatureOption91.value >= 387 && document.shopcart.FeatureOption91.value <= 392))
		{
			ValancePrice += 25; //fringe
		}
		if (document.shopcart.FeatureOption91.value >= 393 && document.shopcart.FeatureOption91.value <= 400)
		{
			ValancePrice += 20; //cord
		}
	}
	//check for valance pricing
	if (document.getElementById('FeatureOption68'))
	{
		if (document.shopcart.FeatureOption68.value > 176) //Rod Type selected
		{	
			if (document.shopcart.FeatureOption68.value == 177) //Bamboo Rod selected
			{
				// Bamboo Pole
				if (document.getElementById('FeatureOption78'))
				{
					if (document.getElementById('FeatureOption78').value == 211) //48" 1 1/4"
					{
						ValancePrice += 25;
					}
					if (document.getElementById('FeatureOption78').value == 212) //72" 1 1/4"
					{
						ValancePrice += 30;
					}
					if (document.getElementById('FeatureOption78').value == 213) //96" 1 1/4"
					{
						ValancePrice += 40;
					}
					if (document.getElementById('FeatureOption78').value == 259) //48" 1 7/8"
					{
						ValancePrice += 35;
					}
					if (document.getElementById('FeatureOption78').value == 260) //72" 1 7/8"
					{
						ValancePrice += 50;
					}
					if (document.getElementById('FeatureOption78').value == 261) //96" 1 7/8"
					{
						ValancePrice += 70;
					}
				}
				//Bamboo Brackets
				if (document.getElementById('FeatureOption94'))
				{
					if (document.getElementById('FeatureOption94').value == 298) //Single Bracket 1 1/4"
					{
						ValancePrice += 15;
					}
					if (document.getElementById('FeatureOption94').value == 299) //Double Bracket 1 1/4"
					{
						ValancePrice += 25;
					}
					if (document.getElementById('FeatureOption94').value == 300) //Single Bracket 1 7/8"
					{
						ValancePrice += 12;
					}
					if (document.getElementById('FeatureOption94').value == 301) //Double Bracket 1 7/8"
					{
						ValancePrice += 15;
					}
				}
				//Bamboo Finials
				if (document.getElementById('FeatureOption74'))
				{
					var woodFinials = document.getElementById('FeatureOption74').value;
					if (woodFinials == 196 || woodFinials == 197 || woodFinials == 262 || woodFinials == 263 || woodFinials == 264 || woodFinials == 266)
					{
						ValancePrice += 25;
					}
					if (woodFinials == 198)
					{
						ValancePrice += 15;
					}
					if (woodFinials == 265)
					{
						ValancePrice += 18;
					}
				}
			}
			if (document.shopcart.FeatureOption68.value == 179) //Wood Rod selected
			{
				//Wood Pole Size
				if (document.getElementById('FeatureOption79'))
				{
					if (document.getElementById('FeatureOption79').value == 214) //48" 1 3/8" Fluted/Smooth
					{
						ValancePrice += 25;
					}
					if (document.getElementById('FeatureOption79').value == 215) //72" 1 3/8" Fluted/Smooth
					{
						ValancePrice += 30;
					}
					if (document.getElementById('FeatureOption79').value == 216) //96" 1 3/8" Fluted/Smooth
					{
						ValancePrice += 40;
					}
					if (document.getElementById('FeatureOption79').value == 267) //48" 2" Fluted/Smooth
					{
						ValancePrice += 35;
					}
					if (document.getElementById('FeatureOption79').value == 268) //72" 2" Fluted/Smooth
					{
						ValancePrice += 50;
					}
					if (document.getElementById('FeatureOption79').value == 269) //96" 2" Fluted/Smooth
					{
						ValancePrice += 70;
					}
					if (document.getElementById('FeatureOption79').value == 270) //48" 1 3/8" Spiral
					{
						ValancePrice += 30;
					}
					if (document.getElementById('FeatureOption79').value == 271) //72" 1 3/8" Spiral
					{
						ValancePrice += 35;
					}
					if (document.getElementById('FeatureOption79').value == 272) //96" 1 3/8" Spiral
					{
						ValancePrice += 45;
					}
				}
				//Wood Finials
				if (document.getElementById('FeatureOption76'))
				{
					if (document.getElementById('FeatureOption76').value > 200 && document.getElementById('FeatureOption76').value < 292)
					{
						ValancePrice += 25;
					}
					if (document.getElementById('FeatureOption76').value == 308)
					{
						ValancePrice += 15;
					}
					if (document.getElementById('FeatureOption76').value == 309)
					{
						ValancePrice += 18;
					}
					if (document.getElementById('FeatureOption76').value == 310)
					{
						ValancePrice += 15;
					}
				}
				//Wood Brackets
				if (document.getElementById('FeatureOption95'))
				{

					if (document.getElementById('FeatureOption95').value == 302) //Single Bracket 1 3/8" Fluted/SMooth
					{
						ValancePrice += 15;
					}
					if (document.getElementById('FeatureOption95').value == 303) //Double Bracket 1 3/8" Fluted/Smooth
					{
						ValancePrice += 25;
					}
					if (document.getElementById('FeatureOption95').value == 304) //Single Bracket 2" Fluted/Smooth
					{
						ValancePrice += 12;
					}
					if (document.getElementById('FeatureOption95').value == 305) //Double Bracket 2" Fluted/Smooth
					{
						ValancePrice += 15;
					}
					if (document.getElementById('FeatureOption95').value == 306) //Single Bracket 1 3/8" Spiral
					{
						ValancePrice += 15;
					}
					if (document.getElementById('FeatureOption95').value == 307) //Double Bracket 1 3/8" Spiral
					{
						ValancePrice += 25;
					}
				}
			}
			if (document.shopcart.FeatureOption68.value == 178) //Metal Rod selected
			{
				//Metal Pole Size
				if (document.getElementById('FeatureOption80'))
				{

					if (document.getElementById('FeatureOption80').value == 217) //28 - 48"
					{
						ValancePrice += 30;
					}
					if (document.getElementById('FeatureOption80').value == 218) //48" - 86"
					{
						ValancePrice += 35;
					}
					if (document.getElementById('FeatureOption80').value == 219) //86 - 120"
					{
						ValancePrice += 50;
					}
				}
				//Metal Finials
				if (document.getElementById('FeatureOption75'))
				{
					if (document.getElementById('FeatureOption75').value > 198 && document.getElementById('FeatureOption75').value < 297) 
					{
						ValancePrice += 25;
					}
					if (document.getElementById('FeatureOption75').value == 297) 
					{
						ValancePrice += 10;
					}
				}
			}
		}
	}
		
	//check for tape option
	if(frmEle.TapeColorID){
		if(frmEle.TapeColorID.value != 0){//Tapes and Edge Banding and Trims
			var TapePricingActive = 1;
			if (document.getElementById('TapePricing')) TapePricingActive = document.getElementById('TapePricing').value;
						
			if (TapePricingActive > 0)
			{
				if(frmEle.pid.value == 19){//EdgeBanding
					OptionsPrice += 35;
				}
				else if(frmEle.pid.value == 83 || frmEle.pid.value == 84){//EdgeBanding Woodlands
					//Get price based on shade width.
					if(blindWidth < 24){
						OptionsPrice += 50;
					}
					else if(blindWidth < 30){
						OptionsPrice += 55;
					}
					else if(blindWidth < 32){
						OptionsPrice += 55;
					}
					else if(blindWidth < 36){
						OptionsPrice += 55;
					}
					else if(blindWidth < 42){
						OptionsPrice += 60;
					}
					else if(blindWidth < 48){
						OptionsPrice += 65;
					}
					else if(blindWidth < 60){
						OptionsPrice += 65;
					}
					else if(blindWidth < 72){
						OptionsPrice += 75;
					}
					else if(blindWidth < 84){
						OptionsPrice += 80;
					}
					else{
						OptionsPrice += 90;
					}
				}
				else if (frmEle.pid.value == 61)
				{
					if (frmEle.TapeColorID.value == 240 || frmEle.TapeColorID.value == 234 || frmEle.TapeColorID.value == 258 || frmEle.TapeColorID.value == 248 || frmEle.TapeColorID.value == 246 || frmEle.TapeColorID.value == 232 || frmEle.TapeColorID.value == 236 || frmEle.TapeColorID.value == 256 || frmEle.TapeColorID.value == 254 || frmEle.TapeColorID.value == 250 || frmEle.TapeColorID.value == 252 || frmEle.TapeColorID.value == 242 || frmEle.TapeColorID.value == 244 || frmEle.TapeColorID.value == 230 || frmEle.TapeColorID.value == 260)
					{
						OptionsPrice += 20;
					}
					else
					{
						OptionsPrice += 30;
					}
				}
				else if (frmEle.pid.value == 224)
				{
					if (frmEle.TapeColorID.value == 301 || frmEle.TapeColorID.value == 302 || frmEle.TapeColorID.value == 303 || frmEle.TapeColorID.value == 304 || frmEle.TapeColorID.value == 306 || frmEle.TapeColorID.value == 307)
					{
						OptionsPrice += 20;
					}
					else if (frmEle.TapeColorID.value == 262 || frmEle.TapeColorID.value == 263 || frmEle.TapeColorID.value == 264 || frmEle.TapeColorID.value == 265 || frmEle.TapeColorID.value == 266 || frmEle.TapeColorID.value == 267 || frmEle.TapeColorID.value == 268 || frmEle.TapeColorID.value == 269 || frmEle.TapeColorID.value == 270 || frmEle.TapeColorID.value == 271 || frmEle.TapeColorID.value == 272 || frmEle.TapeColorID.value == 273 || frmEle.TapeColorID.value == 274 || frmEle.TapeColorID.value == 275 || frmEle.TapeColorID.value == 276 || frmEle.TapeColorID.value == 277 || frmEle.TapeColorID.value == 278 || frmEle.TapeColorID.value == 279)
					{
						OptionsPrice += 40;
					}
					else
					{
						OptionsPrice += 55;
					}
				}
				else if (frmEle.pid.value == 240)
				{
					if (frmEle.TapeColorID.value == 392 || frmEle.TapeColorID.value == 391 || frmEle.TapeColorID.value == 407 || frmEle.TapeColorID.value == 404 || frmEle.TapeColorID.value == 403 || frmEle.TapeColorID.value == 405 || frmEle.TapeColorID.value == 399 || frmEle.TapeColorID.value == 400 || frmEle.TapeColorID.value == 390 || frmEle.TapeColorID.value == 388 || frmEle.TapeColorID.value == 389 || frmEle.TapeColorID.value == 396 || frmEle.TapeColorID.value == 402 || frmEle.TapeColorID.value == 401 || frmEle.TapeColorID.value == 406 || frmEle.TapeColorID.value == 398 || frmEle.TapeColorID.value == 393 || frmEle.TapeColorID.value == 395 || frmEle.TapeColorID.value == 394 || frmEle.TapeColorID.value == 397)
					{
						OptionsPrice += 55;
					}
					else
					{
						OptionsPrice += 40;
					}
				}

				else if (frmEle.pid.value == 220)
				{
					OptionsPrice += 30;
				}
				else if(frmEle.pid.value == 9 || frmEle.pid.value == 31 || frmEle.pid.value == 54 || frmEle.pid.value == 55 || frmEle.pid.value == 56 || frmEle.pid.value == 57 || frmEle.pid.value == 58){//Rollers
					//no price for hems
				}
				else if (frmEle.pid.value == 196)
				{
					if (frmEle.TapeColorID.value > 187 && frmEle.TapeColorID.value < 208) OptionsPrice += 50;
					else OptionsPrice += TapePrice;
				}
				else if (frmEle.pid.value == 137)
				{
					//no price for tropical isle
					OptionsPrice += 60;
				}					
				else{//Cloth Tapes 20%
					//OptionsPrice += (Price * (20/100));
					OptionsPrice += TapePrice;
	//				if(document.shopcart.Option6)
					if(document.getElementById("rTwoOnOne"))
					{//2 in 1
	//					if(document.shopcart.Option6.checked){//Add for second blind tape
						if(document.getElementById("rTwoOnOne").checked){//Add for second blind tape
							OptionsPrice += TapePrice;
						}
					}
	//				if(document.shopcart.Option8)//3 in 1
					if(document.getElementById("rThreeOnOne"))
					{
	//					if(document.shopcart.Option8.checked){//Add for third blind tape
						if(document.getElementById("rThreeOnOne").checked){//Add for third blind tape
							OptionsPrice += (TapePrice * 2);
						}
					}
				}
			}
		}
	}
	Price += OptionsPrice + HeadrailPrice + TaxPrice + ValancePrice;

	var SalePercentage = eval(frmEle.SalePercentage.value);
	var OrigMSRPPrice = 1.3 * (Price/frmEle.mul.value);
	var MSRPPercent = document.shopcart.MSRPSalePercentage.value;
	var MSRPPrice = Price/(1-(MSRPPercent/100))	
	var Savings = ((MSRPPrice - Price) / MSRPPrice) * 100;
	
	Savings = ToDollarsAndCents(Savings);	
	MSRPPrice = ToDollarsAndCents(MSRPPrice) + " (You save " + Math.round(Savings) + "%)";
	Price = ToDollarsAndCents(Price);
	SalePrice = ((Price - (OptionsPrice + TaxPrice + ValancePrice)) * SalePercentage) + (OptionsPrice + TaxPrice + ValancePrice);//give discount on base price only
	SalePrice = ToDollarsAndCents(SalePrice);
	frmEle.Price.value = SalePrice;
	frmEle.DisplayPrice.value = Price;
	
	var dealerLvl = document.getElementById("dealerlvl").value;
	
	if (dealerLvl == "0") 
	{
		if (Price == "0.00")
		{
			document.getElementById("DisplayEverydayPriceDiv").innerHTML = "$N/A";
		}
		else
		{
			document.getElementById("DisplayEverydayPriceDiv").innerHTML = "$" + Price;
		}
		Price = ToDollarsAndCents(Price - (Price * discountPercentage));
		Savings = ((OrigMSRPPrice - Price) / OrigMSRPPrice) * 100;
		Savings = ToDollarsAndCents(Savings);	
		//MSRPPrice = ToDollarsAndCents(OrigMSRPPrice) + " (You save " + Math.round(Savings) + "%)";
	}
	if (Price == "0.00")
	{
		document.getElementById("DisplayPriceDiv").innerHTML = "$N/A";
		document.getElementById("DisplayPriceDivSale").innerHTML = "$N/A";
		document.getElementById("DisplayMSRPPrice").innerHTML = "N/A";
		if (document.getElementById('DisplayPriceDivBlindCS')) document.getElementById('DisplayPriceDivBlindCS').innerHTML = "$N/A";
		if (document.getElementById('BlindPriceCS')) document.getElementById('BlindPriceCS').value = "N/A";
		if (document.getElementById('DisplayPriceDivTotalCS') && document.getElementById('BlindPriceCS') && document.getElementById('ValancePriceCS'))
		{
			document.getElementById('DisplayPriceDivTotalCS').innerHTML = "N/A";
		}
	}
	else
	{
		document.getElementById("DisplayPriceDiv").innerHTML = "$" + Price;
		document.getElementById("DisplayPriceDivSale").innerHTML = "$" + SalePrice;	
		document.getElementById("DisplayMSRPPrice").innerHTML = MSRPPrice;
		if (document.getElementById('DisplayPriceDivBlindCS')) document.getElementById('DisplayPriceDivBlindCS').innerHTML = "$" + Price;
		if (document.getElementById('BlindPriceCS')) document.getElementById('BlindPriceCS').value = Price;
		if (document.getElementById('DisplayPriceDivTotalCS') && document.getElementById('BlindPriceCS') && document.getElementById('ValancePriceCS'))
		{			
			document.getElementById('DisplayPriceDivTotalCS').innerHTML = roundNumber(parseFloat(document.getElementById('BlindPriceCS').value) + parseFloat(document.getElementById('ValancePriceCS').value), 2);
			document.getElementById('DisplayPriceDivTotalCS').innerHTML = "$" + ToDollarsAndCents(document.getElementById('DisplayPriceDivTotalCS').innerHTML);
		}
	}
	//frmEle.DisplayMSRPPrice.value = MSRPPrice;
}

function roundNumber(num, dec) {
	var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
	return result;
}

function CalcMiniPrice(checkJS){
	var frmEle = eval("document.shopcart");
	var Price = 0;var OptionsPrice = 0;var TaxPrice = 0;var TapePrice = 0;
	var blindWidth = 0;
	var blindHeight = 0;
	var SalePercentage = 1;
	var TotalPrice = 0;
	var DisplayTotalPrice = "";
	var hiCookie = ""; var wiCookie = ""; 
	var hdCookie = ""; var wdCookie = "";
	if(frmEle.SalePercentage)SalePercentage = eval(frmEle.SalePercentage.value);
	discountPercentage = frmEle.DiscountPer.value; //get current discount
	//round sizes to next highest values
	
	if(frmEle.window.length){//Multiple Windows
		for(i=0;i<frmEle.window.length;i++){
			if(hiCookie!=""){
				hiCookie += ","; wiCookie += ","; 
				hdCookie += ","; wdCookie += ",";
			}
			hiCookie += frmEle.HeightInchesDisplay[i].value; wiCookie += frmEle.WidthInchesDisplay[i].value; 
			hdCookie += frmEle.Height8thsDisplay[i].value; wdCookie += frmEle.Width8thsDisplay[i].value;
			
			//calc each window
			blindWidth = frmEle.WidthInchesDisplay[i].value + frmEle.Width8thsDisplay[i].value;
			blindHeight = frmEle.HeightInchesDisplay[i].value + frmEle.Height8thsDisplay[i].value;
		
			//calc base price
			if(blindWidth == 0 || blindHeight == 0){
				Price = 0;
			}
			else{
				blindWidth = RoundUp(blindWidth);		
				blindWidth = getPriceBreak(blindWidth,aWidths);
				blindHeight = RoundUp(blindHeight);
				blindHeight = getPriceBreak(blindHeight,aHeights);
				var testWidth = document.shopcart.WidthInchesDisplay[i].value + document.shopcart.Width8thsDisplay[i].value;
				var testHeight = document.shopcart.HeightInchesDisplay[i].value + document.shopcart.Height8thsDisplay[i].value;
				Price = getBasePrice(blindWidth,blindHeight,testWidth,testHeight);
			}					
			
			Price = ToDollarsAndCents(Price);
			SalePrice = (Price * SalePercentage);//give discount on base price only
			SalePrice = ToDollarsAndCents(SalePrice);
			TotalPrice = (SalePrice * 1) + TotalPrice;
			
			document.getElementById("DisplayEverydayPrice" + i).innerHTML = "$" + Price;
			var dealerLvl = document.getElementById("dealerlvl" + i).value;
			if (dealerLvl == "0") Price = ToDollarsAndCents(Price - (Price * discountPercentage));
			
			var DisplayPrice = "";
			//if(Price == SalePrice){
				DisplayPrice = "<font class='errortextbig'>$" + Price + "</font>";
				DisplayTotalPrice = "$" + Price;
			//}
			//else{
			//	DisplayPrice = "<s>$" + Price + "</s><br>Sale Price = <font class='errortextbig'>$" + SalePrice + "</font>";
			//	DisplayTotalPrice = "$" + SalePrice;
			//}
			var displayElement = "DisplayPrice" + i;
			document.getElementById(displayElement).innerHTML = DisplayPrice;
		}
		DisplayTotalPrice = ToDollarsAndCents(TotalPrice);
		document.getElementById("DisplayTotalPrice").innerHTML = "Total(excluding options) = <font class='errortextbig'>$" + DisplayTotalPrice + "</font>";
	}
	else{//Single window
		hiCookie = frmEle.HeightInchesDisplay.value; wiCookie = frmEle.WidthInchesDisplay.value; 
		hdCookie = frmEle.Height8thsDisplay.value; wdCookie = frmEle.Width8thsDisplay.value;
		
		blindWidth = frmEle.WidthInchesDisplay.value + frmEle.Width8thsDisplay.value;
		blindHeight = frmEle.HeightInchesDisplay.value + frmEle.Height8thsDisplay.value;
		
		
		var catID = "";
		if (frmEle.cid) catID = eval(frmEle.cid.value);
		if (catID == "20")
		{
			var basePrice = frmEle.BPrice.value;
			var multiplier = Math.abs(frmEle.PricePer.value);
			blindWidth = RoundUp(blindWidth);		
			blindHeight = RoundUp(blindHeight);	
			Price = basePrice * blindWidth * blindHeight * multiplier;
			if (frmEle.pid.value == 183) Price = (basePrice * blindWidth * blindHeight + 200) * multiplier;
			if (frmEle.pid.value == 186) Price = (basePrice * blindWidth * blindHeight + 250) * multiplier;
		}
		else
		{
			blindWidth = RoundUp(blindWidth);		
			blindWidth = getPriceBreak(blindWidth,aWidths);
			blindHeight = RoundUp(blindHeight);
			blindHeight = getPriceBreak(blindHeight,aHeights);
		
			//calc base price
			var testWidth = document.shopcart.WidthInchesDisplay.value + document.shopcart.Width8thsDisplay.value;
			var testHeight = document.shopcart.HeightInchesDisplay.value + document.shopcart.Height8thsDisplay.value;
			Price = getBasePrice(blindWidth,blindHeight,testWidth,testHeight);
		}
		
		Price = ToDollarsAndCents(Price);
		SalePrice = (Price * SalePercentage);//give discount on base price only
		SalePrice = ToDollarsAndCents(SalePrice);
		
		if (Price == "0.00")
		{
			document.getElementById("DisplayEverydayPrice0").innerHTML = "$N/A";
		}
		else
		{
			document.getElementById("DisplayEverydayPrice0").innerHTML = "$" + Price;
		}
		var dealerLvl = document.getElementById("dealerlvl0").value;
		if (dealerLvl == "0") Price = ToDollarsAndCents(Price - (Price * discountPercentage));
		
		if (Price == "0.00") Price = "N/A";
		if (SalePrice == "0.00") SalePrice = "N/A";
		
		var DisplayPrice = "";
		//if(Price == SalePrice){
			DisplayPrice = "$" + Price;
			DisplayTotalPrice = "$" + SalePrice;
		//}
		//else{
		//	DisplayPrice = "<s>$" + Price + "</s><br>Sale Price = <font class='errortextbig'>$" + SalePrice + "</font>";
		//	DisplayTotalPrice = "$" + SalePrice;
		//}
		document.getElementById("DisplayPrice0").innerHTML = DisplayPrice;
	}
	var BMLPrice = 0;
	var dDisplayPrice = SalePrice.replace("$","") * 1;
	
	BMLPrice = ToFullDollars(dDisplayPrice * .03);
	//alert(SalePrice.replace("$","") + " " + BMLPrice);
	if((dDisplayPrice * .03) < 10) {BMLPrice = 10;}
	if(document.getElementById("BillMeLaterPayments"))document.getElementById("BillMeLaterPayments").innerHTML = BMLPrice;
}

function getHeadrailPrice(BasePrice){
	var Price = 0;
	
	if(document.getElementById("rTwoOnOne"))
	{  	
		if(document.getElementById("rTwoOnOne").checked)
		{
			Price += BasePrice * .2 ;
			
		}
	}
	if(document.getElementById("rThreeOnOne"))
	{
		if(document.getElementById("rThreeOnOne").checked)
		{
			Price += BasePrice * .3;
		}
	}

	return Price	
}

function getOptionPrices(BasePrice){
	var frmEle = eval("document.shopcart");
	var frmEleOption; var frmOptionUnit; var frmOptionPrice;
	var i = 0;
	var Price = 0;

	if(frmEle.Options){
		if(frmEle.Options.length){
			for(i=0;i<frmEle.Options.length;i++){
				//check each option if checked
				frmEleOption = eval("document.shopcart.Option" + frmEle.Options[i].value);
				frmOptionPrice = eval("document.shopcart.OptionPrice" + frmEle.Options[i].value);
				frmOptionUnit = eval("document.shopcart.PriceType" + frmEle.Options[i].value);
				if(frmEleOption.checked == true){
					var testWidth = frmEle.WidthInches.value + frmEle.Width8ths.value;
					var testHeight = frmEle.HeightInches.value + frmEle.Height8ths.value;
					if(frmOptionUnit.value == 1){//Dollars
						//if (frmEleOption.id == "Option68") //Top Down Bottom Up for Cellular Shades - charge if greater than 24"
						//{
						//	var testWidth = frmEle.WidthInches.value + frmEle.Width8ths.value;
						//	if (testWidth > 24) Price += eval(frmOptionPrice.value);
						//}
						//else if ((document.shopcart.pid.value == 197 || document.shopcart.pid.value == 198 || document.shopcart.pid.value == 199 || document.shopcart.pid.value == 200 || document.shopcart.pid.value == 201 || document.shopcart.pid.value == 202 || document.shopcart.pid.value == 203 ||
						//           document.shopcart.pid.value == 308 || document.shopcart.pid.value == 313 || document.shopcart.pid.value == 307 || document.shopcart.pid.value == 311 || document.shopcart.pid.value == 309 || document.shopcart.pid.value == 310 || document.shopcart.pid.value == 312) && frmEleOption.id == "Option12")
						//{//Top Down Bottom Up for Roman Shades
						//	var testWidth = frmEle.WidthInches.value + frmEle.Width8ths.value;
						//	if (testWidth > 24) Price += 4.99;
						//}
						//else
						//{
						//	Price += eval(frmOptionPrice.value);
						//}
						if ((document.shopcart.pid.value == 68) && frmEleOption.id == "Option68")
						{//Top Down Bottom Up
							if (testWidth > 24) Price += 0.00; //12.99;
						}						
						else if ((document.shopcart.pid.value == 65 || document.shopcart.pid.value == 67 || document.shopcart.pid.value == 64 || document.shopcart.pid.value == 238 
						    || document.shopcart.pid.value == 69 || document.shopcart.pid.value == 129 || document.shopcart.pid.value == 66
						    || document.shopcart.pid.value == 267 || document.shopcart.pid.value == 268 || document.shopcart.pid.value == 269
						    || document.shopcart.pid.value == 299 || document.shopcart.pid.value == 300 || document.shopcart.pid.value == 301 || document.shopcart.pid.value == 302) 
						    && frmEleOption.id == "Option68")
						{//Top Down Bottom Up
							if (testWidth > 24) Price += 12.99;
						}
						else if (document.shopcart.pid.value == 91 && frmEleOption.id == "Option68")
						{//Top Down Bottom Up
							if (testWidth > 24) Price += 12.99;
						}
						else if ((document.shopcart.pid.value == 221 || document.shopcart.pid.value == 222) && frmEleOption.id == "Option19")
						{//Top Down Bottom Up
						    // The controls the EveryDay Price shown on the site.
							if (testWidth > 24) Price += 0.00; //12.99;
						}
						else
						{
							Price += eval(frmOptionPrice.value);
						}
					}
					else{//Percentage
					    if ((document.shopcart.pid.value == 259 || document.shopcart.pid.value == 263 || document.shopcart.pid.value == 264) && frmEleOption.id == "Option65") //ccloop
						{
						    //Price += 0;						    													    
							if ((testWidth >= 36 && testWidth < 42 && testHeight >= 102) || (testWidth >= 42 && testWidth < 48 && testHeight >= 84) || (testWidth >= 48 && testWidth < 54 && testHeight >= 72)
								|| (testWidth >= 54 && testWidth < 60 && testHeight >= 66) || (testWidth >= 60 && testWidth < 66 && testHeight >= 60) || (testWidth >= 66 && testWidth < 72 && testHeight >= 48)
								|| (testWidth >= 72 && testWidth < 78 && testHeight >= 42) || (testWidth >= 78 && testWidth < 84 && testHeight >= 42) || (testWidth >= 84))
							{
								Price += 0;
							}
							else
							{
								Price += BasePrice * (eval(frmOptionPrice.value)/100);
							}
						}
						else
						{
							Price += BasePrice * (eval(frmOptionPrice.value)/100);
						}
					}
				}
			}
		}
		else{//Single option
			frmEleOption = eval("document.shopcart.Option" + frmEle.Options.value);
			frmOptionPrice = eval("document.shopcart.OptionPrice" + frmEle.Options.value);
			frmOptionUnit = eval("document.shopcart.PriceType" + frmEle.Options.value);
			if(frmEleOption.checked == true){
				if(frmOptionUnit.value == 1){//Dollars
					Price += eval(frmOptionPrice.value);
				}
				else{//Percentage
					Price += BasePrice * (eval(frmOptionPrice.value)/100);
				}
			}
		}
	}
	if(frmEle.FeatureOption5){//Fold Type Option(Bamboo)
		if(frmEle.FeatureOption5.value == 17){//DuoFold
			Price += 100;
		}
		if(frmEle.FeatureOption5.value == 21){//RollEase
			Price += 35;
		}
	}
	if(frmEle.FeatureOption20){//Valance - Hunter Douglas
		if(frmEle.FeatureOption20.value == 47 || frmEle.FeatureOption20.value == 48 || frmEle.FeatureOption20.value == 49){
		//add for custom valance
			Price += 12;
		}
	}
	if(frmEle.FeatureOption10){//Hem Style Option(Roller)
		if(frmEle.FeatureOption10.value == 24){//Plain
			//do not change price
			//MM_showHideLayers('Tapes','','hide');
		}
		else {//Fancy Hem
			var rollerWidth = frmEle.WidthInches.value + frmEle.Width8ths.value;
			var HemPrice = rollerWidth/1.5;
			Price += HemPrice;
			//MM_showHideLayers('Tapes','','show');
		}
	}
	if(frmEle.FeatureOption24){//Bottom Hem Style Option(Roller)
		if(frmEle.FeatureOption24.value == 87){//Plain
			//do not change price
			//MM_showHideLayers('Tapes','','hide');
		}
		else {//Fancy Hem
			var rollerWidth_btm = frmEle.WidthInches.value + frmEle.Width8ths.value;
			var HemPrice_btm = rollerWidth_btm/1.5;
			Price += HemPrice_btm;
			//MM_showHideLayers('Tapes','','show');
		}
	}
	if(frmEle.FeatureOption11){//Roller Type Option(Roller)
		if(frmEle.FeatureOption4){//Lift Option
			if(frmEle.FeatureOption11.value == 30){//Spring
				frmEle.FeatureOption4.disabled = true;
			}
			else{//Chain
				frmEle.FeatureOption4.disabled = false;
			}
		}
	}
	if(frmEle.FeatureOption7){//Draw Type(vertical)
		if(frmEle.FeatureOption7.value != 13 && frmEle.FeatureOption7.value != 14 && frmEle.FeatureOption7.value != 16){//not standard 
			Price += 15;
		}
	}
	if(frmEle.Option22){//Motorization
		if(frmEle.Option22.checked){//Motor selected
//			if(document.shopcart.Option6){//2 in 1
			if(document.getElementById("rTwoOnOne")){//2 in 1
//				if(document.shopcart.Option6.checked){//Add for second blind motor
				if(document.getElementById("rTwoOnOne").checked){//Add for second blind motor
					Price += (frmEle.OptionPrice22.value * 1);
					
				}
			}
//			if(document.shopcart.Option8){//3 in 1
			if(document.getElementById("rThreeOnOne")){//3 in 1
//				if(document.shopcart.Option8.checked){//Add for second and third blind motor
				if(document.getElementById("rThreeOnOne").checked){//Add for second and third blind motor
					Price += (frmEle.OptionPrice22.value * 2);
				}
			}
		}
	}
	if(frmEle.Option9){//Motorization
		if(frmEle.Option9.checked){//Motor selected
//			if(document.shopcart.Option6){//2 in 1
			if(document.getElementById("rTwoOnOne")){//2 in 1
//				if(document.shopcart.Option6.checked){//Add for second blind motor
				if(document.getElementById("rTwoOnOne").checked){//Add for second blind motor
					Price += (frmEle.OptionPrice9.value * 1);
					
				}
			}
//			if(document.shopcart.Option8){//3 in 1
			if(document.getElementById("rThreeOnOne")){//3 in 1
//				if(document.shopcart.Option8.checked){//Add for second and third blind motor
				if(document.getElementById("rThreeOnOne").checked){//Add for second and third blind motor
					Price += (frmEle.OptionPrice9.value * 2);
				}
			}
		}
	}
	return Price
}

function roundNumber(num, dec) {
	var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
	return result;
}

function getBasePrice(theWidth,theHeight,testWidth,testHeight){	
	var i = 0;
	var Price = 0;
	// The message is thrown if the size is invalid.
    if (!IsBlindMaxWidthHeightValid(testWidth, testHeight)) {
		if(document.shopcart.submitbutton)document.shopcart.submitbutton.style.visibility = 'hidden';
		if(document.getElementById("submitbutton"))document.getElementById("submitbutton").style.visibility = 'hidden';    
        return 0;
    }
	for(i=0;i<aPricing.length;i++){
		if(theWidth==aPricing[i].width && theHeight==aPricing[i].height) {
			//Find matching price
			Price = aPricing[i].price;
			//if (document.getElementById('pid') && document.getElementById('ColorID'))
			//{
			//	if (document.getElementById('pid').value == 195 && document.getElementById('ColorID').value == 1403) Price = roundNumber(Price * .9, 2);
			//}
			
			// Do nothing if there is not a price.  An alert and the submit button will be enabled below.
			if(Price == 0){ continue; }

			if(aPricing[i].dualBlinds == 1){
				iMultipleBlinds = 1;
				//Both 2 in 1 and 3 in 1
				//if(document.shopcart.Option6 && document.shopcart.Option8)
				if(document.getElementById("rTwoOnOne") && document.getElementById("rThreeOnOne"))
				{
//					document.shopcart.Option6.disabled = false;
//					document.shopcart.Option8.disabled = false;
					document.getElementById("rTwoOnOne").disabled = false;
					document.getElementById("rThreeOnOne").disabled = false;
	
//					if(document.shopcart.Option6.checked == false && document.shopcart.Option8.checked == false)
					if(document.getElementById("rTwoOnOne").checked == false && document.getElementById("rThreeOnOne").checked == false)
					{
						alert("Due to the weight of the blinds in the size you have selected we recommend separating them into 2 sections on one headrail. Failure to do this will void the manufacturer warranty.");						
					}
				}
				//3 in 1
//				else if(document.shopcart.Option8)
				else if(document.getElementById("rThreeOnOne"))
				{
//					document.shopcart.Option8.disabled = false;
//					if(document.shopcart.Option8.checked == false)
					document.getElementById("rThreeOnOne").disabled = false;
					if(document.getElementById("rThreeOnOne").checked == false)
					{
						alert("Due to the weight of the blinds in the size you have selected we recommend separating them into 2 sections on one headrail. Failure to do this will void the manufacturer warranty.");
					}
				}
				//2 in 1
//				else if(document.shopcart.Option6)
				else if(document.getElementById("rTwoOnOne"))
				{
//					document.shopcart.Option6.disabled = false;
//					if(document.shopcart.Option6.checked == false)
					document.getElementById("rTwoOnOne").disabled = false;
					if(document.getElementById("rTwoOnOne").checked == false){
						if (document.shopcart.pid.value >= 64 && document.shopcart.pid.value <= 69){
							if(document.shopcart.Option11){
								if(document.shopcart.Option11.checked == false){
									alert("Due to the weight of the blinds in the size you have selected we recommend separating them into 2 sections on one headrail or using a Continuous Loop Lift Cord. Failure to do this will void the manufacturer warranty.");
								}
							}
						}
						else if (document.shopcart.pid.value == 91 || document.shopcart.pid.value == 61 || document.shopcart.pid.value == 236 || document.shopcart.pid.value == 237
						    || document.shopcart.pid.value == 299 || document.shopcart.pid.value == 300 || document.shopcart.pid.value == 301 || document.shopcart.pid.value == 302)
						{
							alert("Due to the weight of the blinds in the size you have selected we recommend separating them into 2 sections on one headrail or using a Continuous Loop Lift Cord. Failure to do this will void the manufacturer warranty.");
						}
						else{
							alert("Due to the weight of blinds the size you have selected we recommend separating them into 2 sections on one headrail.");
						}
					}
				}
				else{//No multiple blinds on one headrail option
				    if (document.shopcart.pid.value == 267 || document.shopcart.pid.value == 268 || document.shopcart.pid.value == 269){
					    if(document.shopcart.Option11){
						    if(document.shopcart.Option11.checked == false){
							    alert("Due to the weight of the size selected, we recommend adding continuous loop lift cord. Failure to do this will void the manufacturer warranty.");
						    }
					    }
				    }
				}
			}
			else{
				iMultipleBlinds = 0;
			}
			if (document.shopcart.pid.value == 87){//Designer Faux
				if(document.shopcart.FeatureOption3){
				if((((testWidth * testHeight) / 144) > 30) && (document.shopcart.FeatureOption3.value == 7)){//if wand and over 30 sq. ft
					var bOK = false;
//					if(document.shopcart.Option6){//2 in 1
//						if(document.shopcart.Option6.checked){//checked 2 on 1 option
					if(document.getElementById("rTwoOnOne")){//2 in 1
						if(document.getElementById("rTwoOnOne").checked){//checked 2 on 1 option
							bOK = true;							
						}
					}
//					if(document.shopcart.Option8){//3 in 1
//						if(document.shopcart.Option8.checked){//checked 3 on 1 option
					if(document.getElementById("rThreeOnOne")){//3 in 1
						if(document.getElementById("rThreeOnOne").checked){//checked 3 on 1 option
							bOK = true;
						}
					}
					if(bOK == false){// limit if they do not have 2 on 1 or 3 on 1
						alert("We cannot make blinds with a Wand Tilter over 30 square feet!");
						document.shopcart.FeatureOption3.value = 6;
					}
				}
				}
			}
			
			if ((document.shopcart.pid.value >= 135 && document.shopcart.pid.value <= 136) || (document.shopcart.pid.value >= 197 && document.shopcart.pid.value <= 203) ||
			    (document.shopcart.pid.value == 308 || document.shopcart.pid.value == 313 || document.shopcart.pid.value == 307 || document.shopcart.pid.value == 311 || document.shopcart.pid.value == 309 || document.shopcart.pid.value == 310 || document.shopcart.pid.value == 312))//Roman Shades
			{
				if (document.shopcart.Option12)//Top Down Bottom Up
				{
					if (document.shopcart.Option12.checked && testWidth > 71)
					{
						alert("Shades over 71 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option12.checked = false;
					}
				}
			}

			if (document.shopcart.pid.value == 197 || document.shopcart.pid.value == 198 || document.shopcart.pid.value == 199 || document.shopcart.pid.value == 200 || document.shopcart.pid.value == 201 || document.shopcart.pid.value == 202 || document.shopcart.pid.value == 203 ||
			    document.shopcart.pid.value == 308 || document.shopcart.pid.value == 313 || document.shopcart.pid.value == 307 || document.shopcart.pid.value == 311 || document.shopcart.pid.value == 309 || document.shopcart.pid.value == 310 || document.shopcart.pid.value == 312) // Roman Shades
			{ // Roman Shades.
				if (document.shopcart.Option45)//European Style Fold
				{
					if (document.shopcart.Option45.checked && testWidth < 30)
					{
						alert("Shades under 30 inches wide are not available with 'European Style Fold' option!")
						document.shopcart.Option45.checked = false;
					}
				}			
			    if (document.shopcart.Option11)
				{
					if (document.shopcart.Option11.checked && testWidth < 24)
					{
						alert("Shades under 24 inches wide are not available with 'Continuous Cord Loop' option!")
						document.shopcart.Option11.checked = false;
					}
				}
							
				if (document.shopcart.Option82 && document.shopcart.Option86 &&
				    document.shopcart.Option82.checked && document.shopcart.Option86.checked)
			    {
						alert("Shades are not available with both 'Continuous Loop' and 'Cordless' option!")
						document.shopcart.Option86.checked = false;
			    }
				
				if (document.shopcart.Option12 && document.shopcart.Option86 &&
				    document.shopcart.Option12.checked && document.shopcart.Option86.checked)
			    {
						alert("Shades are not available with both 'Continuous Loop' and 'Top Down-Bottom Up' options!")
						document.shopcart.Option86.checked = false;			        						
			    }							    
				else if (document.shopcart.Option12)//Top Down Bottom Up
				{
				    
					if (document.shopcart.Option12.checked && testWidth < 24){
						alert("Shades under 24 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option12.checked = false;
					}
				}
			}

			if (document.shopcart.pid.value == 199 || document.shopcart.pid.value == 201 || document.shopcart.pid.value == 203 ||
			    document.shopcart.pid.value == 307 || document.shopcart.pid.value == 309 || document.shopcart.pid.value == 312)//Roman Shades
			{
			    if (document.shopcart.Option82 && document.shopcart.Option82.checked)
			    {
				    if (testWidth < 18) { alert("Shades under 18 inches wide are not available with 'Cordless' option."); document.shopcart.Option82.checked = false; }
				    else if (testWidth > 84) { alert("Shades over 84 inches wide are not available with 'Cordless' option."); document.shopcart.Option82.checked = false; }
				    else if (testHeight < 18) { alert("Shades under 18 inches wide are not available with 'Cordless' option."); document.shopcart.Option82.checked = false; }
				    else if (testHeight > 84) { alert("Shades over 84 inches wide are not available with 'Cordless' option."); document.shopcart.Option82.checked = false; }
                    else
                    {			        
				        if (document.shopcart.Option47 && document.shopcart.Option47.checked)
			            {
						        alert("Shades are not available with both 'Cordless' and 'Blackout Liner' options!")
						        document.shopcart.Option47.checked = false;
			            }
				        if (document.shopcart.Option12 && document.shopcart.Option12.checked)
			            {
						        alert("Shades are not available with both 'Cordless' and 'Top Down-Bottom Up' options!")
						        document.shopcart.Option12.checked = false;			        						
			            }        				
				        if (document.shopcart.Option86 && document.shopcart.Option86.checked)
			            {
						        alert("Shades are not available with both 'Cordless' and 'Blackout Liner' options!")
						        document.shopcart.Option86.checked = false;			        						
			            }							    			    
				        if (document.shopcart.Option42 && document.shopcart.Option42.checked)
			            {
						        alert("Shades are not available with both 'Cordless' and 'Classic Fold Style' options!")
						        document.shopcart.Option42.checked = false;			        						
			            }							    
				        if (document.shopcart.Option45 && document.shopcart.Option45.checked)
			            {
						        alert("Shades are not available with both 'Cordless' and 'European Fold Style' options!")
						        document.shopcart.Option45.checked = false;			        						
			            }	
			        }
			    }						    				
			}						
			else if (document.shopcart.pid.value == 221 || document.shopcart.pid.value == 222)//Extreme Blackout and lightfiltering shades
			{
				if (document.shopcart.Option12){//Top Down Bottom Up
					if (document.shopcart.Option12.checked && testWidth > 72){
						alert("Shades over 72 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option12.checked = false;
					}
					if (document.shopcart.Option12.checked && testWidth < 18){
						alert("Shades under 18 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option12.checked = false;
					}
				}
				if (document.shopcart.Option19){//Top Down Bottom Up
					if (document.shopcart.Option19.checked && testWidth > 72){
						alert("Shades over 72 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
					if (document.shopcart.Option19.checked && testWidth < 18){
						alert("Shades under 18 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
				}
				if (document.shopcart.Option16) //Cordless
				{
					if (document.shopcart.Option16.checked && testHeight > 72)
					{
						alert("Shades over 72 inches high are not available with 'Cordless' option!")
						document.shopcart.Option16.checked = false;
					}
				}
				if (document.shopcart.Option19) //TDBU
				{
					if (document.shopcart.Option19.checked && (testWidth > 72 || testHeight > 72))
					{
						alert("Shades over 72 inches wide and 72 inches high are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
				}
			}
			else if (document.shopcart.pid.value == 208){//Tropical Escapes Collection
				if (document.shopcart.Option12){//Top Down Bottom Up
					if (document.shopcart.Option12.checked && testWidth >= 72){
						alert("Shades over 72 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option12.checked = false;
					}
					if (document.shopcart.Option12.checked && testWidth < 18){
						alert("Shades under 18 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option12.checked = false;
					}
				}
			}
			else if (document.shopcart.pid.value == 137){//Tropical Isle Bamboo
				if (document.shopcart.Option19){//Top Down Bottom Up
					if (document.shopcart.Option19.checked && testWidth > 72){
						alert("Shades over 72 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
					if (document.shopcart.Option19.checked && testWidth < 24){
						alert("Shades under 24 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
					if (document.shopcart.Option19.checked && testHeight > 72){
						alert("Shades over 72 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
				}
			}
			else if (document.shopcart.pid.value >= 83 && document.shopcart.pid.value <= 84){//Bamboo Shades
				if (document.shopcart.Option19){//Top Down Bottom Up
					if (document.shopcart.Option19.checked && testWidth > 72){
						alert("Shades over 72 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
					if (document.shopcart.Option19.checked && testWidth < 24){
						alert("Shades under 24 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
				}
				if (document.shopcart.Option21){//Rollease
					if (document.shopcart.Option21.checked && testWidth < 24){
						alert("Shades under 24 inches wide are not available with 'Rollease' option!")
						document.shopcart.Option21.checked = false;
					}
				}
			}
			else if (document.shopcart.pid.value == 217)
			{
				if (document.shopcart.Option21)
				{
					if (document.shopcart.Option21.checked && testWidth < 24){
						alert("Shades under 24 inches wide are not available with 'Continuous Cord Loop' option!")
						document.shopcart.Option21.checked = false;
					}
				}
			}
			if (document.shopcart.pid.value == 238 || document.shopcart.pid.value == 69 || document.shopcart.pid.value == 68 || document.shopcart.pid.value == 67 
			    || document.shopcart.pid.value == 65 || document.shopcart.pid.value == 129 || document.shopcart.pid.value == 64 || document.shopcart.pid.value == 66 || document.shopcart.pid.value == 91)
			{
			    if (document.shopcart.Option11)
				{
					if (document.shopcart.Option11.checked && testWidth < 22)
					{
						alert("Shades under 22 inches wide are not available with 'Continuous Cord Loop' option!")
						document.shopcart.Option11.checked = false;
					}
					if (document.shopcart.Option11.checked && (testWidth > 96 || testHeight > 120))
					{
						alert("Shades over 96 inches wide and 120 inches high are not available with 'Continuous Cord Loop' option!")
						document.shopcart.Option11.checked = false;
					}
				}
			}
			if (document.shopcart.pid.value == 299 || document.shopcart.pid.value == 300 || document.shopcart.pid.value == 301 || document.shopcart.pid.value == 302)
			{
			    //SIZE LIMITS
                if (testWidth > 120)
                {
				    alert('Maximum width for this type of blinds is 120 inches.');
				    if (document.shopcart.Width8thsDisplay) document.shopcart.Width8thsDisplay.value = ".0";
				    else if (document.shopcart.Width8ths) document.shopcart.Width8ths.value = ".0";
				}
				else if (testHeight > 120)
				{
				    alert('Maximum height for this type of blinds is 120 inches.');
				    if (document.shopcart.Height8thsDisplay) document.shopcart.Height8thsDisplay.value = ".0";
				    if (document.shopcart.Height8ths) document.shopcart.Height8ths.value = ".0";
				}            
							
			    //OPTION LIMITS BASED ON SIZE   
			    if (document.shopcart.Option11)
				{//CCLOOP Width and height
					if (document.shopcart.Option11.checked && testWidth < 22)
					{
						alert("Shades under 22 inches wide are not available with 'Continuous Cord Loop' option!")
						document.shopcart.Option11.checked = false;
					}
				}		    
			    if (document.shopcart.Option16)
				{//Cordless Child Safety System Width and height
					if (document.shopcart.Option16.checked && testWidth < 18)
					{
						alert("Shades under 18 inches wide are not available with 'Cordless' option!")
						document.shopcart.Option16.checked = false;
					}
					if (document.shopcart.Option16.checked && testHeight > 84)
					{
						alert("Shades over 84 inches wide are not available with 'Cordless' option!")
						document.shopcart.Option16.checked = false;
					}
				}			    
			    if (document.shopcart.Option67)
				{//Cordless Top Down-Bottom Up Width and height
					if (document.shopcart.Option67.checked && testWidth < 18)
					{
						alert("Shades under 18 inches wide are not available with 'Cordless Top Down-Bottom Up' option!")
						document.shopcart.Option67.checked = false;
					}
					if (document.shopcart.Option67.checked && testHeight > 84)
					{
						alert("Shades over 84 inches wide are not available with 'Cordless Top Down-Bottom Up' option!")
						document.shopcart.Option67.checked = false;
					}
				}			    
			    if (document.shopcart.Option68)
				{//TDBU Width and height
					if (document.shopcart.Option68.checked && testWidth > 72) 
					{
						alert("Shades over 72 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option68.checked = false;
					}
					if (document.shopcart.Option68.checked && testHeight > 84) 
					{
						alert("Shades over 84 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option68.checked = false;
					}
				}	
				
				
				//OPTION LIMITS BASED ON OPTION COMBINATIONS
			    if (document.shopcart.Option11 && document.shopcart.Option16)
			    {// Cannot select CCLOOP and Cordless Child Safety System
					if (document.shopcart.Option11.checked && document.shopcart.Option16.checked)
					{
						alert("Shades are not available with both 'Continuous Loop' and 'Cordless' options!")
						document.shopcart.Option16.checked = false;
					}
			    }	
			    if (document.shopcart.Option11 && document.shopcart.Option67)
			    {// Cannot select CCLOOP and Cordless TDBU together
					if (document.shopcart.Option11.checked && document.shopcart.Option67.checked)
					{
						alert("Shades are not available with both 'Continuous Cord Loop' and 'Cordless Top Down-Bottom Up' options!")
						document.shopcart.Option67.checked = false;
					}
			    }
			    if (document.shopcart.Option11 && document.shopcart.Option68)
			    {// Cannot select CCLOOP and TDBU together
					if (document.shopcart.Option11.checked && document.shopcart.Option68.checked)
					{
						alert("Shades are not available with both 'Continuous Loop' and 'Top Down-Bottom Up' options!")
						document.shopcart.Option68.checked = false;
					}
			    }
			    if (document.shopcart.Option68 && document.shopcart.Option16)
			    {// Cannot select TDBU together and Cordless Child Safety System
					if (document.shopcart.Option68.checked && document.shopcart.Option16.checked)
					{
						alert("Shades are not available with both ' Top Down-Bottom Up' and 'Cordless' options!")
						document.shopcart.Option16.checked = false;
					}
			    }
			    if (document.shopcart.Option68 && document.shopcart.Option67)
			    {// Cannot select TDBU and Cordless TDBU together
					if (document.shopcart.Option68.checked && document.shopcart.Option67.checked)
					{
						alert("Shades are not available with both ' Top Down-Bottom Up' and 'Cordless Top Down-Bottom Up' options!")
						document.shopcart.Option67.checked = false;
					}
			    }
			    if (document.shopcart.Option16 && document.shopcart.Option67)
			    {// Cannot select TDBU and Cordless TDBU together
					if (document.shopcart.Option16.checked && document.shopcart.Option67.checked)
					{
						alert("Shades are not available with both 'Cordless' and 'Cordless Top Down-Bottom Up' options!")
						document.shopcart.Option67.checked = false;
					}
			    }				
			}
			if (document.shopcart.pid.value == 267)
			{			
			    if (document.shopcart.Option11 && document.shopcart.Option19)
			    {// Cannot select CCLOOP and TDBU together
					if (document.shopcart.Option11.checked && document.shopcart.Option19.checked)
					{
						alert("Shades are not available with both 'Continuous Loop' and 'Top Down-Bottom Up' options!")
						document.shopcart.Option19.checked = false;
					}
			    }
			    if (document.shopcart.Option11)//Continuous Loop
				{
					if (document.shopcart.Option11.checked && testWidth < 22)
					{
						alert("Shades under 22 inches wide are not available with 'Continuous Cord Loop' option!")
						document.shopcart.Option11.checked = false;
					}
					if (document.shopcart.Option11.checked && (testWidth > 96 || testHeight > 120))
					{
						alert("Shades over 96 inches wide and 120 inches high are not available with 'Continuous Cord Loop' option!")
						document.shopcart.Option11.checked = false;
					} 
				}
				if (document.shopcart.Option19)//Top Down Bottom Up
				{
					if (document.shopcart.Option19.checked && testWidth < 12){
						alert("Shades under 12 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
					if (document.shopcart.Option19.checked && testWidth > 96){
						alert("Shades over  96 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
					if (document.shopcart.Option19.checked && testHeight < 12){
						alert("Shades under 12 inches high are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}	
					if (document.shopcart.Option19.checked && testHeight > 96){
						alert("Shades over  96 inches high are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}					
				}
			}
			if (document.shopcart.pid.value == 268 || document.shopcart.pid.value == 269)
			{		
			    if (document.shopcart.Option11 && document.shopcart.Option19)
			    {// Cannot select CCLOOP and TDBU together
					if (document.shopcart.Option11.checked && document.shopcart.Option19.checked)
					{
						alert("Shades are not available with both 'Continuous Cord Loop' and 'Top Down-Bottom Up' options!")
						document.shopcart.Option11.checked = false;
					}
			    }
			    if (document.shopcart.Option11)//Continuous Loop  
				{
					if (document.shopcart.Option11.checked && testWidth < 22)
					{
						alert("Shades under 22 inches wide are not available with 'Continuous Cord Loop' option!")
						document.shopcart.Option11.checked = false;
					} 
					if (document.shopcart.Option11.checked && (testWidth > 120 || testHeight > 120))
					{
						alert("Shades over 120 inches wide and 120 inches high are not available with 'Continuous Cord Loop' option!")
						document.shopcart.Option11.checked = false;
					}
				}
				if (document.shopcart.Option19)//Top Down Bottom Up
				{
					if (document.shopcart.Option19.checked && testWidth < 12){
						alert("Shades under 12 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
					if (document.shopcart.Option19.checked && testWidth > 84){
						alert("Shades over  84 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
					if (document.shopcart.Option19.checked && testHeight < 12){
						alert("Shades under 12 inches high are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}	
					if (document.shopcart.Option19.checked && testHeight > 96){
						alert("Shades over  96 inches high are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}					
				}
			}
			
			if (document.shopcart.pid.value == 91)
			{
				if (document.shopcart.Option11)
				{
					if (document.shopcart.Option11.checked && testWidth < 18)
					{
						alert("Shades under 18 inches wide are not available with 'Continuous Cord Loop' option!")
						document.shopcart.Option11.checked = false;
					}
				}
				if (document.shopcart.RushProduction && document.shopcart.Option7)
				{
					if (document.shopcart.RushProduction.checked && document.shopcart.Option7.checked)
					{
						alert("Shades are not available with both 'Priority Production' and 'Tile or Molding Cutout' options!");
						document.shopcart.RushProduction.checked = false;
					}
				}
			}
			// Added code so Cordless TDBU cannot be ordered on priority production.
			// Added code so Tile cannot be ordered on PP.
			if (document.shopcart.pid.value == 69)
			{
				// Cannot have priority production and Cordless TDBU both selected.
				if (document.shopcart.Option70 && document.shopcart.Option67)
				{
                    if (document.shopcart.Option67.checked)
		            {
		                if (document.shopcart.Option70.checked) 
		                {
		                    alert("Shades are not available with both 'Priority Production' and 'Cordless Top Down-Bottom Up' options!");
		                    document.shopcart.Option70.checked = false;
		                }
		            }				
		            else if (document.shopcart.Option70.checked)
		            {
		                if (document.shopcart.Option67.checked) 
		                {
		                    alert("Shades are not available with both 'Priority Production' and 'Cordless Top Down-Bottom Up' options!");
		                    document.shopcart.Option67.checked = false;
		                }
		            }		            
		        }				
			
				if (document.shopcart.Option70 && document.shopcart.Option7)
				{
					if (document.shopcart.Option70.checked && document.shopcart.Option7.checked)
					{
						alert("Shades are not available with both 'Priority Production' and 'Tile or Molding Cutout' options!");
						document.shopcart.Option70.checked = false;
					}
					if (document.shopcart.Option70.checked && document.shopcart.Option16.checked)
					{
						alert("Shades are not available with both 'Priority Production' and 'Cordless' options!");
						document.shopcart.Option70.checked = false;
					}
				}				
			}
			if (document.shopcart.pid.value == 61 || document.shopcart.pid.value == 236 || document.shopcart.pid.value == 237)
			{
				if (document.shopcart.Option19)//Top Down Bottom Up
				{
					if (document.shopcart.Option19.checked && testWidth < 20){
						alert("Shades under 20 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
				}
				if (document.shopcart.Option10 && document.shopcart.pid.value == 61)//Continuous Cord Loop - Roman Fold
				{
					if (document.shopcart.Option10.checked && testWidth < 20){
						alert("Shades under 20 inches wide are not available with 'Continuous Cord Loop' option!")
						document.shopcart.Option10.checked = false;
					}
				}
				if (document.shopcart.Option10 && ( document.shopcart.pid.value == 236 || document.shopcart.pid.value == 237))//Continuous Cord Loop - Roman Fold
				{
					if (document.shopcart.Option10.checked && testWidth < 24){
						alert("Shades under 24 inches wide are not available with 'Continuous Cord Loop' option!")
						document.shopcart.Option10.checked = false;
					}
				}
				
			}
			if (document.shopcart.pid.value == 265)
			{
				if (document.shopcart.Option19)//Top Down Bottom Up
				{
					if (document.shopcart.Option19.checked && testWidth < 18){
						alert("Shades under 18 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
					if (document.shopcart.Option19.checked && testWidth > 72){
						alert("Shades over 72 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
					if (document.shopcart.Option19.checked && testHeight > 72){
						alert("Shades over 72 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
					
				}
				if (document.shopcart.Option65)//Continuous Cord Loop - Roman Fold
				{
					if (document.shopcart.Option65.checked && testWidth < 24){
						alert("Shades under 20 inches wide are not available with 'Continuous Cord Loop' option!")
						document.shopcart.Option65.checked = false;
					}
				}
				
			}
			
//			if (document.shopcart.pid.value == 265)
//			{
//			if (document.shopcart.Option19)//Top Down Bottom Up
//				{
//					if (document.shopcart.Option19.checked && testWidth < 18){
//						alert("Shades under 18 inches wide are not available with 'Top Down-Bottom Up' option!")
//						document.shopcart.Option19.checked = false;
//					}
//				}
//				if (document.shopcart.Option10)//Continuous Cord Loop - Roman Fold
//				{
//					if (document.shopcart.Option10.checked && testWidth < 24){
//						alert("Shades under 24 inches wide are not available with 'Continuous Cord Loop' option!")
//						document.shopcart.Option10.checked = false;
//					}
//				}
//			}
			if (testWidth < 13 && document.shopcart.pid.value == 220){//2" Extreme Faux Wood
				alert('Helpful hint: Blinds under 13" wide come standard with tilter in the center and no lift cord.');
			}
			else if (testWidth < 14 && document.shopcart.pid.value == 231){//2" Priority Faux Wood
				alert('Helpful hint: Blinds under 14" wide come standard with tilter in the center and no lift cord.');
			}
			
			// Sheer Weave 5000 w/ Cassette
            if (document.shopcart.pid.value == 262)
            { 
                if (testWidth > 84)
                {
				    alert('Maximum width for this type of blinds is 84 inches.');
				    if (document.shopcart.Width8thsDisplay) document.shopcart.Width8thsDisplay.value = ".0";
				    else if (document.shopcart.Width8ths) document.shopcart.Width8ths.value = ".0";
				}
				else if (testHeight > 120)
				{
				    alert('Maximum height is 120 inches. Please choose a size 120 inches or smaller.');
				    if (document.shopcart.Height8thsDisplay) document.shopcart.Height8thsDisplay.value = ".0";
				    if (document.shopcart.Height8ths) document.shopcart.Height8ths.value = ".0";
				}    
                // Motorization Only and Motorization W/ Remote...
                if (document.shopcart.Option79) {                
				    if (document.shopcart.Option79.checked && document.shopcart.Option80.checked){
					    // If both are checked uncheck the Motorization Only.
					    alert('Motorization W/Remote option includes both motorization and remote control. You do not have to choose Motorization Only option.');
					    document.shopcart.Option79.checked = false;
				    }
				}
			}						
			// 2” Deep Wood Blinds || 2.5” Deep Wood Blinds
            else if (document.shopcart.pid.value == 336 || document.shopcart.pid.value == 337)
            { 
                if (testWidth > 96)
                {
				    alert('Maximum width is 96 inches. Please choose a size 96 inches or smaller.');
				    if (document.shopcart.Width8thsDisplay) document.shopcart.Width8thsDisplay.value = ".0";
				    else if (document.shopcart.Width8ths) document.shopcart.Width8ths.value = ".0";
				}
				else if (testHeight > 120)
				{
				    alert('Maximum height is 120 inches. Please choose a size 120 inches or smaller.');
				    if (document.shopcart.Height8thsDisplay) document.shopcart.Height8thsDisplay.value = ".0";
				    if (document.shopcart.Height8ths) document.shopcart.Height8ths.value = ".0";
				}                    
			}	 				
			// 1” Cordless Aluminum Blind
            else if (document.shopcart.pid.value == 328)
            { 
                if (testWidth > 72)
                {
				    alert('Maximum width is 72 inches. Please choose a size 72 inches or smaller.');
				    if (document.shopcart.Width8thsDisplay) document.shopcart.Width8thsDisplay.value = ".0";
				    else if (document.shopcart.Width8ths) document.shopcart.Width8ths.value = ".0";
				}
				else if (testHeight > 84)
				{
				    alert('Maximum height is 84 inches. Please choose a size 84 inches or smaller.');
				    if (document.shopcart.Height8thsDisplay) document.shopcart.Height8thsDisplay.value = ".0";
				    if (document.shopcart.Height8ths) document.shopcart.Height8ths.value = ".0";
				}                    
			}						
			// Sheer Weave 5000
            else if (document.shopcart.pid.value == 290)
            { 
                if (testWidth > 120)
                {
				    alert('Maximum width is 120 inches. Please choose a size 120 inches or smaller.');
				    if (document.shopcart.Width8thsDisplay) document.shopcart.Width8thsDisplay.value = ".0";
				    else if (document.shopcart.Width8ths) document.shopcart.Width8ths.value = ".0";
				}
				else if (testHeight > 120)
				{
				    alert('Maximum height is 120 inches. Please choose a size 120 inches or smaller.');
				    if (document.shopcart.Height8thsDisplay) document.shopcart.Height8thsDisplay.value = ".0";
				    if (document.shopcart.Height8ths) document.shopcart.Height8ths.value = ".0";
				}                    
			}					
			// Sheer Weave 3000 Roller Shades - Woodlands
            else if (document.shopcart.pid.value == 291)
            { 
                if (testWidth > 94)
                {
				    alert('Maximum width is 94 inches. Please choose a size 94 inches or smaller.');
				    if (document.shopcart.Width8thsDisplay) document.shopcart.Width8thsDisplay.value = ".0";
				    else if (document.shopcart.Width8ths) document.shopcart.Width8ths.value = ".0";
				}
				else if (testHeight > 120)
				{
				    alert('Maximum height is 120 inches. Please choose a size 120 inches or smaller.');
				    if (document.shopcart.Height8thsDisplay) document.shopcart.Height8thsDisplay.value = ".0";
				    if (document.shopcart.Height8ths) document.shopcart.Height8ths.value = ".0";
				}                    
			}						
			// Sheer Weave 5000 Roller Shades - Woodlands
            else if (document.shopcart.pid.value == 330)
            { 
                if (testWidth > 94)
                {
				    alert('Maximum width is 94 inches. Please choose a size 94 inches or smaller.');
				    if (document.shopcart.Width8thsDisplay) document.shopcart.Width8thsDisplay.value = ".0";
				    else if (document.shopcart.Width8ths) document.shopcart.Width8ths.value = ".0";
				}
				else if (testHeight > 120)
				{
				    alert('Maximum height is 120 inches. Please choose a size 120 inches or smaller.');
				    if (document.shopcart.Height8thsDisplay) document.shopcart.Height8thsDisplay.value = ".0";
				    if (document.shopcart.Height8ths) document.shopcart.Height8ths.value = ".0";
				}                    
			}			
			// Sheer Weave 5000 Roller Shades with Cassette - Woodlands
            else if (document.shopcart.pid.value == 338)
            { 
                if (testWidth > 94)
                {
				    alert('Maximum width is 94 inches. Please choose a size 94 inches or smaller.');
				    if (document.shopcart.Width8thsDisplay) document.shopcart.Width8thsDisplay.value = ".0";
				    else if (document.shopcart.Width8ths) document.shopcart.Width8ths.value = ".0";
				}
				else if (testHeight > 84)
				{
				    alert('Maximum height is 84 inches. Please choose a size 84 inches or smaller.');
				    if (document.shopcart.Height8thsDisplay) document.shopcart.Height8thsDisplay.value = ".0";
				    if (document.shopcart.Height8ths) document.shopcart.Height8ths.value = ".0";
				} 
                // Motorization Only and Motorization W/ Remote...
                if (document.shopcart.Option79) {                
				    if (document.shopcart.Option79.checked && document.shopcart.Option80.checked){
					    // If both are checked uncheck the Motorization Only.
					    alert('Motorization W/ Remote option includes both motorization and remote control. You do not have to choose Motorization Only option.');
					    document.shopcart.Option79.checked = false;
				    }
				}                   
			}
			// Meriak 2" Premium Aluminum
            else if (document.shopcart.pid.value == 305)
            { 
                if (testWidth > 122)
                {
				    alert('Maximum width is 122 inches. Please choose a size 122 inches or smaller.');
				    if (document.shopcart.Width8thsDisplay) document.shopcart.Width8thsDisplay.value = ".0";
				    else if (document.shopcart.Width8ths) document.shopcart.Width8ths.value = ".0";
				}
				else if (testHeight > 108)
				{
				    alert('Maximum height is 108 inches. Please choose a size 108 inches or smaller.');
				    if (document.shopcart.Height8thsDisplay) document.shopcart.Height8thsDisplay.value = ".0";
				    if (document.shopcart.Height8ths) document.shopcart.Height8ths.value = ".0";
				}                    
			}			
			// Tropical Isle Basic Bamboo
            else if (document.shopcart.pid.value == 278)
            { 
                // Cannot offer blackout and privacy together
		        if (document.shopcart.Option26)
		        {
			        if (document.shopcart.Option26.checked)
			        {
				        if (document.shopcart.Option20) {document.shopcart.Option20.checked = false;document.shopcart.Option20.disabled = true;}
			        }
			        else
			        {
			            if (document.shopcart.Option20) {document.shopcart.Option20.disabled = false;}
			        }
		        }
		        
		        // Cannot offer blackout and privacy together
		        if (document.shopcart.Option20)
		        {
			        if (document.shopcart.Option20.checked)
			        {
				        if (document.shopcart.Option26) {document.shopcart.Option26.checked = false;document.shopcart.Option26.disabled = true;}
			        }
			        else
			        {
			            if (document.shopcart.Option26) {document.shopcart.Option26.disabled = false;}
			        }			        
		        }	          
			    if (document.shopcart.Option19)//Top Down Bottom Up
				{
					if ((testWidth > 72) &&  document.shopcart.Option19.checked){
						alert("Shades over 72 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
					else if ((testWidth < 24) &&  document.shopcart.Option19.checked){
						alert("Shades under 24 inches wide are not available with 'Top Down-Bottom Up' option!")
						document.shopcart.Option19.checked = false;
					}
				}
				if (document.shopcart.Option21)//Continuous Cord Loop
				{
                    if ((testWidth < 24)  && document.shopcart.Option21.checked)
		            {
		                alert("Shades under 24 inches wide are not available with 'Continuous Cord Loop' option ")
						document.shopcart.Option21.checked = false;
					}
				}		                
			}			
			// Earth Art Rollars Shades.
            else if (document.shopcart.pid.value == 284)
            { 
                if (testWidth > 72)
                {
				    alert('Maximum width is 72 inches. Please choose a size 72 inches or smaller.');
				    if (document.shopcart.Width8thsDisplay) document.shopcart.Width8thsDisplay.value = ".0";
				    else if (document.shopcart.Width8ths) document.shopcart.Width8ths.value = ".0";
				}
				else if (testHeight > 120)
				{
				    alert('Maximum height is 120 inches. Please choose a size 120 inches or smaller.');
				    if (document.shopcart.Height8thsDisplay) document.shopcart.Height8thsDisplay.value = ".0";
				    if (document.shopcart.Height8ths) document.shopcart.Height8ths.value = ".0";
				}             
                if (document.shopcart.Option72) {                
				    if (document.shopcart.Option72.checked && document.shopcart.Option81.checked){
					    alert('Shades are not available with both Fascia and Wrapped Fascia.');
					    document.shopcart.Option72.checked = false;
				    }
				}
			}		
            else if (document.shopcart.pid.value == 282)
            { 
                if (testWidth > 96)
                {
				    alert('Maximum width is 96 inches. Please choose a size 96 inches or smaller.');
				    if (document.shopcart.Width8thsDisplay) document.shopcart.Width8thsDisplay.value = ".0";
				    else if (document.shopcart.Width8ths) document.shopcart.Width8ths.value = ".0";
				}
				else if (testHeight > 96)
				{
				    alert('Maximum height is 96 inches. Please choose a size 96 inches or smaller.');
				    if (document.shopcart.Height8thsDisplay) document.shopcart.Height8thsDisplay.value = ".0";
				    if (document.shopcart.Height8ths) document.shopcart.Height8ths.value = ".0";
				}             
                if (document.shopcart.Option72 && document.shopcart.FeatureOption12) {                
                    // Cannot have Roll Position of Reverse ad fascia selected.
                    if (document.shopcart.Option72.checked && document.shopcart.FeatureOption12.selectedIndex == 1)
                    {
                        alert('Shades with Fascia option are not available as Reverse Roll Position shades.');
					    document.shopcart.Option72.checked = false;
                    }
				}
			}				
			// Earth Art Shades.
            else if (document.shopcart.pid.value == 283)
            { 
                if (testWidth > 96)
                {
				    alert('Maximum width is 96 inches. Please choose a size 96 inches or smaller.');
				    if (document.shopcart.Width8thsDisplay) document.shopcart.Width8thsDisplay.value = ".0";
				    else if (document.shopcart.Width8ths) document.shopcart.Width8ths.value = ".0";
				}
				else if (testHeight > 120)
				{
				    alert('Maximum height is 120 inches. Please choose a size 120 inches or smaller.');
				    if (document.shopcart.Height8thsDisplay) document.shopcart.Height8thsDisplay.value = ".0";
				    if (document.shopcart.Height8ths) document.shopcart.Height8ths.value = ".0";
				}
                if (testWidth < 24 && document.shopcart.Option21 && document.shopcart.Option21.checked)
		        {
		            alert("Shades under 24 inches wide are not available with 'Continuous Cord Loop' option.")
			        document.shopcart.Option21.checked = false;			
		        }				             
                if ((testWidth > 72)  && document.shopcart.Option19 && document.shopcart.Option19.checked)
		        {
		            alert("Shades over 72 inches wide are not available with 'Top Down-Bottom Up' option.")
			        document.shopcart.Option19.checked = false;			
		        }				             
                if ((testWidth > 72)  && document.shopcart.Option19 && document.shopcart.Option19.checked)
		        {
		            alert("Shades over 72 inches wide are not available with 'Top Down-Bottom Up' option.")
			        document.shopcart.Option19.checked = false;			
		        }
                else if ((testHeight > 72)  && document.shopcart.Option19 && document.shopcart.Option19.checked)
		        {
		            alert("Shades over 72 inches wide are not available with 'Top Down-Bottom Up' option.")
			        document.shopcart.Option19.checked = false;			
		        }
		        if (document.shopcart.Option26)
		        {
			        if (document.shopcart.Option26.checked)
			        {
				        if (document.shopcart.Option20) {document.shopcart.Option20.checked = false;document.shopcart.Option20.disabled = true;}
			        }
			        else
			        {
			            if (document.shopcart.Option20) {document.shopcart.Option20.disabled = false;}
			        }
		        }
		        
		        // Cannot offer blackout and privacy together
		        if (document.shopcart.Option20)
		        {
			        if (document.shopcart.Option20.checked)
			        {
				        if (document.shopcart.Option26) {document.shopcart.Option26.checked = false;document.shopcart.Option26.disabled = true;}
			        }
			        else
			        {
			            if (document.shopcart.Option26) {document.shopcart.Option26.disabled = false;}
			        }			        
		        }		        				             
                if (document.shopcart.Option72) {                
				    if (document.shopcart.Option72.checked && document.shopcart.Option81.checked){
					    alert('Shades are not available with both Fascia and Wrapped Fascia.');
					    document.shopcart.Option72.checked = false;
				    }
				}
			}					
            
            else if (document.shopcart.pid.value == 217)
            { 
                // Cannot offer blackout and privacy together
		        if (document.shopcart.Option26)
		        {
			        if (document.shopcart.Option26.checked)
			        {
				        if (document.shopcart.Option61) {document.shopcart.Option61.checked = false;document.shopcart.Option61.disabled = true;}
			        }
			        else
			        {
			            if (document.shopcart.Option61) {document.shopcart.Option61.disabled = false;}
			        }
		        }
		        
                
		        if (document.shopcart.Option61)
		        {
			        if (document.shopcart.Option61.checked)
			        {
				        if (document.shopcart.Option26) {document.shopcart.Option26.checked = false;document.shopcart.Option26.disabled = true;}
			        }
			        else
			        {
			            if (document.shopcart.Option26) {document.shopcart.Option26.disabled = false;}
			        }			        
		        }		        				             
			}					
            else if (document.shopcart.pid.value == 83 || document.shopcart.pid.value == 84 || document.shopcart.pid.value == 216)
            { 
                // Cannot offer blackout and privacy together
		        if (document.shopcart.Option26)
		        {
			        if (document.shopcart.Option26.checked)
			        {
				        if (document.shopcart.Option20) {document.shopcart.Option20.checked = false;document.shopcart.Option20.disabled = true;}
			        }
			        else
			        {
			            if (document.shopcart.Option20) {document.shopcart.Option20.disabled = false;}
			        }
		        }
		        
		        // Cannot offer blackout and privacy together
		        if (document.shopcart.Option20)
		        {
			        if (document.shopcart.Option20.checked)
			        {
				        if (document.shopcart.Option26) {document.shopcart.Option26.checked = false;document.shopcart.Option26.disabled = true;}
			        }
			        else
			        {
			            if (document.shopcart.Option26) {document.shopcart.Option26.disabled = false;}
			        }			        
		        }			        				             
			}					

			if ((document.shopcart.pid.value >= 64 && document.shopcart.pid.value <= 69) || document.shopcart.pid.value == 91 || document.shopcart.pid.value == 129 || document.shopcart.pid.value == 238){//Cell Shades
				if (document.shopcart.Option18){//Top Down Bottom Up
					if (document.shopcart.pid.value == 68){//Room Darkening
						if (document.shopcart.Option18.checked && (testWidth > 60 || testHeight > 60)){
							alert("Shades over 60 inches wide and 60 inches high are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.Option18.checked = false;
						}
					}
					else if (document.shopcart.pid.value == 67){//3/4" Blackout
						if (document.shopcart.Option18.checked && (testWidth > 72 || testHeight > 80)){
							alert("Shades over 72 inches wide and 80 inches high are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.Option18.checked = false;
						}
					}
					else{
						if (document.shopcart.Option18.checked && (testWidth > 72 || testHeight > 96)){
							alert("Shades over 72 inches wide and 96 inches high are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.Option18.checked = false;
						}
					}
				}
				if (document.shopcart.FeatureOption61){//Top Down Bottom Up
					if (document.shopcart.pid.value == 68){//Room Darkening
						if (document.shopcart.FeatureOption61.value == 166 && (testWidth > 60 || testHeight > 60)){
							alert("Shades over 60 inches wide and 60 inches high are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.FeatureOption61.selectedIndex = 0;
							//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
						}
					}
					else if (document.shopcart.pid.value == 67){//3/4" Blackout
						if (document.shopcart.FeatureOption61.value == 166 && (testWidth > 72 || testHeight > 80)){
							alert("Shades over 72 inches wide and 80 inches high are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.FeatureOption61.selectedIndex = 0;
						}
					}
					else{
						if (document.shopcart.FeatureOption61.value == 166 && (testWidth > 72 || testHeight > 96)){
							alert("Shades over 72 inches wide and 96 inches high are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.FeatureOption61.selectedIndex = 0;
						}
					}
				}
				if (document.shopcart.Option68){//Top Down Bottom Up
					if (document.shopcart.pid.value == 68){//Room Darkening
						if (document.shopcart.Option68.checked && (testWidth > 60 || testHeight > 60)){
							alert("Shades over 60 inches wide and 60 inches high are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.Option68.checked = false;
						}
					}
					else if (document.shopcart.pid.value == 67){//3/4" Blackout
						if (document.shopcart.Option68.checked && (testWidth > 72 || testHeight > 80)){
							alert("Shades over 72 inches wide and 80 inches high are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.Option68.checked = false;
						}
					}
					else{
						if (document.shopcart.Option68.checked && (testWidth > 72 || testHeight > 96)){
							alert("Shades over 72 inches wide and 96 inches high are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.Option68.checked = false;
						}
					}
				}
				if (document.shopcart.Option67){//Cordless Top Down Bottom Up
					if (document.shopcart.pid.value == 68){//Room Darkening
						if (document.shopcart.Option67.checked && (testWidth > 60 || testHeight > 60)){
							alert("Shades over 60 inches wide and 60 inches high are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.Option67.checked = false;
							//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
						}
					}
					else if (document.shopcart.pid.value == 67){//3/4" Blackout
						if (document.shopcart.Option67.checked && (testWidth > 72 || testHeight > 80)){
							alert("Shades over 72 inches wide and 80 inches high are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.Option67.checked = false;
						}
						if (document.shopcart.Option67.checked && testWidth < 18){
							alert("Shades under 18 inches wide are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.Option67.checked = false;
						}
					}
					else if (document.shopcart.pid.value == 64 || document.shopcart.pid.value == 65 || document.shopcart.pid.value == 66 || document.shopcart.pid.value == 69 || document.shopcart.pid.value == 91){//3/8" double cell light filtering
						if (document.shopcart.Option67.checked && testWidth < 18){
							alert("Shades under 18 inches wide are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.Option67.checked = false;
						}
						if (document.shopcart.Option67.checked && testWidth > 120){
							alert("Shades under 20 inches wide are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.Option67.checked = false;
						}
						if (document.shopcart.Option67.checked && testHeight > 84){
							alert("Shades over 84 inches wide are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.Option67.checked = false;
						}
					}
					else if (document.shopcart.pid.value == 238)
					{
					    if (document.shopcart.Option67.checked && testWidth < 18){
					        alert("Shades under 18 inches wide are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.Option67.checked = false;
					    }
					    if (document.shopcart.Option67.checked && (testWidth > 84 || testHeight > 84)){
					        alert("Shades over 84 inches wide and 84 inches high are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.Option67.checked = false;
					    }
					}
					else{
						if (document.shopcart.Option67.checked && (testWidth > 72 || testHeight > 96)){
							alert("Shades over 72 inches wide and 96 inches high are not available with 'Top Down-Bottom Up' option.")
							document.shopcart.Option67.checked = false;
						}
					}
				}
				if (document.shopcart.Option16){//Cordless
					if (document.shopcart.Option16.checked && (testWidth < 18 || testHeight < 8)){//Min Width
						alert("Shades under 18 inches wide and 8 inches high are not available with 'Cordless' option.")
						document.shopcart.Option16.checked = false;
					}
					if (document.shopcart.pid.value == 68){//Room Darkening
						if (document.shopcart.Option16.checked && (testWidth > 66 || testHeight > 84)){
							alert("Shades over 66 inches wide and 84 inches high are not available with 'Cordless' option.")
							document.shopcart.Option16.checked = false;
						}
					}
					else if (document.shopcart.pid.value == 69){//double cell trans.
						if (document.shopcart.Option16.checked && (testWidth > 96 || testHeight > 84)){
							alert("Shades over 96 inches wide and 84 inches high are not available with 'Cordless' option.")
							document.shopcart.Option16.checked = false;
						}
					}
					else if (document.shopcart.pid.value == 238){//double cell blackout
						if (document.shopcart.Option16.checked && (testWidth > 84 || testHeight > 84)){
							alert("Shades over 84 inches wide and 84 inches high are not available with 'Cordless' option.")
							document.shopcart.Option16.checked = false;
						}
					}
					else{
						if (document.shopcart.Option16.checked && (testWidth > 120 || testHeight > 84)){
							alert("Shades over 120 inches wide and 84 inches high are not available with 'Cordless' option.")
							document.shopcart.Option16.checked = false;
						}
					}
				}
			}
			//budge woven woods
			if (document.shopcart.pid.value == 265)
			{
				if(testWidth <= 60 && document.getElementById("rTwoOnOne") && document.getElementById("rThreeOnOne") && document.getElementById("rStandard"))
				{
					document.getElementById("rTwoOnOne").checked = false;
					document.getElementById("rTwoOnOne").disabled = true;
					document.getElementById("rThreeOnOne").checked = false;
					document.getElementById("rThreeOnOne").disabled = true;
					document.getElementById("rStandard").disabled = false;
					document.getElementById("rStandard").checked = true;
				}
				if(testWidth >= 96 && document.getElementById("rTwoOnOne") && document.getElementById("rThreeOnOne") && document.getElementById("rStandard"))
				{
					if (document.getElementById("rTwoOnOne").checked == false && document.getElementById("rThreeOnOne").checked == false)
					{
						document.getElementById("rStandard").checked = false;
						document.getElementById("rStandard").disabled = true;
						document.getElementById("rTwoOnOne").disabled = false;
						document.getElementById("rTwoOnOne").checked = true;
					}
				}
			}
			//extreme basswood
			if (document.shopcart.pid.value == 270 || document.shopcart.pid.value == 335)
			{
				if(testWidth < 30 && document.getElementById("rTwoOnOne") && document.getElementById("rThreeOnOne") && document.getElementById("rStandard"))
				{
					document.getElementById("rTwoOnOne").checked = false;
					document.getElementById("rTwoOnOne").disabled = true;
					document.getElementById("rThreeOnOne").checked = false;
					document.getElementById("rThreeOnOne").disabled = true;
					document.getElementById("rStandard").disabled = false;
					document.getElementById("rStandard").checked = true;
				}
				if(testWidth >= 30 && document.getElementById("rTwoOnOne") && document.getElementById("rThreeOnOne") && document.getElementById("rStandard"))
				{
					if (document.getElementById("rTwoOnOne").checked == false && document.getElementById("rThreeOnOne").checked == false)
					{
						document.getElementById("rStandard").disabled = false;
						document.getElementById("rTwoOnOne").disabled = false;
						document.getElementById("rThreeOnOne").disabled = true;
					}
				}
				if(testWidth >= 45 && document.getElementById("rTwoOnOne") && document.getElementById("rThreeOnOne") && document.getElementById("rStandard"))
				{
					document.getElementById("rStandard").disabled = false;
					document.getElementById("rTwoOnOne").disabled = false;
					document.getElementById("rThreeOnOne").disabled = false;
				}
			}
			if (document.shopcart.pid.value == 69)
			{
				if (document.shopcart.Option16)
				{
					if (testWidth > 72 && document.shopcart.Option16.checked)
					{
						alert("Shades over 72 inches wide are not available with 'Cordless' option.")
						document.shopcart.Option16.checked = false;
					}
				}
				if (document.shopcart.Option67)
				{
					if (testWidth > 72 && document.shopcart.Option67.checked)
					{
						alert("Shades over 72 inches wide are not available with 'Cordless' option.")  
						document.shopcart.Option67.checked = false;
					}
				}
			}
			if(document.shopcart.FeatureOption7){//Draw Type(vertical)
				if (document.getElementById('stc'))
				{
					if ((document.shopcart.FeatureOption7.value == 14 || document.shopcart.FeatureOption7.value == 15 || document.shopcart.FeatureOption7.value == 16) && document.getElementById('stc').value == 7)
					{
						alert('Vertical Blinds cannot be made with a "Wand Tilter" and "Split Draw", "Opp. Stack" or "Center Stack"! Tilter will change to "Cord and Chain"');
						document.getElementById('stc').value = 6;
					}
				}
				//if(document.shopcart.FeatureOption3){//Wand-Chain Cord
				//	if((document.shopcart.FeatureOption7.value == 14 || document.shopcart.FeatureOption7.value == 15) && document.shopcart.FeatureOption3.value == 7){
				//		alert('Vertical Blinds cannot be made with a "Wand Tilter" and either "Split Draw" or "Center Stack"! Tilter will change to "Cord and Chain"');
				//		document.shopcart.FeatureOption3.value = 6;
				//	}
				//}
			}
			i = aPricing.length;
		}
	}
	
	//add shipping cost into tableaux
	if(document.shopcart.pid.value == 166 || document.shopcart.pid.value == 169 || document.shopcart.pid.value == 170){
		var LongestSide = 1;var ShortestSide = 1;
		if(eval(testWidth) > eval(testHeight)){
			LongestSide = eval(testWidth) + 3;
			ShortestSide = eval(testHeight) + 3;
		}
		else{
			LongestSide = eval(testHeight) + 3;
			ShortestSide = eval(testWidth) + 3;
		}
		var clg = LongestSide + (2 * ShortestSide) + (2 * 5);//estimate 5" box size
		if(LongestSide >= 108){//common carrier if too long
			Price += 90;
		}
		if(clg < 84){
			Price += 16;
		}
		else if(clg >= 84 && clg < 108){//oversize 1
			Price += 27;
		}
		else if(clg >= 108 && clg < 130){//oversize 2
			Price += 40;
		}
		else if(clg >= 130 && clg < 165){//oversize 3
			Price += 52;
		}
		else{//common carrier
			Price += 90;
		}
	}
	
	HeadrailOptionChange();
	for(i=1;i<=3;i++){
		SetHeadrailImage("3", i, "../");
	}
	for(i=1;i<=2;i++){
		SetHeadrailImage("2", i, "../");
	}
	
	if(Price == 0){
		alert("Due to weight constraints, the size you have selected is not available!");
		if(document.shopcart.submitbutton)document.shopcart.submitbutton.style.visibility = 'hidden';
		if(document.getElementById("submitbutton"))document.getElementById("submitbutton").style.visibility = 'hidden';
	}
	else
	{
	    if(document.shopcart.submitbutton)document.shopcart.submitbutton.style.visibility = 'visible';
	    if(document.getElementById("submitbutton"))document.getElementById("submitbutton").style.visibility = 'visible';	
	}
				
	return Price;
}

function getPriceBreak(theSize,theType){
	var i = 0;
	var PriceBreak = 0;
	for(i=0;i<theType.length;i++){
		if(theSize <= theType[i] || i==(theType.length-1)) {
			//Find price break for selected size selected
			PriceBreak = theType[i];
			i = theType.length;
		}
	}
	return PriceBreak;
}
function checkit(name)
{//Check to ensure they want to delete
	if (! confirm ('Do you want to delete: ' + name + '?'))
	{
		return false	
	}
}
function RoundUp(valueToRound){
	var Value = "";
	s = new String(valueToRound);
    decimalPos = s.indexOf(".");
    if (decimalPos == -1) {
      // whole number, do nothing
      Value = valueToRound;
	}
	else{
	  Value = eval(valueToRound.substring( 0, decimalPos ));
	  theLength = valueToRound.length - decimalPos
	  if(eval(valueToRound.substr(decimalPos,theLength)) != 0){
		Value = Value + 1;
	  }
	}
	return Value;
}

function validateShopCart(frmEle){
//	if(frmEle.FeatureOption1){
//		if(frmEle.FeatureOption1.value == '0'){
		//No mount type selected
//			alert("Please select a mount type!");
//			frmEle.FeatureOption1.focus();
//			return false;
//		}
//	}
//	if(frmEle.FeatureOption8){
//		if(frmEle.FeatureOption8.value == '0'){
		//No mount type selected
//			alert("Please select a mount type!");
//			frmEle.FeatureOption8.focus();
//			return false;
//		}
//	}
	if(frmEle.mountType)
	{
		if(frmEle.mountType[0].checked == false && frmEle.mountType[1].checked == false)
		{	
			alert("Please select a mount type!");
			return false;
		}
	}
	
	if(frmEle.ColorID.value == "0"){//No color selected
		alert("Please select a color!");
		frmEle.ColorID.focus();
		return false;
	}
	if(frmEle.ColorIDCS)
	{
		if(frmEle.ColorIDCS.value == "0"){//No color selected for Cross Selling
			alert("Please select a color!");
			frmEle.ColorIDCS.focus();
			return false;
		}
	}
	if(frmEle.TapeColorID){//check for Colors that edge binding is not available
		if((frmEle.ColorID.value >= 622 && frmEle.ColorID.value <= 625) && frmEle.TapeColorID.value != 0){
			alert("Edge Binding is not available with this color bamboo shade!");
			frmEle.TapeColorID.value=0;
			frmEle.ColorID.focus;
			return false;
		}
		if((frmEle.ColorID.value >= 1440 && frmEle.ColorID.value <= 1442) && frmEle.TapeColorID.value != 0){
			alert("Edge Binding is not available with this color bamboo shade!");
			frmEle.TapeColorID.value=0;
			frmEle.ColorID.focus;
			return false;
		}
	}
	
	if(frmEle.TapeColorID && (frmEle.pid.value == "9" || frmEle.pid.value == "31" || frmEle.pid.value == "54" || frmEle.pid.value == "55" || frmEle.pid.value == "56" || frmEle.pid.value == "57" || frmEle.pid.value == "58"))
	{//Roller, require trim color
		//if(frmEle.TapeColorID.value == "0"){
		//	alert("Please select a trim color!");
		//	frmEle.TapeColorID.focus();
		//	return false;
		//}
	}
	//Rollers
	if(frmEle.FeatureOption10){//Hem Style Option(Roller)
		if(frmEle.FeatureOption10.value != 24){//NOT Plain
			if(frmEle.FeatureOption10){//Hem Style Option(Roller)
				if(frmEle.TapeColorID){//Are trim colors there?
					if(frmEle.TapeColorID.value == 0){//Trim color must be chosen
						alert("Please select a Trim Color when using a Decorative Hem!");
						frmEle.TapeColorID.focus();
						return false;
					}
				}
			}
		}
	}

	if(frmEle.FeatureOption13){//Hem Style
		if(frmEle.FeatureOption13.value == 34){//Plain Hem
			if(frmEle.TapeColorID){//Are trim colors there?
				if(frmEle.TapeColorID.value == 0){//Trim color must be chosen
					alert("Please select a Trim Color when using a Plain Hem!");
					frmEle.TapeColorID.focus();
					return false;
				}
			}
		}
	}
	//Small size
	if(frmEle.WidthInches.value < 13.5 && frmEle.pid.value == 100){//1" designer basswood
		alert('Helpful hint: Blinds under 13.5" wide come standard with tilter in the center and no lift cord.')
	}
	if (frmEle.WidthInches.value <= 12 && (frmEle.pid.value == 270 || document.shopcart.pid.value == 335)){//2" extreme basswood
		alert('Helpful hint: Blinds under 12" wide come standard with tilter in the center and no lift cord.');
	}
	if(frmEle.WidthInches.value < 23 && (frmEle.pid.value == 38 || frmEle.pid.value == 39 || frmEle.pid.value == 42 || frmEle.pid.value == 46)){//hunter douglas blinds
		alert('Helpful hint: Blinds under 23" wide come standard with split controls. Controls cannot be on the same side.');
	}
	if(frmEle.WidthInches.value < 24 && (frmEle.pid.value == 224)){//Prestige 2" Aluminum
		if (frmEle.FeatureOption2 && frmEle.FeatureOption4)
		{
			if ((frmEle.FeatureOption2.value == 4 && frmEle.FeatureOption4.value == 9) || (frmEle.FeatureOption2.value == 5 && frmEle.FeatureOption4.value == 10))
			{
				alert('Helpful hint: Blinds under 24" wide come standard with split controls. Controls cannot be on the same side.');
				return false;
			}
		}
	}
	if(frmEle.WidthInches.value < 18 && (frmEle.pid.value == 239 || frmEle.pid.value == 240 || frmEle.pid.value == 241)){//Prestige 1"/2"/2 1/2" Platinum Wood
		if (frmEle.FeatureOption2 && frmEle.FeatureOption4)
		{
			if ((frmEle.FeatureOption2.value == 4 && frmEle.FeatureOption4.value == 9) || (frmEle.FeatureOption2.value == 5 && frmEle.FeatureOption4.value == 10))
			{
				alert('Helpful hint: Blinds under 18" wide come standard with split controls. Controls cannot be on the same side.');
				return false;
			}
		}
	}

	if(frmEle.WidthInches.value < 14 && (frmEle.pid.value == 87 || frmEle.pid.value == 120)){//2" designer fauxwood
		alert('Helpful hint: Blinds under 14" wide come standard with tilter in the center and no lift cord.')
	}
	else if(frmEle.WidthInches.value < 12){
		categoryID = 0
		if(frmEle.cid){
			categoryID = frmEle.cid.value;
		}
		if((categoryID == 4 || categoryID == 7 || categoryID == 8) && frmEle.pid.value != 100 && frmEle.pid.value != 270 && frmEle.pid.value != 335){
			//If horizontal blind
			alert('Helpful hint: Blinds under 12" wide come standard with tilter in the center and no lift cord.')
		}
	}
	if (frmEle.FeatureOption31)
	{
		if (frmEle.FeatureOption31.value == 109)
		{
			alert('Please select a Frame Type.');
			frmEle.FeatureOption31.focus();
			return false;
		}
	}
	if (frmEle.FeatureOption61)
	{
		if (frmEle.FeatureOption61.value == 165 && frmEle.FeatureOption61.disabled == false)
		{
			alert('Please select an option for Top Down Bottom Up.');
			frmEle.FeatureOption61.focus();
			return false;
		}
	}
	if (document.shopcart.Option36 && document.shopcart.Option37 && document.shopcart.Option38 && document.shopcart.Option39)
	{
		if (document.shopcart.Option36.checked == false && document.shopcart.Option37.checked == false && document.shopcart.Option38.checked == false && document.shopcart.Option39.checked == false)
		{
			alert('Please select a Hinge Color.');
			return false;
		}
	}
	if (document.shopcart.Option10 && document.shopcart.Option50 && document.shopcart.Option51 && document.shopcart.Option54)//select natural wood shades
	{
		if (document.shopcart.Option10.checked == false && document.shopcart.Option50.checked == false && document.shopcart.Option51.checked == false && document.shopcart.Option54.checked == false)
		{
			alert('Please select a fold style.');
			return false;
		}
	}
		
	//select roman shades
	if (document.shopcart.pid.value == 197 || document.shopcart.pid.value == 198 || document.shopcart.pid.value == 199 || document.shopcart.pid.value == 200 || document.shopcart.pid.value == 201 || document.shopcart.pid.value == 202 || document.shopcart.pid.value == 203 ||
	    document.shopcart.pid.value == 308 || document.shopcart.pid.value == 313 || document.shopcart.pid.value == 307 || document.shopcart.pid.value == 311 || document.shopcart.pid.value == 309 || document.shopcart.pid.value == 310 || document.shopcart.pid.value == 312)
	{
		var count = 0;
		if (document.shopcart.Option27)
		{
			if (document.shopcart.Option27.checked) count++;
		}
		if (document.shopcart.Option42)
		{
			if (document.shopcart.Option42.checked) count++;
		}
		if (document.shopcart.Option45)
		{
			if (document.shopcart.Option45.checked) count++;
		}
		if (document.shopcart.Option46)
		{
			if (document.shopcart.Option46.checked) count++;
		}
		if (count < 1)
		{
			alert('Please select a fold style.');
			return false;
		}
		if (count > 1)
		{
			alert('Please select only one fold style.');
			return false;
		}
		
		var linerCount = 0;
		if (document.shopcart.Option47)
		{
			if (document.shopcart.Option47.checked) linerCount++;
		}
		if (document.shopcart.FeatureOption47)
		{
			if (document.shopcart.FeatureOption47.selectedIndex > 0) linerCount++;
		}
		if (linerCount == 0)
		{
			alert('Please select a liner.');
			return false;
		}
	}
	
	//select natural wood shades
	if (document.shopcart.pid.value == 61 || document.shopcart.pid.value == 236 || document.shopcart.pid.value == 237)
	{
		var linerSelected = false;
		if (document.shopcart.Option26)
		{
			if (document.shopcart.Option26.checked == true) linerSelected = true;
		}
		if (document.shopcart.Option20)
		{
			if (document.shopcart.Option20.checked == true) linerSelected = true;
		}
		if (document.shopcart.Option47)
		{
			if (document.shopcart.Option47.checked == true) linerSelected = true;
		}
		if (document.shopcart.FeatureOption60)
		{//if liner's selected prompt the user to select a liner color
			if (document.shopcart.FeatureOption60.selectedIndex < 1 && linerSelected == true)
			{
				alert('Please select a liner color.');
				return false;
			}
		}
	}
	if (document.shopcart.pid.value == 208)
	{
		if(document.shopcart.WidthInches.value >= 72)
		{
//			if (document.shopcart.Option6 && document.shopcart.Option8)
			if (document.getElementById("rTwoOnOne") && document.getElementById("rThreeOnOne"))
			{
//				if (document.shopcart.Option6.checked == false && document.shopcart.Option8.checked == false)
				if (document.getElementById("rTwoOnOne").checked == false && document.getElementById("rThreeOnOne").checked == false)
				{
					alert("Due to the weight of the blinds in the size you have selected you must separate them into 2 sections on one headrail.");
					return false;
				}
			}
		}
	}
	
	//Wood, Faux and Mini can't have same side of titler location and lift cord
	if (document.shopcart.pid.value == 13 || document.shopcart.pid.value == 34 ||document.shopcart.pid.value == 99 || document.shopcart.pid.value == 100 || document.shopcart.pid.value == 110 || document.shopcart.pid.value == 111 ||
	    document.shopcart.pid.value == 195 || document.shopcart.pid.value == 196 || document.shopcart.pid.value == 206 || document.shopcart.pid.value == 239 || document.shopcart.pid.value == 240 || document.shopcart.pid.value == 241 ||
	    document.shopcart.pid.value == 3 || document.shopcart.pid.value == 327 || document.shopcart.pid.value == 94 || document.shopcart.pid.value == 117 || document.shopcart.pid.value == 167 || document.shopcart.pid.value == 220 || document.shopcart.pid.value == 226 ||
	    document.shopcart.pid.value == 8 || document.shopcart.pid.value == 95 || document.shopcart.pid.value == 224 || document.shopcart.pid.value == 225 || document.shopcart.pid.value == 270 || document.shopcart.pid.value == 272 || 
	    document.shopcart.pid.value == 273 || document.shopcart.pid.value == 296 || document.shopcart.pid.value == 255 || document.shopcart.pid.value == 254 || document.shopcart.pid.value == 306 || document.shopcart.pid.value == 335 ||
	    document.shopcart.pid.value == 336 || document.shopcart.pid.value == 337 || document.shopcart.pid.value == 328)
	{
		if(document.getElementById("rStandard"))
		{	
			if(document.getElementById("rStandard").checked == true)
			{
				if(document.shopcart.WidthInches && document.getElementById("stl") && document.getElementById("slc") )
				{
					if(document.shopcart.WidthInches.value < 24 &&  ((document.getElementById("stl").selectedIndex == 0 && document.getElementById("slc").selectedIndex == 0) || (document.getElementById("stl").selectedIndex == 1 && document.getElementById("slc").selectedIndex == 1) ) )
					{
						alert("Due to the size, tilter location and lift cord can not be at the same side");
						return false;
					}
				}
			}
		}
	
		if(document.getElementById("rTwoOnOne"))
		{	
			if(document.getElementById("rTwoOnOne").checked == true)
			{
				if(document.getElementById("2wi1") && document.getElementById("2tl1") && document.getElementById("2lc1") )
				{
					if(document.getElementById("2wi1").value < 24 &&  ((document.getElementById("2tl1").selectedIndex == 0 && document.getElementById("2lc1").selectedIndex == 0) || (document.getElementById("2tl1").selectedIndex == 1 && document.getElementById("2lc1").selectedIndex == 1) ) )
					{
						alert("Due to the size, tilter location and lift cord can not be at the same side");
						return false;
					}
				}
				if(document.getElementById("2wi2") && document.getElementById("2tl2") && document.getElementById("2lc2") )
				{
					if(document.getElementById("2wi2").value < 24 &&  ((document.getElementById("2tl2").selectedIndex == 0 && document.getElementById("2lc2").selectedIndex == 0) || (document.getElementById("2tl2").selectedIndex == 1 && document.getElementById("2lc2").selectedIndex == 1) ) )
					{
						alert("Due to the size, tilter location and lift cord can not be at the same side");
						return false;
					}
				}
			}
		}
		if(document.getElementById("rThreeOnOne"))
		{	
			if(document.getElementById("rThreeOnOne").checked == true)
			{
				if(document.getElementById("3wi1") && document.getElementById("3tl1") && document.getElementById("3lc1") )
				{
					if(document.getElementById("3wi1").value < 24 &&  ((document.getElementById("3tl1").selectedIndex == 0 && document.getElementById("3lc1").selectedIndex == 0) || (document.getElementById("3tl1").selectedIndex == 1 && document.getElementById("3lc1").selectedIndex == 1) ) )
					{
						alert("Due to the size, tilter location and lift cord can not be at the same side");
						return false;
					}
				}
				if(document.getElementById("3wi2") && document.getElementById("3tl2") && document.getElementById("3lc2") )
				{
					if(document.getElementById("3wi2").value < 24 &&  ((document.getElementById("3tl2").selectedIndex == 0 && document.getElementById("3lc2").selectedIndex == 0) || (document.getElementById("3tl2").selectedIndex == 1 && document.getElementById("3lc2").selectedIndex == 1) ) )
					{
						alert("Due to the size, tilter location and lift cord can not be at the same side");
						return false;
					}
				}
				if(document.getElementById("3wi3") && document.getElementById("3tl3") && document.getElementById("3lc3") )
				{
					if(document.getElementById("3wi3").value < 24 &&  ((document.getElementById("3tl3").selectedIndex == 0 && document.getElementById("3lc3").selectedIndex == 0) || (document.getElementById("3tl3").selectedIndex == 1 && document.getElementById("3lc3").selectedIndex == 1) ) )
					{
						alert("Due to the size, tilter location and lift cord can not be at the same side");
						return false;
					}
				}
			}
		}
	}

	var blindWidth = 0;
	var blindWidth = frmEle.WidthInches.value + frmEle.Width8ths.value;
	var blindHeight = 0;
	var blindHeight = frmEle.HeightInches.value + frmEle.Height8ths.value;
	if(document.getElementById("rTwoOnOne") || document.getElementById("rThreeOnOne"))
	{
		var frmEle = eval("document.shopcart");
		if(document.getElementById("rTwoOnOne"))
		{	
			if(document.getElementById("rTwoOnOne").checked == true)
			{
				// check each width and total it up to match the total width
				TotalWidth = parseInt(document.getElementById("2wi1").value) + parseFloat(document.getElementById("2w81").value)+ parseInt(document.getElementById("2wi2").value) + parseFloat(document.getElementById("2w82").value);
				if(blindWidth != TotalWidth)
				{
					alert("Total width of two on one headrail does not match up with width selected");
					return false;
				}		
			}
		}
		if(document.getElementById("rThreeOnOne"))
		{
			if(document.getElementById("rThreeOnOne").checked == true)
			{
				// check each width and total it up to match the total width
				TotalWidth = parseInt(document.getElementById("3wi1").value) + parseFloat(document.getElementById("3w81").value) + parseInt(document.getElementById("3wi2").value) + parseFloat(document.getElementById("3w82").value) + parseInt(document.getElementById("3wi3").value) + parseFloat(document.getElementById("3w83").value);
				if(blindWidth != TotalWidth)
				{
					alert("Total width of three on one headrail does not match up with width selected");
					return false;
				}
					
			}
		}
	}
		//budget pleated shades
	if (document.shopcart.pid.value == 228 || document.shopcart.pid.value == 288 || document.shopcart.pid.value == 289 || document.shopcart.pid.value == 297)
	{
		if (document.shopcart.Option11 && document.shopcart.Option19)
		{
			if (document.shopcart.Option11.checked == true && document.shopcart.Option19.checked == true)
			{
				alert("Shades are not available with both 'Continuous Cord Loop' and 'Top Down-Bottom Up' options.");
				return false;
			}
		}
	}
	
	if (document.shopcart.RushProduction && document.shopcart.Option67)
	{
		if (document.shopcart.RushProduction.checked == true && document.shopcart.Option67.checked == true)
		{
		    document.shopcart.RushProduction.checked = false;
			alert("Shades are not available with both 'Priority Production' and 'Cordless Top Down-Bottom Up' options.");  
			return false;
		}
	}
	
	if (document.shopcart.pid.value == 158)
	{
		if ((frmEle.ColorID.value == 1036 && blindWidth > 24 && blindWidth <= 36) || (frmEle.ColorID.value == 1036 && blindWidth > 36 && blindWidth <= 42 && blindHeight > 54 && blindHeight <= 72))
		{
			alert('Shade in this color and/or size is not available as this is a clearance item.');
			return false;
		}
	}
	if (document.shopcart.pid.value == 259 || document.shopcart.pid.value == 263 || document.shopcart.pid.value == 264)
	{
		if (document.shopcart.Option65) //ccloop
		{
			if ((blindWidth >= 36 && blindWidth < 42 && blindHeight >= 102) || (blindWidth >= 42 && blindWidth < 48 && blindHeight >= 84) || (blindWidth >= 48 && blindWidth < 54 && blindHeight >= 72)
						|| (blindWidth >= 54 && blindWidth < 60 && blindHeight >= 66) || (blindWidth >= 60 && blindWidth < 66 && blindHeight >= 60) || (blindWidth >= 66 && blindWidth < 72 && blindHeight >= 48)
						|| (blindWidth >= 72 && blindWidth < 78 && blindHeight >= 42) || (blindWidth >= 78 && blindWidth < 84 && blindHeight >= 42) || (blindWidth >= 84))
			{
				if (document.shopcart.Option65.checked == false) 
				{
					alert("Due to the size of the shade, continuous cord loop is required for efficient operation. If you have ordered smaller sizes we highly recommend that you select continuous cord loop option for all of the shades so that the headrails are the same.");
					return false;
				}
			}
		}
	}
	
	return IsBlindMaxWidthHeightValid(blindWidth, blindHeight);
}

function IsBlindMaxWidthHeightValid(blindWidth, blindHeight)
{
	if (document.shopcart.pid.value == 231)
	{
		if (blindWidth > 72)
		{
			alert('Total width of blind cannot be over 72" wide.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 95)
	{
		if (blindWidth > 71)
		{
			alert('Total width of blind cannot be over 71" wide.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 34 || document.shopcart.pid.value == 94 || document.shopcart.pid.value == 99 || document.shopcart.pid.value == 158 || document.shopcart.pid.value == 256)
	{
		if (blindWidth > 72)
		{
			alert('Total width of blind cannot be over 72" wide.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 327)
	{
		if (blindWidth > 72)
		{
			alert('Total width of blind cannot be over 72" wide.');
			return false;
		}
	    if (blindHeight > 96)
		{
			alert('Total height of blind cannot be over 96" high.');
			return false;
		}		
	}
	else if (document.shopcart.pid.value == 159)
	{
		if (blindWidth > 95)
		{
			alert('Total width of blind cannot be over 95" wide.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 3 || document.shopcart.pid.value == 61 || document.shopcart.pid.value == 236 || document.shopcart.pid.value == 237 || document.shopcart.pid.value == 68 || document.shopcart.pid.value == 69 || document.shopcart.pid.value == 83 || document.shopcart.pid.value == 84 || document.shopcart.pid.value == 91 || document.shopcart.pid.value == 100 || document.shopcart.pid.value == 110 || document.shopcart.pid.value == 111 || document.shopcart.pid.value == 117 || document.shopcart.pid.value == 137 || document.shopcart.pid.value == 167 || document.shopcart.pid.value == 195 || document.shopcart.pid.value == 196 || 
	         document.shopcart.pid.value == 197 || document.shopcart.pid.value == 198 || document.shopcart.pid.value == 199 || document.shopcart.pid.value == 200 || document.shopcart.pid.value == 201 || document.shopcart.pid.value == 202 || document.shopcart.pid.value == 203 || document.shopcart.pid.value == 206 || document.shopcart.pid.value == 216 || document.shopcart.pid.value == 217 || document.shopcart.pid.value == 220 || document.shopcart.pid.value == 226 || document.shopcart.pid.value == 233 || document.shopcart.pid.value == 234 || document.shopcart.pid.value == 235 || document.shopcart.pid.value == 238 || document.shopcart.pid.value == 239 || document.shopcart.pid.value == 240 || document.shopcart.pid.value == 241 || document.shopcart.pid.value == 270 ||
	         document.shopcart.pid.value == 308 || document.shopcart.pid.value == 313 || document.shopcart.pid.value == 307 || document.shopcart.pid.value == 311 || document.shopcart.pid.value == 309 || document.shopcart.pid.value == 310 || document.shopcart.pid.value == 312)
	{
		if (blindWidth > 96)
		{
			alert('Total width of blind cannot be over 96" wide.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 154)
	{
		if (blindWidth > 97)
		{
			alert('Total width of blind cannot be over 97" wide.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 13)
	{
		if (blindWidth > 108)
		{
			alert('Total width of blind cannot be over 108" wide.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 171 || document.shopcart.pid.value == 172)
	{
		if (blindWidth > 114)
		{
			alert('Total width of blind cannot be over 114" wide.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 225 || document.shopcart.pid.value == 242 || document.shopcart.pid.value == 243 || document.shopcart.pid.value == 244 || document.shopcart.pid.value == 245 || document.shopcart.pid.value == 246 ||
	         document.shopcart.pid.value == 322 || document.shopcart.pid.value == 323 || document.shopcart.pid.value == 324 || document.shopcart.pid.value == 321 || document.shopcart.pid.value == 325)
	{
		if (blindWidth > 120)
		{
			alert('Total width of blind cannot be over 120" wide.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 155 || document.shopcart.pid.value == 156 || document.shopcart.pid.value == 157)
	{
		if (blindWidth > 127)
		{
			alert('Total width of blind cannot be over 127" wide.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 224)
	{
		if (blindWidth > 142)
		{
			alert('Total width of blind cannot be over 142" wide.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 64 || document.shopcart.pid.value == 65 || document.shopcart.pid.value == 66 || document.shopcart.pid.value == 67 || document.shopcart.pid.value == 129 || document.shopcart.pid.value == 221 || document.shopcart.pid.value == 222 || document.shopcart.pid.value == 228 || document.shopcart.pid.value == 247 || document.shopcart.pid.value == 248 || document.shopcart.pid.value == 250 || document.shopcart.pid.value == 251 || document.shopcart.pid.value == 252 || document.shopcart.pid.value == 253 ||
	         document.shopcart.pid.value == 315 || document.shopcart.pid.value == 316 || document.shopcart.pid.value == 320 || document.shopcart.pid.value == 319 || document.shopcart.pid.value == 317 || document.shopcart.pid.value == 318)
	{
		if (blindWidth > 144)
		{
			alert('Total width of blind cannot be over 144" wide.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 249 || document.shopcart.pid.value == 314)
	{
		if (blindWidth > 146)
		{
			alert('Total width of blind cannot be over 146" wide.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 124 || document.shopcart.pid.value == 131)
	{
		if (blindWidth > 156)
		{
			alert('Total width of blind cannot be over 156" wide.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 128 || document.shopcart.pid.value == 130 || document.shopcart.pid.value == 133 || document.shopcart.pid.value == 168)
	{
		if (blindWidth > 191)
		{
			alert('Total width of blind cannot be over 191" wide.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 277)
	{
		if (blindWidth > 72)
		{
			alert('Total width of blind cannot be over 72" wide.');
			return false;
		}
		if (blindHeight > 72)
		{
			alert('Total height of blind cannot be over 72" high.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 303)
	{
		if (blindWidth > 71)
		{
			alert('Total width of blind cannot be over 71" wide.');
			return false;
		}
		if (blindHeight > 72)
		{
			alert('Total height of blind cannot be over 72" high.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 304)
	{
		if (blindWidth > 71)
		{
			alert('Total width of blind cannot be over 71" wide.');
			return false;
		}
		if (blindHeight > 72)
		{
			alert('Total height of blind cannot be over 72" high.');
			return false;
		}
	}		
	else if (document.shopcart.pid.value == 273 || document.shopcart.pid.value == 272)
	{
		if (blindWidth > 120)
		{
			alert('Total width of blind cannot be over 120" wide.');
			return false;
		}
		if (blindHeight > 120)
		{
			alert('Total height of blind cannot be over 120" high.');
			return false;
		}
	}	
	else if (document.shopcart.pid.value == 293)
	{
		if (blindWidth > 96)
		{
			alert('Total width of blind cannot be over 96" wide.');
			return false;
		}
		if (blindHeight > 96)
		{
			alert('Total height of blind cannot be over 96" high.');
			return false;
		}
	}		
	else if (document.shopcart.pid.value == 294)
	{
		if (blindWidth > 84)
		{
			alert('Total width of blind cannot be over 84" wide.');
			return false;
		}
		if (blindHeight > 96)
		{
			alert('Total height of blind cannot be over 96" high.');
			return false;
		}
	}	
	else if (document.shopcart.pid.value == 259 || document.shopcart.pid.value == 263)
	{
		if (blindWidth > 96)
		{
			alert('Total width of blind cannot be over 96" wide.');
			return false;
		}
		if (blindHeight > 108)
		{
			alert('Total height of blind cannot be over 108" high.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 264)
	{
		if (blindWidth > 96)
		{
			alert('Total width of blind cannot be over 96" wide.');
			return false;
		}
		if (blindHeight > 108)
		{
			alert('Total height of blind cannot be over 108" high.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 254)
	{
		if (blindWidth > 120)
		{
			alert('Total width of blind cannot be over 120" wide.');
			return false;
		}
		if (blindHeight > 108)
		{
			alert('Total height of blind cannot be over 108" high.');
			return false;
		}
	}	
	else if (document.shopcart.pid.value == 255)
	{
		if (blindWidth > 120)
		{
			alert('Total width of blind cannot be over 120" wide.');
			return false;
		}
		if (blindHeight > 126)
		{
			alert('Total height of blind cannot be over 126" high.');
			return false;
		}
	}	
	else if (document.shopcart.pid.value == 260 || document.shopcart.pid.value == 266 || document.shopcart.pid.value == 296)
	{
		if (blindWidth > 96)
		{
			alert('Total width of blind cannot be over 96" wide.');
			return false;
		}
		if (blindHeight > 120)
		{
			alert('Total height of blind cannot be over 120" high.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 285)
	{
		if (blindWidth > 72)
		{
			alert('Total width of blind cannot be over 72" wide.');
			return false;
		}
		if (blindHeight > 72)
		{
			alert('Total height of blind cannot be over 72" high.');
			return false;
		}
	}	
	else if (document.shopcart.pid.value == 292)
	{
		if (blindWidth > 94)
		{
			alert('Total width of blind cannot be over 94" wide.');
			return false;
		}
		if (blindHeight > 120)
		{
			alert('Total height of blind cannot be over 120" high.');
			return false;
		}
	}		
	else if (document.shopcart.pid.value == 278)
	{
		if (blindWidth > 96)
		{
			alert('Total width of blind cannot be over 96" wide.');
			return false;
		}
		if (blindHeight > 108)
		{
			alert('Total height of blind cannot be over 108" high.');
			return false;
		}
	}				
	else if (document.shopcart.pid.value == 267)
	{
		if (blindWidth > 96)
		{
			alert('Total width of blind cannot be over 96" wide.');
			return false;
		}
		if (blindHeight > 120)
		{
			alert('Total height of blind cannot be over 120" high.');
			return false;
		}
	}					
	else if (document.shopcart.pid.value == 268 || document.shopcart.pid.value == 269)
	{
		if (blindWidth > 120)
		{
			alert('Total width of blind cannot be over 120" wide.');
			return false;
		}
		if (blindHeight > 120)
		{
			alert('Total height of blind cannot be over 120" high.');
			return false;
		}
	}							
	else if (document.shopcart.pid.value == 306)
	{
		if (blindWidth > 96)
		{
			alert('Total width of blind cannot be over 96" wide.');
			return false;
		}
		if (blindHeight > 72)
		{
			alert('Total height of blind cannot be over 72" high.');
			return false;
		}
	}								
	else if (document.shopcart.pid.value == 326)
	{
		if (blindWidth > 191)
		{
			alert('Total width of blind cannot be over 191" wide.');
			return false;
		}
		if (blindHeight > 120)
		{
			alert('Total height of blind cannot be over 120" high.');
			return false;
		}
	}									
	else if (document.shopcart.pid.value == 335)
	{
		if (blindWidth > 72)
		{
			alert('Total width of blind cannot be over 72" wide.');
			return false;
		}
		if (blindHeight > 96)
		{
			alert('Total height of blind cannot be over 96" high.');
			return false;
		}
	}										
	else if (document.shopcart.pid.value == 288 || document.shopcart.pid.value == 289)
	{
		if (blindWidth > 96)
		{
			alert('Total width of blind cannot be over 96" wide.');
			return false;
		}
		if (blindHeight > 96)
		{
			alert('Total height of blind cannot be over 96" high.');
			return false;
		}
	}											
	else if (document.shopcart.pid.value == 297)
	{
		if (blindWidth > 120)
		{
			alert('Total width of blind cannot be over 120" wide.');
			return false;
		}
		if (blindHeight > 96)
		{
			alert('Total height of blind cannot be over 96" high.');
			return false;
		}
	}											
	else if (document.shopcart.pid.value == 279)
	{
		if (blindWidth > 144)
		{
			alert('Total width of blind cannot be over 144" wide.');
			return false;
		}
		if (blindHeight > 120)
		{
			alert('Total height of blind cannot be over 120" high.');
			return false;
		}
	}											
	else if (document.shopcart.pid.value == 280)
	{
		if (blindWidth > 95)
		{
			alert('Total width of blind cannot be over 95" wide.');
			return false;
		}
		if (blindHeight > 75)
		{
			alert('Total height of blind cannot be over 75" high.');
			return false;
		}
	}											
	else if (document.shopcart.pid.value == 281)
	{
		if (blindWidth > 39)
		{
			alert('Total width of blind cannot be over 39" wide.');
			return false;
		}
		if (blindHeight > 123)
		{
			alert('Total height of blind cannot be over 123" high.');
			return false;
		}
	}												
	else if (document.shopcart.pid.value == 336 || document.shopcart.pid.value == 337)
	{
		if (blindWidth > 96)
		{
			alert('Total width of blind cannot be over 96" wide.');
			return false;
		}
		if (blindHeight > 120)
		{
			alert('Total height of blind cannot be over 120" high.');
			return false;
		}
	}  												
	else if (document.shopcart.pid.value == 328)
	{
		if (blindWidth > 72)
		{
			alert('Total width of blind cannot be over 72" wide.');
			return false;
		}
		if (blindHeight > 84)
		{
			alert('Total height of blind cannot be over 84" high.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 291)
	{
		if (blindWidth > 94)
		{
			alert('Total width of blind cannot be over 94" wide.');
			return false;
		}
		if (blindHeight > 120)
		{
			alert('Total height of blind cannot be over 120" high.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 330)
	{
		if (blindWidth > 94)
		{
			alert('Total width of blind cannot be over 94" wide.');
			return false;
		}
		if (blindHeight > 120)
		{
			alert('Total height of blind cannot be over 120" high.');
			return false;
		}
	}
	else if (document.shopcart.pid.value == 338)
	{
		if (blindWidth > 94)
		{
			alert('Total width of blind cannot be over 94" wide.');
			return false;
		}
		if (blindHeight > 120)
		{
			alert('Total height of blind cannot be over 84" high.');
			return false;
		}
	}
	
	return true;
}

function DisableRoutless(theVal){
	if(document.shopcart.TapeColorID)
		theVal = document.shopcart.TapeColorID.value;
	//Standard Check	
	if(document.shopcart.Option2 || document.shopcart.Option14){//Routless option available
		if(theVal == 0){//no tape selected
			if(document.shopcart.Option2 && document.shopcart.Option9){
				if(document.shopcart.Option9.checked == true){//routeless
					document.shopcart.Option2.disabled = true;//remote
				}
				else if(document.shopcart.Option2.checked == true){//remote
					document.shopcart.Option9.disabled = true;//routeless
				}
				else{//enable both
					document.shopcart.Option2.disabled = false;//routeless
					document.shopcart.Option9.disabled = false;//remote
				}
			}
			if(document.shopcart.Option2 && !document.shopcart.Option9){
				document.shopcart.Option2.disabled = false;//routeless
			}
			if (document.shopcart.Option14)
			{
				document.shopcart.Option14.disabled = false;
			}
		}
		else{//tape selected
			if(document.shopcart.Option2){//Routless
				document.shopcart.Option2.disabled = true;
				if(document.shopcart.Option2.checked == true){
					alert("Cloth tape is not available with no holes privacy option. The no holes privacy option has been removed.");
					document.shopcart.Option2.checked = false;
				}
			}
			if(document.shopcart.Option9){//Remote
				document.shopcart.Option9.disabled = true;
				if(document.shopcart.Option9.checked == true){
					alert("Remote control is not available with blinds that have cloth tape. The remote control option has been removed.");
					document.shopcart.Option9.checked = false;
				}
			}
			if (document.shopcart.Option14)
			{
				document.shopcart.Option14.disabled = true;
				if (document.shopcart.Option14.checked == true)
				{
					alert("Cloth tape is not available with no holes privacy option. The no holes privacy option has been removed.");
					document.shopcart.Option14.checked = false;
				}
			}
		}
	}
	//Hunter Douglas check
	if(document.shopcart.Option28){//de-light option available
		if(theVal == 0){
			// not allow de-light and powertilt Hunter Douglas
			if(document.shopcart.Option28 && document.shopcart.Option30){
				if(document.shopcart.Option30.checked == true){//routeless
					document.shopcart.Option28.disabled = true;//remote
				}
				else if(document.shopcart.Option28.checked == true){//remote
					document.shopcart.Option30.disabled = true;//routeless
				}
				else{//enable both
					document.shopcart.Option28.disabled = false;//routeless
					document.shopcart.Option30.disabled = false;//remote
				}
			}
		}
		else{
			if(document.shopcart.Option28){//de-light
				document.shopcart.Option28.disabled = true;
				if(document.shopcart.Option28.checked == true){
					alert("Cloth tape is not available with no holes privacy option. The no holes privacy option has been removed.");
					document.shopcart.Option28.checked = false;
				}
			}
			if(document.shopcart.Option30){//Powertilt
				document.shopcart.Option30.disabled = true;
				if(document.shopcart.Option30.checked == true){
					alert("Remote control is not available with blinds that have cloth tape. The remote control option has been removed.");
					document.shopcart.Option30.checked = false;
				}
			}
		}
	}
}

function addOption(selectbox,text,value )
{
	var optn = document.createElement("option");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}

function SetOptionStatus(){
	if (document.shopcart.pid.value == 265) //budget woven wood
	{
		var blackOutLiner = "N";
		var privacyLiner = "N";
		if (document.shopcart.Option26)
		{
			if (document.shopcart.Option26.checked)
			{
				blackOutLiner = "Y";
				if (document.shopcart.Option20) {document.shopcart.Option20.checked = false;document.shopcart.Option20.disabled = true;}
				if (document.shopcart.FeatureOption60) {document.shopcart.FeatureOption60.disabled = false;}
			}
		}
		if (document.shopcart.Option20)
		{
			if (document.shopcart.Option20.checked)
			{
				blackOutLiner = "Y";
				if (document.shopcart.Option26) {document.shopcart.Option26.checked = false;document.shopcart.Option26.disabled = true;}
				if (document.shopcart.FeatureOption60) {document.shopcart.FeatureOption60.disabled = false;}
			}
		}
		if (blackOutLiner == "N" && privacyLiner == "N")
		{
			if (document.shopcart.Option20) document.shopcart.Option20.disabled = false;
			if (document.shopcart.Option26) document.shopcart.Option26.disabled = false;
			if (document.shopcart.FeatureOption60) {document.shopcart.FeatureOption60.selectedIndex = 0;document.shopcart.FeatureOption60.disabled = true;}
		}
		if (document.shopcart.Option21 && document.shopcart.Option19)
		{
			if (document.shopcart.Option21.checked)
			{
				if (document.shopcart.Option19)
				{
					document.shopcart.Option19.checked = false;
					document.shopcart.Option19.disabled = true;
				}
			}
			else if (document.shopcart.Option19.checked)
			{
				if (document.shopcart.Option21)
				{
					document.shopcart.Option21.checked = false;
					document.shopcart.Option21.disabled = true;
				}
			}
			else
			{
				document.shopcart.Option21.disabled = false;
				document.shopcart.Option19.disabled = false;
			}
		}
	}
	//select natural wood shades
	if (document.shopcart.pid.value == 61 || document.shopcart.pid.value == 236 || document.shopcart.pid.value == 237)
	{
		var blackOutLiner = "N";
		var privacyLiner = "N";
		if (document.shopcart.Option26)
		{
			if (document.shopcart.Option26.checked)
			{
				privacyLiner = "Y";
				if (document.shopcart.Option47) {document.shopcart.Option47.checked = false;document.shopcart.Option47.disabled = true;}
				if (document.shopcart.FeatureOption60) {document.shopcart.FeatureOption60.disabled = false;}
			}
		}
		if (document.shopcart.Option47)
		{
			if (document.shopcart.Option47.checked)
			{
				blackOutLiner = "Y";
				if (document.shopcart.Option26) {document.shopcart.Option26.checked = false;document.shopcart.Option26.disabled = true;}
				if (document.shopcart.FeatureOption60) {document.shopcart.FeatureOption60.disabled = false;}
			}
		}
		if (blackOutLiner == "N" && privacyLiner == "N")
		{
			if (document.shopcart.Option26) document.shopcart.Option26.disabled = false;
			if (document.shopcart.Option47) document.shopcart.Option47.disabled = false;
			if (document.shopcart.FeatureOption60) {document.shopcart.FeatureOption60.selectedIndex = 0;document.shopcart.FeatureOption60.disabled = true;}
		}
		if (document.shopcart.Option10 && document.shopcart.Option19)
		{
			if (document.shopcart.Option10.checked)
			{
				if (document.shopcart.Option19)
				{
					document.shopcart.Option19.checked = false;
					document.shopcart.Option19.disabled = true;
				}
			}
			else if (document.shopcart.Option19.checked)
			{
				if (document.shopcart.Option10)
				{
					document.shopcart.Option10.checked = false;
					document.shopcart.Option10.disabled = true;
				}
			}
			else
			{
				document.shopcart.Option10.disabled = false;
				document.shopcart.Option19.disabled = false;
			}
		}
	}
	
	//select roman shades
	if (document.shopcart.pid.value == 197 || document.shopcart.pid.value == 198 || document.shopcart.pid.value == 199 || document.shopcart.pid.value == 200 || document.shopcart.pid.value == 201 || document.shopcart.pid.value == 202 || document.shopcart.pid.value == 203 ||
	    document.shopcart.pid.value == 308 || document.shopcart.pid.value == 313 || document.shopcart.pid.value == 307 || document.shopcart.pid.value == 311 || document.shopcart.pid.value == 309 || document.shopcart.pid.value == 310 || document.shopcart.pid.value == 312)
	{
		var hobbled = "N"; var classic = "N"; var european = "N"; var flat = "N";
		if (document.shopcart.Option27)
		{
			if (document.shopcart.Option27.checked) 
			{
				hobbled = "Y";
				if (document.shopcart.Option42) {document.shopcart.Option42.checked = false;document.shopcart.Option42.disabled = true;}
				if (document.shopcart.Option45) {document.shopcart.Option45.checked = false;document.shopcart.Option45.disabled = true;}
				if (document.shopcart.Option46) {document.shopcart.Option46.checked = false;document.shopcart.Option46.disabled = true;}
			}
		}
		if (document.shopcart.Option42)
		{
			if (document.shopcart.Option42.checked) 
			{
				classic = "Y";
				if (document.shopcart.Option27) {document.shopcart.Option27.checked = false;document.shopcart.Option27.disabled = true;}
				if (document.shopcart.Option45) {document.shopcart.Option45.checked = false;document.shopcart.Option45.disabled = true;}
				if (document.shopcart.Option46) {document.shopcart.Option46.checked = false;document.shopcart.Option46.disabled = true;}
			}
		}
		if (document.shopcart.Option45)
		{
			if (document.shopcart.Option45.checked) 
			{
				european = "Y";
				if (document.shopcart.Option27) {document.shopcart.Option27.checked = false;document.shopcart.Option27.disabled = true;}
				if (document.shopcart.Option42) {document.shopcart.Option42.checked = false;document.shopcart.Option42.disabled = true;}
				if (document.shopcart.Option46) {document.shopcart.Option46.checked = false;document.shopcart.Option46.disabled = true;}
			}
		}
		if (document.shopcart.Option46)
		{
			if (document.shopcart.Option46.checked) 
			{
				flat = "Y";
				if (document.shopcart.Option27) {document.shopcart.Option27.checked = false;document.shopcart.Option27.disabled = true;}
				if (document.shopcart.Option42) {document.shopcart.Option42.checked = false;document.shopcart.Option42.disabled = true;}
				if (document.shopcart.Option45) {document.shopcart.Option45.checked = false;document.shopcart.Option45.disabled = true;}
			}
		}
		if (hobbled == "N" && classic == "N" && european == "N" && flat == "N")
		{
			if (document.shopcart.Option27) document.shopcart.Option27.disabled = false;
			if (document.shopcart.Option42) document.shopcart.Option42.disabled = false;
			if (document.shopcart.Option45) document.shopcart.Option45.disabled = false;
			if (document.shopcart.Option46) document.shopcart.Option46.disabled = false;
		}
		if (document.shopcart.Option47)
		{
			if (document.shopcart.Option47.checked)
			{
				if (document.shopcart.FeatureOption47) 
				{
					document.shopcart.FeatureOption47.selectedIndex = 0;
					document.shopcart.FeatureOption47.disabled = true;
				}
			}
			else
			{
				if (document.shopcart.FeatureOption47) 
				{
					document.shopcart.FeatureOption47.disabled = false;
				}
			}
		}
		if (document.shopcart.FeatureOption47)
		{
			if (document.shopcart.FeatureOption47.selectedIndex > 0)
			{
				if (document.shopcart.Option47) 
				{
					document.shopcart.Option47.checked = false;
					document.shopcart.Option47.disabled = true;
				}
			}
			else
			{
				if (document.shopcart.Option47) 
				{
					document.shopcart.Option47.disabled = false;
				}
			}
		}
	}
	
	//select roman shades - don't allow european fold with tdbu
	if (document.shopcart.pid.value == 201 || document.shopcart.pid.value == 202 ||
	    document.shopcart.pid.value == 308 || document.shopcart.pid.value == 309 || document.shopcart.pid.value == 310)
	{
		if (document.shopcart.Option45 && document.shopcart.Option12)
		{
			if (document.shopcart.Option45.checked && document.shopcart.Option12.checked)
			{
				alert("Shades are not available with both European Fold and Top Down Bottom Up.");
				document.shopcart.Option12.checked = false;
			}
		}
	}
	
	if(document.shopcart.pid.value == 137) // Tropical Isle Bamboo Shades
	{
        var blindWidth = document.shopcart.WidthInches.value;	
	    // If the width is less than 24" in height than the CC Loop is not available.
	    if (blindWidth < 24 && document.shopcart.Option21 && document.shopcart.Option21.checked)
		{
		    alert("Shades under 24 inches wide are not available with 'Continuous Cord Loop' option.")
			document.shopcart.Option21.checked = false;			
		}
	}	
	
	//Not allow tapes if too small
	if(document.shopcart.WidthInches.value >= 12)
	{
		if(document.shopcart.TapeColorID)
			document.shopcart.TapeColorID.disabled = false;
	}
	else
	{
		if(document.shopcart.TapeColorID)
			document.shopcart.TapeColorID.disabled = true;
	}

	//Not allow multiple headrail if too small
	if(iMultipleBlinds == 1){
//		if(document.shopcart.Option8){
//			document.shopcart.Option8.disabled = false;//3 in 1
//		}
//		if(document.shopcart.Option6){
//			document.shopcart.Option6.disabled = false;//2 in 1 headrail
//		}

		if(document.getElementById("rTwoOnOne"))
		{
			document.getElementById("rTwoOnOne").disabled = false; 
		}
		if(document.getElementById("rThreeOnOne"))
		{
			document.getElementById("rThreeOnOne").disabled = false; 
		}


	}
	else{//Dont allow if blind too small
		//if(document.shopcart.Option6){//Both 2 in 1
		//	document.shopcart.Option6.checked = false;
		//	document.shopcart.Option6.disabled = true;//2 in 1 headrail
		//}
		//if(document.shopcart.Option8){//Both 8 in 1
		//	document.shopcart.Option8.checked = false;
		//	document.shopcart.Option8.disabled = true;//3 in 1 headrail
		//}
	}
		
	if (document.shopcart.pid.value == 221 || document.shopcart.pid.value == 222)
	{
		if (document.shopcart.Option16 && document.shopcart.Option12)
		{
			if (document.shopcart.Option16.checked == true)
			{
				document.shopcart.Option12.checked = false;
				document.shopcart.Option12.disabled = true;
			}
			else if (document.shopcart.Option12.checked == true)
			{
				document.shopcart.Option16.checked = false;
				document.shopcart.Option16.disabled = true;
			}
			else
			{
				document.shopcart.Option12.disabled = false;
				document.shopcart.Option16.disabled = false;
			}
		}
	}
	if(document.shopcart.mountType)
	{	
		for(var i = 0; i< document.shopcart.mountType.length; i++)
		{
			if(document.shopcart.mountType[i].checked)
			{
				if(document.shopcart.mountType[i].value == 2)
				{
					if (document.shopcart.FeatureOption39)
					{//inside mount returns
					document.shopcart.FeatureOption39.disabled = false;
					if (document.shopcart.FeatureOption39.selectedIndex < 0) document.shopcart.FeatureOption39.selectedIndex = 0;
					}
					if (document.shopcart.FeatureOption40)
					{//spacer blocks
						document.shopcart.FeatureOption40.disabled = true;
						document.shopcart.FeatureOption40.selectedIndex = 1;
					}
					if (document.shopcart.FeatureOption41)
					{//hold down brackets
						document.shopcart.FeatureOption41.disabled = true;
						document.shopcart.FeatureOption41.selectedIndex = 1;
					}
					if (document.shopcart.FeatureOption64)
					{//extension brackets
						document.shopcart.FeatureOption64.disabled = true;
						document.shopcart.FeatureOption64.selectedIndex = 1;
					}
					if (document.shopcart.FeatureOption66)
					{//extension brackets
						document.shopcart.FeatureOption66.disabled = true;
						document.shopcart.FeatureOption66.selectedIndex = 1;
					}
				}
				else if (document.shopcart.mountType[i].value == 3)
				{
					if (document.shopcart.FeatureOption39)
					{
						document.shopcart.FeatureOption39.disabled = true;
						document.shopcart.FeatureOption39.selectedIndex = 0;
					}
					if (document.shopcart.FeatureOption40)
					{//spacer blocks
						document.shopcart.FeatureOption40.disabled = false;
						if (document.shopcart.FeatureOption40.selectedIndex < 0) document.shopcart.FeatureOption40.selectedIndex = 0;
					}
					if (document.shopcart.FeatureOption41)
					{//hold down brackets
						document.shopcart.FeatureOption41.disabled = false;
						if (document.shopcart.FeatureOption41.selectedIndex < 0) document.shopcart.FeatureOption41.selectedIndex = 0;
					}
					if (document.shopcart.FeatureOption64)
					{//extension brackets
						document.shopcart.FeatureOption64.disabled = false;
						if (document.shopcart.FeatureOption64.selectedIndex < 0) document.shopcart.FeatureOption64.selectedIndex = 0;
					}
					if (document.shopcart.FeatureOption66)
					{//extension brackets
						document.shopcart.FeatureOption66.disabled = false;
						if (document.shopcart.FeatureOption66.selectedIndex < 0) document.shopcart.FeatureOption66.selectedIndex = 0;
					}
				}
			}
		}
	}
	/*
	if (document.shopcart.FeatureOption1)
	{
		//inside mount
		if (document.shopcart.FeatureOption1.value == 2)
		{
			if (document.shopcart.FeatureOption39)
			{//inside mount returns
				document.shopcart.FeatureOption39.disabled = false;
				if (document.shopcart.FeatureOption39.selectedIndex < 0) document.shopcart.FeatureOption39.selectedIndex = 0;
			}
			if (document.shopcart.FeatureOption40)
			{//spacer blocks
				document.shopcart.FeatureOption40.disabled = true;
				document.shopcart.FeatureOption40.selectedIndex = 1;
			}
			if (document.shopcart.FeatureOption41)
			{//hold down brackets
				document.shopcart.FeatureOption41.disabled = true;
				document.shopcart.FeatureOption41.selectedIndex = 1;
			}
			if (document.shopcart.FeatureOption64)
			{//extension brackets
				document.shopcart.FeatureOption64.disabled = true;
				document.shopcart.FeatureOption64.selectedIndex = 1;
			}
			if (document.shopcart.FeatureOption66)
			{//extension brackets
				document.shopcart.FeatureOption66.disabled = true;
				document.shopcart.FeatureOption66.selectedIndex = 1;
			}
		}
		else if (document.shopcart.FeatureOption1.value == 3)
		{
			if (document.shopcart.FeatureOption39)
			{
				document.shopcart.FeatureOption39.disabled = true;
				document.shopcart.FeatureOption39.selectedIndex = 0;
			}
			if (document.shopcart.FeatureOption40)
			{//spacer blocks
				document.shopcart.FeatureOption40.disabled = false;
				if (document.shopcart.FeatureOption40.selectedIndex < 0) document.shopcart.FeatureOption40.selectedIndex = 0;
			}
			if (document.shopcart.FeatureOption41)
			{//hold down brackets
				document.shopcart.FeatureOption41.disabled = false;
				if (document.shopcart.FeatureOption41.selectedIndex < 0) document.shopcart.FeatureOption41.selectedIndex = 0;
			}
			if (document.shopcart.FeatureOption64)
			{//extension brackets
				document.shopcart.FeatureOption64.disabled = false;
				if (document.shopcart.FeatureOption64.selectedIndex < 0) document.shopcart.FeatureOption64.selectedIndex = 0;
			}
			if (document.shopcart.FeatureOption66)
			{//extension brackets
				document.shopcart.FeatureOption66.disabled = false;
				if (document.shopcart.FeatureOption66.selectedIndex < 0) document.shopcart.FeatureOption66.selectedIndex = 0;
			}
		}
	}
	*/
	var testWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
	var testHeight = document.shopcart.HeightInches.value + document.shopcart.Height8ths.value;	
	
	//Shutters Mount Type	
	if (document.shopcart.mountType && document.shopcart.pid.value == 281)
	{
		document.shopcart.mountType[1].checked == true;
		document.shopcart.mountType[0].disabled = true;
	}
	if (document.shopcart.FeatureOption31)
	{
		//inside standard, outside standard, inside z frame
		if (document.shopcart.FeatureOption31.value == 110 || document.shopcart.FeatureOption31.value == 111 || document.shopcart.FeatureOption31.value == 112)
		{
			//panel configuration
			if (document.shopcart.FeatureOption32)
			{
				if (document.shopcart.FeatureOption32.value == 113 || document.shopcart.FeatureOption32.value == 114) //single panel
				{
					if (testWidth > 34) {alert("We cannot make any single panel shutters over 34 inches wide."); document.shopcart.FeatureOption31.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption32.value == 115) //two panel split
				{
					if (testWidth < 22) {alert("We cannot make any two panel split shutters less than 22 inches wide."); document.shopcart.FeatureOption31.selectedIndex = 0;}
					if (testWidth > 53) {alert("We cannot make any two panel split shutters over 53 inches wide."); document.shopcart.FeatureOption31.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption32.value == 116 || document.shopcart.FeatureOption32.value == 124) //Two Panel Left, Two Panel Right
				{
					if (testWidth < 22) {alert("We cannot make any two panel shutters less than 22 inches wide."); document.shopcart.FeatureOption31.selectedIndex = 0;}
					if (testWidth > 53) {alert("We cannot make any two panel shutters over 53 inches wide."); document.shopcart.FeatureOption31.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption32.value == 125) //Four Panel Bifold Split
				{
					if (testWidth < 36) {alert("We cannot make any four panel bifold split shutters less than 36 inches wide."); document.shopcart.FeatureOption31.selectedIndex = 0;}
					if (testWidth > 105) {alert("We cannot make any four panel bifold split shutters over 105 inches wide."); document.shopcart.FeatureOption31.selectedIndex = 0;}
				}
			}			
		}
		if (document.shopcart.FeatureOption31.value == 123) //outside designer
		{
			//panel configuration
			if (document.shopcart.FeatureOption32)
			{
				if (document.shopcart.FeatureOption32.value == 113 || document.shopcart.FeatureOption32.value == 114) //single panel
				{
					if (testWidth < 22) {alert("We cannot make any single panel shutters less than 22 inches wide."); document.shopcart.FeatureOption31.selectedIndex = 0;}
					if (testWidth > 28) {alert("We cannot make any single panel shutters over 28 inches wide."); document.shopcart.FeatureOption31.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption32.value == 115) //two panel split
				{
					if (testWidth < 30) {alert("We cannot make any two panel split shutters less than 30 inches wide."); document.shopcart.FeatureOption31.selectedIndex = 0;}
					if (testWidth > 48) {alert("We cannot make any two panel split shutters over 48 inches wide."); document.shopcart.FeatureOption31.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption32.value == 116 || document.shopcart.FeatureOption32.value == 124) //Two Panel Left, Two Panel Right
				{
					if (testWidth < 30) {alert("We cannot make any two panel shutters less than 30 inches wide."); document.shopcart.FeatureOption31.selectedIndex = 0;}
					if (testWidth > 48) {alert("We cannot make any two panel shutters over 48 inches wide."); document.shopcart.FeatureOption31.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption32.value == 125) //Four Panel Bifold Split
				{
					if (testWidth < 44) {alert("We cannot make any four panel bifold split shutters less than 44 inches wide."); document.shopcart.FeatureOption31.selectedIndex = 0;}
					if (testWidth > 95) {alert("We cannot make any four panel bifold split shutters over 95 inches wide."); document.shopcart.FeatureOption31.selectedIndex = 0;}
				}
			}
		} 
		//Frame options based on Mount Type
		if(document.shopcart.mountType)
		{
			if (document.shopcart.pid.value == 279 || document.shopcart.pid.value == 280)
			{
				//inside mount
				if (document.shopcart.mountType[0].checked && document.shopcart.FeatureOption31.value == 123)
				{
					alert("'L Frame Outside Mount' can not be selected with Inside Mount Shutters."); 
					document.shopcart.FeatureOption31.selectedIndex = 0;
				}
				//outside mount
				if (document.shopcart.mountType[1].checked)
				{
					if(document.shopcart.FeatureOption31.value == 110)
					{
						document.shopcart.FeatureOption31.selectedIndex = 0;
						alert("'No Frame = Inside Direct Mount' can not be selected with Outside Mount Shutters."); 
					}
					if(document.shopcart.FeatureOption31.value == 111)
					{
						document.shopcart.FeatureOption31.selectedIndex = 0;
						alert("'Thin Frame Inside Mount' can not be selected with Outside Mount Shutters."); 
					}
					if(document.shopcart.FeatureOption31.value == 112)
					{
						document.shopcart.FeatureOption31.selectedIndex = 0;
						alert("'L Frame Inside Mount' can not be selected with Outside Mount Shutters."); 
					}
				}
			}
		}
	}
	if (document.shopcart.FeatureOption38)
	{
		if (document.shopcart.FeatureOption38.value == 135) 
		{
			if (testHeight >= 62 && testHeight < 72) alert("Due to the height of the shutter you have selected 1 dividing rail is required.");
			if (testHeight >= 72 && testHeight < 90) document.shopcart.FeatureOption38.selectedIndex = 1;
			if (testHeight >= 90 && testHeight < 96) alert("Due to the height of the shutter you have selected 2 dividing rails are required.");
			if (testHeight >= 96) document.shopcart.FeatureOption38.selectedIndex = 2;
		}
		if (document.shopcart.FeatureOption38.value == 136) 
		{
			if (testHeight >= 90 && testHeight < 96) alert("Due to the height of the shutter you have selected 2 dividing rails are required.");
			if (testHeight >= 96) document.shopcart.FeatureOption38.selectedIndex = 2;
		}
	}
	if (document.shopcart.Option36 && document.shopcart.Option37 && document.shopcart.Option38 && document.shopcart.Option39)
	{
		if (document.shopcart.Option36.checked == true)
		{
			document.shopcart.Option37.disabled = true;
			document.shopcart.Option38.disabled = true;
			document.shopcart.Option39.disabled = true;
		}
		else if (document.shopcart.Option37.checked == true)
		{
			document.shopcart.Option36.disabled = true;
			document.shopcart.Option38.disabled = true;
			document.shopcart.Option39.disabled = true;
		}
		else if (document.shopcart.Option38.checked == true)
		{
			document.shopcart.Option36.disabled = true;
			document.shopcart.Option37.disabled = true;
			document.shopcart.Option39.disabled = true;
		}
		else if (document.shopcart.Option39.checked == true)
		{
			document.shopcart.Option36.disabled = true;
			document.shopcart.Option37.disabled = true;
			document.shopcart.Option38.disabled = true;
		}
		else
		{
			document.shopcart.Option36.disabled = false;
			document.shopcart.Option37.disabled = false;
			document.shopcart.Option38.disabled = false;
			document.shopcart.Option39.disabled = false;
		}
	}
	
	// not allow 2 in 1 and 3 in 1 headrail
//	if(document.shopcart.Option8 && document.shopcart.Option6){
//		if(document.shopcart.Option8.checked == true){//3 in 1 headrail
//			document.shopcart.Option6.disabled = true;//2 in 1 headrail
//		}
//		else if(document.shopcart.Option6.checked == true){//2 in 1 headrail
//			document.shopcart.Option8.disabled = true;//3 in 1 headrail
//		}
//		else{//enable both
//			if (document.shopcart.pid.value == 208 || document.shopcart.pid.value == 225)
//			{
//				document.shopcart.Option8.disabled = false;//3 in 1
//				document.shopcart.Option6.disabled = false;//2 in 1 headrail
//			}
//			else if(iMultipleBlinds == 1){
//				document.shopcart.Option8.disabled = false;//3 in 1
//				document.shopcart.Option6.disabled = false;//2 in 1 headrail
//			}
//		}
//	}

	
	if (document.shopcart.pid.value == 220)
	{
	/*
		if (document.shopcart.Option6 && testWidth < 30)
		{
			document.shopcart.Option6.disabled = true;
		}
		if (document.shopcart.Option6 && testWidth >= 30)
		{
			document.shopcart.Option6.disabled = false;
		}
		if (document.shopcart.Option8 && testWidth < 45)
		{
			document.shopcart.Option8.disabled = true;
		}
		if (document.shopcart.Option8 && testWidth >= 45)
		{
			document.shopcart.Option8.disabled = false;
		}
		*/
		if (document.getElementById("rTwoOnOne") && testWidth < 30)
		{
			document.getElementById("rTwoOnOne").disabled = true;
		}
		if (document.getElementById("rTwoOnOne") && testWidth >= 30)
		{
			document.getElementById("rTwoOnOne").disabled = false;
		}
		if (document.getElementById("rThreeOnOne") && testWidth < 45)
		{
			document.getElementById("rThreeOnOne").disabled = true;
		}
		if (document.getElementById("rThreeOnOne") && testWidth >= 45)
		{
			document.getElementById("rThreeOnOne").disabled = false;
		}
		
	}
	
	if (document.shopcart.pid.value == 208)
	{
		if (document.shopcart.Option21 && document.shopcart.Option12)
		{
			if (document.shopcart.Option21.checked == true)
			{
				document.shopcart.Option12.checked = false;
				document.shopcart.Option12.disabled = true;
			}
			else if (document.shopcart.Option12.checked == true)
			{
				document.shopcart.Option21.checked = false;
				document.shopcart.Option21.disabled = true;
			}
			else
			{
				document.shopcart.Option12.disabled = false;
				document.shopcart.Option21.disabled = false;
			}
		}
	}
	if (document.shopcart.pid.value == 137)
	{
		// This is for blackoutline and privacy liner
		if (document.shopcart.Option26 && document.shopcart.Option20)
		{
			if (document.shopcart.Option26.checked == true)
			{
				document.shopcart.Option20.checked = false;
				document.shopcart.Option20.disabled = true;
			}
			else if (document.shopcart.Option20.checked == true)
			{
				document.shopcart.Option26.checked = false;
				document.shopcart.Option26.disabled = true;
			}
			else
			{
				document.shopcart.Option26.disabled = false;
				document.shopcart.Option20.disabled = false;
			}
		}
	}
	//budget pleated shades
	if (document.shopcart.pid.value == 228) 
	{
		if (document.getElementById("rTwoOnOne") && document.shopcart.Option19 && document.shopcart.Option11)
		{
			if (document.getElementById("rTwoOnOne").checked == true)
			{
				document.shopcart.Option19.checked = false;
				document.shopcart.Option19.disabled = true;
				document.shopcart.Option11.checked = false;
				document.shopcart.Option11.disabled = true;
			}
			else if (document.shopcart.Option19.checked == true)
			{
				document.getElementById("rTwoOnOne").checked = false;
				document.getElementById("rTwoOnOne").disabled = true;
				document.shopcart.Option11.checked = false;
				document.shopcart.Option11.disabled = true;
			}
			else if (document.shopcart.Option11.checked == true)
			{
				document.getElementById("rTwoOnOne").checked = false;
				document.getElementById("rTwoOnOne").disabled = true;
				document.shopcart.Option19.checked = false;
				document.shopcart.Option19.disabled = true;
			}
			else
			{
				document.getElementById("rTwoOnOne").disabled = false;
				document.shopcart.Option19.disabled = false;
				document.shopcart.Option11.disabled = false;
			}
		}
		// This is for blackoutline and privacy liner
		if (document.shopcart.Option26 && document.shopcart.Option66)
		{
			if (document.shopcart.Option26.checked == true)
			{
				document.shopcart.Option66.checked = false;
				document.shopcart.Option66.disabled = true;
			}
			else if (document.shopcart.Option66.checked == true)
			{
				document.shopcart.Option26.checked = false;
				document.shopcart.Option26.disabled = true;
			}
			else
			{
				document.shopcart.Option26.disabled = false;
				document.shopcart.Option66.disabled = false;
			}
		}
		if ((testWidth < 12 || testWidth > 72) && document.shopcart.Option19)
		{
			document.shopcart.Option19.checked = false;
			document.shopcart.Option19.disabled = true;
		}
		if ((testWidth < 18 || testWidth > 144) && document.shopcart.Option11)
		{
			document.shopcart.Option11.checked = false;
			document.shopcart.Option11.disabled = true;
		}
		if ((testWidth >= 18 && testWidth <= 144) && document.shopcart.Option11)
		{
			document.shopcart.Option11.disabled = false;
		}
	}	
	
	//comfortex light filtering no-holes pleated shades OR comfortex room darkening no-holes pleated shades
	if (document.shopcart.pid.value == 288 || document.shopcart.pid.value == 289) 
	{
		if (document.getElementById("rTwoOnOne") && document.shopcart.Option19 && document.shopcart.Option11 && document.shopcart.Option16 && document.shopcart.Option67)
		{
			if (document.getElementById("rTwoOnOne") && testWidth > 84)
			{ // Required for all shades over 84" wide and disallows any other options to be selected 
				document.shopcart.Option19.checked = false;
				document.shopcart.Option19.disabled = true;
				document.shopcart.Option11.checked = false;
				document.shopcart.Option11.disabled = true;
				document.shopcart.Option67.checked = false;
				document.shopcart.Option67.disabled = true;
				document.shopcart.Option16.checked = false;
				document.shopcart.Option16.disabled = true;			    
			}
			else if (document.getElementById("rTwoOnOne").checked == true)
			{
				document.shopcart.Option19.checked = false;
				document.shopcart.Option19.disabled = true;
				document.shopcart.Option11.checked = false;
				document.shopcart.Option11.disabled = true;
				document.shopcart.Option67.checked = false;
				document.shopcart.Option67.disabled = true;
				document.shopcart.Option16.checked = false;
				document.shopcart.Option16.disabled = true;
			}
			else if (document.shopcart.Option19.checked == true)
			{
				document.getElementById("rTwoOnOne").checked = false;
				document.getElementById("rTwoOnOne").disabled = true;
				document.shopcart.Option11.checked = false;
				document.shopcart.Option11.disabled = true;
				document.shopcart.Option67.checked = false;
				document.shopcart.Option67.disabled = true;
				document.shopcart.Option16.checked = false;
				document.shopcart.Option16.disabled = true;
			}
			else if (document.shopcart.Option11.checked == true)
			{
				document.getElementById("rTwoOnOne").checked = false;
				document.getElementById("rTwoOnOne").disabled = true;
				document.shopcart.Option19.checked = false;
				document.shopcart.Option19.disabled = true;
				document.shopcart.Option67.checked = false;
				document.shopcart.Option67.disabled = true;
				document.shopcart.Option16.checked = false;
				document.shopcart.Option16.disabled = true;
			}
			else if (document.shopcart.Option67.checked == true)
			{
				document.getElementById("rTwoOnOne").checked = false;
				document.getElementById("rTwoOnOne").disabled = true;
				document.shopcart.Option19.checked = false;
				document.shopcart.Option19.disabled = true;
				document.shopcart.Option11.checked = false;
				document.shopcart.Option11.disabled = true;
				document.shopcart.Option16.checked = false;
				document.shopcart.Option16.disabled = true;
			}
			else if (document.shopcart.Option16.checked == true)
			{
				document.getElementById("rTwoOnOne").checked = false;
				document.getElementById("rTwoOnOne").disabled = true;
				document.shopcart.Option19.checked = false;
				document.shopcart.Option19.disabled = true;
				document.shopcart.Option11.checked = false;
				document.shopcart.Option11.disabled = true;
				document.shopcart.Option67.checked = false;
				document.shopcart.Option67.disabled = true;
			}
			else
			{
				document.getElementById("rTwoOnOne").disabled = false;
				document.shopcart.Option19.disabled = false;
				document.shopcart.Option11.disabled = false;
				document.shopcart.Option16.disabled = false;
				document.shopcart.Option67.disabled = false;
			}
		}
		 
		if ((testWidth < 18 || testWidth > 96) && (document.shopcart.Option11 || document.shopcart.Option16 || document.shopcart.Option19 || document.shopcart.Option67))
		{
			document.shopcart.Option11.checked = false;
			document.shopcart.Option11.disabled = true;
			document.shopcart.Option16.checked = false;
			document.shopcart.Option16.disabled = true;
			document.shopcart.Option19.checked = false;
			document.shopcart.Option19.disabled = true;
			document.shopcart.Option67.checked = false;
			document.shopcart.Option67.disabled = true;
		}
	}
	
	//comfortex pleated shades
	if (document.shopcart.pid.value == 297) 
	{
		if (document.getElementById("rTwoOnOne") && document.shopcart.Option19 && document.shopcart.Option11)
		{
			if (document.getElementById("rTwoOnOne").checked == true)
			{
				document.shopcart.Option19.checked = false;
				document.shopcart.Option19.disabled = true;
				document.shopcart.Option11.checked = false;
				document.shopcart.Option11.disabled = true;
			}
			else if (document.shopcart.Option19.checked == true)
			{
				document.getElementById("rTwoOnOne").checked = false;
				document.getElementById("rTwoOnOne").disabled = true;
				document.shopcart.Option11.checked = false;
				document.shopcart.Option11.disabled = true;
			}
			else if (document.shopcart.Option11.checked == true)
			{
				document.getElementById("rTwoOnOne").checked = false;
				document.getElementById("rTwoOnOne").disabled = true;
				document.shopcart.Option19.checked = false;
				document.shopcart.Option19.disabled = true;
			}
			else
			{
				document.getElementById("rTwoOnOne").disabled = false;
				document.shopcart.Option19.disabled = false;
				document.shopcart.Option11.disabled = false;
			}
		}
		if (document.shopcart.Option11)
		{
			if(testWidth < 22)
			{
				document.shopcart.Option11.checked = false;
				document.shopcart.Option11.disabled = true;
			}
			else
			{
				document.shopcart.Option11.disabled = false;
			}
		}
		if (document.shopcart.Option19)
		{
			if(testWidth > 66)
			{
				document.shopcart.Option19.checked = false;
				document.shopcart.Option19.disabled = true;
			}
			else
			{
				document.shopcart.Option19.disabled = false;
			}
		}
	}
	//shutters - MPD
	if (document.shopcart.pid.value == 279 || document.shopcart.pid.value == 280 || document.shopcart.pid.value == 281) 
	{
		if (document.shopcart.Option37 && document.shopcart.Option37.checked == true)
		{
			if(document.shopcart.Option38){document.shopcart.Option38.checked = false;document.shopcart.Option38.disabled = true;}
			if(document.shopcart.Option39){document.shopcart.Option39.checked = false;document.shopcart.Option39.disabled = true;}
		}
		else if (document.shopcart.Option38 && document.shopcart.Option38.checked == true)
		{
			if(document.shopcart.Option37){document.shopcart.Option37.checked = false;document.shopcart.Option37.disabled = true;}
			if(document.shopcart.Option39){document.shopcart.Option39.checked = false;document.shopcart.Option39.disabled = true;}
		}
		else if (document.shopcart.Option39 && document.shopcart.Option39.checked == true)
		{
			if(document.shopcart.Option37){document.shopcart.Option37.checked = false;document.shopcart.Option37.disabled = true;}
			if(document.shopcart.Option38){document.shopcart.Option38.checked = false;document.shopcart.Option38.disabled = true;}
		}
		else
		{
			if(document.shopcart.Option37){document.shopcart.Option37.disabled = false;}
			if(document.shopcart.Option38){document.shopcart.Option38.disabled = false;}
			if(document.shopcart.Option39){document.shopcart.Option39.disabled = false;}
		}
	}
	
	//select natural wood shades
	if (document.shopcart.pid.value == 61 || document.shopcart.pid.value == 236 || document.shopcart.pid.value == 237)
	{
//		if (document.shopcart.Option6 && document.shopcart.Option10 && document.shopcart.Option19)
		if (document.getElementById("rTwoOnOne") && document.shopcart.Option10 && document.shopcart.Option19)
		{
//			if (document.shopcart.Option6.checked == true)
			if(document.getElementById("rTwoOnOne").checked == true)
			{
				document.shopcart.Option10.checked = false;
				document.shopcart.Option10.disabled = true;
				document.shopcart.Option19.checked = false;
				document.shopcart.Option19.disabled = true;
			}
			else if (document.shopcart.Option10.checked == true)
			{
//				document.shopcart.Option6.checked = false;
//				document.shopcart.Option6.disabled = true;
				document.getElementById("rTwoOnOne").checked = false;
				document.getElementById("rTwoOnOne").disabled = true;
				document.shopcart.Option19.checked = false;
				document.shopcart.Option19.disabled = true;
			}
			else if (document.shopcart.Option19.checked == true)
			{
//				document.shopcart.Option6.checked = false;
//				document.shopcart.Option6.disabled = true;
				document.getElementById("rTwoOnOne").checked = false;
				document.getElementById("rTwoOnOne").disabled = true;
				document.shopcart.Option10.checked = false;
				document.shopcart.Option10.disabled = true;
			}
			else
			{
				document.shopcart.Option19.disabled = false;
				document.shopcart.Option10.disabled = false;
//				document.shopcart.Option6.disabled = false;
				document.getElementById("rTwoOnOne").disabled = false;

			}
		}
	}
	if (document.shopcart.pid.value == 265 )
	{
		if (document.getElementById("rTwoOnOne") && document.shopcart.Option19)
		{
			if(document.getElementById("rTwoOnOne").checked == true)
			{
				document.shopcart.Option19.checked = false;
				document.shopcart.Option19.disabled = true;
			}
			else if (document.shopcart.Option19.checked == true)
			{
				document.getElementById("rTwoOnOne").checked = false;
				document.getElementById("rTwoOnOne").disabled = true;
			}
			else
			{
				document.shopcart.Option19.disabled = false;
				document.getElementById("rTwoOnOne").disabled = false;
			}
		}
	}
	
	//extreme light filtering/extreme blackout shades
	if (document.shopcart.pid.value == 221 || document.shopcart.pid.value == 222)
	{
		//if (document.shopcart.Option6 && document.shopcart.Option12 && document.shopcart.Option16)
		if (document.getElementById("rTwoOnOne") && document.shopcart.Option12 && document.shopcart.Option16)
		{
//			if (document.shopcart.Option6.checked == true)
			if(document.getElementById("rTwoOnOne").checked == true)
			{
				document.shopcart.Option12.checked = false;
				document.shopcart.Option12.disabled = true;
				document.shopcart.Option16.checked = false;
				document.shopcart.Option16.disabled = true;
			}
			else if (document.shopcart.Option12.checked == true)
			{
//				document.shopcart.Option6.checked = false;
//				document.shopcart.Option6.disabled = true;
				document.shopcart.Option16.checked = false;
				document.shopcart.Option16.disabled = true;
			}
			else if (document.shopcart.Option16.checked == true)
			{
//				document.shopcart.Option6.checked = false;
//				document.shopcart.Option6.disabled = true;
				document.shopcart.Option12.checked = false;
				document.shopcart.Option12.disabled = true;
			}
			else
			{
//				document.shopcart.Option6.disabled = false;
				document.shopcart.Option12.disabled = false;
				document.shopcart.Option16.disabled = false;
			}
		}
		
//		if (document.shopcart.Option6 && document.shopcart.Option19 && document.shopcart.Option16)
		if (document.getElementById("rTwoOnOne") && document.shopcart.Option19 && document.shopcart.Option16)
		{
//			if (document.shopcart.Option6.checked == true)
			if(document.getElementById("rTwoOnOne").checked == true)
			{
				document.shopcart.Option19.checked = false;
				document.shopcart.Option19.disabled = true;
				document.shopcart.Option16.checked = false;
				document.shopcart.Option16.disabled = true;
			}
			else if (document.shopcart.Option19.checked == true)
			{
//				document.shopcart.Option6.checked = false;
//				document.shopcart.Option6.disabled = true;
				document.shopcart.Option16.checked = false;
				document.shopcart.Option16.disabled = true;
			}
			else if (document.shopcart.Option16.checked == true)
			{
//				document.shopcart.Option6.checked = false;
//				document.shopcart.Option6.disabled = true;
				document.shopcart.Option19.checked = false;
				document.shopcart.Option19.disabled = true;
			}
			else
			{
//				document.shopcart.Option6.disabled = false;
				document.shopcart.Option19.disabled = false;
				document.shopcart.Option16.disabled = false;
			}
		}
	}
	
	//Bamboo shades top-up bottom down, 2 in one headrail and contiuous cord
//	if(document.shopcart.Option19 && document.shopcart.Option21 && document.shopcart.Option6 && document.shopcart.Option8)
	if(document.shopcart.Option19 && document.shopcart.Option21 && document.getElementById("rTwoOnOne") && document.getElementById("rThreeOnOne")) 
	{
		if(document.shopcart.Option21.checked == true){//cont. cord checked
			document.shopcart.Option19.disabled = true;//Top-up Bottom Down
			document.getElementById("rTwoOnOne").disabled = true;
			document.getElementById("rThreeOnOne").disabled = true;
//			document.shopcart.Option6.disabled = true;//2 in 1 headrail
//			document.shopcart.Option8.disabled = true;//3 in 1 headrail
		}
		else if(document.shopcart.Option19.checked == true){//Top-up Bottom Down
			document.shopcart.Option21.disabled = true;//cont. cord checked
			document.getElementById("rTwoOnOne").disabled = true;
			document.getElementById("rThreeOnOne").disabled = true;
//			document.shopcart.Option6.disabled = true;//2 in 1 headrail
//			document.shopcart.Option8.disabled = true;//3 in 1 headrail
		}
		//2 in 1 headrail
//		else if(document.shopcart.Option6.checked == true){
		else if(document.getElementById("rTwoOnOne").checked == true)
		{
			document.shopcart.Option21.disabled = true;//cont. cord checked
			document.shopcart.Option19.disabled = true;//Top-up Bottom Down
//			document.getElementById("rThreeOnOne").disabled = true;//3 in 1 headrail
//			document.shopcart.Option8.disabled = true;//3 in 1 headrail

		}
		//3 in 1 headrail
//		else if(document.shopcart.Option8.checked == true)
		else if(document.getElementById("rThreeOnOne").checked == true)
		{
			document.shopcart.Option21.disabled = true;//cont. cord checked
			document.shopcart.Option19.disabled = true;//Top-up Bottom Down
//			document.shopcart.Option6.disabled = true;//2 in 1 headrail
		}
		else //enable all
		{
			document.shopcart.Option21.disabled = false;//cont. cord checked
			document.shopcart.Option19.disabled = false;//Top-up Bottom Down
			//allow, but dont require 2 on 1 or 3 on 1 with tropical isle  bamboo over 96"
			if(document.shopcart.pid.value == 137 || document.shopcart.pid.value == 278 || document.shopcart.pid.value == 84)
			{	
				var blindWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
				if(blindWidth > 50)
				{ 
					if(document.getElementById("rThreeOnOne"))
					{
						document.getElementById("rThreeOnOne").disabled = false;
//						document.shopcart.Option8.disabled = false;//3 in 1
					}
					if(document.getElementById("rTwoOnOne"))
					{
						document.getElementById("rTwoOnOne").disabled = false;
//						document.shopcart.Option6.disabled = false;//2 in 1 headrail
					}
				}
				else
				{  
					document.getElementById("rTwoOnOne").disabled = true;
					document.getElementById("rThreeOnOne").disabled = true;
//					document.shopcart.Option6.disabled = true;//2 in 1 headrail
//					document.shopcart.Option8.disabled = true;//3 in 1 headrail
				}
			}
			else if(iMultipleBlinds != 1)
			{
				document.getElementById("rTwoOnOne").disabled = true;
				document.getElementById("rThreeOnOne").disabled = true;
//				document.shopcart.Option6.disabled = true;//2 in 1 headrail
//				document.shopcart.Option8.disabled = true;//3 in 1 headrail
			}
		}
	}	
	//WE donot use this anymore Option18
	//Cell shades top-up bottom down, 2 in one headrail and contiuous cord
	if(document.shopcart.Option18 && document.shopcart.Option11 && document.shopcart.Option6 && document.shopcart.Option16){
		if(document.shopcart.Option11.checked == true){//top-up if cont. checked
			document.shopcart.Option18.disabled = true;//Top-up Bottom Down
			document.shopcart.Option6.disabled = true;//2 in 1 headrail
			document.shopcart.Option16.disabled = true;//Cordless
		}
		else if(document.shopcart.Option18.checked == true){//Top-up Bottom Down
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			document.shopcart.Option6.disabled = true;//2 in 1 headrail
			document.shopcart.Option16.disabled = true;//Cordless
		}
		else if(document.shopcart.Option6.checked == true){//2 in 1 headrail
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			document.shopcart.Option18.disabled = true;//Top-up Bottom Down
			document.shopcart.Option16.disabled = true;//Cordless
		}
		else if(document.shopcart.Option16.checked == true){//Cordless
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			document.shopcart.Option18.disabled = true;//Top-up Bottom Down
			document.shopcart.Option6.disabled = true;//2 in 1 headrail
		}
		else{//enable all
			document.shopcart.Option11.disabled = false;//top-up if cont. checked
			document.shopcart.Option18.disabled = false;//Top-up Bottom Down
			if(iMultipleBlinds != 1 && document.shopcart.WidthInches.value <= 44){
				document.shopcart.Option6.disabled = true;//2 in 1 headrail
			}
			document.shopcart.Option16.disabled = false;//Cordless
		}
	}
	else if(document.shopcart.Option18 && document.shopcart.Option11 && document.shopcart.Option6){
		if(document.shopcart.Option11.checked == true){//top-up if cont. checked
			document.shopcart.Option18.disabled = true;//Top-up Bottom Down
			document.shopcart.Option6.disabled = true;//2 in 1 headrail
		}
		else if(document.shopcart.Option18.checked == true){//Top-up Bottom Down
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			document.shopcart.Option6.disabled = true;//2 in 1 headrail
		}
		else if(document.shopcart.Option6.checked == true){//2 in 1 headrail
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			document.shopcart.Option18.disabled = true;//Top-up Bottom Down
		}
		else{//enable all
			document.shopcart.Option11.disabled = false;//top-up if cont. checked
			document.shopcart.Option18.disabled = false;//Top-up Bottom Down
			//document.shopcart.Option6.disabled = false;//2 in 1 headrail
			if(iMultipleBlinds != 1){
				document.shopcart.Option6.disabled = true;//2 in 1 headrail
			}
		}
	}
	else if(document.shopcart.Option18 && document.shopcart.Option11){
		if(document.shopcart.Option11.checked == true){//top-up if cont. checked
			document.shopcart.Option18.disabled = true;//Top-up Bottom Down
		}
		else if(document.shopcart.Option18.checked == true){//Top-up Bottom Down
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
		}
		else{//enable both
			document.shopcart.Option11.disabled = false;//top-up if cont. checked
			document.shopcart.Option18.disabled = false;//Top-up Bottom Down
		}
	}
	else if(document.shopcart.Option18 && document.shopcart.Option6){
		if(document.shopcart.Option18.checked == true){//Top-up Bottom Down
			document.shopcart.Option6.disabled = true;//2 in 1 headrail
		}
		else if(document.shopcart.Option6.checked == true){//2 in 1 headrail
			document.shopcart.Option18.disabled = true;//Top-up Bottom Down
		}
		else{//enable both
			document.shopcart.Option18.disabled = false;//Top-up Bottom Down
			//document.shopcart.Option6.disabled = false;//2 in 1 headrail
			if(iMultipleBlinds != 1){
				document.shopcart.Option6.disabled = true;//2 in 1 headrail
			}
		}
	}
	//Set all honeycomb's Lift Cord options to have only 1 option
	if(document.shopcart.pid.value == 238 || document.shopcart.pid.value == 69 || document.shopcart.pid.value == 68 || document.shopcart.pid.value == 91 || document.shopcart.pid.value == 67 
	    || document.shopcart.pid.value == 129 || document.shopcart.pid.value == 158 || document.shopcart.pid.value == 207 || document.shopcart.pid.value == 221 || document.shopcart.pid.value == 222 
	    || document.shopcart.pid.value == 175 || document.shopcart.pid.value == 65 || document.shopcart.pid.value == 66 || document.shopcart.pid.value == 64 || document.shopcart.pid.value == 159 
	    || document.shopcart.pid.value == 228 || document.shopcart.pid.value == 267 || document.shopcart.pid.value == 268 || document.shopcart.pid.value == 269
	    || document.shopcart.pid.value == 299 || document.shopcart.pid.value == 300 || document.shopcart.pid.value == 301 || document.shopcart.pid.value == 302
	    || document.shopcart.pid.value == 288 || document.shopcart.pid.value == 289 || document.shopcart.pid.value == 297)
	{
		if(document.shopcart.LiftCord21 && document.shopcart.LiftCord22 && document.getElementById("rTwoOnOne"))
		{
			if(document.getElementById("rTwoOnOne").checked == true)
			{
				document.shopcart.LiftCord21.remove(1);
				if(document.shopcart.LiftCord22.length > 1)
				{
					document.shopcart.LiftCord22.remove(0);
				}
			}
		}
	}	
	var discountPercent = '.25';
	if (document.getElementById('DiscountPer')) discountPercent = document.getElementById('DiscountPer').value;
	//Cell shades top-up bottom down, 2 in one headrail and contiuous cord //Top Down Bottom up is now used as a feature
//	if(document.shopcart.FeatureOption61 && document.shopcart.Option11 && document.shopcart.Option6 && document.shopcart.Option16)

	if ((document.shopcart.pid.value == 197 || document.shopcart.pid.value == 198 || document.shopcart.pid.value == 199 || document.shopcart.pid.value == 200 || document.shopcart.pid.value == 201 || document.shopcart.pid.value == 202 || document.shopcart.pid.value == 203 ||
	     document.shopcart.pid.value == 308 || document.shopcart.pid.value == 313 || document.shopcart.pid.value == 307 || document.shopcart.pid.value == 311 || document.shopcart.pid.value == 309 || document.shopcart.pid.value == 310 || document.shopcart.pid.value == 312) && document.getElementById('Option12') && document.getElementById('OptionPriceDisplay12'))
	{
		//if (testWidth > 24)
		//{
		//	if (discountPercent == '.25') document.getElementById('OptionPriceDisplay12').innerHTML = "$4.99";
		//}
		//if (testWidth <= 24)
		//{
		//	document.getElementById('OptionPriceDisplay12').innerHTML = "$0.00";
		//}
	}
	//  TBBU
	if (document.getElementById('Option68') && document.getElementById('OptionPriceDisplay68'))
	{
	    if (document.shopcart.pid.value == 91)
	    {
		    if (testWidth > 24)
		    {
			    if (discountPercent == '.25') document.getElementById('OptionPriceDisplay68').innerHTML = "<font color='green'>$9.74</font>";
			    else document.getElementById('OptionPriceDisplay68').innerHTML = "<font color='green'>$9.09</font>";
		    }
		    if (testWidth <= 24)
		    {
			    document.getElementById('OptionPriceDisplay68').innerHTML = "<font color='green'>$0.00</font>";
		    }
		    //document.getElementById('OptionPriceDisplay68').innerHTML = "<font color='green'>$0.00</font>";
	    }
        else if (document.shopcart.pid.value == 68)
	    {
	    /*
		    if (testWidth > 24)
		    {
			    if (discountPercent == '.25') document.getElementById('OptionPriceDisplay68').innerHTML = "<font color='green'>$9.74</font>";
			    else document.getElementById('OptionPriceDisplay68').innerHTML = "<font color='green'>$9.09</font>";
		    }
		    if (testWidth <= 24)
		    {
			    document.getElementById('OptionPriceDisplay68').innerHTML = "<font color='green'>$0.00</font>";
		    }
		*/
		    document.getElementById('OptionPriceDisplay68').innerHTML = "<font color='green'>$0.00</font>";		
		}		
        else if (document.shopcart.pid.value == 65 || document.shopcart.pid.value == 67 || document.shopcart.pid.value == 64 || document.shopcart.pid.value == 238 
            || document.shopcart.pid.value == 69 || document.shopcart.pid.value == 129 || document.shopcart.pid.value == 66
            || document.shopcart.pid.value == 267 || document.shopcart.pid.value == 268 || document.shopcart.pid.value == 269
            || document.shopcart.pid.value == 299 || document.shopcart.pid.value == 300 || document.shopcart.pid.value == 301 || document.shopcart.pid.value == 302)
	    {
		    if (testWidth > 24)
		    {
			    if (discountPercent == '.25') document.getElementById('OptionPriceDisplay68').innerHTML = "<font color='green'>$9.74</font>";
			    else document.getElementById('OptionPriceDisplay68').innerHTML = "<font color='green'>$9.09</font>";
		    }
		    if (testWidth <= 24)
		    {
			    document.getElementById('OptionPriceDisplay68').innerHTML = "<font color='green'>$0.00</font>";
		    }		
		    //document.getElementById('OptionPriceDisplay68').innerHTML = "<font color='green'>$0.00</font>";		
		}		
	}
    	
	if ((document.shopcart.pid.value == 221 || document.shopcart.pid.value == 222) && document.getElementById('Option19') && document.getElementById('OptionPriceDisplay19'))
	{
	    // When Free Top Down Bottom Up the price will allways be 0.00
	    document.getElementById('OptionPriceDisplay19').innerHTML = "<font color='green'>$0.00</font>";	    
	    // This is for when there is a cost associated with option pricing.
		/*
		if (testWidth > 24)
		{
			if (discountPercent == '.25') document.getElementById('OptionPriceDisplay19').innerHTML = "<font color='green'>$9.74</font>";
			else document.getElementById('OptionPriceDisplay19').innerHTML = "<font color='green'>$9.09</font>";
		}
		else // if (testWidth <= 24)
		{
			document.getElementById('OptionPriceDisplay19').innerHTML = "<font color='green'>$0.00</font>";
		}
		*/
	}
	// ccl
	if ((document.shopcart.pid.value == 259 || document.shopcart.pid.value == 263 || document.shopcart.pid.value == 264) && document.getElementById('Option65') && document.getElementById('OptionPriceDisplay65'))
	{
	    //document.getElementById('OptionPriceDisplay65').innerHTML = "<font color='green'>0.00%</font>";		
		if ((testWidth >= 36 && testWidth < 42 && testHeight >= 102) || (testWidth >= 42 && testWidth < 48 && testHeight >= 84) || (testWidth >= 48 && testWidth < 54 && testHeight >= 72)
			|| (testWidth >= 54 && testWidth < 60 && testHeight >= 66) || (testWidth >= 60 && testWidth < 66 && testHeight >= 60) || (testWidth >= 66 && testWidth < 72 && testHeight >= 48)
			|| (testWidth >= 72 && testWidth < 78 && testHeight >= 42) || (testWidth >= 78 && testWidth < 84 && testHeight >= 42) || (testWidth >= 84))
		{
			document.getElementById('OptionPriceDisplay65').innerHTML = "<font color='green'>0.00%</font>";
		}
		else
		{
			document.getElementById('OptionPriceDisplay65').innerHTML = "<font color='green'>25.00%</font>";
		}
	}
	if(document.shopcart.Option68 && document.shopcart.Option11 && document.getElementById("rTwoOnOne") && document.shopcart.Option16 && document.shopcart.Option67)
	{ 	
		if(document.shopcart.Option11.checked == true){//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
//			document.shopcart.Option6.disabled = true;//2 in 1 headrail
			document.getElementById("rTwoOnOne").disabled = true; //can't choose 2 on 1
			document.shopcart.Option16.disabled = true;//Cordless
			document.shopcart.Option67.disabled = true;//Cordless TDBU
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').checked = false;
				document.getElementById('Option68').disabled = true;
			}
		}
		else if(document.shopcart.Option68.checked == true){//Top-up Bottom Down
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			//document.shopcart.Option6.disabled = true;//2 in 1 headrail
			document.getElementById("rTwoOnOne").disabled = true; //can't choose 2 on 1
			document.shopcart.Option16.disabled = true;//Cordless
			document.shopcart.Option67.disabled = true;//Cordless TDBU
		}
//		else if(document.shopcart.Option6.checked == true){//2 in 1 headrail
//			document.shopcart.Option11.disabled = true;//top-up if cont. checked
//			document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
//			document.shopcart.FeatureOption61.options[0].text = 'Not Available';
//			document.shopcart.Option16.disabled = true;//Cordless
//		}
		else if(document.getElementById("rTwoOnOne").checked == true){
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
			document.shopcart.Option16.disabled = true;//Cordless
			document.shopcart.Option67.disabled = true;//Cordless TDBU
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').checked = false;
				document.getElementById('Option68').disabled = true;
			}
		}
		else if(document.shopcart.Option16.checked == true){//Cordless
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
//			document.shopcart.Option6.disabled = true;//2 in 1 headrail
			document.getElementById("rTwoOnOne").disabled = true;//2 in 1 headrail
			document.shopcart.Option67.disabled = true;//Cordless TDBU
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').checked = false;
				document.getElementById('Option68').disabled = true;
			}
		}
		else if(document.shopcart.Option67.checked == true){//Cordless TDBU
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
//			document.shopcart.Option6.disabled = true;//2 in 1 headrail
			document.getElementById("rTwoOnOne").disabled = true;//2 in 1 headrail
			document.shopcart.Option16.disabled = true;//Cordless
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').checked = false;
				document.getElementById('Option68').disabled = true;
			}
		}
		else{//enable all
			document.shopcart.Option11.disabled = false;//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = false;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = '--Select--';
			document.getElementById("rTwoOnOne").disabled = false;//2 in 1 headrail
			if(iMultipleBlinds != 1 && document.shopcart.WidthInches.value <= 44){
//				document.shopcart.Option6.disabled = true;//2 in 1 headrail
				document.getElementById("rTwoOnOne").disabled = true;//2 in 1 headrail
			}
			document.shopcart.Option16.disabled = false;//Cordless
			document.shopcart.Option67.disabled = false;//Cordless TDBU
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').disabled = false;
			}
		}
	}
	
	else if(document.shopcart.Option68 && document.shopcart.Option11 && document.getElementById("rTwoOnOne") && document.shopcart.Option16)
	{ 	
		if(document.shopcart.Option11.checked == true){//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
			document.getElementById("rTwoOnOne").disabled = true; //can't choose 2 on 1
			document.shopcart.Option16.disabled = true;//Cordless
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').checked = false;
				document.getElementById('Option68').disabled = true;
			}
		}
		else if(document.shopcart.Option68.checked == true){//Top-up Bottom Down
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			document.getElementById("rTwoOnOne").disabled = true; //can't choose 2 on 1
			document.shopcart.Option16.disabled = true;//Cordless
		}
		else if(document.getElementById("rTwoOnOne").checked == true){
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
			document.shopcart.Option16.disabled = true;//Cordless
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').checked = false;
				document.getElementById('Option68').disabled = true;
			}
		}
		else if(document.shopcart.Option16.checked == true){//Cordless
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
			document.getElementById("rTwoOnOne").disabled = true;//2 in 1 headrail
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').checked = false;
				document.getElementById('Option68').disabled = true;
			}
		}
		else{//enable all
			document.shopcart.Option11.disabled = false;//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = false;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = '--Select--';
			document.getElementById("rTwoOnOne").disabled = false;//2 in 1 headrail
			if(iMultipleBlinds != 1 && document.shopcart.WidthInches.value <= 44){
				document.getElementById("rTwoOnOne").disabled = true;//2 in 1 headrail
			}
			document.shopcart.Option16.disabled = false;//Cordless
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').disabled = false;
			}
		}
	}

	else if(document.shopcart.Option68 && document.shopcart.Option11 && document.getElementById("rTwoOnOne"))
	{
		if(document.shopcart.Option11.checked == true){//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
			document.getElementById("rTwoOnOne").disabled = true; //can't choose 2 on 1
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').checked = false;
				document.getElementById('Option68').disabled = true;
			}
		}
		else if(document.shopcart.Option68.checked == true){//Top-up Bottom Down
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			document.getElementById("rTwoOnOne").disabled = true; //can't choose 2 on 1
		}
		else if(document.getElementById("rTwoOnOne").checked == true){
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').checked = false;
				document.getElementById('Option68').disabled = true;
			}
		}
		else{//enable all
			document.shopcart.Option11.disabled = false;//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = false;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = '--Select--';
			document.getElementById("rTwoOnOne").disabled = false;//2 in 1 headrail
			if(iMultipleBlinds != 1 && document.shopcart.WidthInches.value <= 44){
				document.getElementById("rTwoOnOne").disabled = true;//2 in 1 headrail
			}
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').disabled = false;
			}
		}
	}
//	else if(document.shopcart.FeatureOption61 && document.shopcart.Option11 && document.shopcart.Option6)
	else if(document.shopcart.Option68 && document.shopcart.Option11 && document.getElementById("rTwoOnOne")&& document.shopcart.Option67)
	{
	
		if(document.shopcart.Option11.checked == true){//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
//			document.shopcart.Option6.disabled = true;//2 in 1 headrail
			document.getElementById("rTwoOnOne").disabled = true;//2 in 1 headrail
			document.shopcart.Option67.disabled = true;//Cordless TDBU
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').checked = false;
				document.getElementById('Option68').disabled = true;
			}
		}
		else if(document.shopcart.Option68.checked == true){//Top-up Bottom Down
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
//			document.shopcart.Option6.disabled = true;//2 in 1 headrail
			document.getElementById("rTwoOnOne").disabled = true;//2 in 1 headrail
			document.shopcart.Option67.disabled = true;//Cordless TDBU
		}
//		else if(document.shopcart.Option6.checked == true){//2 in 1 headrail
//			document.shopcart.Option11.disabled = true;//top-up if cont. checked
//			document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
//			document.shopcart.FeatureOption61.options[0].text = 'Not Available';
//		}
		else if(document.getElementById("rTwoOnOne").checked == true){//2 in 1 headrail
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
			document.shopcart.Option67.disabled = true;//Cordless TDBU
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').checked = false;
				document.getElementById('Option68').disabled = true;
			}
		}
		else if(document.shopcart.Option67.checked == true){//Cordless TDBU
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
//			document.shopcart.Option6.disabled = true;//2 in 1 headrail
			document.getElementById("rTwoOnOne").disabled = true;//2 in 1 headrail
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').checked = false;
				document.getElementById('Option68').disabled = true;
			}
		}
		else{//enable all
			document.shopcart.Option11.disabled = false;//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = false;//Top-up Bottom Down
			document.shopcart.Option67.disabled = false;//Cordless TDBU
			//document.shopcart.FeatureOption61.options[0].text = '--Select--';
			//document.shopcart.Option6.disabled = false;//2 in 1 headrail
			document.getElementById("rTwoOnOne").disabled = false;//2 in 1 headrail
			if(iMultipleBlinds != 1){
//				document.shopcart.Option6.disabled = true;//2 in 1 headrail
				document.getElementById("rTwoOnOne").disabled = true;//2 in 1 headrail
			}
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').disabled = false;
			}
		}
	}
	else if(document.shopcart.Option68 && document.shopcart.Option11){
		if(document.shopcart.Option11.checked == true){//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').checked = false;
				document.getElementById('Option68').disabled = true;
			}
		}
		else if(document.shopcart.Option68.checked == true){//Top-up Bottom Down
			document.shopcart.Option11.disabled = true;//top-up if cont. checked
		}
		else{//enable both
			document.shopcart.Option11.disabled = false;//top-up if cont. checked
			//document.shopcart.FeatureOption61.disabled = false;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = '--Select--';
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').disabled = false;
			}
		}
	}
//	else if(document.shopcart.FeatureOption61 && document.shopcart.Option6)
	else if(document.shopcart.Option68 && document.getElementById("rTwoOnOne"))
	{
		if(document.shopcart.Option68.checked == true)
		{//Top-up Bottom Down
//			document.shopcart.Option6.disabled = true;//2 in 1 headrail
			document.getElementById("rTwoOnOne").disabled = true;
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').disabled = false;
				document.getElementById('Option68').checked = true;
			}
		}
//		else if(document.shopcart.Option6.checked == true)
		else if(ddocument.getElementById("rTwoOnOne").checked == true)
		{//2 in 1 headrail
			//document.shopcart.FeatureOption61.disabled = true;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = 'Not Available';
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').checked = false;
				document.getElementById('Option68').disabled = true;
			}
		}
		else
		{//enable both
			//document.shopcart.FeatureOption61.disabled = false;//Top-up Bottom Down
			//document.shopcart.FeatureOption61.options[0].text = '--Select--';
			//document.shopcart.Option6.disabled = false;//2 in 1 headrail
			document.getElementById("rTwoOnOne").disabled = false;
			if(iMultipleBlinds != 1)
			{
//				document.shopcart.Option6.disabled = true;//2 in 1 headrail
				document.getElementById("rTwoOnOne").disabled = true; //can't choose 2 on 1

			}
			if (document.getElementById('Option68')) 
			{
				document.getElementById('Option68').disabled = false;
			}
		}
	}
	
	// not allow routless and remote control
	DisableRoutless(0);
	if(document.shopcart.FeatureOption18 && document.shopcart.FeatureOption7){//Vertical blinds. opposite stack with wand
		if(document.shopcart.FeatureOption18.value == 45 && document.shopcart.FeatureOption7.value == 16){
			alert("The wand option is not available on opposite stack blinds! Tilter control will be set to chain and cord.");
			document.shopcart.FeatureOption18.value = 44;
		}
	}
	if(document.shopcart.FeatureOption13 && document.shopcart.TapeColorID){//Roller - Decoractive Trim and Deco Bar
		if(document.shopcart.FeatureOption13.value == 35 && document.shopcart.TapeColorID.value != 0){
			alert("Decorative trims are not available with the deco bar hem style! Bottom hem style will be set to plain hem.");
			document.shopcart.FeatureOption13.value = 34;
		}
	}	
}

function SetPreviewColor(ID,ColorType){
	var eleTapeColorImage = document.getElementById("TapeColor");
	var eleColorImage = document.getElementById("BlindColor");
	var eleColorImage3 = document.getElementById("BlindColor3");
	var ColorID = 0;// = document.shopcart.ColorID.value;
	var TapeColorID = 0;
	
	//set javascript check
	document.shopcart.jsBrowserCheck.value = "1";
	
	/*if(document.shopcart.TapeColorID){
		TapeColorID = document.shopcart.TapeColorID.value;
	}*/
	if(ColorType == 1){//blinds
		ColorID = ID;
		document.shopcart.ColorID.value = ID;
		if(document.shopcart.TapeColorID) TapeColorID = document.shopcart.TapeColorID.value;
	}
	else{//tapes
		ColorID = document.shopcart.ColorID.value;
		if(document.shopcart.TapeColorID){
			TapeColorID = ID;
			document.shopcart.TapeColorID.value = ID;
		}
	}
	if(ColorID == 0){//No color selected, Set all color to nothing
		//Set blind sections to empty
		eleColorImage.src = "images/spacer.gif";
		if(eleColorImage3){	eleColorImage3.src = "images/spacer.gif";}
		
		//Set tape color
		if(eleTapeColorImage){
			if(TapeColorID == 0){//No tape selected
				eleTapeColorImage.src = "images/spacer.gif";
			}
			else{//Show tape color
				eleTapeColorImage.src = "images/tapes/tape_" + TapeColorID + ".jpg";
			}
		}
	}
	else{//Color Selected
		//Set color on blind sections
		eleColorImage.src = "images/blinds/enlarge/blindcolor_" + ColorID + ".jpg";
		//if(eleColorImage3){eleColorImage3.src = "images/blinds/blindcolor_" + ColorID + "_3.jpg";}
		if(eleColorImage3){eleColorImage3.src = "images/blinds/enlarge/blindcolor_" + ColorID + ".jpg";}
		if(eleTapeColorImage){
			if(TapeColorID == 0){//No tape selected
				if(eleColorImage3){
					//eleTapeColorImage.src = "images/blinds/blindcolor_" + ColorID + "_2.jpg";
					eleTapeColorImage.src = "images/blinds/enlarge/blindcolor_" + ColorID + ".jpg";
				}
				else{//old products
					eleTapeColorImage.src = "images/spacer.gif";
				}
			}
			else{//Set to tape color
				eleTapeColorImage.src = "images/tapes/tape_" + TapeColorID + ".jpg";
			}
		}
	}
}

function HeadrailOptionChange()
{
	if(document.getElementById("rStandard"))
	{
		if(document.getElementById("rStandard").checked)
		{
			document.all.divSt.style.display = 'block';
			if(document.getElementById("rTwoOnOne"))document.all.divTwoOnOne.style.display = 'none';
			if(document.getElementById("rThreeOnOne")) document.all.divThreeOnOne.style.display = 'none';
		}
	}
	
	if(document.getElementById("rTwoOnOne"))
	{
		if(document.getElementById("rTwoOnOne").checked)
		{
			document.all.divSt.style.display = 'none';
			document.all.divTwoOnOne.style.display = 'block';
			if(document.getElementById("rThreeOnOne")) document.all.divThreeOnOne.style.display = 'none';
		}
	}
	if(document.getElementById("rThreeOnOne"))
	{
		if(document.getElementById("rThreeOnOne").checked)
		{
			document.all.divSt.style.display = 'none';
			document.all.divTwoOnOne.style.display = 'none';
			document.all.divThreeOnOne.style.display = 'block';
		}
	}
	
}

function SetHeadrailImage(ImgToChange, HeadRailOptions,root)
{
	if(document.getElementById("rTwoOnOne")|| document.getElementById("rThreeOnOne"))
	{
		var eleControl = "";
		var eleTilt = "";
		var eleLift = "";		
		var selectedImg = "0";
		/*
		if(document.getElementById("rStandard"))
		{	
			if(HeadRailOptions == 1)
			{   eleControl = document.getElementById("stc");
			    eleTilt = document.getElementById("stl");
				eleLift = document.getElementById("slc");		
				var eleStandardHeadrailImg = document.getElementById("StandardHeadrailImg");
				selectedImg = eleControl.value + eleTilt.value +eleLift.value;
				eleStandardHeadrailImg.src =  root + "images/headrails/" + selectedImg + ".jpg";
				
			}
		}
		*/
		if(document.getElementById("rTwoOnOne"))
		{;
			if(HeadRailOptions == 2 && document.getElementById("2HeadrailImg1"))
			{	
				var ele2HeadrailImg1 = document.getElementById("2HeadrailImg1");
				var ele2HeadrailImg2 = document.getElementById("2HeadrailImg2");
			
				if(ImgToChange = 1)
				{
					if(document.getElementById("2tc1")) 
						eleControl = document.getElementById("2tc1");
					else 
					{
						eleControl = "c";
					} 
					if (document.getElementById("2tl1")) eleTilt = document.getElementById("2tl1");
					if (document.getElementById("2lc1")) eleLift = document.getElementById("2lc1");
					
					
					if(document.getElementById("2tc1") && document.getElementById("2tl1") && document.getElementById("2lc1"))
					{	
						selectedImg = eleControl.value + eleTilt.value + eleLift.value;
					}
					else if(document.getElementById("2tl1") && document.getElementById("2lc1"))
					{
						selectedImg = eleControl + eleTilt.value + eleLift.value;
					}
					else
					{
						selectedImg = eleControl  + eleLift.value;
					}	
					ele2HeadrailImg1.src =  root + "images/headrails/1" + selectedImg + ".jpg";
				}
				if(ImgToChange = 2)
				{
					if(document.getElementById("2tc1"))
						eleControl = document.getElementById("2tc1");
					else 
					{
						eleControl = "c";
					}
					
					if(document.getElementById("2tl2")) eleTilt = document.getElementById("2tl2");
					if(document.getElementById("2lc2")) eleLift = document.getElementById("2lc2");
					
					if(document.getElementById("2tc1") && document.getElementById("2tl2") && document.getElementById("2lc2"))
					{	
						selectedImg = eleControl.value + eleTilt.value +eleLift.value;
					}
					else if(document.getElementById("2tl1") && document.getElementById("2lc1"))
					{
						selectedImg = eleControl + eleTilt.value + eleLift.value;
					}
					else
					{
						selectedImg = eleControl  + eleLift.value;
					}	
					ele2HeadrailImg2.src =  root + "images/headrails/2on1/2" + selectedImg + ".jpg";
				}
			}	
		}	
		if(document.getElementById("rThreeOnOne"))
		{
		
			if(HeadRailOptions == 3 && document.getElementById("3HeadrailImg1"))
			{	
				var ele3HeadrailImg1 = document.getElementById("3HeadrailImg1");
				var ele3HeadrailImg2 = document.getElementById("3HeadrailImg2");
				var ele3HeadrailImg3 = document.getElementById("3HeadrailImg3");
				
				if(ImgToChange = 1)
				{
					if(document.getElementById("3tc1")) 
						eleControl = document.getElementById("3tc1");
					else 
					{
						eleControl = "c";
					} 
					if(document.getElementById("3tl1")) eleTilt = document.getElementById("3tl1");
					if (document.getElementById("3lc1")) eleLift = document.getElementById("3lc1");
					
					if(document.getElementById("3tc1") && document.getElementById("3tl1") && document.getElementById("3lc1"))
					{	
						selectedImg = eleControl.value + eleTilt.value +eleLift.value;
					}
					else if(document.getElementById("3tl1") && document.getElementById("3lc1"))
					{
						selectedImg = eleControl + eleTilt.value + eleLift.value;
					}
					else
					{
						selectedImg = eleControl  + eleLift.value;
					}	
					ele3HeadrailImg1.src =  root + "images/headrails/1" + selectedImg + ".jpg";
				}
				if(ImgToChange = 2)
				{
					if(document.getElementById("3tc1")) 
						eleControl = document.getElementById("3tc1");
					else 
					{
						eleControl = "c";
					} 
					if(document.getElementById("3tl2")) eleTilt = document.getElementById("3tl2");
					if (document.getElementById("3lc2")) eleLift = document.getElementById("3lc2");
					if(document.getElementById("3tc1") && document.getElementById("3tl2") && document.getElementById("3lc2"))
					{	
						selectedImg = eleControl.value + eleTilt.value +eleLift.value;
					}
					else if(document.getElementById("3tl2") && document.getElementById("3lc2"))
					{
						selectedImg = eleControl + eleTilt.value + eleLift.value;
					}
					else
					{
						selectedImg = eleControl  + eleLift.value;
					}	
					ele3HeadrailImg2.src =  root + "images/headrails/3on1/2" + selectedImg + ".jpg";
				}
				if(ImgToChange = 3)
				{
					if(document.getElementById("3tc1")) 
						eleControl = document.getElementById("3tc1");
					else 
					{
						eleControl = "c";
					} 
					if(document.getElementById("3tl3")) eleTilt = document.getElementById("3tl3");
					eleLift = document.getElementById("3lc3");
					if(document.getElementById("3tc1") && document.getElementById("3tl3") && document.getElementById("3lc3"))
					{	
						selectedImg = eleControl.value + eleTilt.value +eleLift.value;
					}
					else if(document.getElementById("3tl3") && document.getElementById("3lc3"))
					{
						selectedImg = eleControl + eleTilt.value + eleLift.value;
					}
					else
					{
						selectedImg = eleControl  + eleLift.value;
					}	
					ele3HeadrailImg3.src =  root + "images/headrails/3on1/3" + selectedImg + ".jpg";
				}	
			}
		}
	}
	if(document.shopcart.FeatureOption7){//Draw Type(vertical)
		if (document.getElementById('stc'))
		{
			if ((document.shopcart.FeatureOption7.value == 14 || document.shopcart.FeatureOption7.value == 15 || document.shopcart.FeatureOption7.value == 16) && document.getElementById('stc').value == 7)
			{
				alert('Vertical Blinds cannot be made with a "Wand Tilter" and "Split Draw", "Opp. Stack" or "Center Stack"! Tilter will change to "Cord and Chain"');
				document.getElementById('stc').value = 6;
			}
		}
	}
}

function SetPreviewColor2(ID,ColorType,root){
	var eleTapeColorImage = document.getElementById("TapeColor");
	var eleColorImage = document.getElementById("BlindColor");
	var eleColorImage3 = document.getElementById("BlindColor3");
	var ColorID = 0;// = document.shopcart.ColorID.value;
	var TapeColorID = 0;
	
	//set javascript check
	document.shopcart.jsBrowserCheck.value = "1";
	
	/*if(document.shopcart.TapeColorID){
		TapeColorID = document.shopcart.TapeColorID.value;
	}*/
	if(ColorType == 1){//blinds
		ColorID = ID;
		document.shopcart.ColorID.value = ID;
		if(document.shopcart.TapeColorID) TapeColorID = document.shopcart.TapeColorID.value;
	}
	else{//tapes
		ColorID = document.shopcart.ColorID.value;
		if(document.shopcart.TapeColorID){
			TapeColorID = ID;
			document.shopcart.TapeColorID.value = ID;
		}
	}
	if(ColorID == 0){//No color selected, Set all color to nothing
		//Set blind sections to empty
		eleColorImage.src = root + "images/spacer.gif";
		if(eleColorImage3){	eleColorImage3.src = root + "images/spacer.gif";}
		
		//Set tape color
		if(eleTapeColorImage){
			if(TapeColorID == 0){//No tape selected
				eleTapeColorImage.src = root + "images/spacer.gif";
			}
			else{//Show tape color
				eleTapeColorImage.src = root + "images/tapes/tape_" + TapeColorID + ".jpg";
			}
		}
	}
	else{//Color Selected
		//Set color on blind sections
		eleColorImage.src = root + "images/blinds/enlarge/blindcolor_" + ColorID + ".jpg";
		//if(eleColorImage3){eleColorImage3.src = "images/blinds/blindcolor_" + ColorID + "_3.jpg";}
		if(eleColorImage3){eleColorImage3.src = root + "images/blinds/enlarge/blindcolor_" + ColorID + ".jpg";}
		if(eleTapeColorImage){
			if(TapeColorID == 0){//No tape selected
				if(eleColorImage3){
					//eleTapeColorImage.src = "images/blinds/blindcolor_" + ColorID + "_2.jpg";
					eleTapeColorImage.src = root + "images/blinds/enlarge/blindcolor_" + ColorID + ".jpg";
				}
				else{//old products
					eleTapeColorImage.src = root + "images/spacer.gif";
				}
			}
			else{//Set to tape color
				eleTapeColorImage.src = root + "images/tapes/tape_" + TapeColorID + ".jpg";
			}
		}
	}
}

function validatePayment(frmEle){

	if(frmEle.PaymentType[0].checked){//CreditCard
		if(frmEle.PaymentID.value == "0"){
			alert("Please select a credit card type.");
			frmEle.PaymentID.focus();
			return false;
		}
		if(frmEle.CardNumber.value == ""){
			alert("Please enter a credit card number.");
			frmEle.CardNumber.focus();
			return false;
		}
		// Credit Card Number Validation: AMEX, VISA, MasterCard 
		var type = "MasterCard"; 
		if(frmEle.PaymentID.value == "1") type="MasterCard";
		if(frmEle.PaymentID.value == "2") type="Visa";
		if(frmEle.PaymentID.value == "3") type="Discover";
		if(frmEle.PaymentID.value == "4") type="American Express";
		var num = frmEle.CardNumber.value;
		var dig1 = num.charAt(0); 
		/*var dig2 = num.charAt(1); 
		var dig3 = num.charAt(2); 
		var dig4 = num.charAt(3); 
		var dig5 = num.charAt(4); 
		var dig6 = num.charAt(5); 
		var dig7 = num.charAt(6); 
		var dig8 = num.charAt(7); 
		var dig9 = num.charAt(8); 
		var dig10 = num.charAt(9); 
		var dig11 = num.charAt(10); 
		var dig12 = num.charAt(11); 
		var dig13 = num.charAt(12); 
		var dig14 = num.charAt(13); 
		var dig15 = num.charAt(14); 
		var dig16 = num.charAt(15); */

		if(type == "American Express"){  
			if ((dig1 != "3") || (num.length != 15)) {
				alert('Invalid credit card number! Please ensure you are using an American Express card or change the Type of Card.');
				frmEle.PaymentID.focus();
				return false; 
			}  
		}
		if(type == "Visa") {  
			if ((dig1 != "4") || (num.length != 16))  {
				alert('Invalid credit card number! Please ensure you are using a Visa or change the Type of Card.');  
				frmEle.PaymentID.focus();
				return false; 
			}
		}
		if(type == "MasterCard") {  
			if ((dig1 != 5) || (num.length != 16)) {
				alert('Invalid credit card number! Please ensure you are using a Mastercard or change the Type of Card.'); 
				frmEle.PaymentID.focus();
				return false; 
			}  
		}
		if(frmEle.cvv2.value.length < 3){
			
			alert("Please enter the CVV2 number on the credit card.");
			frmEle.cvv2.focus();
			return false;
		}
		if(frmEle.Name.value == ""){
			alert("Please enter the name on the credit card.");
			frmEle.Name.focus();
			return false;
		}
		if(frmEle.Zip.value == ""){
			alert("Please enter your zip code.");
			frmEle.Zip.focus();
			return false;
		}
	}
	if(frmEle.PaymentType[1].checked){//Bill Me Later
	}
	if(frmEle.PaymentType[2].checked){//Alternative methods
		/*if(frmEle.Alternative[0].checked == false && frmEle.Alternative[1].checked == false){
			alert("Please select EITHER Cashier Check/Money Order or Call for Credit Card if you selected Alternative Payment Method!");
			//frmEle.frmEle.Alternative[0].focus();
			return false;
		}*/
		if(frmEle.Alternative.checked == false){
			alert("Please select Call for Credit Card if you selected Alternative Payment Method!");
			//frmEle.frmEle.Alternative[0].focus();
			return false;
		}
	}
	
	if(frmEle.measure_disclaimer.checked == false){
		alert("Please read the Measuring Instructions and Color Disclaimer and agree to the terms!");
		frmEle.measure_disclaimer.focus();
		return false;
	}
	//if(frmEle.color_disclaimer.checked == false){
	//	alert("Please read the color disclaimer agree to the terms! If you are worried about the color we suggest that you order a sample from our sample page.");
	//	frmEle.color_disclaimer.focus();
	//	return false;
	//}
	MM_showHideLayers('PaymentDiv','','show');
}

function validateBMLPayment(frmEle){
	if(frmEle.bdmonth.value == "" || frmEle.bdday.value == "" || frmEle.bdyear.value == ""){
		alert("Please enter your birthdate.");
		frmEle.bdmonth.focus();
		return false;
	}
	//check that applicant is 18 or older
	var dTodaysDate = new Date();
	var dTestDate = new Date((eval(frmEle.bdyear.value) + 18),
                            (eval(frmEle.bdmonth.value) - 1),
                            frmEle.bdday.value);
    if(dTodaysDate < dTestDate){
		alert("The date of birth you entered indicated is less than 18 years of age. Please correct the date of birth or choose another form of payment!");
		return false;
    }
	if(frmEle.ssn.value == "" || frmEle.ssn.value.length < 4){
		alert("Please enter the last 4 digits of your Social Security Number.");
		frmEle.ssn.focus();
		return false;
	}
	if(frmEle.consent.checked == false){
		alert('You forgot to check the e-sign consent box.  To continue with your order please check the box and click the "I Agree and Complete Order" button.  By checking the box you are agreeing to electronic presentment of the Bill Me Later(R) Terms and Conditions.');
		frmEle.consent.focus();
		return false;
	}
	MM_showHideLayers('PaymentDiv','','show');
}

function validatePaymentMethod(clicked){
	frmEle = document.shopcart;
	//REMOVE OPTIONS SELECTED	
	//if bill me later or credit card, remove alternative methods
	if((frmEle.PaymentType[0].checked || frmEle.PaymentType[1].checked) && clicked != 'alternative'){
		//frmEle.Alternative.checked = false;
		//frmEle.Alternative[0].checked = false;
		//frmEle.Alternative[1].checked = false;
	}
	//if an alternative method selected, check alternative payment type
	//if(frmEle.Alternative[0].checked || frmEle.Alternative[1].checked){
	//if(frmEle.Alternative.checked){
	//	frmEle.PaymentType[2].checked = true;
	//}
	
	//ENABLE-DISABLE OPTIONS
	if(frmEle.PaymentType[0].checked)
	{//credit card
		frmEle.PaymentID.disabled = false;
		frmEle.CardNumber.disabled = false;
		frmEle.expMonth.disabled = false;
		frmEle.expYear.disabled = false;
		frmEle.Name.disabled = false;
		frmEle.Address.disabled = false;
		frmEle.City.disabled = false;
		frmEle.State.disabled = false;
		frmEle.Zip.disabled = false;
		
		if(frmEle.c90days)frmEle.c90days.disabled = true;
		
//		frmEle.Alternative.checked = false;
		//frmEle.Alternative[0].disabled = true;
		//frmEle.Alternative[1].disabled = true;
	}
	else if(frmEle.PaymentType[1].checked)
	{//BML
		frmEle.PaymentID.disabled = true;
		frmEle.CardNumber.disabled = true;
		frmEle.expMonth.disabled = true;
		frmEle.expYear.disabled = true;
		frmEle.Name.disabled = true;
		frmEle.Address.disabled = true;
		frmEle.City.disabled = true;
		frmEle.State.disabled = true;
		frmEle.Zip.disabled = true;
		
		if(frmEle.c90days)frmEle.c90days.disabled = false;
		
//		frmEle.Alternative.checked = false;
		//frmEle.Alternative[0].disabled = true;
		//frmEle.Alternative[1].disabled = true;
	}
	else
	{//Alternative
		frmEle.PaymentID.disabled = true;
		frmEle.CardNumber.disabled = true;
		frmEle.expMonth.disabled = true;
		frmEle.expYear.disabled = true;
		frmEle.Name.disabled = true;
		frmEle.Address.disabled = true;
		frmEle.City.disabled = true;
		frmEle.State.disabled = true;
		frmEle.Zip.disabled = true;
		
		if(frmEle.c90days)frmEle.c90days.disabled = true;
		
//		frmEle.Alternative.disabled = false;
//		frmEle.Alternative.checked = true;
		//frmEle.Alternative[0].disabled = false;
		//frmEle.Alternative[1].disabled = false;
	}
}
function setPayment(theType){

}
var answerFunction;
function myConfirm(text,button1,button2,answerFunc) {
	var box = document.getElementById("confirmBox");
	box.getElementsByTagName("p")[0].firstChild.nodeValue = text;
	var button = box.getElementsByTagName("input");
	button[0].value=button1;
	button[1].value=button2;
	answerFunction = answerFunc;
	box.style.visibility="visible";
}
function answer(response) {
	document.getElementById("confirmBox").style.visibility="hidden";
	answerFunction(response);
}

//Sample Scripts
function validateSamples(frmEle,useDhtml,submit){
	var count = 0;var BambooCount = 0;
	var sSelSamples = "";var SampleValue = "";
	var ItemID = 0;var sLastSampleProName = "";var sSelSampleProName = "";
	
	var sSelectedSamples = frmEle.Sample.value;
	var sCheckedValues = "";
	
	if(frmEle.SampleCheckbox){
		//add each item to the form value and display the selected results
		if(frmEle.SampleCheckbox.length){
			for(i=frmEle.SampleCheckbox.length-1;i>=0;i--){//loop each checked item
				
				if(frmEle.SampleCheckbox[i].checked){
					//Update Number of selected samples
					count++;
					ItemID = frmEle.SampleCheckbox[i].value;
					if(sCheckedValues != "") sCheckedValues += ",";
					sCheckedValues += ItemID;
					if(useDhtml == 1){//Setup inner html for list of selected samples
						sSelSampleProName = eval("document.samplesForm.spn" + ItemID + ".value");
						if(sLastSampleProName != sSelSampleProName) sSelSamples += "<br><b>" + sSelSampleProName + "</b><br>";
						sSelSamples += "<li style='padding-left:10;'>" + eval("document.samplesForm.scn" + ItemID + ".value") + "</li>"
						sLastSampleProName = sSelSampleProName;
					}
					var aItemID = ItemID.split("_");
					//alert(aItemID[1]);
					if (aItemID.length > 0){
						if (aItemID[1] == "60" || aItemID[1] == "62" || aItemID[1] == "83" || aItemID[1] == "84" || aItemID[1] == "61" || aItemID[1] == "137" || aItemID[1] == "208")
							BambooCount++;
					}
					if(frmEle.Sample.value != ""){//setup form values for selected items
						var aSelectedItems = frmEle.Sample.value.split(",");
						var bFound = false;
						for(j=aSelectedItems.length-1;j>=0;j--){//loop each item in the form
							var aSelectedItemID = aSelectedItems[j].split("_");
							//alert(aSelectedItems[j] + "!=" + ItemID);
							if(aSelectedItems[j] == ItemID)
								bFound = true;
						}
						if(bFound == false)
							frmEle.Sample.value += "," + ItemID;
					}
					else{
						frmEle.Sample.value = ItemID;
					}
				}
			}
		}
		else{//only one
			if(frmEle.SampleCheckbox.checked){
				//Update Number of selected samples
				count++
				ItemID = frmEle.SampleCheckbox.value;
				if(sCheckedValues != "") sCheckedValues += ",";
				sCheckedValues += ItemID;
				if(useDhtml == 1){//Setup inner html for list of selected samples
					sSelSampleProName = eval("document.samplesForm.spn" + ItemID + ".value");
					if(sLastSampleProName != sSelSampleProName) sSelSamples += "<br><b>" + sSelSampleProName + "</b><br>";
					sSelSamples += "<li style='padding-left:10;'>" + eval("document.samplesForm.scn" + ItemID + ".value") + "</li>"
					sLastSampleProName = sSelSampleProName;
				}				
				//alert(ItemID);
				var aItemID = ItemID.split("_");
				//alert(aItemID[1]);
				if (aItemID.length > 0){
					if (aItemID[1] == "60" || aItemID[1] == "62" || aItemID[1] == "83" || aItemID[1] == "84" || aItemID[1] == "153" || aItemID[1] == "137" || aItemID[1] == "61")
						BambooCount++;
				}
				if(frmEle.Sample.value != ""){//setup form values for selected items
					var aSelectedItems = frmEle.Sample.value.split(",");
					var bFound = false;
					for(j=aSelectedItems.length-1;j>=0;j--){//loop each item in the form
						var aSelectedItemID = aSelectedItems[j].split("_");
						//alert(aSelectedItems[j] + "!=" + ItemID);
						if(aSelectedItems[j] == ItemID)
							bFound = true;
					}
					var FormSampleValue = frmEle.Sample.value;
					if(FormSampleValue.indexOf(ItemID) > 0) bFound == true;
					if(bFound == false)
						frmEle.Sample.value += "," + ItemID;
				}
				else{
					frmEle.Sample.value = ItemID;
				}
				
			}
		}
		if(frmEle.Sample.value != ""){//double check that each item is still selected
			var aSelectedItems2 = frmEle.Sample.value.split(",");
			var bFound2 = false;
			var sCurValue = frmEle.Sample.value;
			var sNewValue = "";
			for(j=aSelectedItems2.length-1;j>=0;j--){//loop each item in the form
				var aSelectedItemID2 = aSelectedItems2[j].split("_");
				if(aSelectedItemID2[1] == frmEle.ProductID.value){//if product id is the current product
					
				}
				else if(aSelectedItemID2[0] == "1162" && aSelectedItemID2[1] == "153"){//brochure
					if(sSelSamples.indexOf("rochure") < 0){//no borchure yet
						if(sNewValue != "") sNewValue += ",";
						sNewValue += aSelectedItems2[j];
						count ++;
						if(useDhtml == 1){
							sSelSampleProName = eval("document.samplesForm.spn" + aSelectedItems2[j] + ".value");
							if(sLastSampleProName != sSelSampleProName) sSelSamples += "<br><b>" + sSelSampleProName + "</b><br>";
							sSelSamples += "<li style='padding-left:10;'>" + eval("document.samplesForm.scn" + aSelectedItems2[j] + ".value") + "</li>";
						}
					}
				}
				else{//add to value by default since passed from another product
					if(sNewValue != "") sNewValue += ",";
					sNewValue += aSelectedItems2[j];
					count ++;
					
					/*if(sSelSamples.indexOf("Brochure") > 0 && aSelectedItems2[j] == "1162_153"){
					}
					else{*/
						if(useDhtml == 1){//Setup inner html for list of selected samples
							sSelSampleProName = eval("document.samplesForm.spn" + aSelectedItems2[j] + ".value");
							if(sLastSampleProName != sSelSampleProName) sSelSamples += "<br><b>" + sSelSampleProName + "</b><br>";
							sSelSamples += "<li style='padding-left:10;'>" + eval("document.samplesForm.scn" + aSelectedItems2[j] + ".value") + "</li>"
							sLastSampleProName = sSelSampleProName;
						}
					//}
				}
			}
			if(sCheckedValues != "" && sNewValue != "")sNewValue = "," + sNewValue;
			frmEle.Sample.value = sCheckedValues + sNewValue;
		}
	}
	if(count == 0 && frmEle.p.value == 2){
		alert("Please select at least one Sample!");
		//Hide Sample list
		if(useDhtml == 1){//document.all.SelectedSamples.style.display="none";
			MM_showHideLayers('SelectedSamples','','hide');
		}
		return false;
	}
	if(count > 15){
		alert("We thank you for your interest in our blinds, but we limit our samples to 15 per customer. Please remove one sample and then click the Enter Shipping button to complete your transaction.");
		return false;
	}
	if(BambooCount > 4){
		alert("We thank you for your interest in our blinds, but we limit our BAMBOO samples to 4 per customer. Please remove one sample and then click the Enter Shipping button to complete your transaction.");
		return false;
	}
	if(count > 0 && useDhtml == 1){//Show seleccted sample list
		var sHeader = "";
		var sFooter = "";
		document.getElementById("SelectedSamples").innerHTML = sHeader + sSelSamples + sFooter;
		
		if (submit == 1)
		{
			document.samplesForm.p.value = 1;
			document.samplesForm.pid.value = document.samplesForm.ProductID.value;
			document.samplesForm.submit();
		}
	}
}

function validateSampleUser(frmEle){
	if(frmEle.FirstName.value == ""){
		alert("Please enter your Firstname!");
		frmEle.FirstName.focus();
		return false;
	}
	if(frmEle.LastName.value == ""){
		alert("Please enter your Lastname!");
		frmEle.LastName.focus();
		return false;
	}
	if(frmEle.Address.value == ""){
		alert("Please enter your Address!");
		frmEle.Address.focus();
		return false;
	}
	if(frmEle.Email){
		if(frmEle.Email.value == ""){
			alert("Please enter your Email!");
			frmEle.Email.focus();
			return false;
		}
		var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
		var check=/@[\w\-]+\./;
		var checkend=/\.[a-zA-Z]{2,4}$/;
		
		emailad = frmEle.Email.value;
		
		if(((emailad.search(exclude) != -1)||(emailad.search(check))
		== -1)||(emailad.search(checkend) == -1)){
	  		alert("Incorrect email address!  Please amend.");
			frmEle.Email.focus();
			return false;
		}
	 }
	if(frmEle.City.value == ""){
		alert("Please enter your City!");
		frmEle.City.focus();
		return false;
	}
	if(frmEle.State.value == "" || frmEle.State.value == "0"){
		alert("Please enter your State!");
		frmEle.State.focus();
		return false;
	}
	if(frmEle.Zip.value == ""){
		alert("Please enter your Zip!");
		frmEle.Zip.focus();
		return false;
	}
	if(frmEle.Shipping.value != "0"){
		if(frmEle.Phone.value == ""){
			alert("Please enter your Phone!");
			frmEle.Phone.focus();
			return false;
		}
	}
}

function validateSamplePayment(frmEle){
		if(frmEle.PaymentID.value == "0"){
			alert("Please select a payment type.");
			frmEle.PaymentID.focus();
			return false;
		}
		if(frmEle.CardNumber.value == ""){
			alert("Please enter your credit card number.");
			frmEle.CardNumber.focus();
			return false;
		}
		if(frmEle.BillName.value == ""){
			alert("Please enter your name on the credit card.");
			frmEle.BillName.focus();
			return false;
		}
		if(frmEle.BillZip.value == ""){
			alert("Please enter your zip code.");
			frmEle.BillZip.focus();
			return false;
		}
}

//User scripts
function validateUser(frmEle){
	if(frmEle.FirstName.value == ""){
		alert("Please enter your Firstname!");
		frmEle.FirstName.focus();
		return false;
	}
	if(frmEle.LastName.value == ""){
		alert("Please enter your Lastname!");
		frmEle.LastName.focus();
		return false;
	}
	if(frmEle.Address.value == ""){
		alert("Please enter your Address!");
		frmEle.Address.focus();
		return false;
	}
	if(frmEle.Email){
		if(frmEle.Email.value == ""){
			alert("Please enter your Email!");
			frmEle.Email.focus();
			return false;
		}
		var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
		var check=/@[\w\-]+\./;
		var checkend=/\.[a-zA-Z]{2,4}$/;
		
		emailad = frmEle.Email.value;
		
		if(((emailad.search(exclude) != -1)||(emailad.search(check))
		== -1)||(emailad.search(checkend) == -1)){
	  		alert("Incorrect email address!  Please amend.");
			frmEle.Email.focus();
			return false;
		}
	 }
	if(frmEle.City.value == ""){
		alert("Please enter your City!");
		frmEle.City.focus();
		return false;
	}
	if(frmEle.State.value == "" || frmEle.State.value == "0"){
		alert("Please enter your State!");
		frmEle.State.focus();
		return false;
	}
	if(frmEle.Zip.value == ""){
		alert("Please enter your Zip!");
		frmEle.Zip.focus();
		return false;
	}
	if(frmEle.Phone.value == ""){
		alert("Please enter your Phone Number!");
		frmEle.Phone.focus();
		return false;
	}
	if(frmEle.Password){
		if(frmEle.Password.value == ""){
			alert("Please enter a Password!");
			frmEle.Password.focus();
			return false;
		}
		if(frmEle.Password.value != frmEle.Password2.value){
			alert("Passwords do not match!");
			frmEle.Password.focus();
			return false;
		}
	}
}

//Gift Card Scripts
function validateGiftCardPayment(frmEle){
		if(frmEle.Amount.value == "0"){
			alert("Please select a Gift Certificate type.");
			frmEle.Amount.focus();
			return false;
		}
		if(frmEle.PaymentID.value == "0"){
			alert("Please select a payment type.");
			frmEle.PaymentID.focus();
			return false;
		}
		if(frmEle.CardNumber.value == ""){
			alert("Please enter a credit card number.");
			frmEle.CardNumber.focus();
			return false;
		}
		if(frmEle.BillName.value == ""){
			alert("Please enter the name on the credit card.");
			frmEle.BillName.focus();
			return false;
		}
		if(frmEle.BillZip.value == ""){
			alert("Please enter your zip code.");
			frmEle.BillZip.focus();
			return false;
		}
		if(frmEle.Email.value == ""){
			alert("Please enter your Email.");
			frmEle.Email.focus();
			return false;
		}
}

//Generic Scripts
function ToDollarsAndCents(n) 
{ 
   n = Math.round(n * 1000) / 1000
   n = Math.round(n * 100) / 100
   var s = "" + Math.round(n * 100) / 100 
   var i = s.indexOf('.') 
   if (i < 0) return s + ".00" 
   var t = s.substring(0, i + 1) + s.substring(i + 1, i + 3) 
   if (i + 2 == s.length) t += "0" 
   return t 
}

function ToFullDollars(n) 
{ 
   var s = "" + Math.round(n * 100) / 100 
   var i = s.indexOf('.')
   if(i == -1) return s
   var t = s.substring(0, i + 1)
   if(s.substring(i + 1, i + 3) == "00" || s.substring(i + 1, i + 3) == "0"){
	return t
   }
   else{
	return eval(t) + 1
   }
   return t 
}

function setTab(tabName){
	MM_showHideLayers('StackingLayer','','hide');
	MM_showHideLayers('descriptionLayer','','hide');
	MM_showHideLayers('infoLayer','','hide');
	MM_showHideLayers('colorsLayer','','hide');
	MM_showHideLayers('shippingLayer','','hide');
	MM_showHideLayers(tabName,'','show');
	
	MM_swapImage('descTransImage','','../../../images/tabs/leftOff.jpg');
	MM_swapImage('colorsTransImage','','../../../images/tabs/leftOff.jpg');
	MM_swapImage('infoTransImage','','../../../images/tabs/leftOff.jpg');
	MM_swapImage('shippingTransImage','','../../../images/tabs/leftOff.jpg');
	
	
	if(tabName == 'descriptionLayer'){
		MM_swapImage('descriptionImage','','../../../images/tabs/DescriptionOn.jpg');
		MM_swapImage('descTransImage','','../../../images/tabs/rightOn.jpg');
	}
	else{
		MM_swapImage('descriptionImage','','../../../images/tabs/DescriptionOff.jpg');
	}
	if(tabName == 'infoLayer'){
		MM_swapImage('infoImage','','../../../images/tabs/FeaturesOn.jpg');
		MM_swapImage('infoTransImage','','../../../images/tabs/rightOn.jpg');
		MM_swapImage('colorsTransImage','','../../../images/tabs/leftOn.jpg');
	}
	else{
		MM_swapImage('infoImage','','../../../images/tabs/FeaturesOff.jpg');
	}
	if(tabName == 'colorsLayer'){
		MM_swapImage('colorsImage','','../../../images/tabs/ColorsOn.jpg');
		MM_swapImage('colorsTransImage','','../../../images/tabs/rightOn.jpg');
		MM_swapImage('descTransImage','','../../../images/tabs/leftOn.jpg');
	}
	else{
		MM_swapImage('colorsImage','','../../../images/tabs/ColorsOff.jpg');
	}
	if(tabName == 'shippingLayer'){
		MM_swapImage('shippingImage','','../../../images/tabs/ShippingOn.jpg');
		MM_swapImage('shippingTransImage','','../../../images/tabs/RightOn.jpg');
		MM_swapImage('infoTransImage','','../../../images/tabs/leftOn.jpg');
		MM_swapImage('infoTransImage','','../../../images/tabs/leftOn.jpg');
	}
	else{
		MM_swapImage('shippingImage','','../../../images/tabs/ShippingOff.jpg');
	}
	
}
function changeStyle(id, newClass) {
	identity=document.getElementById(id);
	identity.className=newClass;
}
function ShowProductDetail(page, categoryID, productID)
{
	var frmEle = eval("document.shopcart");
	window.location.href = page + '.aspx?cid=' + categoryID + '&pid=' + productID + '&WidthInches=' + frmEle.WidthInchesDisplay.value + '&Width8ths=' + frmEle.Width8thsDisplay.value + '&HeightInches=' + frmEle.HeightInchesDisplay.value + '&Height8ths=' + frmEle.Height8thsDisplay.value;
}
function setSize(value){
	var frmEle = eval("document.shopcart");
	
	if(frmEle.window.length){//Multiple Windows
		frmEle.WidthInches.value = frmEle.WidthInchesDisplay[value].value;
		frmEle.Width8ths.value = frmEle.Width8thsDisplay[value].value;
		frmEle.HeightInches.value = frmEle.HeightInchesDisplay[value].value;
		frmEle.Height8ths.value = frmEle.Height8thsDisplay[value].value;
	}
	else{
		frmEle.WidthInches.value = frmEle.WidthInchesDisplay.value;
		frmEle.Width8ths.value = frmEle.Width8thsDisplay.value;
		frmEle.HeightInches.value = frmEle.HeightInchesDisplay.value;
		frmEle.Height8ths.value = frmEle.Height8thsDisplay.value;
	}
}

function validatePaymentType(clicked){
	frmEle = document.shopcart;
	//REMOVE OPTIONS SELECTED	
	//if bill me later or credit card, remove alternative methods
	if((frmEle.PaymentType[0].checked || frmEle.PaymentType[1].checked) && clicked != 'alternative'){
		//frmEle.Alternative.checked = false;
		//frmEle.Alternative[0].checked = false;
		//frmEle.Alternative[1].checked = false;
	}
	//if an alternative method selected, check alternative payment type
	//if(frmEle.Alternative[0].checked || frmEle.Alternative[1].checked){
	//if(frmEle.Alternative.checked){
	//	frmEle.PaymentType[2].checked = true;
	//}
	
	//ENABLE-DISABLE OPTIONS
	if(frmEle.PaymentType[0].checked)
	{//credit card
		frmEle.PaymentID.disabled = false;
		frmEle.CardNumber.disabled = false;
		frmEle.expMonth.disabled = false;
		frmEle.expYear.disabled = false;
		//frmEle.Name.disabled = false;
		//frmEle.Address.disabled = false;
		//frmEle.City.disabled = false;
		//frmEle.State.disabled = false;
		//frmEle.Zip.disabled = false;
		
		if(frmEle.c90days)frmEle.c90days.disabled = true;
		
		if (document.getElementById('divCreditCard')) document.getElementById('divCreditCard').style.display = 'block';
		if (document.getElementById('divBML')) document.getElementById('divBML').style.display = 'none';
		if (document.getElementById('divBML2')) document.getElementById('divBML2').style.display = 'none';
		if (document.getElementById('divCheck')) document.getElementById('divCheck').style.display = 'none';
		
//		frmEle.Alternative.checked = false;
		//frmEle.Alternative[0].disabled = true;
		//frmEle.Alternative[1].disabled = true;
	}
	else if(frmEle.PaymentType[1].checked)
	{//BML
		frmEle.PaymentID.disabled = true;
		frmEle.CardNumber.disabled = true;
		frmEle.expMonth.disabled = true;
		frmEle.expYear.disabled = true;
		//frmEle.Name.disabled = true;
		//frmEle.Address.disabled = true;
		//frmEle.City.disabled = true;
		//frmEle.State.disabled = true;
		//frmEle.Zip.disabled = true;
		
		if(frmEle.c90days)frmEle.c90days.disabled = false;
		
		if (document.getElementById('divCreditCard')) document.getElementById('divCreditCard').style.display = 'none';
		if (document.getElementById('divBML')) document.getElementById('divBML').style.display = 'block';
		if (document.getElementById('divBML2')) document.getElementById('divBML2').style.display = 'block';
		if (document.getElementById('divCheck')) document.getElementById('divCheck').style.display = 'none';
		
//		frmEle.Alternative.checked = false;
		//frmEle.Alternative[0].disabled = true;
		//frmEle.Alternative[1].disabled = true;
	}
	else
	{//Alternative
		frmEle.PaymentID.disabled = true;
		frmEle.CardNumber.disabled = true;
		frmEle.expMonth.disabled = true;
		frmEle.expYear.disabled = true;
		//frmEle.Name.disabled = true;
		//frmEle.Address.disabled = true;
		//frmEle.City.disabled = true;
		//frmEle.State.disabled = true;
		//frmEle.Zip.disabled = true;
		
		if(frmEle.c90days)frmEle.c90days.disabled = true;
		
		if (document.getElementById('divCreditCard')) document.getElementById('divCreditCard').style.display = 'none';
		if (document.getElementById('divBML')) document.getElementById('divBML').style.display = 'none';
		if (document.getElementById('divBML2')) document.getElementById('divBML2').style.display = 'none';
		if (document.getElementById('divCheck')) document.getElementById('divCheck').style.display = 'block';
		
//		frmEle.Alternative.disabled = false;
//		frmEle.Alternative.checked = true;
		//frmEle.Alternative[0].disabled = false;
		//frmEle.Alternative[1].disabled = false;
	}
}
function ShowHideLogin()
{
	if (document.getElementById('customerTypeReturn'))
	{
		if (document.getElementById('customerTypeReturn').checked == true)
		{
			document.getElementById('NewCustomerConfirmEmailTR').style.display='none';
			document.getElementById('NewCustomerConfirmPasswordTR').style.display='none';
			return;
		}
		else
		{
		    if (IsIE())
		    {
			    document.getElementById('NewCustomerConfirmEmailTR').style.display='block';
			    document.getElementById('NewCustomerConfirmPasswordTR').style.display='block';
			}
			else
			{
			    document.getElementById('NewCustomerConfirmEmailTR').style.display='table-row';
			    document.getElementById('NewCustomerConfirmPasswordTR').style.display='table-row';
			}
			return;
		}
	}
}

function IsIE()
{
    var userAgent = navigator.userAgent.toLowerCase();
    var version = (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1];
    var isIE = /msie/.test( userAgent ) && !/opera/.test( userAgent );
    
    return isIE;
}

function clearFormNew() {
	document.getElementById('newUserName').value = "";
	document.getElementById('newUserNameConfirm').value = "";
	document.getElementById('newPassword').value = "";
}
function clearFormReturn() {
    document.getElementById('returnUserName').value = "";
    document.getElementById('returnPassword').value = "";
}

function ValidateNewLogin()
{
 var newUserName = document.getElementById('newUserName');
  
  if (newUserName != null && newUserName.value != "")
  {
    var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
    var check=/@[\w\-]+\./;
    var checkend=/\.[a-zA-Z]{2,4}$/;
    
    emailad = newUserName.value;
    if ((emailad.search(exclude) != -1) || 
          (emailad.search(check) == -1) ||
          (emailad.search(checkend) == -1)) {
          alert("Incorrect email address! Please amend.");
          newUserName.focus();
          return false;
          
    }
    
    var newUserNameConfirm = document.getElementById('newUserNameConfirm');
    if (newUserNameConfirm != null && newUserNameConfirm.value != newUserName.value)
    {
          alert('Emails do not match. Please re-enter.');
          newUserNameConfirm.focus();
          return false;
    
    }
    var newPassword = document.getElementById('newPassword');
    if (newPassword != null && newPassword.value == "")
    {
          alert('Please enter your new password.');
          document.getElementById('newPassword').focus();
          return false;
    }
    
  }
  return true;
}


function ValidateReturnLogin()
{
    var returnUserName = document.getElementById('returnUserName');
    if (returnUserName != null && returnUserName.value != "")
    {
        var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
        var check=/@[\w\-]+\./;
        var checkend=/\.[a-zA-Z]{2,4}$/;
        
        emailad = returnUserName.value;
        
        if ((emailad.search(exclude) != -1) || 
              (emailad.search(check) == -1) ||
              (emailad.search(checkend) == -1)) {
              alert("Incorrect email address. Please amend.");
              newUserName.focus();
              return false;

        }      
        var returnPassword = document.getElementById('returnPassword');
        if (returnPassword != null && returnPassword.value == "")
        {
              alert('Please enter your password.');
              document.getElementById('returnPassword').focus();
              return false;
        }
    return true; 
    }
    
}

function CopyBillingInfo()
{
	if (document.getElementById('BillingShipping'))
	{
		if (document.getElementById('BillingShipping').checked == true)
		{
			if (document.getElementById('FirstName')) document.getElementById('ShippingFirstName').value = document.getElementById('FirstName').value;
			if (document.getElementById('LastName')) document.getElementById('ShippingLastName').value = document.getElementById('LastName').value;
			if (document.getElementById('Address')) document.getElementById('ShippingAddress').value = document.getElementById('Address').value;
			if (document.getElementById('Address2')) document.getElementById('ShippingAddress2').value = document.getElementById('Address2').value;
			if (document.getElementById('City')) document.getElementById('ShippingCity').value = document.getElementById('City').value;
			if (document.getElementById('State')) document.getElementById('ShippingState').value = document.getElementById('State').value;
			if (document.getElementById('Zip')) document.getElementById('ShippingZip').value = document.getElementById('Zip').value;
			if (document.getElementById('Phone')) document.getElementById('ShippingPhone').value = document.getElementById('Phone').value;
		}
		else
		{
			if (document.getElementById('FirstName')) document.getElementById('ShippingFirstName').value = "";
			if (document.getElementById('LastName')) document.getElementById('ShippingLastName').value = "";
			if (document.getElementById('Address')) document.getElementById('ShippingAddress').value = "";
			if (document.getElementById('Address2')) document.getElementById('ShippingAddress2').value = "";
			if (document.getElementById('City')) document.getElementById('ShippingCity').value = "";
			if (document.getElementById('State')) document.getElementById('ShippingState').value = "";
			if (document.getElementById('State')) document.getElementById('ShippingState').selectedIndex = -1;
			if (document.getElementById('Zip')) document.getElementById('ShippingZip').value = "";
			if (document.getElementById('Phone')) document.getElementById('ShippingPhone').value = "";
		}
		UpdShipping();
	}
}

function validateCheckout(frmEle)
{
	if(frmEle.FirstName.value == ""){
		alert("Please enter the Billing First Name.");
		frmEle.FirstName.focus();
		return false;
	}
	if(frmEle.LastName.value == ""){
		alert("Please enter the Billing Last Name.");
		frmEle.LastName.focus();
		return false;
	}
	if(frmEle.Address.value == ""){
		alert("Please enter the Billing Address.");
		frmEle.Address.focus();
		return false;
	}
	if(frmEle.City.value == ""){
		alert("Please enter the Billing City.");
		frmEle.City.focus();
		return false;
	}
	if(frmEle.State.value == "0"){
		alert("Please enter the Billing State.");
		frmEle.State.focus();
		return false;
	}
	if(frmEle.Zip.value == ""){
		alert("Please enter the Billing Zip.");
		frmEle.Zip.focus();
		return false;
	}
	if(frmEle.Phone.value == ""){
		alert("Please enter the Billing Phone.");
		frmEle.Phone.focus();
		return false;
	}
	if(frmEle.ShippingFirstName.value == ""){
		alert("Please enter the Shipping First Name.");
		frmEle.ShippingFirstName.focus();
		return false;
	}
	if(frmEle.ShippingLastName.value == ""){
		alert("Please enter the Shipping Last Name.");
		frmEle.ShippingLastName.focus();
		return false;
	}
	if(frmEle.ShippingAddress.value == ""){
		alert("Please enter the Shipping Address.");
		frmEle.ShippingAddress.focus();
		return false;
	}
	if(frmEle.ShippingCity.value == ""){
		alert("Please enter the Shipping City.");
		frmEle.ShippingCity.focus();
		return false;
	}
	if(frmEle.ShippingState.value == "0"){
		alert("Please enter the Shipping State.");
		frmEle.ShippingState.focus();
		return false;
	}
	if(frmEle.ShippingZip.value == ""){
		alert("Please enter the Shipping Zip.");
		frmEle.ShippingZip.focus();
		return false;
	}
	
	if(frmEle.PaymentType[0].checked){//CreditCard
		if(frmEle.PaymentID.value == "0"){
			alert("Please select a credit card type.");
			frmEle.PaymentID.focus();
			return false;
		}
		if(frmEle.CardNumber.value == ""){
			alert("Please enter a credit card number.");
			frmEle.CardNumber.focus();
			return false;
		}
		// Credit Card Number Validation: AMEX, VISA, MasterCard 
		var type = "MasterCard"; 
		if(frmEle.PaymentID.value == "1") type="MasterCard";
		if(frmEle.PaymentID.value == "2") type="Visa";
		if(frmEle.PaymentID.value == "3") type="Discover";
		if(frmEle.PaymentID.value == "4") type="American Express";
		var num = frmEle.CardNumber.value;
		var dig1 = num.charAt(0);

		if(type == "American Express"){  
			if ((dig1 != "3") || (num.length != 15)) {
				alert('Invalid credit card number! Please ensure you are using an American Express card or change the Type of Card.');
				frmEle.PaymentID.focus();
				return false; 
			}  
		}
		if(type == "Visa") {  
			if ((dig1 != "4") || (num.length != 16))  {
				alert('Invalid credit card number! Please ensure you are using a Visa or change the Type of Card.');  
				frmEle.PaymentID.focus();
				return false; 
			}
		}
		if(type == "MasterCard") {  
			if ((dig1 != 5) || (num.length != 16)) {
				alert('Invalid credit card number! Please ensure you are using a Mastercard or change the Type of Card.'); 
				frmEle.PaymentID.focus();
				return false; 
			}  
		}
		if(frmEle.cvv2.value.length < 3){
			
			alert("Please enter the CVV2 number on the credit card.");
			frmEle.cvv2.focus();
			return false;
		}
	}
	if(frmEle.PaymentType[1].checked){//Bill Me Later
	}
	if(frmEle.PaymentType[2].checked){//Alternative methods
	}
	
	if(frmEle.measure_disclaimer.checked == false){
		alert("Please read the Measuring Instructions and Color Disclaimer and agree to the terms!");
		frmEle.measure_disclaimer.focus();
		return false;
	}

	MM_showHideLayers('PaymentDiv','','show');
}

function ViewDetail()
{
	if (document.getElementById('divOrderDetails').style.display == 'none')
	{
		grayOut(true);
		document.getElementById('divMainBody').disabled = true;
		document.getElementById('CompleteOrder').disabled = true;
		document.getElementById('divOrderDetails').style.display = 'block';
	}
	else
	{
		grayOut(false);
		document.getElementById('divMainBody').disabled = false;
		document.getElementById('CompleteOrder').disabled = false;
		document.getElementById('divOrderDetails').style.display = 'none';
	}
}

function grayOut(vis, options) {  
	// Pass true to gray out screen, false to ungray  
	// options are optional.  This is a JSON object with the following (optional) properties  
	// opacity:0-100         
	// Lower number = less grayout higher = more of a blackout   
	// zindex: #             
	// HTML elements with a higher zindex appear on top of the gray out  
	// bgcolor: (#xxxxxx)    
	// Standard RGB Hex color code  
	// grayOut(true, {'zindex':'50', 'bgcolor':'#0000FF', 'opacity':'70'});  
	// Because options is JSON opacity/zindex/bgcolor are all optional and can appear  
	// in any order.  Pass only the properties you need to set.  
	var options = options || {};   
	var zindex = options.zindex || 50;  
	var opacity = options.opacity || 30;  
	var opaque = (opacity / 100);  
	var bgcolor = options.bgcolor || '#000000';  
	var dark=document.getElementById('darkenScreenObject');  
	if (!dark) {    
		// The dark layer doesn't exist, it's never been created.  So we'll    
		// create it here and apply some basic styles.    
		// If you are getting errors in IE see: http://support.microsoft.com/default.aspx/kb/927917    
		var tbody = document.getElementsByTagName("body")[0];    
		var tnode = document.createElement('div');           // Create the layer.        
		tnode.style.position='absolute';                 // Position absolutely        
		tnode.style.top='0px';                           // In the top        
		tnode.style.left='0px';                          // Left corner of the page        
		tnode.style.overflow='hidden';                   // Try to avoid making scroll bars                    
		tnode.style.display='none';                      // Start out Hidden        
		tnode.id='darkenScreenObject';                   // Name it so we can find it later    
		tbody.appendChild(tnode);                            // Add it to the web page    
		dark=document.getElementById('darkenScreenObject');  // Get the object.  
	}  
	if (vis) {    
		// Calculate the page width and height     
		if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {        
			var pageWidth = document.body.scrollWidth+'px';        
			var pageHeight = document.body.scrollHeight+'px';    
		} else if( document.body.offsetWidth ) {      
			var pageWidth = document.body.offsetWidth+'px';      
			var pageHeight = document.body.offsetHeight+'px';    
		} else {       
			var pageWidth='100%';       
			var pageHeight='100%';    
		}       
		//set the shader to cover the entire page and make it visible.    
		dark.style.opacity=opaque;                          
		dark.style.MozOpacity=opaque;                       
		dark.style.filter='alpha(opacity='+opacity+')';     
		dark.style.zIndex=zindex;            
		dark.style.backgroundColor=bgcolor;      
		dark.style.width= pageWidth;    
		dark.style.height= pageHeight;    
		dark.style.display='block';                            
	} 
	else {     
		dark.style.display='none';  
	}
}

function LoginClick()
{
	if (event.keyCode == 13)
	{
	var sourceElement = event.srcElement.id;
		if (sourceElement != "returnUserName" && sourceElement != "returnUserPassword")
		{
			ValidateNewLogin()
			return true;
		}
		else 
		{
		    ValidateReturnLogin()
		    return true;
		}
	    return false;
	}
}
function UpdShipping()
{
	if (document.getElementById('options'))
	{
		document.getElementById('options').value = '10';
		document.getElementById('shopcart').submit();
	}
}
function validatePaypalCheckout(frmEle)
{
	if(frmEle.measure_disclaimer.checked == false){
		alert("Please read the Measuring Instructions and Color Disclaimer and agree to the terms!");
		frmEle.measure_disclaimer.focus();
		return false;
	}

	MM_showHideLayers('PaymentDiv','','show');
}
function validateEmail2(frmEle)
{
	if(frmEle.ProductID.selectedIndex < 1){
		alert("Please select your free rug.");
		frmEle.ProductID.focus();
		return false;
	}
	if(frmEle.FirstName.value == ""){
		alert("Please enter your first name.");
		frmEle.FirstName.focus();
		return false;
	}
	if(frmEle.LastName.value == ""){
		alert("Please enter your last name.");
		frmEle.LastName.focus();
		return false;
	}
	if(frmEle.Address.value == ""){
		alert("Please enter your address.");
		frmEle.Address.focus();
		return false;
	}
	if(frmEle.City.value == ""){
		alert("Please enter your city.");
		frmEle.City.focus();
		return false;
	}
	if(frmEle.State.selectedIndex < 1){
		alert("Please select your state.");
		frmEle.State.focus();
		return false;
	}
	if(frmEle.Zip.value == ""){
		alert("Please enter your zip.");
		frmEle.Zip.focus();
		return false;
	}
	if(frmEle.Phone.value == ""){
		alert("Please enter your phone.");
		frmEle.Phone.focus();
		return false;
	}
	if(frmEle.Email.value == ""){
		alert("Please enter your email.");
		frmEle.Email.focus();
		return false;
	}
}
function popUpRoomShot()
{
	var url = document.getElementById('ProductPreview').src;
	var pos = url.lastIndexOf('/');
	var newurl = url.substring(0, pos - 0) + '/800x549' + url.substring(pos);
	javascript:popUpWin(newurl,620,820);
}
function ArrivalEstimateEnter(e)
{
	if (window.event)
	{
		if (window.event.keyCode == 13)
		{
			document.getElementById('ArrivalForm').submit();
			if (document.getElementById('ArrivalEstimateExit')) document.getElementById('ArrivalEstimateExit').disabled = true;
			if (document.getElementById('ArrivalEstimateClose')) document.getElementById('ArrivalEstimateClose').disabled = true;
			if (document.getElementById('ShippingEstimate')) document.getElementById('ShippingEstimate').disabled = true;
		}
	}
	else
	{
		if (e.which == 13)
		{
			document.getElementById('ArrivalForm').submit();
			if (document.getElementById('ArrivalEstimateExit')) document.getElementById('ArrivalEstimateExit').disabled = true;
			if (document.getElementById('ArrivalEstimateClose')) document.getElementById('ArrivalEstimateClose').disabled = true;
			if (document.getElementById('ShippingEstimate')) document.getElementById('ShippingEstimate').disabled = true;
		}
	}
}
