var reqXML;
var TO,M;
var mouseOver=0; 

function hidelayer(lay) {
if(document.getElementById([lay]))
document.getElementById([lay]).style.visibility="hidden";
}

function showlayer(lay) {
if(document.getElementById([lay]))
document.getElementById([lay]).style.visibility="visible";
}

function DeleteAllProductInfoColor() 
{
var SSampleColorIDArray = document.getElementById('SSampleColorID').value.split(",");
//alert(document.getElementById('SSampleColorID').value);
	for (var loop=0; loop < SSampleColorIDArray.length; loop++)
	{
		//alert(SSampleColorIDArray[loop]);
			if(SSampleColorIDArray[loop] !='' && SSampleColorIDArray[loop] > 0)
				hidelayer("selectedtext"+ SSampleColorIDArray[loop]);
	}
}

function SelectProductInfoColor(ID) 
{
var SSampleColorIDArray = document.getElementById('SSampleColorID').value.split(",");
//alert(document.getElementById('SSampleColorID').value);
	for (var loop=0; loop < SSampleColorIDArray.length; loop++)
	{
		//alert(SSampleColorIDArray[loop]);
			if(SSampleColorIDArray[loop] !='' && SSampleColorIDArray[loop] > 0)
				hidelayer("selectedtext"+ SSampleColorIDArray[loop]);
	}
	
showlayer("selectedtext"+ID);
document.getElementById('SelectedColorID').value = ID;
}



function jump (url) {self.location.hash = url}

//Shutters M and I
function validateCheckMeasureAndInstall(frmEle){
if(document.MeasureAndInstallForm.Install.checked == false && document.MeasureAndInstallForm.MeasureAndInstall.checked == false && document.MeasureAndInstallForm.Measure.checked == false && document.MeasureAndInstallForm.WantAlone.checked == false){
		alert("Please choose at least one Measuring and/or Installation Option, then click the 'Add to Cart' button.");
		return false;
	}
}


//Shutters M and I
function VerifyMandI(Param)
{

	if(document.MeasureAndInstallForm.Measure.checked == false && document.MeasureAndInstallForm.MeasureAndInstall.checked == false)
	{
	document.getElementById('measure_install_concrete_pop').style.display = "None";	
	document.getElementById('install_concrete_pop').style.display = "None";	
	}

if (Param == "Measure") 
	{
	document.MeasureAndInstallForm.Install.checked = false;
	document.MeasureAndInstallForm.MeasureAndInstall.checked = false;
	document.MeasureAndInstallForm.WantAlone.checked = false;	

	document.getElementById('measure_install_concrete_pop').style.display = "None";	
	document.getElementById('install_concrete_pop').style.display = "None";		
	}
	else if (Param == "Install") 
	{
	document.MeasureAndInstallForm.Measure.checked = false;
	document.MeasureAndInstallForm.MeasureAndInstall.checked = false;
	document.MeasureAndInstallForm.WantAlone.checked = false;	
	
	document.getElementById('measure_install_concrete_pop').style.display = "None";
	document.getElementById('install_concrete_pop').style.display = "block";
	}
	else if (Param == "MeasureAndInstall") 
	{
	document.MeasureAndInstallForm.Install.checked = false;
	document.MeasureAndInstallForm.Measure.checked = false;
	document.MeasureAndInstallForm.WantAlone.checked = false;	
	
	document.getElementById('measure_install_concrete_pop').style.display = "block";
	document.getElementById('install_concrete_pop').style.display = "None";
	}
	else if (Param == "WantAlone") 
	{
	document.MeasureAndInstallForm.Install.checked = false;
	document.MeasureAndInstallForm.Measure.checked = false;
	document.MeasureAndInstallForm.MeasureAndInstall.checked = false;	
	
	document.getElementById('measure_install_concrete_pop').style.display = "None";	
	document.getElementById('install_concrete_pop').style.display = "None";	
	}
}


//User scripts
function validateUserShipping(frmEle){


	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.value == "" || frmEle.State.value == "0"){
		alert("Please enter a Province");
		frmEle.State.focus();
		return false;
	}
	
	
	if(frmEle.State.value == "out")
	{
	var answer = confirm("SelectBlindsCanada.ca only accepts orders from and deliveries to Canadian addresses. For shipments to other countries, including the USA, visit SelectBlinds.com. Click OK to go to SelectBlinds.com now. Otherwise, click 'Cancel' and choose your province.")
     if (answer)
		{
		win = top;
		win.opener = top;
		win.close ();
		window.open("http://www.selectblinds.com"); 
		}
     else
		{
		frmEle.State.focus();
			return false;
		}
	}
	
	
	if(frmEle.Phone.value == ""){
		alert("Please enter a Daytime Phone Number");
		frmEle.Phone.focus();
		return false;
	}


	if(frmEle.Zip.value == ""){
		alert("Please enter your postal code in the format X0X 0X0");
		frmEle.Zip.focus();
		return false;
	}
	else
	{
	objRegExp = /^\D{1}\d{1}\D{1}\s\d{1}\D{1}\d{1}$/
	if(!objRegExp.test(frmEle.Zip.value))
		{
			alert("Please enter your postal code in the format X0X 0X0");
			frmEle.Zip.focus();
			return false;
		}
	}
		
	
}









function createPopUp(popUpCode)
{	alert();
	var div = document.createElement('div');
	div.innerHTML = popUpCode;
	document.body.appendChild(div.firstChild);
}


      function showHide(elementid)
      {
		if (document.getElementById(elementid).style.display == 'none')
		{
		document.getElementById(elementid).style.display = '';
		} 
		else 
		{
		document.getElementById(elementid).style.display = 'none';
		}
      }

function ShowSubDiv(SubDivID)
{
	if(document.getElementById('SubDivStatus'+ SubDivID).value == 1)
	{
	document.getElementById('SubDiv'+ SubDivID).style.display = 'block';
	document.getElementById('SubDivStatus'+ SubDivID).value = 0;
	}
	else
	{
	document.getElementById('SubDiv'+ SubDivID).style.display = 'none';
	document.getElementById('SubDivStatus'+ SubDivID).value = 1;
	}
}


// this function determines whether the event is the equivalent of the microsoft
// mouseleave or mouseenter events.


function showImageColorsPop(ProductName,ProductImageName,ColorIDs,ColorCategoryIDs,ColorCategoryNames,ColorsPath,Widths,Heights)
{
var friend_array = ColorIDs.split(",");
var CategoryID_array = ColorCategoryIDs.split(",");
var ColorCategoryNames_array = ColorCategoryNames.split(",");

var AvailabvleColors ="";
AvailabvleColors = AvailabvleColors + "<table cellspacing='0' cellpadding='0' border='0' bgcolor='white' width ='190'>";
for (var loop=0; loop < CategoryID_array.length; loop++)
{
if(CategoryID_array[loop] == 0)
{
AvailabvleColors = AvailabvleColors + "<tr><td>"; 
}
else
{
for (var loop3=0; loop3 < ColorCategoryNames_array.length; loop3++)
	{
	var ColorCategoryNames_array_array = ColorCategoryNames_array[loop3].split("_");
	if(ColorCategoryNames_array_array[0] == CategoryID_array[loop])
	AvailabvleColors = AvailabvleColors + "<tr><td>"+ ColorCategoryNames_array_array[1] +"</td></tr><tr><td>";
	}


}

		var intc=0;
		for (var loop2=0; loop2 < friend_array.length; loop2++)
		{
			if(CategoryID_array[loop] == CategoryID_array[loop2])
			{
			intc++;
			AvailabvleColors = AvailabvleColors + "<img src='" + ColorsPath + friend_array[loop2] +".jpg' width='32' height='32' border='0'/>";
			if((intc % 6) == 0) AvailabvleColors = AvailabvleColors +"<br/>";
			}
		}
AvailabvleColors = AvailabvleColors +"</td></tr>";		
		

  
  while(CategoryID_array[loop] == CategoryID_array[loop + 1])
  {
  loop++
  }
}
AvailabvleColors = AvailabvleColors +"</table>";




M = document.getElementById("image_colors_pop").style;
M.visibility="visible";
document.getElementById("image_colors_pop").style.cursor = 'hand'; 
document.getElementById("image_colors_pop").innerHTML = "<table class='box' cellspacing='1' cellpadding='3' border='0' bgcolor='white' width ='190'><tr><td><div align='center'><b>"+ ProductName +"</b></div></td></tr><tr><td><img src='" + ProductImageName + "' width='190'/></td></tr><tr><td>"+ friend_array.length +" Colours Available:</td></tr><tr><td>" + AvailabvleColors + "</td></tr><tr><td>Width: "+ Widths +"<br/>Height: "+ Heights +"</td></tr></table>";

var pHeight = OffWindowH(); 
document.getElementById("image_colors_pop").style.top = pHeight + 'px'; 
}

function OffWindowH() 
{ 
 var OffWindowH=0; 
 
 if(typeof self.pageYOffset!='undefined') 
 OffWindowH=self.pageYOffset; 
 else if(document.compatMode && document.compatMode != 'BackCompat') 
OffWindowH=document.documentElement.scrollTop; 
 else if(document.body && typeof(document.body.scrollTop)!='undefined') 
OffWindowH=document.body.scrollTop; 
  
 return OffWindowH; 
} 


function hideImageColorsPop(ProductID)
{
document.getElementById("image_colors_pop").style.visibility="hidden";
}



function validatePaymentMethodNew(clicked){
	frmEle = document.shopcart;
	
	//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;		
	}
	
}


function UpdShipping()
{
	if (document.getElementById('options'))
	{
		document.getElementById('options').value = '10';
		//document.getElementById('shopcart').submit();
	}
}

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;
			if (document.getElementById('Phone2')) document.getElementById('ShippingPhone2').value = document.getElementById('Phone2').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 = "0";
			if (document.getElementById('State')) document.getElementById('ShippingState').selectedIndex = 0;
			if (document.getElementById('Zip')) document.getElementById('ShippingZip').value = "";
			if (document.getElementById('Phone')) document.getElementById('ShippingPhone').value = "";
			if (document.getElementById('Phone2')) document.getElementById('ShippingPhone2').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 Province.");
		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 Province.");
		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 == "MC") type="MasterCard";
		if(frmEle.PaymentID.value == "VI") type="Visa";
		if(frmEle.PaymentID.value == "DI") type="Discover";
		if(frmEle.PaymentID.value == "AM") 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.expMonth.value == ""){
		alert("Please enter Expiry Month");
		frmEle.expMonth.focus();
		return false;
	}
	
	if(frmEle.expYear.value == ""){
		alert("Please enter Expiry Year");
		frmEle.expYear.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 Colour Disclaimer and agree to the terms");
		frmEle.measure_disclaimer.focus();
		return false;
	}




//if(frmEle.PaymentType[0].checked)
	MM_showHideLayers('PaymentDiv','','show');


}


function validatePaymentTypeCat()
{
		if(document.getElementById('PaymentTypeCatPP').checked == true)
		{
			document.getElementById('paypalcheck').checked = true;
			document.getElementById('ppage').value = 11;
			if (document.getElementById('divCard')) document.getElementById('divCard').style.display = 'none';
			if (document.getElementById('divPayPal')) document.getElementById('divPayPal').style.display = 'block';
			if (document.getElementById('divCheckT')) document.getElementById('divCheckT').style.display = 'none';
			if (document.getElementById('divCheckIN')) document.getElementById('divCheckIN').style.display = 'none';
			//alert(document.getElementById('ppage').value);
		}
		else if(document.getElementById('PaymentTypeCatIN').checked == true)
		{
			document.getElementById('interact').checked = true;
			document.getElementById('ppage').value = 12;
			if (document.getElementById('divCheckIN')) document.getElementById('divCheckIN').style.display = 'block';
			if (document.getElementById('divCard')) document.getElementById('divCard').style.display = 'none';
			if (document.getElementById('divPayPal')) document.getElementById('divPayPal').style.display = 'none';
			if (document.getElementById('divCheckT')) document.getElementById('divCheckT').style.display = 'none';
		}
		else if(document.getElementById('PaymentTypeCatCH').checked == true)
		{
			document.getElementById('paypalcheck5').checked = true;
			document.getElementById('ppage').value = 11;
			if (document.getElementById('divCard')) document.getElementById('divCard').style.display = 'none';
			if (document.getElementById('divPayPal')) document.getElementById('divPayPal').style.display = 'none';
			if (document.getElementById('divCheckT')) document.getElementById('divCheckT').style.display = 'block';
			if (document.getElementById('divCheckIN')) document.getElementById('divCheckIN').style.display = 'none';
			//alert(document.getElementById('ppage').value);
		}
		else if(document.getElementById('PaymentTypeCatCC').checked == true)
		{
		document.shopcart.PaymentType[0].checked = true;
		document.shopcart.PaymentID.disabled = false;
		document.shopcart.CardNumber.disabled = false;
		document.shopcart.expMonth.disabled = false;
		document.shopcart.expYear.disabled = false;
	    document.getElementById('ppage').value = 8;		
		    
			if (document.getElementById('divCard')) document.getElementById('divCard').style.display = 'block';
			if (document.getElementById('divPayPal')) document.getElementById('divPayPal').style.display = 'none';
			if (document.getElementById('divCheckT')) document.getElementById('divCheckT').style.display = 'none';
			if (document.getElementById('divCheckIN')) document.getElementById('divCheckIN').style.display = 'none';
		}
		 

}

function validatePaymentType(clicked){
	frmEle = document.shopcart;
	
	//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;
		
		if (document.getElementById('divCreditCard')) document.getElementById('divCreditCard').style.display = 'block';
		if (document.getElementById('divCheck')) document.getElementById('divCheck').style.display = 'none';
		if (document.getElementById('besttimediv')) document.getElementById('besttimediv').style.display = 'none';
		
		MM_swapImage('CompleteOrder','','./images/completeorder2.jpg');
	}
	else
	{//Alternative
		frmEle.PaymentID.disabled = true;
		frmEle.CardNumber.disabled = true;
		frmEle.expMonth.disabled = true;
		frmEle.expYear.disabled = true;
		
		
		if (document.getElementById('divCreditCard')) document.getElementById('divCreditCard').style.display = 'none';
		
			if(frmEle.PaymentType[2].checked || frmEle.PaymentType[3].checked)
			{
				if (document.getElementById('divCheck')) 
						document.getElementById('divCheck').style.display = 'block';
			}
		
		if(document.getElementById('Alternative').checked) // frmEle.PaymentType[1].checked)
		{
			if (document.getElementById('divCheck')) 
				document.getElementById('divCheck').style.display = 'none';
		    if (document.getElementById('besttimediv')) document.getElementById('besttimediv').style.display = 'block';
		}
		
		
		
if(document.getElementById('Payments3'))
{
		if(document.getElementById('paypalcheck').checked || document.getElementById('paypalcheck2').checked || document.getElementById('paypalcheck3').checked || document.getElementById('paypalcheck4').checked || document.getElementById('paypalcheck5').checked)		
			{
			document.getElementById('ppage').value = 11;
			MM_swapImage('CompleteOrder','','./images/completeorder2.jpg');
			}	
		else if(document.getElementById('Payments3').checked)
			{
			MM_swapImage('CompleteOrder','','./images/completeorderPayments3.jpg');
			document.getElementById('ppage').value = 10;
			if(document.getElementById('divCheck')) document.getElementById('divCheck').style.display = 'none';
			if (document.getElementById('besttimediv')) document.getElementById('besttimediv').style.display = 'none';
			}
		else
			{
			MM_swapImage('CompleteOrder','','./images/completeorder2.jpg');
			document.getElementById('ppage').value = 8;
			}
}
else
{
	MM_swapImage('CompleteOrder','','./images/completeorder2.jpg');
		//if(document.getElementById('paypalcheck').checked)
		if(document.getElementById('paypalcheck').checked || document.getElementById('paypalcheck2').checked || document.getElementById('paypalcheck3').checked || document.getElementById('paypalcheck4').checked || document.getElementById('paypalcheck5').checked)	
			{
			document.getElementById('ppage').value = 11;
			}
	else
			{
			document.getElementById('ppage').value = 8;
			}
}


//DebitWay
if(document.getElementById('interact').checked)
			{
			MM_swapImage('CompleteOrder','','./images/completeorder2.jpg');
			document.getElementById('ppage').value = 12;
			}	
//DebitWay				
		

		
	
	}
}

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 BuildXMLResults(){}
   
function LoadXMLDoc(url){ 
  if (window.XMLHttpRequest){ //Mozilla, Firefox, Opera 8.01, Safari
    reqXML = new XMLHttpRequest(); 
    reqXML.onreadystatechange = BuildXMLResults; 
    reqXML.open("GET", url, true); 
    reqXML.send(null); 
  }
  else if(window.ActiveXObject){ //IE
    reqXML = new ActiveXObject("Microsoft.XMLHTTP"); 
    if (reqXML) { 
      reqXML.onreadystatechange = BuildXMLResults; 
      reqXML.open("GET", url, true); 
      reqXML.send(); 
    } 
  }
  else{ //Older Browsers
    alert("Your Browser does not support Ajax!");
  }
} 


function validateExpensive(frmEle){
		
		if(frmEle.besttime[0].checked==false && frmEle.besttime[1].checked == false && frmEle.besttime[2].checked == false){
			alert("Please choose the best time for us to call you");
			frmEle.besttime[0].focus();
			return false;
		}
}


function validateDiscountF(frmEle){

//Shutters M and I
if (document.MeasureAndInstallForm)
{

if(document.MeasureAndInstallForm.WeHaveMandIinCart.value == 0 && document.MeasureAndInstallForm.WantAlone.checked == false){
		alert("Please choose at least one Measuring and/or Installation Option, then click the 'Add to Cart' button.");
		return false;
}
else if(document.MeasureAndInstallForm.Install.checked == false && document.MeasureAndInstallForm.MeasureAndInstall.checked == false && document.MeasureAndInstallForm.Measure.checked == false && document.MeasureAndInstallForm.WeHaveMandIinCart.value == 0 && document.MeasureAndInstallForm.WantAlone.checked == false){
		alert("Please choose at least one Measuring and/or Installation Option, then click the 'Add to Cart' button.");
		return false;
	}
	
}

if(frmEle.DiscountCodeF)
{
		if((frmEle.DiscountCodeF.value== 'FREEBLIND' || frmEle.DiscountCodeF.value== 'freeblind') && frmEle.nomorethanone.value>1 && frmEle.JustUpdate.value ==1)
		{
			alert("If you want to order more than one blind, then place one order for your free blind, and then a second order for the rest of your blinds; enter discount code FMR2C at checkout for your second order to save up to 20% off your second order.");
			return false;
		}
}


if(frmEle.ToBliockRep50PerCluents)
{
		if(frmEle.ToBliockRep50PerCluents.value > 0 && frmEle.ToBliockRep50PerCluents.value != null && frmEle.Count50Per.value > 0)
		{
			alert("It appears you have already placed an order during our current sale. This special sale is limited to 1 order per person/household/business. If you have any questions at all or if we may be of assistance, please contact Customer Care at 1-888-685-1735. ");
			return false;
		}
}





}

function validateDiscount(frmEle){

if(frmEle.DiscountCode)
{
		//alert(frmEle.DiscountCode.value+"___"+frmEle.nomorethanone.value);
		if((frmEle.DiscountCode.value== 'FREEBLIND' || frmEle.DiscountCode.value== 'freeblind') && frmEle.nomorethanone.value>1)
		{
			alert("If you want to order more than one blind, then place one order for your free blind, and then a second order for the rest of your blinds; enter discount code FMR2C at checkout for your second order to save up to 20% off your second order.");
			return false;
		}
	}
}


//Shopping cart scripts

//alert("haha");
//document.shopcart.nextbdiv.style.visibility="hidden";

function capitalizeMe(obj) {
        val = obj.value.toLowerCase();
        newVal = '';
        val = val.split(' ');
        for(var c=0; c < val.length; c++) {
                newVal += val[c].substring(0,1).toUpperCase() +
val[c].substring(1,val[c].length) + ' ';
        }
        obj.value = newVal;
}

function openwindowguide()
{
	window.open("http://www.selectblindscanada.ca/Guide.html","Guide","scrollbars=1,width=550,height=570");
}
function openshutterguide()
{
	window.open("http://www.selectblindscanada.ca/shutter.html","Shutter","scrollbars=1,width=550,height=570");
}
var iMultipleBlinds = 0;



function CalcPrice(checkJS){
// 2 on 1 

if(document.shopcart.hOption && (document.getElementById(get_radio_id_from_value(document.shopcart.hOption,'DB')))){if(document.getElementById(get_radio_id_from_value(document.shopcart.hOption,'DB')).checked){DO_that();}else{DO_that2();}}
/*
if(document.shopcart.Option6){if(document.shopcart.Option6.checked){DO_that();}else{DO_that2();}}
if(document.shopcart.Option46){if(document.shopcart.Option46.checked){DO_that();}else{DO_that2();}}
if(document.shopcart.Option48){if(document.shopcart.Option48.checked){DO_that();}else{DO_that2();}}
if(document.shopcart.Option50){if(document.shopcart.Option50.checked){DO_that();}else{DO_that2();}}
if(document.shopcart.Option52){if(document.shopcart.Option52.checked){DO_that();}else{DO_that2();}}
if(document.shopcart.Option87){if(document.shopcart.Option87.checked){DO_that();}else{DO_that2();}}
if(document.shopcart.Option81){if(document.shopcart.Option81.checked){DO_that();}else{DO_that2();}}
if(document.shopcart.Option95){if(document.shopcart.Option95.checked){DO_that();}else{DO_that2();}}
if(document.shopcart.Option105){if(document.shopcart.Option105.checked){DO_that();}else{DO_that2();}}
if(document.shopcart.Option111){if(document.shopcart.Option111.checked){DO_that();}else{DO_that2();}}
if(document.shopcart.Option115){if(document.shopcart.Option115.checked){DO_that();}else{DO_that2();}}
if(document.shopcart.Option116){if(document.shopcart.Option116.checked){DO_that();}else{DO_that2();}}
if(document.shopcart.Option126){if(document.shopcart.Option126.checked){DO_that();}else{DO_that2();}}
*/

// 2 connections
if(document.shopcart.Option192){if(document.shopcart.Option192.checked){DO_that7();}else{DO_that8();}}

// 3 on 1 

if(document.shopcart.hOption && document.getElementById(get_radio_id_from_value(document.shopcart.hOption,'TR'))){if(document.getElementById(get_radio_id_from_value(document.shopcart.hOption,'TR')).checked){DO_that3();}else{DO_that4();}}
/*
if(document.shopcart.Option8) {if(document.shopcart.Option8.checked) {DO_that3();}else{DO_that4();}}
if(document.shopcart.Option38){if(document.shopcart.Option38.checked){DO_that3();}else{DO_that4();}}
if(document.shopcart.Option47){if(document.shopcart.Option47.checked){DO_that3();}else{DO_that4();}}
if(document.shopcart.Option49){if(document.shopcart.Option49.checked){DO_that3();}else{DO_that4();}}
if(document.shopcart.Option51){if(document.shopcart.Option51.checked){DO_that3();}else{DO_that4();}}
if(document.shopcart.Option53){if(document.shopcart.Option53.checked){DO_that3();}else{DO_that4();}}
if(document.shopcart.Option88){if(document.shopcart.Option88.checked){DO_that3();}else{DO_that4();}}
if(document.shopcart.Option82){if(document.shopcart.Option82.checked){DO_that3();}else{DO_that4();}}
if(document.shopcart.Option96){if(document.shopcart.Option96.checked){DO_that3();}else{DO_that4();}}
if(document.shopcart.Option106){if(document.shopcart.Option106.checked){DO_that3();}else{DO_that4();}}
if(document.shopcart.Option112){if(document.shopcart.Option112.checked){DO_that3();}else{DO_that4();}}
if(document.shopcart.Option114){if(document.shopcart.Option114.checked){DO_that3();}else{DO_that4();}}
if(document.shopcart.Option117){if(document.shopcart.Option117.checked){DO_that3();}else{DO_that4();}}
*/

//Common
if(document.shopcart.Option23){if(document.shopcart.Option23.checked){DO_that5();}else{DO_that6();}}
if(document.shopcart.Option24){if(document.shopcart.Option24.checked){DO_that5();}else{DO_that6();}}
if(document.shopcart.Option74){if(document.shopcart.Option74.checked){DO_that5();}else{DO_that6();}}
if(document.shopcart.Option71){if(document.shopcart.Option71.checked){DO_that5();}else{DO_that6();}}
if(document.shopcart.Option158){if(document.shopcart.Option158.checked){DO_that5();}else{DO_that6();}}
if(document.shopcart.Option89){if(document.shopcart.Option89.checked){DO_that5();}else{DO_that6();}}
if(document.shopcart.Option97){if(document.shopcart.Option97.checked){DO_that5();}else{DO_that6();}}



	var frmEle = eval("document.shopcart");
	var Price = 0;var OptionsPrice = 0;var TaxPrice = 0;var TapePrice = 0;
	var Price2 = 0;
	var retailPrice = 0;
	if(frmEle.TapePrice){TapePrice = eval(frmEle.TapePrice.value);}
	var blindWidth = frmEle.WidthInches.value + frmEle.Width8ths.value;
	var blindHeight = frmEle.HeightInches.value + frmEle.Height8ths.value;
	
	//hide lift cord for premium aluminium option 4
		if(frmEle.pid.value == 8)
		{
			//alert(frmEle.FeatureOption4.disabled);
			if( frmEle.WidthInches.value == 12)
			{
			frmEle.FeatureOption4.disabled=true;
			frmEle.FeatureOption2.disabled=true;
			alert('Because of the size Blinds with 12 in width will be produced with middle tilt only');
			}
			if( frmEle.WidthInches.value > 12)
			{
			frmEle.FeatureOption4.disabled=false;
			frmEle.FeatureOption2.disabled=false;
			}
		}
	
	//hide inches when it's the max widht		
		if( frmEle.MaxWidthHide.value == frmEle.WidthInches.value)
		{
			document.getElementById('Width8thsDisplay1').style.visibility="hidden";
		}
		else
		{
		document.getElementById('Width8thsDisplay1').style.visibility="visible";
		}
		
		if( frmEle.MaxHeightHide.value == frmEle.HeightInches.value)
		{
			document.getElementById('Height8thsDisplay1').style.visibility="hidden";
		}
		else
		{
		document.getElementById('Height8thsDisplay1').style.visibility="visible";
		}	
	
	//round sizes to next highest values
	
	
	var catID = "";
	if (frmEle.cid) catID = eval(frmEle.cid.value);
	
	if(frmEle.TapeColorID)
	{
		if (catID != "22")
		{
			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";}
	

	if (catID == "19")
	{
		blindWidth = RoundUp(blindWidth);
		blindHeight = RoundUp(blindHeight);
	}
	else
	{
		blindWidth = RoundUp(blindWidth);
		blindWidth = getPriceBreak(blindWidth,aWidths);
		blindHeight = RoundUp(blindHeight);
		blindHeight = getPriceBreak(blindHeight,aHeights);
	}
	
	if((eval(frmEle.WidthInches.value) + eval(frmEle.Width8ths.value)) >= eval(document.shopcart.OverSizeWidth.value))
	{
	    document.getElementById("oversizepop").style.display = 'block';
	
	}
	else if((eval(document.shopcart.HeightInches.value + document.shopcart.Height8ths.value)) >= eval(document.shopcart.OverSizeWidth.value))
	{
	    document.getElementById("oversizepop").style.display = 'block';
	
	}
	else 	
	{
	    if(document.getElementById("oversizepop"))
	    {
	        document.getElementById("oversizepop").style.display = 'none';
	    }
	}
	
	

	
	
if (catID == "19")
	{
		var PricePer;
		var basePrice = frmEle.BPrice.value;
		if(frmEle.mul)Mul = eval(frmEle.mul.value);
		Price = basePrice * blindWidth * blindHeight;
		Price = Price * Mul;
		var ClearPrice =Price;
	}
	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,testWidth);
	Price = ToDollarsAndCents(Price);
	Price = eval(Price);
	var ClearPrice =Price;

	}

	//setup option availability prior to setting option pricing
	SetOptionStatus();
	//calc option price
	var ConvRate2 = eval(frmEle.ConvRate.value);
	
	OptionsPrice = getOptionPrices(Price);
	//alert(OptionsPrice);
	
	if(OptionsPrice)
	{
		if(OptionsPrice.value != "0[object]" && OptionsPrice.value != 0 && OptionsPrice.value != "0" && frmEle.SalePercentage.value != "0" && frmEle.SalePercentage.value != 0)
		{
		//alert(OptionsPrice);
		//alert(frmEle.SalePercentage.value);
		OptionsPrice2 = eval(OptionsPrice) / eval(frmEle.SalePercentage.value);
		}
		else
		OptionsPrice2 = 0;
	}
	else
	{
	OptionsPrice2 = 0;
	}
	
	var OptionsPriceopt = OptionsPrice;
	var ConvRate2 = eval(frmEle.ConvRate.value);
	var LimDiscPer2;
	var LimDiscPer2SalePer1;
	var ClothTapePrice = 0;	
	if(frmEle.LimDiscPer2 && frmEle.LimDiscPer2 !=0) LimDiscPer2 = eval(frmEle.LimDiscPer2.value);
	if(frmEle.SalePercentage1 && frmEle.SalePercentage1 !=0) LimDiscPer2SalePer1 = eval(frmEle.SalePercentage1.value);
	
	var SalePercentage2= eval(frmEle.SalePercentage.value);
	var SalePercentage = eval(frmEle.SalePercentage.value);
	var ConvRate = eval(frmEle.ConvRate.value);
	
	//check for tape option
	if(frmEle.TapeColorID){
	
	
	
	//new cloth calc
	
		if(document.getElementById("TapePriceVar"))
		{
				
		var prevWidthCL=0;
		frmClothPriceVar = document.getElementById("TapePriceVar").value;
				if(frmClothPriceVar !="")
				{
					
					var ClothPriceVarArray = frmClothPriceVar.split(",");
					for (var lp=0; lp < ClothPriceVarArray.length; lp++)
					{
						if(ClothPriceVarArray[lp])
						{
							var tmpArray = ClothPriceVarArray[lp].split("_");
							if(eval(tmpArray[0]) >= eval(testWidth) && prevWidthCL < eval(testWidth))
							{
document.getElementById("indollars0").innerHTML = "Add <font color='red'>$" 
+ ToDollarsAndCents(eval(tmpArray[1]) - (eval(tmpArray[1]) * (LimDiscPer2/100)) ) + "*</font>"; 

								if(frmEle.TapeColorID.value > 0)
								{
								ClothTapePrice = eval(tmpArray[1]);
								}
							}
							prevWidthCL = eval(tmpArray[0]);
						}
					}
				}
				
				}
				
	
	//new cloth calc
	
	
	//OLDS
	/*
		if(frmEle.TapeColorID.value != 0){//Tapes and Edge Banding and Trims
			if(frmEle.pid.value == 19){//EdgeBanding
				OptionsPrice2+=45;
				OptionsPrice += 45;
			}
			else if(frmEle.pid.value == 83 || frmEle.pid.value == 84)//
			{
				//Get price based on shade width.
				if(blindWidth < 24){
					OptionsPrice += 65;
					OptionsPrice2+=65;
				}
				else if(blindWidth < 30){
					OptionsPrice += 70;
					OptionsPrice2+=70;
				}
				else if(blindWidth < 32){
					OptionsPrice += 70;
				}
				else if(blindWidth < 36){
					OptionsPrice += 70;
					OptionsPrice2+=70;
				}
				else if(blindWidth < 42){
					OptionsPrice += 75;
					OptionsPrice2+=75;
				}
				else if(blindWidth < 48){
					OptionsPrice += 65;
					OptionsPrice2+=65;
				}
				else if(blindWidth < 60){
					OptionsPrice += 80;
					OptionsPrice2+=80;
				}
				else if(blindWidth < 72){
					OptionsPrice += 90;
					OptionsPrice2+=90;
				}
				else if(blindWidth < 84){
					OptionsPrice += 95;
					OptionsPrice2+=95;
				}
				else{
					OptionsPrice += 105;
					OptionsPrice2+=105;
				}
			}
			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{//Cloth Tapes 20%
			if(frmEle.pid.value == 110 || frmEle.pid.value == 117  || frmEle.pid.value == 668 || frmEle.pid.value == 87  || frmEle.pid.value == 639 || frmEle.pid.value == 667 || frmEle.pid.value == 670 || frmEle.pid.value == 137 || frmEle.pid.value == 683)	
					{
								OptionsPrice += (Price * SalePercentage *ConvRate * (TapePrice/100));
								OptionsPrice2 += (Price * SalePercentage *ConvRate * (TapePrice/100));
								
					}
			else
					{
									OptionsPrice += TapePrice;
								OptionsPrice2 += TapePrice;
								if(document.shopcart.Option6){//2 in 1
									if(document.shopcart.Option6.checked){//Add for second blind tape
									
										OptionsPrice += TapePrice;
										OptionsPrice2 += TapePrice;
									}
								}
								if(document.shopcart.Option8){//3 in 1
									if(document.shopcart.Option8.checked){//Add for third blind tape
										OptionsPrice += (TapePrice * 2);
										OptionsPrice2 += (TapePrice * 2);
									}
								}
					
					
					}
			
			
			
			}
		}
		*/
		//OLDS
		
		
		
	}
	
	
	OptionsPricePremium = 0;
	
	if(frmEle.ColorID)
    {
	    if(frmEle.ColorID.value != "") // Extra amount for  2nd type of colors
	    {	
	        var sColorID2ids = "";
    	    var sColorID = frmEle.ColorID.value + ",";
    	    
    	    if(document.getElementById("ColorID2ids") != null)
    	    {
    	        sColorID2ids = document.getElementById("ColorID2ids").value + ",";
    	    }
	        if(sColorID2ids.indexOf(sColorID) != -1)
	        { 
    	     
    //alert("SP: " + SalePercentage + "PRICE: " + Price * SalePercentage *ConvRate + "CONV: " + ConvRate+ "EA: " + frmEle.ExtraAmount.value/100 + "Lim: " + LimDiscPer2 + "TEXTRACOLOR: " + (Price * SalePercentage *ConvRate * (frmEle.ExtraAmount.value/100))+ "TEXTRACOLOR40: " + (Price * SalePercentage *ConvRate * (LimDiscPer2/100) * (frmEle.ExtraAmount.value/100)));
			    if(frmEle.ExtraAmountType.value == 2)	
			    {
					    OptionsPricePremium = (Price * SalePercentage *ConvRate * (frmEle.ExtraAmount.value/100));
					    //OptionsPrice2 += (Price * SalePercentage *ConvRate * (frmEle.ExtraAmount.value/100));		
			    }
			    else
			    {
					    OptionsPricePremium = frmEle.ExtraAmount.value;
					    //OptionsPrice2 += frmEle.ExtraAmount.value;
		        }
		    }
	    }
	}
	

	
	if(OptionsPrice >0 )
		{
		Price2 =Price  + TaxPrice;
		}

		Price += (OptionsPrice) + TaxPrice;
		


	//SalePrice = ((Price - (OptionsPrice + TaxPrice)) * SalePercentage *ConvRate) + (OptionsPrice + TaxPrice);
	//Here New Cloth Calc -- 
	SalePrice = ((Price - (OptionsPrice + TaxPrice)) * SalePercentage *ConvRate) + (OptionsPrice + ClothTapePrice + TaxPrice + OptionsPricePremium);	
	SalePricePP = ((Price - (OptionsPrice + TaxPrice)) * SalePercentage * ConvRate);
	
	if(OptionsPrice >0)
	SalePriceWOOptions = Price2 * SalePercentage * ConvRate;
	else
	SalePriceWOOptions=SalePrice;

	
	//give discount on base price only
	//SalePrice = Price * SalePercentage *ConvRate;
			
		var BaseGridPrice = eval(Price * ConvRate);
		if (frmEle.pid.value == 647) {SalePrice = SalePrice + 350; BaseGridPrice=BaseGridPrice+350;}
		if (frmEle.pid.value == 646) {SalePrice = SalePrice + 450; BaseGridPrice=BaseGridPrice+450;}

	SalePriceWOOptionsWithLim = SalePriceWOOptions - (SalePriceWOOptions * (LimDiscPer2/100));
	
	SaveLimDiscPer2 = LimDiscPer2;
	
	//LimDiscPer2 = SalePricePP - (SalePricePP * (LimDiscPer2/100)) + eval((OptionsPrice) * 0.7);
	// //Here New Cloth Calc -- 
	LimDiscPer2 = (SalePricePP + OptionsPricePremium) - ((SalePricePP + OptionsPricePremium) * (LimDiscPer2/100)) + eval((OptionsPrice + ClothTapePrice) * (1-(LimDiscPer2/100)));	//* 0.7
	
	
	
	
	SalePrice = ToDollarsAndCents(SalePrice);
	frmEle.Price.value = SalePrice;
	Price2=Price2 * ConvRate
	
	if(OptionsPrice >0)
		{
		Price2 +=eval(OptionsPrice2);
		}
		
	var widthdir2 =document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
	var PricePercentage,iv;	
	for(iv=0;iv<aPricePer.length;iv++){
		if(widthdir2 <= aPricePer[iv].MaxWidth) {
		PricePercentage = aPricePer[iv].PricePercentage;
		iv=aPricePer.length;
		}
	}		
		
	document.getElementById("DisplayClearName").innerHTML = "<input type=\"hidden\" name=\"ClearName\" value=\"" + ToDollarsAndCents(ClearPrice / PricePercentage)+"\">" + "&#160;";
	
	Price =ToDollarsAndCents(Price * ConvRate);
	RaisedBlackPrice =ToDollarsAndCents(Price2 * 1.2);
	Price2 =ToDollarsAndCents(Price2);
	 
	frmEle.DisplayPrice.value = Price;

	if(OptionsPrice >0)
		{
		document.getElementById("DisplayPriceDiv").innerHTML = "$" + RaisedBlackPrice;
		document.getElementById("DisplayPriceDiv2").innerHTML = "$" + RaisedBlackPrice;
		retailPrice = RaisedBlackPrice;
		}
	else
		{
		    if(SalePercentage == 1)
		    {
		        document.getElementById("DisplayPriceDiv").innerHTML = "<font style='font-size:18px;' COLOR='#009933'><b>$" + ToDollarsAndCents(BaseGridPrice) + "</b></font>";
		        document.getElementById("DisplayPriceDiv2").innerHTML = "<font style='font-size:18px;' COLOR='#009933'><b>$" + ToDollarsAndCents(BaseGridPrice) + "</b></font>";
		        retailPrice = ToDollarsAndCents(BaseGridPrice);
		    }
		    else
		    {
		        document.getElementById("DisplayPriceDiv").innerHTML = "$" + ToDollarsAndCents(BaseGridPrice * 1.2) + "";
		        document.getElementById("DisplayPriceDiv2").innerHTML = "$" + ToDollarsAndCents(BaseGridPrice * 1.2) + "";
		        retailPrice = ToDollarsAndCents(BaseGridPrice * 1.2);
		    }
		
		}	
	document.getElementById("DisplayPriceDivSale").innerHTML = "$" + SalePrice;	
	document.getElementById("DisplayPriceDivSale2").innerHTML = "$" + SalePrice;	
	//document.getElementById("LimDiscPerDiv3SalePer1").innerHTML =  "&#160;to $" + ToDollarsAndCents(eval(SalePrice) * LimDiscPer2SalePer1) + "<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font size='1' color='#FF2C2C'><u>final price dependant on total order value</u></font>" ;  
	
	
	// Here updating the $ options prices begin
	 if (document.shopcart.Options)
	 { 
		var mOptions = document.shopcart.Options;
		
	 if(mOptions.length) 	
	 {	
		for (var mi=0; mi < mOptions.length; mi++)
		{
		    var prevWidth=0;
	       //new options calc
		    if(mOptions[mi].value != "")
		    {
			    //variing options prices start
			    frmOptionPriceVar = document.getElementById("OptionPriceVar" + mOptions[mi].value).value;
			    if(frmOptionPriceVar !="")
			    {
				    var OptionPriceVarArray = frmOptionPriceVar.split(",");
				    for (var lp=0; lp < OptionPriceVarArray.length; lp++)
				    {
					    if(OptionPriceVarArray[lp])
					    {
						    var tmpArray = OptionPriceVarArray[lp].split("_");
						    if(eval(tmpArray[0]) >= eval(blindWidth) && prevWidth < eval(blindWidth))
						    {
    document.getElementById("indollars" + mOptions[mi].value).innerHTML = "Add <font color='red'>$" 
    + ToDollarsAndCents(eval(tmpArray[1]) - (eval(tmpArray[1]) * (SaveLimDiscPer2/100)) ) + "*</font>"; 
						    }
						    prevWidth = eval(tmpArray[0]);
					    }
				    }
			    }
		        //new options calc		
		    }
		}
	}
	else
	{
			var prevWidth=0;
			//variing options prices start for just 1 option case
				frmOptionPriceVar = document.getElementById("OptionPriceVar" + mOptions.value).value;
				if(frmOptionPriceVar !="")
				{
					var OptionPriceVarArray = frmOptionPriceVar.split(",");
					for (var lp=0; lp < OptionPriceVarArray.length; lp++)
					{
						if(OptionPriceVarArray[lp])
						{
							var tmpArray = OptionPriceVarArray[lp].split("_");
							if(eval(tmpArray[0]) >= eval(blindWidth) && prevWidth < eval(blindWidth))
							{
								document.getElementById("indollars" + mOptions.value).innerHTML = "Add <font color='red'>$" 
								+ ToDollarsAndCents(eval(tmpArray[1]) - (eval(tmpArray[1]) * (SaveLimDiscPer2/100)) ) + "*</font>"; 
							}
							prevWidth = eval(tmpArray[0]);
						}
					}
				}
	
	}
	
	// Here updating the $ options prices ends	
	
	}
	
	
	if(ToDollarsAndCents(LimDiscPer2)  != SalePrice)
	{
	    document.getElementById("LimDiscPerDiv").innerHTML = "$" + ToDollarsAndCents(LimDiscPer2);
    	
	    if(document.getElementById("LimDiscPerDiv2"))
	    {
	        document.getElementById("LimDiscPerDiv2").innerHTML = "$" + ToDollarsAndCents(LimDiscPer2);
	    }
	    
	    if(document.getElementById("LimDiscPerDiv3"))
	    {
	        document.getElementById("LimDiscPerDiv3").innerHTML = "$" + ToDollarsAndCents(LimDiscPer2);
	    }
	    
	    if(document.getElementById("DisplayPriceOff"))
	    {
	        document.getElementById("DisplayPriceOff").innerHTML = (100 - Math.round(LimDiscPer2/retailPrice*100));
	    }
	}

	
}






function CalcMiniPrice(checkJS){
	var frmEle = eval("document.shopcart");
	var Price = 0;var OptionsPrice = 0;var TaxPrice = 0;var TapePrice = 0;var LimDiscPer = 0; var LimDiscPerSalePer1 = 0;
	var blindWidth = 0;
	var blindHeight = 0;
	var SalePercentage = 1;
	var isDealer = 0;
	var TotalPrice = 0;
	var DisplayTotalPrice = "";
	var hiCookie = ""; var wiCookie = ""; 
	var hdCookie = ""; var wdCookie = "";
	if(frmEle.SalePercentage)SalePercentage = eval(frmEle.SalePercentage.value);
	//if(frmEle.PricePer)PricePer = eval(frmEle.PricePer.value);
	if(frmEle.isDealer) isDealer = eval(frmEle.isDealer.value);
	if(frmEle.ConvRate)ConvRate = eval(frmEle.ConvRate.value);
	if(frmEle.LimDiscPer && frmEle.LimDiscPer !=0) LimDiscPer = eval(frmEle.LimDiscPer.value);
	if(frmEle.LimDiscPerSalePer1 && frmEle.LimDiscPerSalePer1 !=0) LimDiscPerSalePer1 = eval(frmEle.LimDiscPerSalePer1.value);
	
	//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{
			
			
		var catID = "";
		if (frmEle.cid) catID = eval(frmEle.cid.value);
		if (catID == "19")
		{
			if(frmEle.mul)Mul = eval(frmEle.mul.value);
			var basePrice = frmEle.BPrice.value;
			blindWidth = RoundUp(blindWidth);		
			blindHeight = RoundUp(blindHeight);	
			Price = basePrice * blindWidth * blindHeight;
			Price = Price * Mul;

		}
		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,testWidth);
		}	
				
				
				
				
				
			}
			RaisedBlackPrice = ToDollarsAndCents(Price * 1.2);
			Price = ToDollarsAndCents(Price);
			SalePrice = (Price * SalePercentage * ConvRate);//give discount on base price only
				
			SalePrice = ToDollarsAndCents(SalePrice);
			TotalPrice = (SalePrice * 1) + TotalPrice;
			var DisplayPrice = "";

			if(ToDollarsAndCents((Price * ConvRate)) == SalePrice){
				DisplayPrice = "$" + Price;
				DisplayTotalPrice = "$" + Price;
							
			}
			else{
				DisplayPrice = "$" + Price + "<br><b><font color='#009933'>SelectBlinds Price:</b></font> <font class='errortextbig'>$" + SalePrice + "";
				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;
		
//hide inches when it's the max widht		
		if( frmEle.MaxWidthHide.value == frmEle.WidthInchesDisplay.value)
		{
			document.getElementById('Width8thsDisplay1').style.visibility="hidden";
			//  alert('pomoshtt');
		}
		else
		{
		document.getElementById('Width8thsDisplay1').style.visibility="visible";
		}
		
		if( frmEle.MaxHeightHide.value == frmEle.HeightInchesDisplay.value)
		{
			document.getElementById('Height8thsDisplay1').style.visibility="hidden";
		}
		else
		{
		document.getElementById('Height8thsDisplay1').style.visibility="visible";
		}
		
		blindWidth = frmEle.WidthInchesDisplay.value + frmEle.Width8thsDisplay.value;
		blindHeight = frmEle.HeightInchesDisplay.value + frmEle.Height8thsDisplay.value;	
		
		var originalblindWidth = blindWidth;
		
			var catID = "";
		if (frmEle.cid) catID = eval(frmEle.cid.value);
		if (catID == "19")
		{
			if(frmEle.mul)Mul = eval(frmEle.mul.value);
			var basePrice = frmEle.BPrice.value;
			blindWidth = RoundUp(blindWidth);		
			blindHeight = RoundUp(blindHeight);	
			Price = basePrice * blindWidth * blindHeight;
			Price = Price * Mul;
		}
		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,originalblindWidth);
		
		}	
		
		
		
		
		

		
		Price = ToDollarsAndCents(Price);
		SalePrice = (Price * SalePercentage * ConvRate);//give discount on base price only
		
		var BaseGridPrice = eval(Price * ConvRate);
		if (frmEle.pid.value == 647) {SalePrice = SalePrice + 350; BaseGridPrice=BaseGridPrice+350;}
		if (frmEle.pid.value == 646) {SalePrice = SalePrice + 450; BaseGridPrice=BaseGridPrice+450;}
		
		LimDiscPer = SalePrice - (SalePrice * (LimDiscPer/100));
		LimDiscPerSalePer1 = SalePrice - (SalePrice * (LimDiscPerSalePer1/100));
		
		SalePrice = ToDollarsAndCents(SalePrice);	
		var DisplayPrice = "";
		if(ToDollarsAndCents((Price * ConvRate))  == SalePrice){
		
			DisplayPrice = "$" + ToDollarsAndCents((Price * ConvRate));
			DisplayTotalPrice = "$" + SalePrice;
		}
		else{// herere
		
			if(isDealer == 1)
			{
			
			DisplayPrice = "$" + ToDollarsAndCents(BaseGridPrice) + "<br><font color='#009933'><b>Your Price: &#160;</b></font> <font class='errortextbig'>$" + SalePrice + "</font>";
			DisplayTotalPrice = "$" + SalePrice;
			}
			else
			{
			DisplayPrice = "$" + ToDollarsAndCents(BaseGridPrice * 1.2) + "<br><font color='#009933'><b>SelectBlinds Price: &#160;</b></font> <font class='errortextbig'>$" + SalePrice + "</font>";
			DisplayTotalPrice = "$" + SalePrice;  //eval(BaseGridPrice)* 1.2
			}
		}
		document.getElementById("DisplayPrice0").innerHTML = DisplayPrice;
		if(ToDollarsAndCents(LimDiscPer) != SalePrice)
		{
			if(isDealer != 1)
			{
			
			    if(frmEle.ShowVolumeDiscount.value == 0)
			    document.getElementById("LimDiscPerDiv").innerHTML = "$" + ToDollarsAndCents(LimDiscPer); 
			    else
			    document.getElementById("LimDiscPerDiv").innerHTML = "$" + ToDollarsAndCents(LimDiscPer) + " to $" + ToDollarsAndCents(LimDiscPerSalePer1) + "<br/>&#160;&#160;&#160;<span onMouseOver=\"MM_showHideLayers('POP1','','show');\" onMouseOut=\"MM_showHideLayers('POP1','','hide')\"><font size='1'><u>final price dependant on total order value</u></span></font>"; 
			    
			    if(document.getElementById("LimDiscPerDiv2"))
			    {
			        document.getElementById("LimDiscPerDiv2").innerHTML = "$" + ToDollarsAndCents(LimDiscPer);
			    }
			}
			
		}
	}
	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 getOptionPrices(BasePrice){
	var frmEle = eval("document.shopcart");
	var frmEleOption; var frmOptionUnit; 
	var frmOptionPrice = 0;
	var i = 0;
	var Price = 0;
	var blindWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
	
    if(frmEle.Options)
    {
        if(frmEle.Options.length)
	    {
		    for(i=0;i<frmEle.Options.length;i++)
			{
				var prevWidth = 0;
				if(frmEle.Options[i].value != "")
				{
				    //check each option if checked
				    frmEleOption = eval("document.shopcart.Option" + frmEle.Options[i].value);
				    frmOptionPrice = eval("document.shopcart.OptionPrice" + frmEle.Options[i].value);
    				
				    //variing options prices start
    				
				    frmOptionPriceVar = document.getElementById("OptionPriceVar" + frmEle.Options[i].value).value;
				    if(frmOptionPriceVar !="" && frmOptionPriceVar !="0_400")
				    {
					    var OptionPriceVarArray = frmOptionPriceVar.split(",");
    					
					    for (var lp=0; lp < OptionPriceVarArray.length; lp++)
					    {
						    if(OptionPriceVarArray[lp])
						    {
							    var tmpArray = OptionPriceVarArray[lp].split("_");
							    //alert("Width: " + tmpArray[0] + "  value:" + tmpArray[1]);
							    if(eval(tmpArray[0]) >= eval(blindWidth) && prevWidth < eval(blindWidth))
							    {
							        //alert("Width: " + tmpArray[0] + "  value:" + tmpArray[1] + " blinds width:" + blindWidth + " prev width:" + prevWidth);
							        frmOptionPrice = eval(tmpArray[1]);
							    }
							    prevWidth = eval(tmpArray[0]);
						    }
					    }
    										
				    }	
				    else
				    {
				        frmOptionPrice = "0";	
				    }		
    				
				    //variing options prices start
    				
				    frmOptionUnit = eval("document.shopcart.PriceType" + frmEle.Options[i].value);
    				
		            if(frmEleOption.checked == true)
		            {
    					
					    //old way to calculate
					    /*
					    if(frmOptionUnit.value == 1){//Dollars
							    if(frmEle.Options[i].value == 21)
							    {
    								
									    if(blindWidth < 24){
										    Price += 20;

									    }
									    else if(blindWidth < 30){
										    Price += 25;

									    }
									    else if(blindWidth < 36){
										    Price += 30;

									    }
									    else if(blindWidth < 42){
										    Price += 35;

									    }
									    else if(blindWidth < 48){
										    Price += 40;
									    }
									    else if(blindWidth < 60){
										    Price += 45;
									    }
									    else if(blindWidth < 72){
										    Price += 52;
									    }
									    else if(blindWidth < 84){
										    Price += 60;
									    }
									    else if(blindWidth < 96){
										    Price += 68;
									    }
									    else if(blindWidth < 108){
										    Price += 77;
									    }
									    else if(blindWidth < 120){
										    Price += 86;
									    }
									    else if(blindWidth < 144){
										    Price += 105;
									    }
							    }
							    else
							    {
							    Price += eval(frmOptionPrice.value);
							    }
    						
					    }
					    else{//Percentage
							    var ConvRate2 = eval(frmEle.ConvRate.value);
							    var LimDiscPer2;
							    if(frmEle.LimDiscPer2 && frmEle.LimDiscPer2 !=0)LimDiscPer2 = eval(frmEle.LimDiscPer2.value);
							    var SalePercentage2= eval(frmEle.SalePercentage.value);
							    Price += BasePrice * (eval(frmOptionPrice.value)/100) * SalePercentage2 * ConvRate2;;
					    }
					    */
					    //old way to calculate
					    Price += eval(frmOptionPrice);
    					
				    }
				}
				
			}
		}
		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);
				}
			}
			*/
			

				// just one option
				var prevWidth = 0;
				frmEleOption = eval("document.shopcart.Option" + frmEle.Options.value);	
				frmOptionPriceVar = document.getElementById("OptionPriceVar" + frmEle.Options.value).value;
				if(frmOptionPriceVar !="" && frmOptionPriceVar !="0_400")
				{

				var OptionPriceVarArray = frmOptionPriceVar.split(",");
					

						for (var lp=0; lp < OptionPriceVarArray.length; lp++)
						{
							if(OptionPriceVarArray[lp])
							{

								var tmpArray = OptionPriceVarArray[lp].split("_");
								
								//alert("Width: " + tmpArray[0] + "  value:" + tmpArray[1]);
								
								if(eval(tmpArray[0]) >= eval(blindWidth) && prevWidth < eval(blindWidth))
								{
								//alert("Width: " + tmpArray[0] + "  value:" + tmpArray[1] + " blinds width:" + blindWidth + " prev width:" + prevWidth);
								frmOptionPrice = eval(tmpArray[1]);
								}
								prevWidth = eval(tmpArray[0]);
							}
						}
										
				}
			// just one option	
			
		if(frmEleOption.checked == true){ Price += eval(frmOptionPrice);	}	
			
			
			
			
			
		}
	}



	if(frmEle.FeatureOption43){//Woodland Remote controls
		if(frmEle.FeatureOption43.value > 0){
			Price += eval(frmEle.FeatureOption43.selectedIndex) * 25;
		}
	}


	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
		}
		else {//Fancy Hem
			var rollerWidth = frmEle.WidthInches.value + frmEle.Width8ths.value;
			var HemPrice = rollerWidth/1.5;
			Price += HemPrice;
		}
	}
	if(frmEle.FeatureOption11){//Roller Type Option(Roller)
		if(frmEle.FeatureOption4){//Lift Option
			if(frmEle.FeatureOption11.value == 30){//Spring
				frmEle.FeatureOption4.disabled = true;			
					if ((eval(frmEle.WidthInches.value) + eval(frmEle.Width8ths.value)) > 60) //&& (eval(frmEle.HeightInches.value) + eval(frmEle.Height8ths.value)) > 60

							{
							alert("Sorry, the maximum size for a spring operated shade is 60\" width. Please either modify your size or order your blind with the chain option (no additional charge).");
							frmEle.FeatureOption11.value = 31;
							frmEle.FeatureOption11.focus();
							frmEle.FeatureOption4.disabled = false;
							}
			}
			else{//Chain
				frmEle.FeatureOption4.disabled = false;
			}
		}
	}
	if(frmEle.FeatureOption7){//Draw Type(vertical)
		if(frmEle.FeatureOption7.value == 15){//not standard
			Price += 35;
		}
	}
	

	
	if(frmEle.Option22){//Motorization
		if(frmEle.Option22.checked){//Motor selected
			if(document.shopcart.Option6){//2 in 1
				if(document.shopcart.Option6.checked){//Add for second blind motor
					Price += (frmEle.OptionPrice22.value * 1);
					
				}
			}
			if(document.shopcart.Option8){//3 in 1
				if(document.shopcart.Option8.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.shopcart.Option6.checked){//Add for second blind motor
					Price += (frmEle.OptionPrice9.value * 1);
					
				}
			}
			if(document.shopcart.Option8){//3 in 1
				if(document.shopcart.Option8.checked){//Add for second and third blind motor
					Price += (frmEle.OptionPrice9.value * 2);
				}
			}
		}
	}
	
	if(frmEle.Option41){//Motorization
		if(frmEle.Option41.checked){//Motor selected
			if(document.shopcart.Option41){//2 in 1
				if(document.shopcart.Option6.checked){//Add for second blind motor
					Price += (frmEle.OptionPrice41.value * 1);
					
				}
			}
			if(document.shopcart.Option8){//3 in 1
				if(document.shopcart.Option8.checked){//Add for second and third blind motor
					Price += (frmEle.OptionPrice41.value * 2);
				}
			}
		}
	}

	return Price
}





function getBasePrice(theWidth,theHeight,testWidth,testHeight,originalblindWidth){
	var i = 0;
	var Price = 0;
	var PricePer2 = 0;
	
	
	for(i=0;i<aPricePer.length;i++){
		if(originalblindWidth <= aPricePer[i].MaxWidth) {
		PricePer2 = aPricePer[i].PricePercentage;
		i=aPricePer.length;
		//alert(originalblindWidth);
		//return;
		}
	}
	i = 0;
	
	//alert(theWidth + " " + theHeight);
	for(i=0;i<aPricing.length;i++){
		if(theWidth==aPricing[i].width && theHeight==aPricing[i].height) {
			//Find matching price
			Price = aPricing[i].price * PricePer2;
			document.shopcart.PricePer.value=PricePer2 * document.shopcart.SalePercentage.value;
			
			

if(Price == 0){
	us = document.getElementById("size_not_availablepop");
	if(us)
	{
		var winX = screen.width;
		if (winX == '1600') us.style.left = 1070;
		if (winX == '1440') us.style.left = 990;
		if (winX == '1400') us.style.left = 970;
		if (winX == '1280') us.style.left = 908;
		if (winX == '1152') us.style.left = 845;
		if (winX == '1024') us.style.left = 780;
		if (winX == '800') us.style.left = 750;

		MM_showHideLayers('size_not_availablepop','','show');
		MM_showHideLayers('2on1PopUp','','hide');
		document.getElementById("oversizepop").style.display = 'none';
		MM_showHideLayers('hidebutton','','hide');
	}

}
else
{
MM_showHideLayers('size_not_availablepop','','hide');
MM_showHideLayers('hidebutton','','show');
}
			


// START SHUTTERS

		if (document.shopcart.cid.value == 22 && document.getElementById('FeatureOption71') != null)
	{
		
	// RULE NO 2.  if opening Depth (71) = Less than 1 3/4 (145) -> mount type (72)  = Outside (150)
		  
		 // DEFINE MOUNT OUTSIDE
		 // It's always disabled by default, unless is standard window and it has trim...
		 document.shopcart.FeatureOption72.disabled = true;
	
		 if (document.shopcart.FeatureOption69.value == 0)
		 {
		 		document.shopcart.FeatureOption72.selectedIndex = 0;
		 }
		 
		 if (document.shopcart.FeatureOption69.value == 138 
//		 			&& (document.shopcart.FeatureOption70.value == 143 || document.shopcart.FeatureOption70.value == 144)
	 			)
		 {
		 		document.shopcart.FeatureOption72.disabled = false;
		 }

		 if (document.shopcart.FeatureOption69.value == 139 
		 		 || document.shopcart.FeatureOption69.value == 140 
		 		 || document.shopcart.FeatureOption69.value == 232
		 		)
		 {
		 	  if (document.shopcart.FeatureOption72.selectedIndex != 2)
		 	  {         
		 	  	alert('Based on your Window Type, your shutters must be Mounted Outside the window opening.');
		 	  }
		 		
		 		document.shopcart.FeatureOption72.selectedIndex = 2;
		 		document.shopcart.FeatureOption72.disabled = true;
		 }
     else if (document.shopcart.FeatureOption69.value == 138 && document.shopcart.FeatureOption71.value == 145)
		 {
		 	  if (document.shopcart.FeatureOption72.selectedIndex != 2)
		 	  {         
		 	  	alert('Based on your opening depth of less than 1 3/4", your shutters must be Mounted Outside the window opening.');
		 	  }
		 		document.shopcart.FeatureOption72.selectedIndex = 2;
		 		document.shopcart.FeatureOption72.disabled = true;
		 }	

	// RULE NO 1.  if opening Trim = NO TRIM OR SILL or NO TRIM WITH SILL -> Frame = Yes
	// RULE NO 3. If mount Type (72) == Outside (150) -> Frame = Mandatory  and  Louver Size Could be any
	
		 shuttersFrameOptionFlag = document.getElementById('ShuttersFrameOption');
		 shuttersOpeningTrim = document.getElementById('ShuttersOpeningTrim');
		 
		 if (    (document.shopcart.FeatureOption70.value == 141 && document.shopcart.FeatureOption69.value == 138)
		 			|| (document.shopcart.FeatureOption70.value == 142 && document.shopcart.FeatureOption69.value == 138)
		      ||  document.shopcart.FeatureOption72.value == 150 
	//      || (document.shopcart.FeatureOption93.value == 233 && document.shopcart.FeatureOption69.value == 139) //--
	// 	    ||  document.shopcart.FeatureOption70.value == 0
		 		  || (document.shopcart.FeatureOption69.value == 138 
		 		 		 && (document.shopcart.FeatureOption70.value == 141 || document.shopcart.FeatureOption70.value == 142))
		 	  )
		 {
		 		if ((!document.shopcart.Option133.checked && !document.shopcart.Option141.checked)
		 		     && (!document.shopcart.Option138.checked && !document.shopcart.Option142.checked)
		 		   )
 		 		//     && (document.shopcart.FeatureOption70.value != 0 ||  (document.shopcart.FeatureOption93.value == 233 && document.shopcart.FeatureOption69.value == 139))) //--
		 		{
	    		alert ('Please note: A Standard Frame Option has been added to your order based on your choice of one or more of the following:\r\n\r\n\u00B7 Window Trim:  Windows with "No Trim" require a frame\r\n\u00B7 Window Opening Depth:  Opening depth of "less than 1 3/4" requires a frame\r\n\u00B7 Mount Type:  "Outside Mount" requires a frame');
	
		 			document.shopcart.Option138.checked = true;	
		 			document.shopcart.Option138.disabled = true;	
		 		}
		 		else if ((document.shopcart.Option133.checked && document.shopcart.Option138.checked)
		 			    || (document.shopcart.Option141.checked && document.shopcart.Option142.checked))
		 	  {
		 	  	if (shuttersFrameOptionFlag.value == "138")
		 	  	{
		 	  		//alert("flag = 138");
		 	  		document.shopcart.Option138.checked = false;	
		 				document.shopcart.Option138.disabled = false;
		 	  		document.shopcart.Option133.checked = true;	
		 				document.shopcart.Option133.disabled = true;	
		 				
		 				document.shopcart.Option141.checked = false;	
		 				document.shopcart.Option141.disabled = false;
		 				document.shopcart.Option142.checked = false;	
		 				document.shopcart.Option142.disabled = false;
		 	  	}
		 	  	else if (shuttersFrameOptionFlag.value == "133")
		 	    {
		 	    	//alert("flag = 133");
		 	  		document.shopcart.Option138.checked = true;	
		 				document.shopcart.Option138.disabled = true;
		 				document.shopcart.Option133.checked = false;	
		 				document.shopcart.Option133.disabled = false;			
		 				
		 				document.shopcart.Option141.checked = false;	
		 				document.shopcart.Option141.disabled = false;
		 				document.shopcart.Option142.checked = false;	
		 				document.shopcart.Option142.disabled = false;
		 	    }
					else if (shuttersFrameOptionFlag.value == "142")
		 	  	{
		 	  		//alert("flag = 142");
		 	  		document.shopcart.Option138.checked = false;	
		 				document.shopcart.Option138.disabled = false;
		 				document.shopcart.Option133.checked = false;	
		 				document.shopcart.Option133.disabled = false;		
		 	  		
		 	  		document.shopcart.Option142.checked = false;	
		 				document.shopcart.Option142.disabled = false;
		 	  		document.shopcart.Option141.checked = true;	
		 				document.shopcart.Option141.disabled = true;	
		 	  	}
		 	  	else if (shuttersFrameOptionFlag.value == "141")
		 	    {
		 	    	//alert("flag = 141");
		 	    	document.shopcart.Option138.checked = false;	
		 				document.shopcart.Option138.disabled = false;
		 				document.shopcart.Option133.checked = false;	
		 				document.shopcart.Option133.disabled = false;
		 				
		 	  		document.shopcart.Option142.checked = true;	
		 				document.shopcart.Option142.disabled = true;
		 				document.shopcart.Option141.checked = false;	
		 				document.shopcart.Option141.disabled = false;			
		 	    }
	
		 	  }
		 	  else if ((document.shopcart.Option133.checked) || (document.shopcart.Option141.checked))
		 	  {
		 	  	document.shopcart.Option133.disabled = true;	
		 	  	document.shopcart.Option141.disabled = true;		
		 	  }
		 	  else if ((document.shopcart.Option138.checked) || (document.shopcart.Option142.checked))
		 	  {
		 	  	document.shopcart.Option138.disabled = true;
		 	  	document.shopcart.Option142.disabled = true;	
		 	  }	
		 }
		 else
		 {
		 		document.shopcart.Option133.disabled = false; // Decorative Frame
		 		document.shopcart.Option138.disabled = false;	// Standard Frame 
		 	  document.shopcart.Option141.disabled = false; // Decorative Frame (Stains)
		 		document.shopcart.Option142.disabled = false;	// Standard Frame  (Stains)
		 		
		 		if ((shuttersOpeningTrim.value == 143 || shuttersOpeningTrim.value == 144) 
		 		  && shuttersOpeningTrim.value == document.shopcart.FeatureOption70.value
		 		  && ((document.shopcart.Option138.checked || document.shopcart.Option142.checked)
		 		   && (document.shopcart.Option133.checked || document.shopcart.Option141.checked)))
		 		{
			 		if (shuttersFrameOptionFlag.value == "138")
		 	  	{ 
	 	  			document.shopcart.Option133.checked = true;	
	 	  			document.shopcart.Option138.checked = false;
	 	  			document.shopcart.Option141.checked = false;
	 	  			document.shopcart.Option142.checked = false;
		 	  	}
		 	  	else if (shuttersFrameOptionFlag.value == "133")
		 	    {
	 	    	  document.shopcart.Option133.checked = false;	
	 	    	  document.shopcart.Option138.checked = true;	
	 	  			document.shopcart.Option141.checked = false;
	 	  			document.shopcart.Option142.checked = false;
		 	    }
		 	  	else if (shuttersFrameOptionFlag.value == "142")
		 	    {
	 	    	  document.shopcart.Option133.checked = false;	
	 	    	  document.shopcart.Option138.checked = false;	
	 	    	  document.shopcart.Option141.checked = true;
	 	  			document.shopcart.Option142.checked = false;
	 	    	  
		 	    }
		 	    else if (shuttersFrameOptionFlag.value == "141")
		 	    {
	 	    	  document.shopcart.Option133.checked = false;	
	 	    	  document.shopcart.Option138.checked = false;	
	 	    	  document.shopcart.Option141.checked = false;
	 	  			document.shopcart.Option142.checked = true;
		 	    }
	 	  	}
		 }
	 
		 //  Change Flags for Frame options depending on opening Trim
		 if ((document.shopcart.Option138.checked))
		 {
		 		shuttersFrameOptionFlag.value = "138";
		 }
		 else if (document.shopcart.Option142.checked)
		 {
		 		shuttersFrameOptionFlag.value = "142";
		 }
		 else if ((document.shopcart.Option133.checked) )
		 {
		 		shuttersFrameOptionFlag.value = "133";	
		 }
		 else if ((document.shopcart.Option141.checked))
		 {
		 		shuttersFrameOptionFlag.value = "141";	
		 }
		 else
		 {
		 		shuttersFrameOptionFlag.value = "";	
		 }
		
		 shuttersOpeningTrim.value = document.shopcart.FeatureOption70.value;
		 		
	// RULE NO 4. if Mount Type (72) = INSIDE (149) -> based on chart and opening depth
	// Opening Depth  (71)  -> Limit Louver size (73) to:
	// 1 3/4" - 2 (146)      = 151
	// 2 1/4" - 2 7/8  (147) = 151, 152
	
		if (document.shopcart.FeatureOption72.value == 149)
		{
			if (document.shopcart.FeatureOption71.value == 146 
					&& document.shopcart.FeatureOption73.value != 0
					&& document.shopcart.FeatureOption73.value != 151)
			{
				alert ('Sorry, based on your Opening Depth and Mount Type, only 2.5" Louver Size will fit.');
				document.shopcart.FeatureOption73.selectedIndex = 1;
			}
			else if (document.shopcart.FeatureOption71.value == 147 
					&& document.shopcart.FeatureOption73.value != 0
					&& document.shopcart.FeatureOption73.value != 151
					&& document.shopcart.FeatureOption73.value != 152)
			{
				alert ('Sorry, based on your Opening Depth and Mount Type, only 2.5" or 3.5" Louver Size will fit.');
				document.shopcart.FeatureOption73.selectedIndex = 1;
			}
		}
		
	// RULE NO 6.  FineView Not available if:
	// Frame = No AND Mount Type (72) = Inside (149) AND ( Opening Depth =  1 3/4-2"  OR Louver Size (73) = 4.5" (153))
	
		if (( (!document.shopcart.Option133.checked && !document.shopcart.Option138.checked)
		   || (!document.shopcart.Option141.checked && !document.shopcart.Option142.checked))
		 	  && document.shopcart.FeatureOption72.value == 149
				&& ( document.shopcart.FeatureOption71.value == 146 || document.shopcart.FeatureOption73.value == 153))
		{
			// ADDED 2009.09.21
			if (!document.shopcart.Option130.disabled && document.shopcart.Option130.checked)
			{
				alert ('Selectview is not available on 4 1/2" Louvres.');  
			}
			
			document.shopcart.Option130.disabled = true;
			document.shopcart.Option130.checked = false;
		}
		else
		{
			document.shopcart.Option130.disabled = false;
		}
		
	// RULE No 7. Panel configuration Range.
	// width <=30  = L, R, LR, LL, RR
	// width > 30 and <=60 = LR, LL, RR, LLR, LRR, LTRTR
	// width > 60  = LLR, LRR, LTRTR, LL RR, LR T LR
	
	  var openingWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value; 

		if (document.shopcart.FeatureOption69.value != 140 && document.shopcart.FeatureOption69.value != 232)
		{    // Check sizes if it's not French doors...
			if (openingWidth <=20)
		  {
				if (document.shopcart.FeatureOption76.value == 158
						|| document.shopcart.FeatureOption76.value == 159
						|| document.shopcart.FeatureOption76.value == 160
						|| document.shopcart.FeatureOption76.value == 161
						|| document.shopcart.FeatureOption76.value == 162
						|| document.shopcart.FeatureOption76.value == 163
						|| document.shopcart.FeatureOption76.value == 164
						|| document.shopcart.FeatureOption76.value == 165
						|| document.shopcart.FeatureOption76.value == 166)
				{
					alert ("Sorry, Panel Configuration should be 1 panel for windows under 20 inches wide.");
					document.shopcart.FeatureOption76.selectedIndex = 1;
				}
			}
	 		else if (openingWidth > 20 && openingWidth <=30)
			{
				if (document.shopcart.FeatureOption76.value == 161
						|| document.shopcart.FeatureOption76.value == 162
						|| document.shopcart.FeatureOption76.value == 163
						|| document.shopcart.FeatureOption76.value == 164
						|| document.shopcart.FeatureOption76.value == 165
						|| document.shopcart.FeatureOption76.value == 166)
				{
					alert ("Sorry, Panel Configuration should be 1 or 2 panels for windows between 20 1/8 inches and 30 inches.")
					document.shopcart.FeatureOption76.selectedIndex = 0;
				}
			}
			else if (openingWidth > 30 && openingWidth <=40)
		  {
		  	if (document.shopcart.FeatureOption76.value == 156
						|| document.shopcart.FeatureOption76.value == 157
						|| document.shopcart.FeatureOption76.value == 164
						|| document.shopcart.FeatureOption76.value == 165
						|| document.shopcart.FeatureOption76.value == 166)
				{
					alert ("Sorry, Panel Configuration should be 2 or 3 panels for windows between 30 1/8 inches and 40 inches.")
					document.shopcart.FeatureOption76.selectedIndex = 0;
				}
		  }
			else if (openingWidth > 40 && openingWidth <=60)
		  {
		  	if (document.shopcart.FeatureOption76.value == 156
						|| document.shopcart.FeatureOption76.value == 157
						|| document.shopcart.FeatureOption76.value == 166)
				{
					alert ("Sorry, Panel Configuration should be 2, 3 or 4 panels for windows between 40 1/8 inches and 60 inches.")
					document.shopcart.FeatureOption76.selectedIndex = 0;
				}
		  }
			else if (openingWidth > 60 && openingWidth <=90)
		  {
		  	if (document.shopcart.FeatureOption76.value == 156
						|| document.shopcart.FeatureOption76.value == 157
						|| document.shopcart.FeatureOption76.value == 158
						|| document.shopcart.FeatureOption76.value == 159
						|| document.shopcart.FeatureOption76.value == 160)
				{
					alert ("Sorry, Panel Configuration should be 3, 4 or 6 panels for windows between 60 1/8 inches and 90 inches.")
					document.shopcart.FeatureOption76.selectedIndex = 0;
				}
		  }
		  else if (openingWidth > 90)
		  {
		  	  	if (document.shopcart.FeatureOption76.value == 156
						|| document.shopcart.FeatureOption76.value == 157
						|| document.shopcart.FeatureOption76.value == 158
						|| document.shopcart.FeatureOption76.value == 159
  					|| document.shopcart.FeatureOption76.value == 160
	  				|| document.shopcart.FeatureOption76.value == 161
		  			|| document.shopcart.FeatureOption76.value == 162
						|| document.shopcart.FeatureOption76.value == 163)
				{
					alert ("Sorry, Panel Configuration should be 4 or 6 panels for windows over 90 inches wide.");
					document.shopcart.FeatureOption76.selectedIndex = 0;
				}
		  }
	  }
	  
	// RULE 8. If Decorative frame is checked then style available
	
		if ((document.shopcart.Option133.checked) || (document.shopcart.Option141.checked))
		{
			document.shopcart.FeatureOption83.disabled = false;
		}
		else
		{
			document.shopcart.FeatureOption83.selectedIndex = 1;
			document.shopcart.FeatureOption83.disabled = true;
		}
	
	// RULE 9. If Decorative Panel is checked then style is available
		if (document.shopcart.FeatureOption69.value == 139 || document.shopcart.FeatureOption69.value == 140 ||  document.shopcart.FeatureOption69.value == 232)
		{
			if (document.shopcart.FeatureOption77.value != 167)
			{
				alert('Please note: Only Full Height Shutters are available with French Doors and Sliding Doors.');
			}
			
			document.shopcart.FeatureOption77.selectedIndex = 1;
			document.shopcart.FeatureOption77.disabled = true;

		}
		else
		{	
			document.shopcart.FeatureOption77.disabled = false;
		}
			

			if (document.shopcart.FeatureOption69.value == 140 ||  document.shopcart.FeatureOption69.value == 232)
			{
				
				if (document.shopcart.FeatureOption93.value == 234)
				{
					alert('Please note: Based on the window type selected, 3 Sided Trim is not allowed.');
					document.shopcart.FeatureOption93.selectedIndex = 1;
				}
			}
			
			if (document.shopcart.FeatureOption69.value == 139) //--
			{
				if (document.shopcart.FeatureOption93.value == 235)
				{
					alert('Please note: Based on the window type selected, 4 Sided Trim Around Glass is not allowed.');
					document.shopcart.FeatureOption93.selectedIndex = 1;
				}
				
				if (document.shopcart.FeatureOption82.value == 182)
				{
					alert('Please note: Based on the window type selected, Mount Outside Trim is not allowed.');
					document.shopcart.FeatureOption82.selectedIndex = 1;
				}
				
			}
	
	// RULE NO 11. If Panel style (77) == Cafe Style (169)... T-Post should be checked
	
		document.shopcart.Option147.disabled = true;  // It's always disabled
	
		if (document.shopcart.FeatureOption77.value == 169)
		{
			if (!document.shopcart.Option147.checked && !document.shopcart.Option148.checked)
			{
				alert("Please note: A Horizontal T-Post has been added to your order based on your choice of Cafe Style.");		
								document.shopcart.FeatureOption96.selectedIndex = 0;
			}
	  	document.shopcart.Option147.checked = true;
		}
		else
		{
			document.shopcart.Option147.checked = false;
			document.shopcart.Option148.checked = false;
		}

	// RULE NO 11b. If Panel Configuration (76) has T-Post. Options: 163, 165, 166
	
		document.shopcart.Option152.disabled = true;  // It's always disabled
	
		if (document.shopcart.FeatureOption76.value == 163
			 || document.shopcart.FeatureOption76.value == 165 
			 || document.shopcart.FeatureOption76.value == 166)
		{
			if (!document.shopcart.Option152.checked && !document.shopcart.Option153.checked)
			{
				alert("Please note: A T-Post has been added to your order, as your choice of Panel Configuration requires a T-Post.");		
				document.shopcart.FeatureOption97.selectedIndex = 0;
			}
	  	document.shopcart.Option152.checked = true;
		}
		else
		{
			document.shopcart.Option152.checked = false;
			document.shopcart.Option153.checked = false;
		}

	// RULE NO 12. If Panel style (77) == Cafe Style (169)... and Frame selected show Height box 
	
		if (document.shopcart.FeatureOption77.value == 169 
		    && ((document.shopcart.Option133.checked || document.shopcart.Option138.checked)
		   	 || (document.shopcart.Option141.checked || document.shopcart.Option142.checked)))
		{
			
			var objRow = document.getElementById('TPostRow'); 
			if (objRow.style.display == "none")
			{
				alert("Please make sure to enter the height you want your Cafe Style shutter to be and NOT the height of the window opening in the Height measurement above.\r\n\r\nEnter the Window opening height in the box below so we can prepare the correct frame size.");	
			}
			showRow("TPostRow");

			document.shopcart.TPostHeight.disabled = false;
			document.shopcart.TPostHeight8ths.disabled = false;
		}
		else
		{
			document.shopcart.TPostHeight.disabled = true;
			document.shopcart.TPostHeight8ths.disabled = true;
			
			hideRow("TPostRow");
		}


		if (document.shopcart.Option151.checked)
		{
			
			var objRow = document.getElementById('DividerRailRow'); 
			if (objRow.style.display == "none")
			{
				alert("Please enter the distance from the bottom.");	
			}
			
			showRow("DividerRailRow");
		}
		else
		{
			hideRow("DividerRailRow");
		}
		

		
	// RULE 13. - When French Door with Knob or French Door with Lever is chosen, #2 Changes to Door Trim. always outside mount. 
	// Program for L 1 Panel or R 1 Panel. 
	// RULE 13. -	When French Door with Lever is chosen, #2 Changes to Door Trim. outside mount. Program for L1 Panel or R1 Panel. 
	//		Option for French-Door Cutout must be shown and enabled
	// RULE 13. -	When Sliding Door is chosen, #2 Changes to Door Trim.
	
	//  138 Standard Window 
	//  140 French Door with Knob
	//  139 Sliding Doors
	//  232 French Door with Lever
	
		if (document.shopcart.FeatureOption69.value == 138 ||  document.shopcart.FeatureOption69.value == 0)
		{
			showRow("featureRow70");		
			hideRow("featureRow93");
	
			document.shopcart.FeatureOption93.selectedIndex = 0;
	
	  	hideRow("optionRow149");
	  	document.shopcart.Option149.checked = false;
	  	
	  	document.shopcart.FeatureOption71.disabled = false;
		}
		else 
		{
			showRow("featureRow93");		
			hideRow("featureRow70");
			
			document.shopcart.FeatureOption70.selectedIndex = 0;

			if (document.shopcart.FeatureOption69.value == 140 ||  document.shopcart.FeatureOption69.value == 232)
			{
				document.shopcart.FeatureOption71.selectedIndex = 1; // ADDED 2009.10.20
				document.shopcart.FeatureOption71.disabled = true;
				
				if (!(document.shopcart.FeatureOption76.value == 156 || document.shopcart.FeatureOption76.value == 157 || document.shopcart.FeatureOption76.value == 0))
				{
					alert('Please note: The only Panel Configuration for a French Door is "L - 1 panel" or "R - 1 panel".\r\nUsually, the shutter will be hinged the same way as the door hinge.\r\nFor example, if the door is hinged  to the left, we suggest you choose "L - 1 panel".');
					document.shopcart.FeatureOption76.selectedIndex = 0;
				}
				
//		 	  if (document.shopcart.FeatureOption72.value != 150)
//		 	  {         
//		 	  	alert('Based on the window type selected, your shutters must be Mounted Outside the window opening.');
//		 	  }
//		 		document.shopcart.FeatureOption72.selectedIndex = 2;
//		 		document.shopcart.FeatureOption72.disabled = true;
		 		
		 		if (document.shopcart.FeatureOption69.value == 232)
		 		{
	 				showCell("optionRow149");	
		 		}
		 		else
		 		{
			  	hideRow("optionRow149");
			  	document.shopcart.Option149.checked = false;
		 		}
			}
			else
			{
				document.shopcart.FeatureOption71.disabled = false; // ADDED 2009.10.20
				
//				if (document.shopcart.FeatureOption72.value != 150)
//		 	  {         
//		 	  	alert('Based on the window type selected, your shutters must be Mounted Outside the window opening.');
//		 	  }
//		 	  document.shopcart.FeatureOption72.selectedIndex = 2;
//		 		document.shopcart.FeatureOption72.disabled = true;
				
		  	hideRow("optionRow149");
		  	document.shopcart.Option149.checked = false;
			}
	
		}
	
// RULE NO 5. If 3-SIDED TRIM WITH SILL or 4-SIDED TRIM NO SILL and FRAME = YES, then MOUNT ON TRIM or OUTSIDE TRIM
	
		if (((document.shopcart.FeatureOption70.value == 143 || document.shopcart.FeatureOption70.value == 144)
				|| (document.shopcart.FeatureOption93.value == 234 || document.shopcart.FeatureOption93.value == 235))
		 && ((document.shopcart.Option138.checked || document.shopcart.Option133.checked)
		  || (document.shopcart.Option142.checked || document.shopcart.Option141.checked)))
		{
			document.shopcart.FeatureOption82.disabled = false;
	
			if (document.shopcart.FeatureOption72.value == 149)
			{
				document.shopcart.FeatureOption82.selectedIndex = 1;
				document.shopcart.FeatureOption82.disabled = true;
			}
		}
		else
		{
				document.shopcart.FeatureOption82.selectedIndex = 1;
				document.shopcart.FeatureOption82.disabled = true;
		}
	
		if (document.shopcart.FeatureOption82.disabled)
		{
			hideRow("featureRow82");	
		}
		else
		{
			showRow("featureRow82");	
		}
	
	
	// RULE NO 10. If Stain colour selected. Show additional amount for Panel and Frame Options.
	
	//FIX STAINS
	
			document.shopcart.Option141.disabled = document.shopcart.Option133.disabled;
			document.shopcart.Option142.disabled = document.shopcart.Option138.disabled;
			document.shopcart.Option143.disabled = document.shopcart.Option132.disabled;
			document.shopcart.Option146.disabled = document.shopcart.Option134.disabled;
			document.shopcart.Option148.disabled = document.shopcart.Option147.disabled;
			document.shopcart.Option153.disabled = document.shopcart.Option152.disabled;
			
			if(document.shopcart.ColorID)
			{
			    var sColorID2ids = "";
    	        var sColorID = document.shopcart.ColorID.value + ",";
    	        
    	        if(document.getElementById("ColorID2ids") != null)
    	        {
    	            sColorID2ids = document.getElementById("ColorID2ids").value + ",";
    	        }
    	    
    	        if(sColorID2ids.indexOf(sColorID) != -1)			
			    {		
					  if (document.shopcart.Option133.checked)
						{
							document.shopcart.Option141.checked = true;
							document.shopcart.Option133.checked = false;
	 					}
					
					  if (document.shopcart.Option138.checked)
						{
							document.shopcart.Option142.checked = true;
							document.shopcart.Option138.checked = false;
	 					}
	 					
	 					if (document.shopcart.Option132.checked)
						{
							document.shopcart.Option143.checked = true;
							document.shopcart.Option132.checked = false;
	 					}
						
						if (document.shopcart.Option134.checked) // ADDED 2009.09.21
						{
							document.shopcart.Option146.checked = true;
							document.shopcart.Option134.checked = false;
	 					}
						
						if (document.shopcart.Option147.checked) // ADDED 2009.09.21
						{
							document.shopcart.Option148.checked = true;
							document.shopcart.Option147.checked = false;
	 					}
						
						
						if (document.shopcart.Option152.checked) // ADDED 2010.01.16
						{
							document.shopcart.Option153.checked = true;
							document.shopcart.Option152.checked = false;
	 					}
						
						hideRow("optionRow133");
						hideRow("optionRow138");
						hideRow("optionRow132");	
					  hideRow("optionRow134"); // ADDED 2009.09.21
					  hideRow("optionRow147"); // ADDED 2009.09.21
					  hideRow("optionRow152"); // ADDED 2010.01.16
					  					  
					  showCell("optionRow141");
						showCell("optionRow142");
						showCell("optionRow143");
						showCell("optionRow146"); // ADDED 2009.09.21
						showCell("optionRow148"); // ADDED 2009.09.21
						showCell("optionRow153"); // ADDED 2010.01.16
				}
				else
				{
						if (document.shopcart.Option141.checked)
						{
							document.shopcart.Option141.checked = false;
							document.shopcart.Option133.checked = true;
	 					}	
	
					  if (document.shopcart.Option142.checked)
						{
							document.shopcart.Option142.checked = false;
							document.shopcart.Option138.checked = true;
	 					}
	 					
	  				if (document.shopcart.Option143.checked)
						{
							document.shopcart.Option143.checked = false;
							document.shopcart.Option132.checked = true;
	 					}
	 					
	 					if (document.shopcart.Option146.checked) // ADDED 2009.09.21
						{
							document.shopcart.Option146.checked = false;
							document.shopcart.Option134.checked = true;
	 					}
	 					
	 					if (document.shopcart.Option148.checked) // ADDED 2009.09.21
						{
							document.shopcart.Option148.checked = false;
							document.shopcart.Option147.checked = true;
	 					}
	 					
	 					if (document.shopcart.Option153.checked) // ADDED 2010.01.16
						{
							document.shopcart.Option153.checked = false;
							document.shopcart.Option152.checked = true;
	 					}
	 													
	 													
	 					showCell("optionRow133");
						showCell("optionRow138");
						showCell("optionRow132");
						showCell("optionRow134"); // ADDED 2009.09.21
						showCell("optionRow147"); // ADDED 2009.09.21
						showCell("optionRow152"); // ADDED 2009.09.21
						
						hideRow("optionRow141");
						hideRow("optionRow142");
						hideRow("optionRow143");	
						hideRow("optionRow146");	// ADDED 2009.09.21
						hideRow("optionRow148");	// ADDED 2009.09.21
						hideRow("optionRow153");	// ADDED 2009.09.21
				}
			}
		
			if (document.shopcart.FeatureOption83.disabled)
			{
				hideRow("featureRow83");	
			}
			else
			{
				showRow("featureRow83");	
			}
	
			if (document.shopcart.Option147.checked || document.shopcart.Option148.checked)
			{ 
				document.shopcart.FeatureOption96.disabled = false;	
			}
			else
			{
				document.shopcart.FeatureOption96.disabled = true;	
			}
			
			if (document.shopcart.FeatureOption96.disabled)
			{
				hideRow("featureRow96");	
			}
			else
			{
				showRow("featureRow96");	
			}

// ///////////////////////////////////////////////////////

			if (document.shopcart.Option152.checked || document.shopcart.Option153.checked)
			{
				document.shopcart.FeatureOption97.disabled = false;	
			}
			else
			{
				document.shopcart.FeatureOption97.disabled = true;	
			}
			
			if (document.shopcart.FeatureOption97.disabled)
			{
				hideRow("featureRow97");	
			}
			else
			{
				showRow("featureRow97");	
			}


// Hide/show T-post boxes if options disabled
// TPostPanelConfig - TPostCafeOnly

			if (document.shopcart.Option147.checked || document.shopcart.Option148.checked)
			{	
				showRow("TPostCafeOnly", "block");
			}
			else
			{
				hideRow("TPostCafeOnly");
			}
						
			if (document.shopcart.Option152.checked || document.shopcart.Option153.checked)
			{
				showRow("TPostPanelConfig", "block");	
			}
			else
			{
				hideRow("TPostPanelConfig");
			}
			
//			if (document.shopcart.FeatureOption84.disabled)
//			{
//				hideRow("featureRow84");	
//			}
//			else
//			{
//				showRow("featureRow84");	
//			}

			var optionsChecked = new Array(9) ;
			optionsChecked[0]="138"; 
			optionsChecked[1]="142"; 
			optionsChecked[2]="133"; 
			optionsChecked[3]="141"; 
			optionsChecked[4]="147"; 
			optionsChecked[5]="148"; 
			optionsChecked[6]="151"; 
		  optionsChecked[7]="152"; 
			optionsChecked[8]="153"; 
			
			for (i = 0; i < optionsChecked.length; ++ i)
			{
				var optionsCheck = document.getElementById('Option'+optionsChecked[i])
				if(optionsCheck)
				{
					if(optionsCheck.checked && optionsCheck.disabled)
					{
						optionsCheck.disabled = false;
					}
				}
			}

			var featuresChecked = new Array(9) ;
			featuresChecked[0]="69"; 
			featuresChecked[1]="70"; 
			featuresChecked[2]="93"; 
			featuresChecked[3]="71"; 
			featuresChecked[4]="72"; 
			featuresChecked[5]="73"; 
			featuresChecked[6]="77"; 
			featuresChecked[7]="76"; 
			featuresChecked[8]="88"; 

			for (i = 0; i < featuresChecked.length; ++ i)
			{
				var featureCheck = document.getElementById('FeatureOption'+featuresChecked[i])
				if(featureCheck)
				{
					if(featureCheck.selectedIndex != 0 && featureCheck.disabled)
					{
						featureCheck.disabled = false;
					}
				}
			}
	}

// END SHUTTERS




if (document.shopcart.pid.value != 701 && document.shopcart.pid.value != 702 && document.shopcart.pid.value != 703 && document.shopcart.pid.value != 777 && document.shopcart.pid.value != 778  && document.shopcart.pid.value != 817  && document.shopcart.pid.value != 818)
if(document.shopcart.Option127)
{
	if(testWidth > 72)
	document.shopcart.Option127.disabled = true;
	else
	document.shopcart.Option127.disabled = false;
}

if(document.shopcart.Option126)
{
	if(testWidth < 24)
	document.shopcart.Option126.disabled = true;
	else
	document.shopcart.Option126.disabled = false;
}

if(document.shopcart.Option128)
{
	if(testWidth < 22)
	document.shopcart.Option128.disabled = true;
	else
	document.shopcart.Option128.disabled = false;
}

if (document.shopcart.Option126)
if(document.shopcart.Option126.checked == true  && document.shopcart.Option128.checked == true)
{
	if(testWidth < 44)
	{
	alert("Sorry, It's not possible to combine 2 Blinds on 1 Headrail with Continuous Cord Loop on Blinds on blind under 44 inches.");
	document.shopcart.Option126.checked = false;
	document.shopcart.Option128.checked = false;
	document.getElementById('OnOneType').value = "0";
	document.getElementById('OnOneType2').value = "0";
	if(document.getElementById('pdHROptionsDouble')) document.getElementById('pdHROptionsDouble').style.display = "None";
	if(document.getElementById('TwoConns')) document.getElementById('TwoConns').style.display = "None";
	}
}




if ((document.shopcart.pid.value >= 713 && document.shopcart.pid.value <= 717) || (document.shopcart.pid.value >= 723 && document.shopcart.pid.value <= 725))
{
if(document.shopcart.FeatureOption86)
{


//Size restrictions:
//Widths 36-48, Number of Panels = 3
if(document.shopcart.FeatureOption87.value != 220)
{
if(testWidth >= 36 && testWidth <= 49.875 && document.shopcart.FeatureOption87.value != 220)
	{
	
	if (document.shopcart.FeatureOption87.value != 194)// force panel num
			{
			alert("When choosing Blind Width between 36 inches and 49 7/8 inches, you need to also have the Number of Panels: 3 Panels.");
			document.shopcart.FeatureOption87.value = 220;
			}
	}
//Widths 50-59 ¾E Number of Panels =3 or 4
else if(testWidth >= 50 && testWidth <= 59.875)
	{
		if(document.shopcart.FeatureOption86.value != 193)
		{
				if (document.shopcart.FeatureOption87.value != 194 && document.shopcart.FeatureOption87.value != 195)// force panel num
				{
				alert("When choosing Blind Width between 50 inches and 59 7/8 inches, you need to also have the Number of Panels: 3 Panels or 4 Panels.");
				document.shopcart.FeatureOption87.value = 220;
				}
		}
		else
		{
		
			if(document.shopcart.FeatureOption87.value != 195 && document.shopcart.FeatureOption87.value != 220)
			{
			alert("When choosing Panel Track Configuration: Split, you need to also have the Number of Panels: 4 Panels.");
			document.shopcart.FeatureOption87.value = 195;
			}
		
		}
		
	}	
//Widths 60-107 ¾E Number of Panels = 3,4,5
else if(testWidth >= 60 && testWidth <= 107.875)
	{
			if(document.shopcart.FeatureOption86.value != 193)
			{
				if (document.shopcart.FeatureOption87.value != 194 && document.shopcart.FeatureOption87.value != 195  && document.shopcart.FeatureOption87.value != 196)// force panel num
				{
				alert("When choosing Blind Width between 60 inches and 107 7/8 inches, you need to also have the Number of Panels: 3 Panels, 4 Panels or 5 Panels.");
				document.shopcart.FeatureOption87.value = 220;
				}
			
			}
		else
		{
			if(document.shopcart.FeatureOption87.value != 195 && document.shopcart.FeatureOption87.value != 220)
			{
			alert("When choosing Panel Track Configuration: Split, you need to also have the Number of Panels: 4 Panels.");
			document.shopcart.FeatureOption87.value = 195;
			}
		
		}
			
			
	}	
//Width 108, Number of Panels = 3, 4, 5, 6
else if(testWidth >= 108)
	{
	
			if (document.shopcart.FeatureOption86.value == 193 && document.shopcart.FeatureOption87.value != 195  && document.shopcart.FeatureOption87.value != 202 && document.shopcart.FeatureOption87.value != 220)// force panel num
			{
			alert("When choosing Panel Track Configuration: Split, you need to also have the Number of Panels: 4 Panels or 6 Panels.");
			document.shopcart.FeatureOption87.value = 220;
			}
	
	}
}

//Size restrictions:




if(testWidth >= 50)
{
//If Control Location = Center, then Control Type = Wand, Panel Track Configuration = Split,  & Number of Panels = 4 or 6
if (document.shopcart.FeatureOption80.value == 178)
{	
		if (document.shopcart.FeatureOption81.value == 179) //If Control type - Cord
			{
			document.shopcart.FeatureOption81.value = 180; //force wand 
			alert("When choosing Control Location: Center, you need to also have the Control Type: Wand.");
			}
		
		if (document.shopcart.FeatureOption86.value != 193 && document.shopcart.FeatureOption86.value != 223) //force Panel - Split
			{
				alert("When choosing Control Location: Center, you need to also have the Panel Track Configuration: Split.");
				document.shopcart.FeatureOption86.value = 223; 
			}
		
/*if (document.shopcart.FeatureOption87.value != 195 && document.shopcart.FeatureOption87.value != 202 && document.shopcart.FeatureOption87.selectedindex != 0)// force panel num
			{
			alert("When choosing Control Location: Center, you need to also have the Number of panels : 4 or 6 Panels.");
			document.shopcart.FeatureOption87.value = 220;
			}
			*/
		
}
//If Control Type = Wand & Panel Track Configuration = Split, then Control Location = Center 		
else if (document.shopcart.FeatureOption81.value == 180  && document.shopcart.FeatureOption86.value == 193)
{

			if (document.shopcart.FeatureOption80.value != 178 && document.shopcart.FeatureOption80.value != 222) //Check if not Center
			{
			document.shopcart.FeatureOption80.value = 222; //force Center 
			alert("When choosing Control Type: Wand and Panel Track Configuration: Split, you need to also have the Control Location: Center.");
			}

}
//If Number of Panels = 6 Panels, then Panel Track Configuration = Split		
else if (document.shopcart.FeatureOption87.value == 202 && testWidth >= 108)
{
			if (document.shopcart.FeatureOption86.value != 193 && document.shopcart.FeatureOption86.value != 223) //force Panel - Split
				{
				alert("When Number of Panels: 6 Panels, you need to also have the Panel Track Configuration: Split.");
				document.shopcart.FeatureOption86.value = 223; 
				}
}	

// here

//If Panel Track Configuration = Left & Control Type = Wand, then Control Location = Right		
else if (document.shopcart.FeatureOption86.value == 191 && document.shopcart.FeatureOption81.value == 180)
{
		if (document.shopcart.FeatureOption80.value != 174 && document.shopcart.FeatureOption80.value != 222) //Check if not Right
			{
			document.shopcart.FeatureOption80.value = 222; //force Right 
			alert("When choosing Panel Track Configuration: Left and Control Type: Wand, you need to also have the Control Location: Right.");
			}
}	
//If Panel Track Configuration = Right & Control Type = Wand, then Control Location = Left 		
else if (document.shopcart.FeatureOption86.value == 192 && document.shopcart.FeatureOption81.value == 180)
{
		if (document.shopcart.FeatureOption80.value != 175 && document.shopcart.FeatureOption80.value != 222) //Check if not Left
			{
			alert("When choosing Panel Track Configuration: Right and Control Type: Wand, you need to also have the Control Location: Left.");
			document.shopcart.FeatureOption80.value = 222; //force Left 
			}
}	

// here

	
//If Panel Track Configuration = Split, then Number of Panels = 4 or 6	
/*else if (document.shopcart.FeatureOption86.value == 193)
{
		if (document.shopcart.FeatureOption87.value == 194 || document.shopcart.FeatureOption87.value == 196)// force panel num
			{
			alert("When choosing Panel Track Configuration: Split, you need to also have the Number of Panels: 4 Panels or 6 Panels.");
			document.shopcart.FeatureOption87.value = 220;
			}
}*/

}	// end 50
else 
{

		if(document.shopcart.FeatureOption86.value == 193 || document.shopcart.FeatureOption80.value == 178)
		{
			alert("For blinds under 50 inches you cannot have Control Location: Centre or Panel Track Configuration: Split Draw.");
			document.shopcart.FeatureOption86.value = 223; 
			document.shopcart.FeatureOption80.value = 222;			
		}
		
		
			//If Panel Track Configuration = Left & Control Type = Wand, then Control Location = Right		
			if (document.shopcart.FeatureOption86.value == 191 && document.shopcart.FeatureOption81.value == 180)
			{
					if (document.shopcart.FeatureOption80.value != 174 && document.shopcart.FeatureOption80.value != 222) //Check if not Right
						{
						document.shopcart.FeatureOption80.value = 222; //force Right 
						alert("When choosing Panel Track Configuration: Left and Control Type: Wand, you need to also have the Control Location: Right.");
						}
			}	
			//If Panel Track Configuration = Right & Control Type = Wand, then Control Location = Left 		
			else if (document.shopcart.FeatureOption86.value == 192 && document.shopcart.FeatureOption81.value == 180)
			{
					if (document.shopcart.FeatureOption80.value != 175 && document.shopcart.FeatureOption80.value != 222) //Check if not Left
						{
						alert("When choosing Panel Track Configuration: Right and Control Type: Wand, you need to also have the Control Location: Left.");
						document.shopcart.FeatureOption80.value = 222; //force Left 
						}
			}			
		
		
} //else na 50



	
}	
}




if (document.shopcart.pid.value == 701 || document.shopcart.pid.value == 702 || document.shopcart.pid.value == 703)
{
	if(document.shopcart.Option128)
	{
		if(document.shopcart.Option128.checked == true)
		{
		document.shopcart.Option127.checked = false;
		document.shopcart.Option127.disabled = true;
		}
		else if (document.shopcart.Option127.checked == true  && testWidth <= 84)
		{
		document.shopcart.Option128.checked = false;
		document.shopcart.Option128.disabled = true;	
		}
		else
		{


		
			if(testWidth >= 22)
			{			
			document.shopcart.Option128.checked = false;
			document.shopcart.Option128.disabled = false;	
			}
			
			if(testWidth > 84)
			{			
			document.shopcart.Option127.checked = false;
			document.shopcart.Option127.disabled = true;	
			}
			else
			{
			document.shopcart.Option127.checked = false;
		    document.shopcart.Option127.disabled = false;	
			}

		}
	}
}


if (document.shopcart.pid.value == 711)
{
	if(document.shopcart.Option126)
	{
		if(document.shopcart.Option126.checked == true && testWidth >= 24)
		{
		document.shopcart.Option127.checked = false;
		document.shopcart.Option127.disabled = true;
		}
		else if (document.shopcart.Option127.checked == true && testWidth <= 72)
		{
		document.shopcart.Option126.checked = false;
		document.shopcart.Option126.disabled = true;
		document.shopcart.Option128.checked = false;
		document.shopcart.Option128.disabled = true;	
		}
		else if (document.shopcart.Option128.checked == true)
		{
		document.shopcart.Option127.checked = false;
		document.shopcart.Option127.disabled = true;
		}
		else
		{
			if(testWidth < 24)
			{
			document.shopcart.Option126.checked = false;
			document.shopcart.Option126.disabled = true;
			}
			else
			{
			document.shopcart.Option126.checked = false;
			document.shopcart.Option126.disabled = false;
			}
			if(testWidth > 72)
			{
			document.shopcart.Option127.checked = false;
			document.shopcart.Option127.disabled = true;
			}
			else
			{
			document.shopcart.Option127.checked = false;
			document.shopcart.Option127.disabled = false;	
			}
				
		document.shopcart.Option128.checked = false;
		document.shopcart.Option128.disabled = false;	
			
		}
	}
	
}

//if(document.shopcart.pid.value == 752)
if (document.shopcart.pid.value == 752 || document.shopcart.pid.value == 754 || document.shopcart.pid.value == 743  || document.shopcart.pid.value == 753  || document.shopcart.pid.value == 696  || document.shopcart.pid.value == 744  || document.shopcart.pid.value == 798)
{


if(document.shopcart.Option154 && document.shopcart.Option158)
{ 
	if(document.shopcart.FeatureOption11.value == 30 || document.shopcart.FeatureOption12.value == 33)
	{
	document.shopcart.Option154.checked = false;
	document.shopcart.Option154.disabled = true;
	document.shopcart.Option124.checked = false;
	document.shopcart.Option124.disabled = true;
	document.shopcart.Option155.checked = false;
	document.shopcart.Option155.disabled = true;	
	document.shopcart.Option158.checked = false;
	document.shopcart.Option158.disabled = true;
    document.getElementById('ValanceOption125').style.display = "None";
    document.getElementById('ValanceOption124').style.display = "None";
    document.shopcart.FeatureOption66.value = 0;
	}
    else if(document.shopcart.FeatureOption12.value == 33 && document.shopcart.Option124.checked == false)
	{ //Roll Position
	document.shopcart.Option154.checked = false;
	document.shopcart.Option154.disabled = true;
	document.shopcart.Option158.checked = false;
	document.shopcart.Option158.disabled = true;
	document.shopcart.Option155.checked = false;
	document.shopcart.Option155.disabled = true;		
    document.getElementById('ValanceOption125').style.display = "None";
    document.getElementById('ValanceOption124').style.display = "None";
	document.shopcart.Option124.checked = false;
	document.shopcart.Option124.disabled = false;
	document.shopcart.FeatureOption66.value = 0;
	}	
    else if(document.shopcart.Option154.checked) 
	{//facia
	document.getElementById('ValanceOption125').style.display = "block";
	document.getElementById('ValanceOption124').style.display = "None";
	document.shopcart.Option124.checked = false;
	document.shopcart.Option124.disabled = true;
	document.shopcart.Option158.checked = false;
	document.shopcart.Option158.disabled = true;		
    document.shopcart.Option155.checked = false;
	document.shopcart.Option155.disabled = true;	
	}
    else if(document.shopcart.Option155.checked) 
	{//fabric facia
	document.shopcart.Option124.checked = false;
	document.shopcart.Option124.disabled = true;		
    document.shopcart.Option154.checked = false;
	document.shopcart.Option154.disabled = true;	
	}	
	else if(document.shopcart.Option124.checked) 
	{//casset
	document.getElementById('ValanceOption125').style.display = "None";
	document.getElementById('ValanceOption124').style.display = "Block";
	document.shopcart.Option154.checked = false;
	document.shopcart.Option154.disabled = true;	
	document.shopcart.Option155.checked = false;
	document.shopcart.Option155.disabled = true;
	document.shopcart.Option158.checked = false;
	document.shopcart.Option158.disabled = true;
	}
    else if(document.shopcart.Option158.checked) 
	{//common facia
	document.shopcart.Option124.checked = false;
	document.shopcart.Option124.disabled = true;	
	}	
    else
	{
	    document.getElementById('ValanceOption125').style.display = "None";
	    document.getElementById('ValanceOption124').style.display = "None";

	    document.shopcart.Option124.checked = false;
	    document.shopcart.Option124.disabled = false;

	    document.shopcart.Option154.checked = false;
	    document.shopcart.Option154.disabled = false;

	    document.shopcart.Option158.checked = false;
	    document.shopcart.Option158.disabled = false; 
	    
	    document.shopcart.Option155.checked = false;
	    document.shopcart.Option155.disabled = false; 
	    
	    document.shopcart.FeatureOption66.value = 0;
	    document.shopcart.FeatureOption100.value = 0;
	    document.shopcart.FeatureOption104.value = 0;
	
	}

if(document.shopcart.FeatureOption11.value == 31)
    {
	document.shopcart.FeatureOption103.disabled = false;

	}
else
    { 
    document.shopcart.FeatureOption103.disabled = true;
    document.shopcart.FeatureOption103.value = 273;	
    
    if(document.shopcart.FeatureOption101.value == 255)
        {
        document.shopcart.FeatureOption101.value = 254;
	    document.shopcart.FeatureOption102.disabled = true;
        document.shopcart.FeatureOption102.value = 272;
        alert("When choosing Roller Type: Spring, you need to also have the Hembar: Internal.");
        }
    }


if(document.shopcart.FeatureOption101.value == 255)
    {
	document.shopcart.FeatureOption102.disabled = false;
	document.shopcart.FeatureOption54.disabled = false;
	}
else 
    {
    document.shopcart.FeatureOption102.disabled = true;
    document.shopcart.FeatureOption102.value = 272;
    document.shopcart.FeatureOption54.disabled = true;
    document.shopcart.FeatureOption54.value = 93;
    }
    
    

    
if(document.shopcart.FeatureOption11.value == 30 && testHeight > 120)
    {
        if(document.shopcart.FeatureOption12.value != 33)
        {
        alert('The maximum height for Spring Roller  is 120".');     
        document.shopcart.FeatureOption11.value = 31;
        document.shopcart.FeatureOption11.focus();
	    document.shopcart.Option124.disabled = false;
	    document.shopcart.Option154.disabled = false;
	    document.shopcart.Option158.disabled = false; 
	    document.shopcart.Option155.disabled = false;         
        }
    }
    
    
if(document.shopcart.FeatureOption11.value == 30 && testWidth < 19.5)
    {
        
        alert('The min width for Spring Roller  is 19.5".');     
        document.shopcart.FeatureOption11.value = 31;
        document.shopcart.FeatureOption11.focus();
	    document.shopcart.Option124.disabled = false;
	    document.shopcart.Option154.disabled = false;
	    document.shopcart.Option158.disabled = false; 
	    document.shopcart.Option155.disabled = false;         

    }
    

    }    
    
}



if (document.shopcart.pid.value == 751 || document.shopcart.pid.value == 750 || document.shopcart.pid.value == 755)
{
if(document.shopcart.Option157)
{
	
	if(document.shopcart.FeatureOption11.value == 30 && testWidth < 19.5)
    {
        
        alert('The min width for Spring Roller  is 19.5".');     
        document.shopcart.FeatureOption11.value = 31;
        document.shopcart.FeatureOption11.focus();     

    }
	else if(document.shopcart.FeatureOption11.value == 30 && testWidth >= 19.5)
	{
	document.shopcart.Option154.checked = false;
	document.shopcart.Option154.disabled = true;
	document.shopcart.Option157.checked = false;
	document.shopcart.Option157.disabled = true;
	document.shopcart.Option158.checked = false;
	document.shopcart.Option158.disabled = true;
    document.getElementById('ValanceOption125').style.display = "None";
	//document.getElementById('ValanceOption124').style.display = "None";	
	}
    else if(document.shopcart.FeatureOption12.value == 33 && document.shopcart.Option157.checked == false)
	{
	document.shopcart.Option154.checked = false;
	document.shopcart.Option154.disabled = true;
	document.shopcart.Option158.checked = false;
	document.shopcart.Option158.disabled = true;
    document.getElementById('ValanceOption125').style.display = "None";
   // document.getElementById('ValanceOption124').style.display = "None";
	document.shopcart.Option157.checked = false;
	document.shopcart.Option157.disabled = true;
	}	
    else if(document.shopcart.Option154.checked) 
	{//facia
	document.getElementById('ValanceOption125').style.display = "block";
	//document.getElementById('ValanceOption124').style.display = "None";
	document.shopcart.Option157.checked = false;
	document.shopcart.Option157.disabled = true;
	document.shopcart.Option158.checked = false;
	document.shopcart.Option158.disabled = true;		
	}
	else if(document.shopcart.Option157.checked  && testWidth <= 84) 
	{//casset
	document.getElementById('ValanceOption125').style.display = "None";
	//document.getElementById('ValanceOption124').style.display = "None";
	document.shopcart.Option154.checked = false;
	document.shopcart.Option154.disabled = true;	
	document.shopcart.Option158.checked = false;
	document.shopcart.Option158.disabled = true;
	}
    else if(document.shopcart.Option158.checked) 
	{//common facia
	document.shopcart.Option154.checked = false;
	document.shopcart.Option154.disabled = true;	
	document.shopcart.Option157.checked = false;
	document.shopcart.Option157.disabled = true;	
	//document.getElementById('ValanceOption124').style.display = "block";
	}	
    else
	{
	    document.getElementById('ValanceOption125').style.display = "None";
	    //document.getElementById('ValanceOption124').style.display = "None";	

	    document.shopcart.Option157.checked = false;
	    document.shopcart.Option157.disabled = false;

	    document.shopcart.Option154.checked = false;
	    document.shopcart.Option154.disabled = false;

	    document.shopcart.Option158.checked = false;
	    document.shopcart.Option158.disabled = false; 
	    
        document.shopcart.FeatureOption100.value = 0;
        document.shopcart.FeatureOption104.value = 0;
	
	}
    }
}



if(document.shopcart.Option122 && document.shopcart.Option124)
{

	if(document.shopcart.Option124.checked)
	{
	document.shopcart.Option122.checked = false;
	document.shopcart.Option122.disabled = true;
	}
	else if(document.shopcart.Option122.checked)
	{
	document.shopcart.Option124.checked = false;
	document.shopcart.Option124.disabled = true;
	}
else
	{

	if(document.shopcart.FeatureOption12.value == 32)
	{document.shopcart.Option124.checked = false;
	document.shopcart.Option124.disabled = false;
	}
	else
	{
	document.shopcart.Option124.checked = false;
	document.shopcart.Option124.disabled = true;
	}
	
	
	document.shopcart.Option122.checked = false;
	document.shopcart.Option122.disabled = false;




	
	}


}

			
			
if(document.shopcart.Option122 && document.shopcart.Option124 && document.shopcart.Option123)
{
	if(document.shopcart.Option124.checked && testHeight <= 100 && document.shopcart.FeatureOption12.value == 32)
	{
	document.getElementById('ValanceOption123').style.display = "None";
	document.getElementById('ValanceOption124').style.display = "block";
	document.shopcart.FeatureOption65.selectedIndex = 0;
	document.shopcart.Option122.checked = false;
	document.shopcart.Option123.checked = false;
	document.shopcart.Option122.disabled = true;
	document.shopcart.Option123.disabled = true;
	document.shopcart.FeatureOption12.value = 32;		
	}
	else if(document.shopcart.Option123.checked && testWidth <= 72 && testHeight <=60 && document.shopcart.FeatureOption12.value == 32) 
	{
	document.getElementById('ValanceOption123').style.display = "block";
	document.getElementById('ValanceOption124').style.display = "None";
	document.shopcart.FeatureOption66.selectedIndex = 0;
	document.shopcart.Option122.checked = false;
	document.shopcart.Option124.checked = false;
	document.shopcart.Option122.disabled = true;
	document.shopcart.Option124.disabled = true;
	document.shopcart.FeatureOption12.value = 32;	
	}
	else if(document.shopcart.Option122.checked)
	{
	document.getElementById('ValanceOption123').style.display = "None";
	document.getElementById('ValanceOption124').style.display = "None";
	document.shopcart.FeatureOption65.selectedIndex = 0;
	document.shopcart.FeatureOption66.selectedIndex = 0;
	document.shopcart.Option123.checked = false;
	document.shopcart.Option124.checked = false;
	document.shopcart.Option123.disabled = true;
	document.shopcart.Option124.disabled = true;
	}
else
	{
	document.shopcart.FeatureOption65
	document.getElementById('ValanceOption123').style.display = "None";
	document.getElementById('ValanceOption124').style.display = "None";
	document.shopcart.FeatureOption65.selectedIndex = 0;	
	document.shopcart.FeatureOption66.selectedIndex = 0;	
	document.shopcart.Option122.checked = false;
	document.shopcart.Option123.checked = false;
	document.shopcart.Option124.checked = false;
	document.shopcart.Option122.disabled = false;
	
		if (testHeight > 100)
		{
		document.shopcart.Option124.disabled = true;
		document.shopcart.Option123.disabled = true;
		}
		else if (testWidth > 72 || testHeight > 60)  
		{	
			
		if (document.shopcart.FeatureOption12.value == 33)
		document.shopcart.Option124.disabled = true;
		else
		document.shopcart.Option124.disabled = false
		;
		document.shopcart.Option123.disabled = true;
		}
		else if (document.shopcart.FeatureOption12.value == 33)
		{
		document.shopcart.Option124.disabled = true;
		document.shopcart.Option123.disabled = true;
		}
		else
		{
		document.shopcart.Option123.disabled = false;
		document.shopcart.Option124.disabled = false;
		}
	
		
	}
	
}			
				

				
			
			
			if(aPricing[i].dualBlinds == 1)
			{
				iMultipleBlinds = 1;
				
				if (document.shopcart.pid.value == 3){//2 in premium faux wood
				Print2on1And3on1Msg();
				}
				
				if(document.shopcart.Option52 && document.shopcart.Option53){//Both 2 in 1 and 3 in 1
					document.shopcart.Option52.disabled = false;
					document.shopcart.Option53.disabled = false;
					if(document.shopcart.Option52.checked == false && document.shopcart.Option53.checked == false){
						Print2on1And3on1Msg();
					}
				} else if(document.shopcart.Option50 && document.shopcart.Option51){//Both 2 in 1 and 3 in 1
					//document.shopcart.Option50.disabled = false;
					//document.shopcart.Option51.disabled = false;
					if(document.shopcart.Option50.checked == false && document.shopcart.Option51.checked == false){
						Print2on1And3on1Msg();
					}
				} else if(document.shopcart.Option87 && document.shopcart.Option88){//Both 2 in 1 and 3 in 1
					document.shopcart.Option87.disabled = false;
					document.shopcart.Option88.disabled = false;
					if(document.shopcart.Option87.checked == false && document.shopcart.Option88.checked == false){
						Print2on1And3on1Msg();
					}	
				} else if(document.shopcart.Option95 && document.shopcart.Option96){//Both 2 in 1 and 3 in 1
					document.shopcart.Option95.disabled = false;
					document.shopcart.Option96.disabled = false;
					if(document.shopcart.Option95.checked == false && document.shopcart.Option96.checked == false){
						Print2on1And3on1Msg();
					}
				} else if(document.shopcart.Option115 && document.shopcart.Option114){//Both 2 in 1 and 3 in 1
					document.shopcart.Option115.disabled = false;
					document.shopcart.Option114.disabled = false;
					if(document.shopcart.Option114.checked == false && document.shopcart.Option115.checked == false){
						Print2on1And3on1Msg();
					}
				} else if(document.shopcart.Option116 && document.shopcart.Option117){//Both 2 in 1 and 3 in 1
					document.shopcart.Option116.disabled = false;
					document.shopcart.Option117.disabled = false;
					if(document.shopcart.Option116.checked == false && document.shopcart.Option117.checked == false){
						Print2on1And3on1Msg();
					}
				} else if(document.shopcart.Option126)
					{//Both 2 in 1 and 3 in 1
					document.shopcart.Option126.disabled = false;
					if(document.shopcart.Option126.checked == false) Print2on1And3on1Msg();
										
				} else if(document.shopcart.Option111 && document.shopcart.Option112){//Both 2 in 1 and 3 in 1
					document.shopcart.Option111.disabled = false;
					document.shopcart.Option112.disabled = false;
					if(document.shopcart.Option111.checked == false && document.shopcart.Option112.checked == false){
						Print2on1And3on1Msg();
					}
				} else if(document.shopcart.Option105 && document.shopcart.Option106){//Both 2 in 1 and 3 in 1
					document.shopcart.Option105.disabled = false;
					document.shopcart.Option106.disabled = false;
					if(document.shopcart.Option105.checked == false && document.shopcart.Option106.checked == false){
						Print2on1And3on1Msg();
					}
				} else if(document.shopcart.Option48 && document.shopcart.Option49){//Both 2 in 1 and 3 in 1
					document.shopcart.Option48.disabled = false;
					document.shopcart.Option49.disabled = false;
					if(document.shopcart.Option48.checked == false && document.shopcart.Option49.checked == false){
						Print2on1And3on1Msg();
					}
				} else if(document.shopcart.Option6 && document.shopcart.Option8){//Both 2 in 1 and 3 in 1
					document.shopcart.Option6.disabled = false;
					document.shopcart.Option8.disabled = false;
					if(document.shopcart.Option6.checked == false && document.shopcart.Option8.checked == false){
						Print2on1And3on1Msg();
					}
				}
				else if(document.shopcart.Option6 && document.shopcart.Option38){//Both 2 in 1 and 3 in 1
					document.shopcart.Option6.disabled = false;
					document.shopcart.Option38.disabled = false;
					if(document.shopcart.Option6.checked == false && document.shopcart.Option38.checked == false){
						Print2on1And3on1Msg();
					}
				}
				else if(document.shopcart.Option8){//3 in 1
					document.shopcart.Option8.disabled = false;
					if(document.shopcart.Option8.checked == false){
						Print2on1And3on1Msg();
					}
				}
				else if(document.shopcart.Option6){//2 in 1
					document.shopcart.Option6.disabled = false;
					if(document.shopcart.Option6.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{
							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
					//alert("Due to the weight of blinds the size you have selected two separate blinds are recommended.");
				}
				
					
				
				
				
				
			}
			else
			{
				iMultipleBlinds = 0;
				MM_showHideLayers('2on1PopUp','','hide');
			}
			
			
			
		if (document.shopcart.Option12){//ROMANS TDBU
				if (testWidth > 72){//ROMANS TDBU
				document.shopcart.Option12.checked = false;
				document.shopcart.Option12.disabled = true;
				}
				else
				{
				document.shopcart.Option12.disabled = false;
				}
				}
			
			
	
			
			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
							bOK = true;							
						}
					}
					if(document.shopcart.Option8){//3 in 1
						if(document.shopcart.Option8.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 == 667)
			{
				if(document.shopcart.Option83)
				{
				if(document.shopcart.Option83.checked == true)
				{document.shopcart.Option85.disabled = true; document.shopcart.FeatureOption59.disabled = false; document.shopcart.Option85.checked == false;}
				else if(document.shopcart.Option85.checked == true)
				{document.shopcart.Option83.disabled = true; document.shopcart.FeatureOption59.disabled = false; }
				else {document.shopcart.FeatureOption59.selectedIndex = 8; document.shopcart.FeatureOption59.disabled = true; document.shopcart.Option83.checked == false; document.shopcart.Option85.checked == false;document.shopcart.Option85.disabled = false;document.shopcart.Option83.disabled = false;}
				
				
				if(document.shopcart.Option81.checked == true)
				{document.shopcart.Option84.disabled = true;document.shopcart.Option84.checked == false;
				document.shopcart.Option86.disabled = true;document.shopcart.Option86.checked == false;
				}
				else if(document.shopcart.Option86.checked == true)
				{
				document.shopcart.Option84.disabled = true;document.shopcart.Option84.checked == false;
				document.shopcart.Option81.disabled = true;document.shopcart.Option81.checked == false;
				}
				else if(document.shopcart.Option84.checked == true)
				{document.shopcart.Option86.disabled = true;document.shopcart.Option86.checked == false;
				document.shopcart.Option81.disabled = true;document.shopcart.Option81.checked == false;}
				else {
				if(testWidth >= 24){
				document.shopcart.Option84.disabled = false;document.shopcart.Option84.checked == false;}
				else{
				document.shopcart.Option84.disabled = true;document.shopcart.Option84.checked == false;}
				if(testWidth >= 20){
				document.shopcart.Option86.disabled = false;document.shopcart.Option86.checked == false;}
				else{
				document.shopcart.Option86.disabled = true;document.shopcart.Option86.checked == false;}
				
				document.shopcart.Option81.disabled = false;document.shopcart.Option81.checked == false;}
				}
				
			}
			
			
			if (document.shopcart.pid.value == 668)
			{
			if(document.shopcart.Option87){
			/*
				if(document.shopcart.Option87.checked == true)
				{
				    document.shopcart.Option88.disabled = true;  
				    document.shopcart.Option88.checked == false;
				    }
				else if(document.shopcart.Option88.checked == true)
				{
				    document.shopcart.Option87.disabled = true; 
				    document.shopcart.Option87.checked == false; 
				    }
				else {
				    document.shopcart.Option87.disabled = false; 
				    document.shopcart.Option87.checked == false; 
				    document.shopcart.Option88.disabled = false; 
				    document.shopcart.Option88.checked == false;
				}
				*/
				if (document.shopcart.FeatureOption1.value == 2)
				{//insidemount
						document.shopcart.FeatureOption60.disabled = false;
						//document.shopcart.FeatureOption53.selectedIndex = 0;
				}
				else if (document.shopcart.FeatureOption1.value == 3)
				{
						document.shopcart.FeatureOption60.disabled = true;
						//document.shopcart.FeatureOption53.selectedIndex = 0;
				}
				else
				document.shopcart.FeatureOption60.disabled = false;
			}
			}
			
			

	if (document.shopcart.pid.value == 670)
			{
			if (document.shopcart.FeatureOption1)
			{
				if (document.shopcart.FeatureOption1.value == 2)
				{//insidemount
						document.shopcart.FeatureOption60.disabled = false;
				}
				else if (document.shopcart.FeatureOption1.value == 3)
				{
						document.shopcart.FeatureOption60.disabled = true;
				}
				else
				document.shopcart.FeatureOption60.disabled = false;
			}	
				/*
			if (document.shopcart.Option95)
				{
					if (document.shopcart.Option95.checked){
							document.shopcart.Option96.checked = false;
							document.shopcart.Option96.disabled = true;
					}
					else if (document.shopcart.Option96.checked){
							document.shopcart.Option95.checked = false;
							document.shopcart.Option95.disabled = true;
					}
					else
					{
					
					document.shopcart.Option95.disabled = false;
					document.shopcart.Option96.disabled = false;
					
										
					}
				}
				*/
				
				
				
if(document.shopcart.Option98)
{//Routless option available
		if(document.shopcart.TapeColorID.value == 0){//no tape selected
		document.shopcart.Option98.disabled = false;	
		}	
		else
		{//tape selected
			if(document.shopcart.Option98)
			{//Routless
					if(document.shopcart.Option98.checked == true)
					{
					alert("The Routeless Option cannot be combined with Cloth Tapes. Please choose one or the other.");
					document.shopcart.TapeColorID.selectedIndex=1;
					document.shopcart.TapeColorID.focus();
					}
					else
					document.shopcart.Option98.disabled = true;
					
			}
		}
}				
				
				
			}
			
			
			
			if (document.shopcart.pid.value == 83 || document.shopcart.pid.value == 814 || document.shopcart.pid.value == 84 || document.shopcart.pid.value == 137 || document.shopcart.pid.value == 153){//Bamboo Shades
				if (document.shopcart.Option21){//continuouse
					if (document.shopcart.Option21.checked && testWidth < 24){
						alert("Sorry, the  'Continuous Cord Loop' option is not available for blinds under 24 inches wide.")
						document.shopcart.Option21.checked = false;
					}
				}
				if (document.shopcart.Option34){//continuouse
					if (document.shopcart.Option34.checked && testWidth < 24){
						alert("Sorry, the  'Continuous Cord Loop' option is not available for blinds under 24 inches wide.")
						document.shopcart.Option34.checked = false;
					}
				}
				if (document.shopcart.Option36){//continuouse
					if (document.shopcart.Option36.checked && testWidth < 24){
						alert("Sorry, the  'Continuous Cord Loop' option is not available for blinds under 24 inches wide.")
						document.shopcart.Option36.checked = false;
					}
				}
				if (document.shopcart.Option37){////continuouse
					if (document.shopcart.Option37.checked && testWidth < 24){
						alert("Sorry, the  'Continuous Cord Loop' option is not available for blinds under 24 inches wide.")
						document.shopcart.Option37.checked = false;
					}
				}
			}
			
			
			if (document.shopcart.pid.value >= 83 && document.shopcart.pid.value <= 84 || document.shopcart.pid.value == 153 || document.shopcart.pid.value == 137){//Bamboo Shades
				if (document.shopcart.Option19){//Top Down Bottom Up
					if (document.shopcart.Option19.checked && testWidth > 72){
						alert("Sorry, the 'Top Down-Bottom Up'  option is not available for blinds over 72 inches wide. Consider dividing the blind into two separate blinds, each less than 72 inches wide.")
						document.shopcart.Option19.checked = false;
					}
					if (document.shopcart.Option19.checked && testWidth < 12){
						alert("Sorry, the 'Top Down-Bottom Up'  option is not available for blinds under 12 inches wide. Consider dividing the blind into two separate blinds, each less than 72 inches wide.")
						document.shopcart.Option19.checked = false;
					}
				}
					if (document.shopcart.Option73){//Top Down Bottom Up
					if (document.shopcart.Option73.checked && testWidth > 72){
						alert("Sorry, the 'Top Down-Bottom Up'  option is not available for blinds over 72 inches wide.")
						document.shopcart.Option73.checked = false;
					}
					if (document.shopcart.Option73.checked && testWidth < 12){
						alert("Sorry, the 'Top Down-Bottom Up'  option is not available for blinds under 12 inches wide.")
						document.shopcart.Option73.checked = false;
					}
				}
				if (document.shopcart.Option21){//Rollease
					if (document.shopcart.Option21.checked && testWidth < 24){
						alert("Sorry, the 'Rollease' option is not available for blinds under 24 inches wide.")
						document.shopcart.Option21.checked = false;
					}
				}
			}
			
			
			
			

					

			
			
			if (document.shopcart.pid.value == 674 || document.shopcart.pid.value == 686 || document.shopcart.pid.value == 685)
			{//Cell Shades
				if (document.shopcart.Option100)
				{//Top Down Bottom Up
						if (document.shopcart.Option100.checked && testWidth > 72){
							alert("Sorry, the 'Top Down-Bottom Up' option is not available for blinds over 72 inches wide.")
							document.shopcart.Option100.checked = false;
							}
				}	
			}
			
			
			
			
			
			
			
			
			
			if ((document.shopcart.pid.value >= 64 && document.shopcart.pid.value <= 69 && document.shopcart.pid.value <= 777 && document.shopcart.pid.value <= 778) || document.shopcart.pid.value == 129 || document.shopcart.pid.value == 91){//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("Sorry, the 'Top Down-Bottom Up' option is not available for blinds over 60 inches wide or 60 inches high.")
							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("Sorry, the 'Top Down-Bottom Up' option is not available for blinds over 72 inches wide or 80 inches high.")
							document.shopcart.Option18.checked = false;
						}
					}
					else{
						if (document.shopcart.Option18.checked && (testWidth > 72 || testHeight > 96)){
							alert("Sorry, the 'Top Down-Bottom Up' option is not available for blinds over 72 inches wide or 96 inches high.")
							document.shopcart.Option18.checked = false;
						}
					}
				}
				
				
				if (document.shopcart.Option119){//Cordless
				if (document.shopcart.pid.value == 69){//Room Darkening
						if (document.shopcart.Option119.checked && (testWidth > 72 || testHeight > 84)){
							alert("Sorry, the 'Cordless Top Down Bottom Up' option is not available for blinds over 72 inches wide or 84 inches high.")
							document.shopcart.Option119.checked = false;
						}
					}
				}
				if (document.shopcart.Option16){//Cordless
					if (document.shopcart.Option16.checked && (testWidth < 18 || testHeight < 8)){//Min Width
						alert("Sorry, the 'Cordless' option is not available for blinds under 18 inches wide or 8 inches high.")
						document.shopcart.Option16.checked = false;
					}
					if (document.shopcart.pid.value == 68){//Room Darkening
						if (document.shopcart.Option16.checked && (testWidth > 66 || testHeight > 84)){
							alert("Sorry, the 'Cordless' option is not available for blinds over 66 inches wide or 84 inches high.")
							document.shopcart.Option16.checked = false;
						}
					}
					else if (document.shopcart.pid.value == 69){//double cell trans.
						if (document.shopcart.Option16.checked && (testWidth > 72 || testHeight > 84)){
							alert("Sorry, the 'Cordless' option is not available for blinds  over 72 inches wide or 84 inches high.")
							document.shopcart.Option16.checked = false;
						}
					}
					else{
						if (document.shopcart.Option16.checked && (testWidth > 120 || testHeight > 84)){
							alert("Sorry, the 'Cordless' option is not available for blinds  over 120 inches wide or 84 inches high.")
							document.shopcart.Option16.checked = false;
						}
					}
				}
			}
			if(document.shopcart.FeatureOption7){//Draw Type(vertical)
				if(document.shopcart.FeatureOption18){//Wand-Chain Cord
					if(document.shopcart.FeatureOption7.value == 14 && document.shopcart.FeatureOption18.value == 45){
						//alert('We cannot make vertical blinds with a "Split Draw" and "Wand Tilter!" Tilter will change to "Cord and Chain"');
						//document.shopcart.FeatureOption18.value = 44;
					}
				}
			}
			i = aPricing.length;
		}
	}
	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 validateShopCart2(frmEle)
{
	
	if(frmEle.FeatureOption1){
		if(frmEle.ZipZip.value == '0'){
		//No mount type selected
			alert("Please select a mount type");
			return false;
		}
	}

}	




function insidemount()
{

	if(document.shopcart.FeatureOption1){

		if(document.shopcart.FeatureOption1.value == '2'){
		//No mount type selected
			alert("For inside mounts: please make sure to follow the Measuring Instructions on our site; do not make any deductions in your measurements, as our factory will make all necessary deductions to allow for mounting brackets.");
			document.shopcart.FeatureOption1.focus();
			return false;
		}
	}
	
}

function validateShopCart(frmEle){


if(document.getElementById('FeatureOption4') && document.getElementById('FeatureOption2') )
{
	if(
	(document.getElementById('FeatureOption4').value==9 && document.getElementById('FeatureOption2').value==4) 
	|| (document.getElementById('FeatureOption4').value==10 && document.getElementById('FeatureOption2').value==5)
	 )
	{
	lWitdth = (eval(frmEle.WidthInches.value)+eval(frmEle.Width8ths.value));
			if(lWitdth < 23 && lWitdth > 12 && (frmEle.pid.value == 38 || frmEle.pid.value == 39 || frmEle.pid.value == 42 || frmEle.pid.value == 46 || frmEle.pid.value == 639)){//hunter douglas blinds and  2" vogue wood
				alert('Sorry, blinds under 23" wide cannot have both the tilt and raise/lower controls on the same side. Please let us know on which side you would like to have each control on.')
							document.getElementById('FeatureOption2').focus(); return false;
			}
			if(lWitdth < 21 && lWitdth > 12 && (frmEle.pid.value == 110 || frmEle.pid.value == 111 || frmEle.pid.value == 117 || frmEle.pid.value == 648 || frmEle.pid.value == 683)){//Designer basswood 2 and 2"1/2 + 2" Premium  faux wood
				alert('Sorry, blinds under 21" wide cannot have both the tilt and raise/lower controls on the same side. Please let us know on which side you would like to have each control on.')
							document.getElementById('FeatureOption2').focus(); return false
			}
			if(lWitdth < 24 && lWitdth > 12 && (frmEle.pid.value == 8)){//premium alumin 
				alert('Sorry, blinds under 24" wide cannot have both the tilt and raise/lower controls on the same side. Please let us know on which side you would like to have each control on.')
							document.getElementById('FeatureOption2').focus(); return false;
			}
			if(lWitdth < 18.375 && lWitdth > 12 && (frmEle.pid.value == 13 || frmEle.pid.value == 677)){//American Hardwood
				alert('Sorry, blinds under 18 3/8" wide cannot have both the tilt and raise/lower controls on the same side. Please let us know on which side you would like to have each control on.')
							document.getElementById('FeatureOption2').focus(); return false;
			}

	}
}


if(document.shopcart.Price.value == 0)
{
                alert("The size you selected does not allow you to add the product to your cart. Please choose another size!");
                return false;
}



if(frmEle.pid.value == 810 && frmEle.FeatureOption1)
{
if((eval(frmEle.WidthInches.value)+ eval(frmEle.Width8ths.value) > 72) || ((eval(frmEle.WidthInches.value)+ eval(frmEle.Width8ths.value) > 54) && (eval(frmEle.HeightInches.value)+ eval(frmEle.Height8ths.value) > 72)))
    {   
			alert("While you can order blinds as one unit at this size, it is recommended to order 2 separate blinds to fill the needed space, as buying only one would make it too heavy to lift. This is relevant to all blinds 72\" and over in width as well as all blinds 72\" in height where the width is 54\" or greater.");
			//return false;
	}
}


if(frmEle.pid.value == 813 || frmEle.pid.value == 816)
{

	if(frmEle.Option6.checked == false && frmEle.Option8.checked == false)
	
		if((eval(frmEle.WidthInches.value)+eval(frmEle.Width8ths.value)) > 84)
            {   
                alert("This product, when chosen with width over 84 inches is only available with the 2 or 3 Blinds on 1 Headrail options - please select one of these options to order this product in this size.");
                return false;
	        }
}


if(frmEle.Option83)
if(frmEle.Option83.checked)
{
	if(frmEle.FeatureOption59.value == '112'){
			alert("Please select a Liner Colour");
			frmEle.FeatureOption59.focus();
			return false;
		}
}

if(frmEle.Option85)
if(frmEle.Option85.checked)
{
	if(frmEle.FeatureOption59.value == '112'){
			alert("Please select a Liner Colour");
			frmEle.FeatureOption59.focus();
			return false;
		}
}

if(frmEle.pid.value == 84)
{

	if(frmEle.Option6.checked == false && frmEle.Option8.checked == false)
		if((eval(frmEle.WidthInches.value)+eval(frmEle.Width8ths.value)) > 96)
		{
		alert("This product is only available in the size you have selected with the 2 or 3 Blinds on 1 Headrail options - please select one of these options to order this product in this size.");return false;
		}
}

if(frmEle.pid.value == 667)
{
	if(frmEle.Option85.checked == true || frmEle.Option83.checked == true)
		if(frmEle.FeatureOption59.value == '')
		{
		alert("When selecting Blackout Liner or Privacy Liner you are required to select Liner Colour!");
		document.shopcart.FeatureOption59.focus();
		return false;
		}
}


if(frmEle.pid.value == 728)
{

	if(frmEle.Option18.checked == false)
		if((eval(frmEle.WidthInches.value)+eval(frmEle.Width8ths.value)) < 18)
		{
		alert("Note: The minimum width for this blind is 12 inches with selected Top-Down/Bottom-Up option, otherwise the blind width must be minimum 18 inches.");return false;
		}
}


if(frmEle.pid.value == 784)
{

	if(frmEle.Option52.checked == false && frmEle.Option53.checked == false)
		if((eval(frmEle.WidthInches.value)+eval(frmEle.Width8ths.value)) > 107.5)
		{
		alert("This product is only available in the size you have selected with the 2 or 3 Blinds on 1 Headrail options - please select one of these options to order this product in this size.");return false;
		}
}



if(frmEle.pid.value == 773  || frmEle.pid.value == 774  || frmEle.pid.value == 775)
{
if(frmEle.FeatureOption1){
		    if (frmEle.FeatureOption1.value != '0' && frmEle.ColorID.value != "0") {
		

	if(frmEle.Option176.checked == false)
		{
		return confirm("PLEASE NOTE:  Remote controls are not included with this product. To get a remote, please choose 'Cancel' and then choose a remote under the options section on this page.  To add this product to your shopping cart as is,  choose 'OK'.");
		}		
		
		}
	}
}




if(frmEle.pid.value == 711)
{

	if(frmEle.Option126.checked == false && (eval(frmEle.WidthInches.value)+eval(frmEle.Width8ths.value)) > 84)
	{
		alert("This product is only available in the size you have selected with the 2 Blinds on 1 Headrail options - please select 2 Blinds on 1 Headrail options to order this product in this size.");return false;
	}

}


if(document.shopcart.FeatureOption65 && frmEle.Option154)
{
	if(document.shopcart.FeatureOption65.value == 0 && frmEle.Option154.checked)
	{
	alert("Please select Valance Colour.");
		document.shopcart.FeatureOption65.focus();
		return false;
	}
}


if(document.shopcart.FeatureOption66 && frmEle.Option124)
{
	if(document.shopcart.FeatureOption66.value == 0 && frmEle.Option124.checked)
	{
	alert("Please select Valance Colour.");
		document.shopcart.FeatureOption66.focus();
		return false;
	}
}


if(document.shopcart.FeatureOption87)
{
	if(document.shopcart.FeatureOption92.value == "0")
	{

		alert("Please select Mount Type.");
		//document.shopcart.FeatureOption92.focus();
		return false;
	}
	
	if(document.shopcart.FeatureOption81.value == 236)
	{
		alert("Please select Control Type.");
		document.shopcart.FeatureOption81.focus();
		return false;
	}
	
	if(document.shopcart.FeatureOption80.value == 222)
	{
		alert("Please select Control Location.");
		document.shopcart.FeatureOption80.focus();
		return false;
	}
	
	if(document.shopcart.FeatureOption86.value == 223)
	{
		alert("Please select Panel Configuration.");
		document.shopcart.FeatureOption86.focus();
		return false;
	}
	
	if(document.shopcart.FeatureOption87.value == 220)
	{
		alert("Please select Number of Panels.");
		document.shopcart.FeatureOption87.focus();
		return false;
	}
}


if(frmEle.Option6){ if(frmEle.Option6.checked){if(NotExactSize2OnOne(frmEle)== 1) return false;  }}
if(frmEle.Option46){ if(frmEle.Option46.checked){if(NotExactSize2OnOne(frmEle)== 1) return false;}}
if(frmEle.Option48){ if(frmEle.Option48.checked){if(NotExactSize2OnOne(frmEle)== 1) return false;}}
if(frmEle.Option50){ if(frmEle.Option50.checked){if(NotExactSize2OnOne(frmEle)== 1) return false;}}
if(frmEle.Option52){ if(frmEle.Option52.checked){if(NotExactSize2OnOne(frmEle)== 1) return false;}}
if(frmEle.Option81){ if(frmEle.Option81.checked){if(NotExactSize2OnOne(frmEle)== 1) return false;}}
if(frmEle.Option87){ if(frmEle.Option87.checked){if(NotExactSize2OnOne(frmEle)== 1) return false;}}
if(frmEle.Option95){ if(frmEle.Option95.checked){if(NotExactSize2OnOne(frmEle)== 1) return false;}}
if(frmEle.Option105){ if(frmEle.Option105.checked){if(NotExactSize2OnOne(frmEle)== 1) return false;}}
if(frmEle.Option111){ if(frmEle.Option111.checked){if(NotExactSize2OnOne(frmEle)== 1) return false;}}
if(frmEle.Option115){ if(frmEle.Option115.checked){if(NotExactSize2OnOne(frmEle)== 1) return false;}}
if(frmEle.Option116){ if(frmEle.Option116.checked){if(NotExactSize2OnOne(frmEle)== 1) return false;}}
if(frmEle.Option126){ if(frmEle.Option126.checked){if(NotExactSize2OnOne(frmEle)== 1) return false;}}

if(frmEle.Option8){ if(frmEle.Option8.checked){if(NotExactSize3OnOne(frmEle)== 1) return false;}}
if(frmEle.Option38){ if(frmEle.Option38.checked){if(NotExactSize3OnOne(frmEle)== 1) return false;}}
if(frmEle.Option47){ if(frmEle.Option47.checked){if(NotExactSize3OnOne(frmEle)== 1) return false;}}
if(frmEle.Option49){ if(frmEle.Option49.checked){if(NotExactSize3OnOne(frmEle)== 1) return false;}}
if(frmEle.Option51){ if(frmEle.Option51.checked){if(NotExactSize3OnOne(frmEle)== 1) return false;}}
if(frmEle.Option53){ if(frmEle.Option53.checked){if(NotExactSize3OnOne(frmEle)== 1) return false;}}
if(frmEle.Option82){ if(frmEle.Option82.checked){if(NotExactSize3OnOne(frmEle)== 1) return false;}}
if(frmEle.Option88){ if(frmEle.Option88.checked){if(NotExactSize3OnOne(frmEle)== 1) return false;}}
if(frmEle.Option96){ if(frmEle.Option96.checked){if(NotExactSize3OnOne(frmEle)== 1) return false;}}
if(frmEle.Option106){ if(frmEle.Option106.checked){if(NotExactSize3OnOne(frmEle)== 1) return false;}}
if(frmEle.Option112){ if(frmEle.Option112.checked){if(NotExactSize3OnOne(frmEle)== 1) return false;}}
if(frmEle.Option114){ if(frmEle.Option114.checked){if(NotExactSize3OnOne(frmEle)== 1) return false;}}
if(frmEle.Option117){ if(frmEle.Option117.checked){if(NotExactSize3OnOne(frmEle)== 1) return false;}}


if(frmEle.Option192){ if(frmEle.Option192.checked){if(NotExactSize2Conns(frmEle)== 1) return false;}}


	if(frmEle.ColorID.value == ""){//No color selected
		alert("Please select a colour");
		document.getElementById('aBlindColor').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;
			document.getElementById('aBlindColor').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");
						document.getElementById('aTapeColor').focus();
						return false;
					}
				}
			}
		}
	}
	if(frmEle.FeatureOption13){//Hem Style
		if(frmEle.FeatureOption13.value == 34){//Plain Hem
			if(frmEle.TapeColorID &&  frmEle.TapePrice){//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");
					document.getElementById('aTapeColor').focus();
					return false;
				}
			}
		}
	}
	
	if(frmEle.FeatureOption1){
		if(frmEle.FeatureOption1.value == 0){
		//No mount type selected
			alert("Please select a mount type");
			document.getElementById('aMountType').focus();
			return false;
		}
	}
	
	//Sheerweaves Validation
	
	if(frmEle.FeatureOption101){
		if(frmEle.FeatureOption101.value == '255'){
		        if(frmEle.FeatureOption102.value == '272'){
			        alert("Please select External Hembar Colour");
			        frmEle.FeatureOption102.focus();
			        return false;
			        }
		}
	}
	
	if(frmEle.FeatureOption11){
		if(frmEle.FeatureOption11.value == '31'){
		        if(frmEle.FeatureOption103)
		        if(frmEle.FeatureOption103.value == '273'){
			        alert("Please select Chain Colour");
			        frmEle.FeatureOption103.focus();
			        return false;
			        }
		}
	}
	
	if(frmEle.Option154){
		if(frmEle.Option154.checked){
		        if(frmEle.FeatureOption100.value == '0'){
			        alert("Please select Fascia Colour");
			        frmEle.FeatureOption100.focus();
			        return false;
			        }
		}
	}
	
		if(frmEle.Option158){
		if(frmEle.Option158.checked){
		        if(frmEle.FeatureOption104.value == '0'){
			        alert("Please select Fascia Colour");
			        frmEle.FeatureOption104.focus();
			        return false;
			        }
		}
	}
	
	if(frmEle.Option124){
		if(frmEle.Option124.checked){
		        if(frmEle.FeatureOption66.value == '0'){
			        alert("Please select Valance Colour");
			        frmEle.FeatureOption66.focus();
			        return false;
			        }
		}
	}
	
// SHUTTERS VALIDATIONS
	
	if(frmEle.cid.value == 22)
	{
		if (frmEle.Option151.checked)
		{ 
			var divRailHeight = document.getElementById('DivRailHeight');
			var divRailHeight8ths = document.getElementById('DivRailHeight8ths');
			
			//alert (eval(eval(frmEle.HeightInches.value)+eval(frmEle.Height8ths.value)));
			//alert (eval(eval(divRailHeight.value)+eval(divRailHeight8ths.value)));
			
			if ((eval(eval(divRailHeight.value)+eval(divRailHeight8ths.value))) >=
					(eval(eval(frmEle.HeightInches.value)+eval(frmEle.Height8ths.value))))
			{
				alert("Please note: Divider rail height must be lower than the overall height of the panel.");
				divRailHeight.focus();
				return false;
			}
		}
	}
	
	
	// ADDED 2009.09.21
	
	var features = new Array(12) ;
	for (i = 0; i < features.length; ++ i) {features[i] = new Array(2)};

	features[0][0]="69"; features[0][1]="Window Type";
	// features[1][0]="70"; features[1][1]="Window Trim";
	features[1][0]="71"; features[1][1]="Window Opening Depth";
	features[2][0]="72"; features[2][1]="Mount Type";
	features[3][0]="73"; features[3][1]="Louver Size";
	features[4][0]="77"; features[4][1]="Panel Style";
	features[5][0]="76"; features[5][1]="Panel Configuration";
	features[6][0]="88"; features[6][1]="Hinge Colour";
	features[7][0]="82"; features[7][1]="frame placement";
	features[8][0]="83"; features[8][1]="decorative frame style";
	features[9][0]="84"; features[9][1]="decorative panel style";
  features[10][0]="96"; features[10][1]="window frame material";
  features[11][0]="97"; features[11][1]="window frame material";
 
	for (i = 0; i < features.length; ++ i)
	{
		var featureCheck = document.getElementById('FeatureOption'+features[i][0])
		if(featureCheck)
		{
			if(featureCheck.value == '0' && featureCheck.disabled == false)
			{
				alert("Please select a " + features[i][1]);
				featureCheck.focus();
				return false;
			}
		}
	}

	if(frmEle.FeatureOption69)
	{
		if(frmEle.FeatureOption69.value != 138)
		{
			if(frmEle.FeatureOption93){
				if(frmEle.FeatureOption93.value == '0'){
				//No mount type selected
					alert("Please select a Door Trim");
					frmEle.FeatureOption93.focus();
					return false;
				}
			}
		}
		else
		{
			if(frmEle.FeatureOption70){
				if(frmEle.FeatureOption70.value == '0'){
				//No mount type selected
					alert("Please select a Window Trim");
					frmEle.FeatureOption70.focus();
					return false;
				}
			}
		}
		
		if((frmEle.FeatureOption69.value == 140 || frmEle.FeatureOption69.value == 232)
			&& ((eval(frmEle.WidthInches.value)+eval(frmEle.Width8ths.value)) > 30))
		{
			alert('Please note: Max width for 1 panel is 30"');
			return false;
		}
	}

// END SHUTTERS VALIDATIONS	
	
	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.FeatureOption56){
		if(frmEle.FeatureOption56.value == 97){
		//No Standard Privacy Liner
			alert("Please select Standard Privacy Liner Colour");
			frmEle.FeatureOption56.focus();
			return false;
		}
	}
	
	//Small size
	if(frmEle.WidthInches.value < 13.5 && frmEle.pid.value == 100){//1" designer basswood
		alert('NOTICE: Blinds under 13.5" come standard with tilter in the center and no lift cord.')
	}
	if(frmEle.WidthInches.value < 14 && (frmEle.pid.value == 87 || frmEle.pid.value == 120 || frmEle.pid.value == 639)){//2" designer fauxwood , Vogue wood
		alert('NOTICE: Blinds under 14" may come 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){
			//If horizontal blind 
			alert('NOTICE: Blinds under 12" come standard with tilter in the center and no lift cord.')
		}
	}
	
	
		if (frmEle.FeatureOption45)
	{
		if (frmEle.FeatureOption45.value == 65)
		{
			alert('Please select a Frame Type.');
			frmEle.FeatureOption45.focus();
			return false;
		}
	}
	if (document.shopcart.Option67 && document.shopcart.Option68 && document.shopcart.Option69 && document.shopcart.Option70)
	{
		if (document.shopcart.Option67.checked == false && document.shopcart.Option68.checked == false && document.shopcart.Option69.checked == false && document.shopcart.Option70.checked == false)
		{
			alert('Please select a Hinge Color.');
			return false;
		}
	}	
	
}

function DisableRoutless(theVal){
	if(document.shopcart.TapeColorID)
		theVal = document.shopcart.TapeColorID.value;



if(document.shopcart.FeatureOption11)
{
	if(document.shopcart.FeatureOption11.value == 30)
	{
	if(document.shopcart.FeatureOption63)
	document.shopcart.FeatureOption63.disabled = true;
	}
	else
	{
	if(document.shopcart.FeatureOption63)
	document.shopcart.FeatureOption63.disabled = false;
	}
}


//woodland horisontals remote control begin

if(document.shopcart.pid.value == 87 || document.shopcart.pid.value == 110)
{
	if(document.shopcart.Option9)
	{
		if(document.shopcart.Option9.checked == true)
			document.getElementById('RemoteShow').style.display = "block";
		else
		{
		    document.getElementById('RemoteShow').style.display = "none";
		    if(document.shopcart.FeatureOption43)
		    {
		        document.shopcart.FeatureOption43.selectedIndex = 0;
		    }
		}
	}
	else if(document.shopcart.Option41)
	{
		if(document.shopcart.Option41.checked == true)
			document.getElementById('RemoteShow').style.display = "block";
		else 
			{
			document.getElementById('RemoteShow').style.display = "none";
			if(document.shopcart.FeatureOption43)
		    {
			    document.shopcart.FeatureOption43.selectedIndex = 0;
			}
			}
	}
	else 
	{
	document.getElementById('RemoteShow').style.display = "none";
			if(document.shopcart.FeatureOption43)
			document.shopcart.FeatureOption43.selectedIndex = 0;
	}
}
//woodland horisontals remote control end


	//Standard Check
	if(document.shopcart.Option2){//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.Option41){
				if(document.shopcart.Option41.checked == true){//routeless
					document.shopcart.Option2.disabled = true;//remote
				}
				else if(document.shopcart.Option2.checked == true){//remote
					document.shopcart.Option41.disabled = true;//routeless
				}
				else{//enable both
					document.shopcart.Option2.disabled = false;//routeless
					document.shopcart.Option41.disabled = false;//remote
				}
			}	
			
			
			
		}
		else{//tape selected
			if(document.shopcart.Option2){//Routless
				document.shopcart.Option2.disabled = true;
				if(document.shopcart.Option2.checked == true){
					alert("Because you have already chosen the routeless option, cloth tapes are not available, since these 2 options cannot be combined. The routeless 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("You may not choose tapes on remote control blinds! The remote control option has been removed.");
					document.shopcart.Option9.checked = false;
				}
			}
			if(document.shopcart.Option41){//Remote
				document.shopcart.Option41.disabled = true;
				if(document.shopcart.Option41.checked == true){
					alert("You may not choose tapes on remote control blinds! The remote control option has been removed.");
					document.shopcart.Option41.checked = false;
				}
			}
		}
	}
	
	// new routeless
	
	
		if(document.shopcart.Option43 && document.shopcart.pid.value != 729){//Routless option available
		if(theVal == 0){//no tape selected
			if(document.shopcart.Option43 && document.shopcart.Option9){
				if(document.shopcart.Option9.checked == true){//routeless
					document.shopcart.Option43.disabled = true;//remote
				}
				else if(document.shopcart.Option43.checked == true){//remote
					document.shopcart.Option9.disabled = true;//routeless
				}
				else{//enable both
					document.shopcart.Option43.disabled = false;//routeless
					document.shopcart.Option9.disabled = false;//remote
				}
			}	
			
			if(document.shopcart.Option43 && document.shopcart.Option41){
				if(document.shopcart.Option41.checked == true){//routeless
					document.shopcart.Option43.disabled = true;//remote
					if(document.shopcart.pid.value == 675)
					document.shopcart.Option8.disabled = true;//3 on 1
				}
				else if(document.shopcart.Option43.checked == true){//remote
					document.shopcart.Option41.disabled = true;//routeless
				}
				else{//enable both
					document.shopcart.Option43.disabled = false;//routeless
					if(document.shopcart.pid.value == 675)
					{
					if(document.shopcart.Option8.checked != true)
					document.shopcart.Option41.disabled = false;//remote
					}
					else
					document.shopcart.Option41.disabled = false;//remote
					
				}
			}	
			
			
		}
		else{//tape selected
			if(document.shopcart.Option43){//Routless
				document.shopcart.Option43.disabled = true;
				if(document.shopcart.Option43.checked == true){
					alert("Because you have already chosen the routeless option, cloth tapes are not available, since these 2 options cannot be combined. The routeless option has been removed.");
					document.shopcart.Option43.checked = false;
				}
			}
			if(document.shopcart.Option9){//Remote
				document.shopcart.Option9.disabled = true;
				if(document.shopcart.Option9.checked == true){
					alert("You may not choose tapes on remote control blinds! The remote control option has been removed.");
					document.shopcart.Option9.checked = false;
				}
			}
			if(document.shopcart.Option41){//Remote
				document.shopcart.Option41.disabled = true;
				if(document.shopcart.Option41.checked == true){
					alert("You may not choose tapes on remote control blinds! The remote control option has been removed.");
					document.shopcart.Option41.checked = false;
				}
			}
		}
	}
	
	
	
		if(document.shopcart.Option44){//Routless option available
		if(theVal == 0){//no tape selected
			if(document.shopcart.Option44 && document.shopcart.Option9){
				if(document.shopcart.Option9.checked == true){//routeless
					document.shopcart.Option44.disabled = true;//remote
				}
				else if(document.shopcart.Option44.checked == true){//remote
					document.shopcart.Option9.disabled = true;//routeless
				}
				else{//enable both
					document.shopcart.Option44.disabled = false;//routeless
					document.shopcart.Option9.disabled = false;//remote
				}
			}	
			
			if(document.shopcart.Option44 && document.shopcart.Option41){
				if(document.shopcart.Option41.checked == true){//routeless
					document.shopcart.Option44.disabled = true;//remote
				}
				else if(document.shopcart.Option44.checked == true){//remote
					document.shopcart.Option41.disabled = true;//routeless
				}
				else{//enable both
					document.shopcart.Option44.disabled = false;//routeless
					document.shopcart.Option41.disabled = false;//remote
				}
			}	
			
			
			
		}
		else{//tape selected
			if(document.shopcart.Option44){//Routless
				document.shopcart.Option44.disabled = true;
				if(document.shopcart.Option44.checked == true){
					alert("Because you have already chosen the routeless option, cloth tapes are not available, since these 2 options cannot be combined. The routeless option has been removed.");
					document.shopcart.Option44.checked = false;
				}
			}
			if(document.shopcart.Option9){//Remote
				document.shopcart.Option9.disabled = true;
				if(document.shopcart.Option9.checked == true){
					alert("You may not choose tapes on remote control blinds! The remote control option has been removed.");
					document.shopcart.Option9.checked = false;
				}
			}
			if(document.shopcart.Option41){//Remote
				document.shopcart.Option41.disabled = true;
				if(document.shopcart.Option41.checked == true){
					alert("You may not choose tapes on remote control blinds! The remote control option has been removed.");
					document.shopcart.Option41.checked = false;
				}
			}
		}
	}
	
	
		if(document.shopcart.Option45){//Routless option available
		if(theVal == 0){//no tape selected
			if(document.shopcart.Option45 && document.shopcart.Option9){
				if(document.shopcart.Option9.checked == true){//routeless
					document.shopcart.Option45.disabled = true;//remote
				}
				else if(document.shopcart.Option45.checked == true){//remote
					document.shopcart.Option9.disabled = true;//routeless
				}
				else{//enable both
					document.shopcart.Option45.disabled = false;//routeless
					document.shopcart.Option9.disabled = false;//remote
				}
			}	
			
			if(document.shopcart.Option45 && document.shopcart.Option41){
				if(document.shopcart.Option41.checked == true){//routeless
					document.shopcart.Option45.disabled = true;//remote
				}
				else if(document.shopcart.Option45.checked == true){//remote
					document.shopcart.Option41.disabled = true;//routeless
				}
				else{//enable both
					document.shopcart.Option45.disabled = false;//routeless
					document.shopcart.Option41.disabled = false;//remote
				}
			}	
			
			
			
		}
		else{//tape selected
			if(document.shopcart.Option45){//Routless
				document.shopcart.Option45.disabled = true;
				if(document.shopcart.Option45.checked == true){
					alert("Because you have already chosen the routeless option, cloth tapes are not available, since these 2 options cannot be combined. The routeless option has been removed.");
					document.shopcart.Option45.checked = false;
				}
			}
			if(document.shopcart.Option9){//Remote
				document.shopcart.Option9.disabled = true;
				if(document.shopcart.Option9.checked == true){
					alert("You may not choose tapes on remote control blinds! The remote control option has been removed.");
					document.shopcart.Option9.checked = false;
				}
			}
			if(document.shopcart.Option41){//Remote
				document.shopcart.Option41.disabled = true;
				if(document.shopcart.Option41.checked == true){
					alert("You may not choose tapes on remote control blinds! The remote control option has been removed.");
					document.shopcart.Option41.checked = false;
				}
			}
		}
	}
	
	
	
	
	
	
	
	
	
	
	
	
if(document.shopcart.Option90)
{//Routless option available
		if(theVal == 0){//no tape selected
		document.shopcart.Option90.disabled = false;	
		}	
		else
		{//tape selected
			if(document.shopcart.Option90)
			{//Routless
			//document.shopcart.Option90.disabled = true;
					if(document.shopcart.Option90.checked == true)
					{
					alert("The Routeless Option cannot be combined with Cloth Tapes. Please choose one or the other.");
					//document.shopcart.Option90.checked = false;
					document.shopcart.TapeColorID.selectedIndex=1;
					document.shopcart.TapeColorID.focus();
					}
					else
					document.shopcart.Option90.disabled = true;
					
			}
		}
}


if(document.shopcart.Option113)
{//Routless option and cloth tape 2" Extreme Faux Wood Blinds
		if(theVal == 0){//no tape selected
		document.shopcart.Option113.disabled = false;	
		}	
		else
		{//tape selected
			if(document.shopcart.Option113)
			{//Routless
					if(document.shopcart.Option113.checked == true)
					{
					alert("The Routeless Option cannot be combined with Cloth Tapes. Please choose one or the other.");
					document.shopcart.TapeColorID.selectedIndex=1;
					document.shopcart.TapeColorID.focus();
					}
					else
					document.shopcart.Option113.disabled = true;
					
			}
		}
}
	
	
	
	
	
	

	
	
	
		if(document.shopcart.Option42){//Routless option available
		if(theVal == 0){//no tape selected
			if(document.shopcart.Option42 && document.shopcart.Option9){
				if(document.shopcart.Option9.checked == true){//routeless
					document.shopcart.Option42.disabled = true;//remote
					
					//if(document.shopcart.pid.value == 117)
					//{
					document.shopcart.Option51.disabled = true;//3 on 1
					//}
					
				}
				else if(document.shopcart.Option42.checked == true){//remote
					document.shopcart.Option9.disabled = true;//routeless
				}
				else{//enable both
				
				
					document.shopcart.Option42.disabled = false;//routeless
			
					if(document.shopcart.Option51.checked != true){
						if(document.shopcart.Option50.checked != true)
						document.shopcart.Option51.disabled = false;//3 on 1
						document.shopcart.Option9.disabled = false;//remote
						
						}
				}
			}	
			
			if(document.shopcart.Option42 && document.shopcart.Option41){
				if(document.shopcart.Option41.checked == true){//routeless
					document.shopcart.Option42.disabled = true;//remote
				}
				else if(document.shopcart.Option42.checked == true){//remote
					document.shopcart.Option41.disabled = true;//routeless
				}
				else{//enable both
					document.shopcart.Option42.disabled = false;//routeless
					document.shopcart.Option41.disabled = false;//remote
				}
			}	
			
			
			
		}
		else{//tape selected
			if(document.shopcart.Option42){//Routless
				document.shopcart.Option42.disabled = true;
				if(document.shopcart.Option42.checked == true){
					alert("Because you have already chosen the routeless option, cloth tapes are not available, since these 2 options cannot be combined. The routeless option has been removed.");
					document.shopcart.Option42.checked = false;
				}
			}
			if(document.shopcart.Option9){//Remote
				document.shopcart.Option9.disabled = true;
				if(document.shopcart.Option9.checked == true){
					alert("You may not choose tapes on remote control blinds! The remote control option has been removed.");
					document.shopcart.Option9.checked = false;
				}
			}
			if(document.shopcart.Option41){//Remote
				document.shopcart.Option41.disabled = true;
				if(document.shopcart.Option41.checked == true){
					alert("You may not choose tapes on remote control blinds! The remote control option has been removed.");
					document.shopcart.Option41.checked = false;
				}
			}
		}
	}
	

			if (document.shopcart.pid.value == 739 || document.shopcart.pid.value == 740)
			{
			    if (document.shopcart.Option164)
			    {
			    
			     if (document.shopcart.Option165.checked)
			        {
			        document.shopcart.Option166.checked = false;
			        document.shopcart.Option166.disabled = true;
			        }
			      else if (document.shopcart.Option166.checked)
			        {
			        document.shopcart.Option165.checked = false;
			        document.shopcart.Option165.disabled = true;
			        }
			      else
			      {
			        document.shopcart.Option165.checked = false;
			        document.shopcart.Option165.disabled = false;			      
			      	document.shopcart.Option166.checked = false;
			        document.shopcart.Option166.disabled = false;
			      }  
			      
			      
			      if (document.shopcart.Option164.checked)
			        {
                    if(document.shopcart.FeatureOption106.value == 278) document.shopcart.FeatureOption106.value = 277;
			        }
			      else if (document.shopcart.FeatureOption106.value == 278)
			        {
			        document.shopcart.Option164.checked = false;
			        document.shopcart.Option164.disabled = true;
			        }
			      else
			      {
			        document.shopcart.Option164.checked = false;
			        document.shopcart.Option164.disabled = false;			      
			      }  
			      
			        if (!document.shopcart.Option164.checked)
			        {
			        document.shopcart.Option165.checked = false;
			        document.shopcart.Option165.disabled = true;			      
			      	document.shopcart.Option166.checked = false;
			        document.shopcart.Option166.disabled = true;
			        }
			    
			    var testWidthl = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
			    var testHeightl = document.shopcart.HeightInches.value + document.shopcart.Height8ths.value;
			        
			        if(testWidthl > 84 || testHeightl > 84)
			        {
			            if(document.shopcart.FeatureOption106.value == 278) document.shopcart.FeatureOption106.value = 277;
			        }

			    
			    }
			 }

	
	/*
			if (document.shopcart.pid.value == 741 || document.shopcart.pid.value == 742)
			{
			    if (document.shopcart.Option116)
			    {
			    
			     if (document.shopcart.Option116.checked)
			        {
			        document.shopcart.Option117.checked = false;
			        document.shopcart.Option117.disabled = true;
			        }
			      else if (document.shopcart.Option117.checked)
			        {
			        document.shopcart.Option116.checked = false;
			        document.shopcart.Option116.disabled = true;
			        }
			      else
			      {
			        document.shopcart.Option117.checked = false;
			        document.shopcart.Option117.disabled = false;			      
			      	document.shopcart.Option116.checked = false;
			        document.shopcart.Option116.disabled = false;
			      }  
			        
			    }
	        }
	        */
	        
	        
	        
	        
	        
	
				if (document.shopcart.pid.value == 729)
			{
			    if (document.shopcart.Option6)
			    {
			        //2 on 1
			        if (document.shopcart.Option6.checked)
			        {
			        document.shopcart.Option43.checked = false;
			        document.shopcart.Option43.disabled = true;
			        
			        document.shopcart.TapeColorID.disabled = true;
			        document.shopcart.TapeColorID.value = 0;
			        }
			        else if (document.shopcart.Option8.checked)
			        {
			        document.shopcart.Option41.checked = false;
			        document.shopcart.Option41.disabled = true;
			        }
			         else if (document.shopcart.Option43.checked)
			        {
			        document.shopcart.TapeColorID.disabled = true;
			        document.shopcart.TapeColorID.value = 0;
			        }
			        else if (document.shopcart.TapeColorID.value != 0)
			        {
			        document.shopcart.Option43.checked = false;
			        document.shopcart.Option43.disabled = true;
			        }			        
			        else if (document.shopcart.Option41.checked)
			        {
			        document.shopcart.Option6.checked = false;
			        document.shopcart.Option6.disabled = true;
			        }
			        else
			        {
			        document.shopcart.Option43.checked = false;
			        document.shopcart.Option43.disabled = false;
			        document.shopcart.Option41.checked = false;
			        document.shopcart.Option41.disabled = false;			
			        document.shopcart.Option6.checked = false;
			        document.shopcart.Option6.disabled = false;		
			        document.shopcart.Option8.checked = false;
			        document.shopcart.Option8.disabled = false;		
			        document.shopcart.TapeColorID.disabled = false;		        		        		                
			        }
			        
			        var testWidthl = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
			        
			        if(testWidthl < 12)
			            document.shopcart.FeatureOption4.disabled =true;
			        else
    		            document.shopcart.FeatureOption4.disabled =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("You may not choose tapes on routless blinds! The routless 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("You may not choose tapes on remote control blinds! The remote control option has been removed.");
					document.shopcart.Option30.checked = false;
				}
			}
		}
	}
}

function SetOptionStatus(){	

	var testWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
	var testHeight = document.shopcart.HeightInches.value + document.shopcart.Height8ths.value;
	

	if(document.shopcart.FeatureOption11 && (document.shopcart.pid.value == 54 || document.shopcart.pid.value == 57 || document.shopcart.pid.value == 58))
	{
		if((testWidth < 17 || testWidth >= 60) && document.shopcart.FeatureOption11.value == 30)
		{
			document.shopcart.FeatureOption11.value = 31
			alert("Roller Type: Spring is not available for blinds over 60 inches and below 17 inches!")
		}
	
	}

	
	if(document.shopcart.pid.value == 58) 
	
	{
		if(testWidth > 84 && (document.shopcart.ColorID.value == 3167 || document.shopcart.ColorID.value == 3168 || document.shopcart.ColorID.value == 3169))
		{
			document.shopcart.ColorID.value = 0;
			document.shopcart.ColorID.selectedIndex = 0; 
			document.shopcart.IsSelectedC2.value = 0;
			document.shopcart.IsSelectedC.value = 0;			
			document.getElementById("BlindColor").src = "http://www.selectblindscanada.ca/images/selectcolor.gif";			
			alert("Please note for Premium Colours: Saddle, Prairie, Moccasin - Maximum Blind Width is 84 inches.")
		}
		
		
		if(testWidth > 78.25 && (document.shopcart.ColorID.value == 3165 || document.shopcart.ColorID.value == 3166))
		{
			document.shopcart.ColorID.value = 0;
			document.shopcart.ColorID.selectedIndex = 0; 
			document.shopcart.IsSelectedC2.value = 0;
			document.shopcart.IsSelectedC.value = 0;
			document.getElementById("BlindColor").src = "http://www.selectblindscanada.ca/images/selectcolor.gif";					
			alert("Please note for Colours: Cotton White, Natural - Maximum Blind Width is 78 1/4 inches.")
		}
		
		
		if(document.shopcart.FeatureOption11)
	{
		if((testWidth >= 17 && testWidth <= 60) && document.shopcart.FeatureOption11.value == 30 && (document.shopcart.ColorID.value == 3167 || document.shopcart.ColorID.value == 3168 || document.shopcart.ColorID.value == 3169))
		{
			document.shopcart.FeatureOption11.value = 31
			alert("Roller Type: Spring is not available for Premium Colours: Saddle, Prairie, Moccasin.")
		}
	
	}
	
	}
	
	
	if (document.shopcart.pid.value == 57 || document.shopcart.pid.value == 54 || document.shopcart.pid.value == 58 || document.shopcart.pid.value == 709) {
	    if (document.shopcart.FeatureOption11) {
	        if (document.shopcart.FeatureOption11.value == 30) {
	            document.shopcart.Option124.checked = false;
	            document.shopcart.Option124.disabled = true;
	            document.shopcart.Option123.checked = false;
	            document.shopcart.Option123.disabled = true;
	        }
	        else {
	            if (document.shopcart.FeatureOption11.value == 32) {
	                document.shopcart.Option124.disabled = false;
	                document.shopcart.Option123.disabled = false;
	            }
	        }

	    }
	}	
	
	
	
	if (document.shopcart.pid.value == 57) 
	{
	    if (document.shopcart.FeatureOption11) 
	    {

	if(testWidth > 78 && (document.shopcart.ColorID.value == 4031 || document.shopcart.ColorID.value == 4034 || document.shopcart.ColorID.value == 4036 || document.shopcart.ColorID.value == 3037 || document.shopcart.ColorID.value == 4038 || document.shopcart.ColorID.value == 4039 || document.shopcart.ColorID.value == 4028 || document.shopcart.ColorID.value == 4029 || document.shopcart.ColorID.value == 4030 || document.shopcart.ColorID.value == 519 || document.shopcart.ColorID.value == 520))
		{
			document.shopcart.ColorID.value = 0;
			document.shopcart.ColorID.selectedIndex = 0; 
			//document.shopcart.ColorID2.value = 0;
			//document.shopcart.ColorID2.selectedIndex = 0; 
			document.shopcart.IsSelectedC2.value = 0;
			document.shopcart.IsSelectedC.value = 0;
			document.getElementById("BlindColor").src = "http://www.selectblindscanada.ca/images/selectcolor.gif";		
			alert("Please note for Colours: Cotton,Natural,Cloud,Flex,Grain,Snow,Harvest,Ice,Black,White,Linen - Maximum Blind Width is 78 inches for a single blind.")
		}

	    }
	}	
	
	
	
	if (document.shopcart.FeatureOption1)
	{
		//inside mount
		if (document.shopcart.FeatureOption1.value == 2)
		{
			if (document.shopcart.FeatureOption53)
			{//spacer blocks
				document.shopcart.FeatureOption53.disabled = true;
				document.shopcart.FeatureOption53.selectedIndex = 0;
			}
			/*if (document.shopcart.FeatureOption53)
			{//hold down brackets
				if (document.shopcart.FeatureOption54)
				{
				document.shopcart.FeatureOption54.disabled = true;
				document.shopcart.FeatureOption54.selectedIndex = 0;
				}
			}*/
			if (document.shopcart.FeatureOption62)
			{//extantion brackets
				if (document.shopcart.FeatureOption62)
				{
				document.shopcart.FeatureOption62.disabled = true;
				document.shopcart.FeatureOption62.selectedIndex = 0;
				}
			}
		}
		else if (document.shopcart.FeatureOption1.value == 3) // outside
		{
			if (document.shopcart.FeatureOption53)
			{//spacer blocks
				document.shopcart.FeatureOption53.disabled = false;
				if (document.shopcart.FeatureOption53.selectedIndex < 0) document.shopcart.FeatureOption53.selectedIndex = 1;
			}
			if (document.shopcart.FeatureOption54)
			{//hold down brackets
				document.shopcart.FeatureOption54.disabled = false;
				if (document.shopcart.FeatureOption54.selectedIndex < 0) document.shopcart.FeatureOption54.selectedIndex = 1;
			}
			if (document.shopcart.FeatureOption62)
			{//extantion brackets
				document.shopcart.FeatureOption62.disabled = false;
				if (document.shopcart.FeatureOption62.selectedIndex < 0) document.shopcart.FeatureOption62.selectedIndex = 1;
			}
		}
	}
	
if(document.shopcart.Option31)
{
	if (document.shopcart.Option31.checked == true)
	{
	document.getElementById('FeatureOption4').disabled=true;
	}
	else
		document.getElementById('FeatureOption4').disabled=false;
	
}
		
	
	//Shutters Mount Type
	if (document.shopcart.FeatureOption45)
	{
		//inside standard, outside standard, inside z frame
		if (document.shopcart.FeatureOption45.value == 66 || document.shopcart.FeatureOption45.value == 67 || document.shopcart.FeatureOption45.value == 68)
		{
			//panel configuration
			if (document.shopcart.FeatureOption46)
			{
				if (document.shopcart.FeatureOption46.value == 70 || document.shopcart.FeatureOption46.value == 71) //single panel
				{
					if (testWidth > 34) {alert("We cannot make any single panel shutters over 34 inches wide."); document.shopcart.FeatureOption45.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption46.value == 72) //two panel split
				{
					if (testWidth < 22) {alert("We cannot make any two panel split shutters less than 22 inches wide."); document.shopcart.FeatureOption45.selectedIndex = 0;}
					if (testWidth > 53) {alert("We cannot make any two panel split shutters over 53 inches wide."); document.shopcart.FeatureOption45.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption46.value == 73 || document.shopcart.FeatureOption46.value == 74) //Two Panel Left, Two Panel Right
				{
					if (testWidth < 22) {alert("We cannot make any two panel shutters less than 22 inches wide."); document.shopcart.FeatureOption45.selectedIndex = 0;}
					if (testWidth > 53) {alert("We cannot make any two panel shutters over 53 inches wide."); document.shopcart.FeatureOption45.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption46.value == 75) //Four Panel Bifold Split
				{
					if (testWidth < 36) {alert("We cannot make any four panel bifold split shutters less than 36 inches wide."); document.shopcart.FeatureOption45.selectedIndex = 0;}
					if (testWidth > 105) {alert("We cannot make any four panel bifold split shutters over 105 inches wide."); document.shopcart.FeatureOption45.selectedIndex = 0;}
				}
			}
		}
		if (document.shopcart.FeatureOption45.value == 69) //outside designer
		{
			//panel configuration
			if (document.shopcart.FeatureOption46)
			{
				if (document.shopcart.FeatureOption46.value == 70 || document.shopcart.FeatureOption46.value == 71) //single panel
				{
					if (testWidth < 22) {alert("We cannot make any single panel shutters less than 22 inches wide."); document.shopcart.FeatureOption45.selectedIndex = 0;}
					if (testWidth > 28) {alert("We cannot make any single panel shutters over 28 inches wide."); document.shopcart.FeatureOption45.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption46.value == 72) //two panel split
				{
					if (testWidth < 30) {alert("We cannot make any two panel split shutters less than 30 inches wide."); document.shopcart.FeatureOption45.selectedIndex = 0;}
					if (testWidth > 48) {alert("We cannot make any two panel split shutters over 48 inches wide."); document.shopcart.FeatureOption45.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption46.value == 73 || document.shopcart.FeatureOption46.value == 74) //Two Panel Left, Two Panel Right
				{
					if (testWidth < 30) {alert("We cannot make any two panel shutters less than 30 inches wide."); document.shopcart.FeatureOption45.selectedIndex = 0;}
					if (testWidth > 48) {alert("We cannot make any two panel shutters over 48 inches wide."); document.shopcart.FeatureOption45.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption46.value == 75) //Four Panel Bifold Split
				{
					if (testWidth < 44) {alert("We cannot make any four panel bifold split shutters less than 44 inches wide."); document.shopcart.FeatureOption45.selectedIndex = 0;}
					if (testWidth > 95) {alert("We cannot make any four panel bifold split shutters over 95 inches wide."); document.shopcart.FeatureOption45.selectedIndex = 0;}
				}
			}
		}
	}
	
	if (document.shopcart.FeatureOption50)
	{
		if (document.shopcart.FeatureOption50.value == 85) 
		{
			if (testHeight >= 62 && testHeight < 72) alert("Due to the height of the shutter you have selected we recommend adding 1 dividing rail.");
			if (testHeight >= 72 && testHeight < 90) document.shopcart.FeatureOption50.selectedIndex = 1;
			if (testHeight >= 90 && testHeight < 96) alert("Due to the height of the shutter you have selected we recommend adding 2 dividing rail.");
			if (testHeight >= 96) document.shopcart.FeatureOption50.selectedIndex = 2;
		}
		if (document.shopcart.FeatureOption50.value == 136) 
		{
			if (testHeight >= 90 && testHeight < 96) alert("Due to the height of the shutter you have selected we recommend adding 2 dividing rail.");
			if (testHeight >= 96) document.shopcart.FeatureOption50.selectedIndex = 2;
		}
	}
	
	
	if (document.shopcart.Option70 && document.shopcart.Option67 && document.shopcart.Option69 && document.shopcart.Option68)
	{
		if (document.shopcart.Option70.checked == true)
		{
			document.shopcart.Option67.disabled = true;
			document.shopcart.Option69.disabled = true;
			document.shopcart.Option68.disabled = true;
		}
		else if (document.shopcart.Option67.checked == true)
		{
			document.shopcart.Option70.disabled = true;
			document.shopcart.Option69.disabled = true;
			document.shopcart.Option68.disabled = true;
		}
		else if (document.shopcart.Option69.checked == true)
		{
			document.shopcart.Option70.disabled = true;
			document.shopcart.Option67.disabled = true;
			document.shopcart.Option68.disabled = true;
		}
		else if (document.shopcart.Option68.checked == true)
		{
			document.shopcart.Option70.disabled = true;
			document.shopcart.Option67.disabled = true;
			document.shopcart.Option69.disabled = true;
		}
		else
		{
			document.shopcart.Option70.disabled = false;
			document.shopcart.Option67.disabled = false;
			document.shopcart.Option69.disabled = false;
			document.shopcart.Option68.disabled = false;
		}
		
		
		
		


} // end shutters 


// romans
	if (document.shopcart.Option80)
	{
		if (document.shopcart.Option80.checked == true)
		{
			document.shopcart.Option77.disabled = true;
			document.shopcart.Option79.disabled = true;
			document.shopcart.Option78.disabled = true;
		}
		else if (document.shopcart.Option77.checked == true)
		{
		    document.shopcart.Option80.disabled = true;
			document.shopcart.Option79.disabled = true;
			document.shopcart.Option78.disabled = true;
		}
		else if (document.shopcart.Option79.checked == true)
		{
			document.shopcart.Option80.disabled = true;
			document.shopcart.Option77.disabled = true;
			document.shopcart.Option78.disabled = true;
		}
		else if (document.shopcart.Option78.checked == true)
		{
			document.shopcart.Option80.disabled = true;
			document.shopcart.Option77.disabled = true;
			document.shopcart.Option79.disabled = true;
		}
		else
		{
			document.shopcart.Option80.disabled = false;
			document.shopcart.Option77.disabled = false;
			document.shopcart.Option79.disabled = false;
			document.shopcart.Option78.disabled = false;
		}
	}
	else if (document.shopcart.Option77)
	{
		 if (document.shopcart.Option77.checked == true)
		{
			document.shopcart.Option79.disabled = true;
			document.shopcart.Option78.disabled = true;
		}
		else if (document.shopcart.Option79.checked == true)
		{
			document.shopcart.Option77.disabled = true;
			document.shopcart.Option78.disabled = true;
		}
		else if (document.shopcart.Option78.checked == true)
		{
			document.shopcart.Option77.disabled = true;
			document.shopcart.Option79.disabled = true;
		}
		else
		{
			document.shopcart.Option77.disabled = false;
			document.shopcart.Option79.disabled = false;
			document.shopcart.Option78.disabled = false;
		}
	}
	
	
	
// romans
            if (document.shopcart.pid.value != 817 && document.shopcart.pid.value != 818)
			if (document.shopcart.Option129)
			{//romans
				if (testWidth <= 84 && testWidth >= 18 && testHeight <= 84 && testHeight >= 18)
				{
				document.shopcart.Option129.disabled = false;
					if (document.shopcart.pid.value == 656 || document.shopcart.pid.value == 747)
					{//cordless
							if (document.shopcart.ColorID.value == 2366 || document.shopcart.ColorID.value == 2366 || document.shopcart.ColorID.value == 2381 || document.shopcart.ColorID.value == 2380 || document.shopcart.ColorID.value == 2365 || document.shopcart.ColorID.value == 2382){
								document.shopcart.Option129.disabled = false;
								}
								else
								{
								document.shopcart.Option129.disabled = true;
								document.shopcart.Option129.checked = false;
								}
					}
					if (document.shopcart.pid.value == 661 || document.shopcart.pid.value == 748)
					{//cordless
							if (document.shopcart.ColorID.value == 2357 || document.shopcart.ColorID.value == 2358 || document.shopcart.ColorID.value == 2359 || document.shopcart.ColorID.value == 2360 || document.shopcart.ColorID.value == 2362 || document.shopcart.ColorID.value == 2363 || document.shopcart.ColorID.value == 2421 || document.shopcart.ColorID.value == 2422 || document.shopcart.ColorID.value == 2423 || document.shopcart.ColorID.value == 2424 || document.shopcart.ColorID.value == 2427 || document.shopcart.ColorID.value == 2428 || document.shopcart.ColorID.value == 2429 || document.shopcart.ColorID.value == 2430){
								document.shopcart.Option129.disabled = false;
								}
								else
								{
								document.shopcart.Option129.disabled = true;
								document.shopcart.Option129.checked = false;
								}
					}
					
				}
				else
				{
				document.shopcart.Option129.disabled = true;
				document.shopcart.Option129.checked = false;
				}
				
			if(document.shopcart.Option77)
			if(document.shopcart.Option129.checked == true)
				{
				if(document.shopcart.Option77.disabled == false)
					document.shopcart.Option77.disabled = true;
				}
			else
				{
				if(document.shopcart.Option77.disabled == false)
					document.shopcart.Option77.disabled = 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;
	}
	
	
if(document.shopcart.pid.value != 83 && document.shopcart.pid.value != 84)
{	



	//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
		}
	}
	else if(document.shopcart.pid.value == 137){
	}
	else{//Dont allow if blind too small
	
		
		if(document.shopcart.Option6){//Both 2 in 1
			//document.shopcart.Option6.checked = false;
			document.shopcart.Option6.disabled = false;//2 in 1 headrail
		}
		if(document.shopcart.Option8){//Both 8 in 1
			//document.shopcart.Option8.checked = false;
			document.shopcart.Option8.disabled = false;//3 in 1 headrail
		}
		
	}

	
	
	
	

	
	// 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
			if(document.shopcart.pid.value == 675)
			{
					document.shopcart.Option41.disabled = true;	
					
			}
				
		}
		/*
		else if(document.shopcart.Option6.checked == true){//2 in 1 headrail
			document.shopcart.Option8.disabled = true;//3 in 1 headrail

		}
		else{//enable both
			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 == 640){
		if( document.shopcart.FeatureOption3.value == 7 && document.shopcart.FeatureOption7.value == 14)
			{
			alert("Sorry, Split Draw is only available with Cord Tilter Control.");
			document.shopcart.FeatureOption3.value = 6;
			}
		}

	/*
	if(document.shopcart.pid.value == 639){
	
	//2" vogue wood
	
	
		
	
	if( document.shopcart.Option48 && document.shopcart.Option49){
	if(document.shopcart.Option48.checked == true)
		{//2 in 1 headrail
			document.shopcart.Option49.disabled = true;//3 in 1 headrail
		}
		else if(document.shopcart.Option49.checked == true){//3 in 1 headrail
			document.shopcart.Option48.disabled = true;//2 in 1 headrail
		}
		else
		{//enable all
		
			//allow, but dont require 2 on 1 or 3 on 1
		 if(iMultipleBlinds != 1)
			{
				document.shopcart.Option48.disabled = false;//2 in 1 headrail
				document.shopcart.Option49.disabled = false;//3 in 1 headrail
			}
		}
	
	}
}
*/
/*
if(document.shopcart.pid.value == 678){
	
	//2" Extreme Faux Wood Blinds
	if( document.shopcart.Option115 && document.shopcart.Option114){
	if(document.shopcart.Option115.checked == true)
		{//2 in 1 headrail
			document.shopcart.Option114.disabled = true;//3 in 1 headrail
		}
		else if(document.shopcart.Option114.checked == true){//3 in 1 headrail
			document.shopcart.Option115.disabled = true;//2 in 1 headrail
		}
		else
		{//enable all
		
			//allow, but dont require 2 on 1 or 3 on 1
		 if(iMultipleBlinds != 1)
			{
				document.shopcart.Option115.disabled = false;//2 in 1 headrail
				document.shopcart.Option114.disabled = false;//3 in 1 headrail
			}
		}
	
	}
}
*/

if(document.shopcart.pid.value == 677){
		//vintage wood
			var blindWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
						
			if(blindWidth >= 7 && blindWidth <= 12)
			{
			alert('Please note that Blinds under 12" come standard with tilter in the centre.');
			document.shopcart.FeatureOption61.disabled = true;
			}
			else
			document.shopcart.FeatureOption61.disabled = false;
			
			if(blindWidth >= 12.125 && blindWidth <= 17.85)
			{
			if((document.shopcart.FeatureOption61.value == 115 && document.shopcart.FeatureOption4.value == 9) || (document.shopcart.FeatureOption61.value == 116 && document.shopcart.FeatureOption4.value == 10))
			alert('Blinds 12 1/8" - 17 7/8"  wide need to have split controls. Please choose opposite side for the location of the Tilt control and the Lift Cord.');
			}
			
			
	
}


/*
if(document.shopcart.pid.value == 682 || document.shopcart.pid.value == 689){
	
	//1/2" Micro Aluminum Blinds Blinds
	if( document.shopcart.Option116 && document.shopcart.Option117){
	if(document.shopcart.Option116.checked == true)
		{//2 in 1 headrail
			document.shopcart.Option117.disabled = true;//3 in 1 headrail
		}
		else if(document.shopcart.Option117.checked == true){//3 in 1 headrail
			document.shopcart.Option116.disabled = true;//2 in 1 headrail
		}
		else
		{//enable all
		
			//allow, but dont require 2 on 1 or 3 on 1
		 if(iMultipleBlinds != 1)
			{
				document.shopcart.Option116.disabled = false;//2 in 1 headrail
				document.shopcart.Option117.disabled = false;//3 in 1 headrail
			}
		}
	
	}
}
*/


/*
if(document.shopcart.pid.value == 679){
	
	//2" Extreme Faux Wood Blinds
	if( document.shopcart.Option111 && document.shopcart.Option112){
	if(document.shopcart.Option111.checked == true)
		{//2 in 1 headrail
			document.shopcart.Option112.disabled = true;//3 in 1 headrail
		}
		else if(document.shopcart.Option112.checked == true){//3 in 1 headrail
			document.shopcart.Option111.disabled = true;//2 in 1 headrail
		}
		else
		{//enable all
		
			//allow, but dont require 2 on 1 or 3 on 1
		 if(iMultipleBlinds != 1)
			{
				document.shopcart.Option111.disabled = false;//2 in 1 headrail
				document.shopcart.Option112.disabled = false;//3 in 1 headrail
			}
		}
	
	}
}
*/


if(document.shopcart.pid.value == 676){
	
	//Pleated Shades
	
	if( document.shopcart.Option104 && document.shopcart.Option107){
	if(document.shopcart.Option104.checked == true)
		{//2 in 1 headrail
			document.shopcart.Option107.disabled = true;//Top Down / Bottom up
		}
		else if(document.shopcart.Option107.checked == true){//Top Down / Bottom up
			document.shopcart.Option104.disabled = true;//Continuous Cord Loop
		}
		else
		{//enable all
		 if(iMultipleBlinds != 1)
			{
				document.shopcart.Option104.disabled = false;//Continuous Cord Loop
				document.shopcart.Option107.disabled = false;//Top Down / Bottom up
			}
		}
	}
	
	
	
			if(testWidth > 72 && (document.shopcart.ColorID.value == 2650 || document.shopcart.ColorID.value == 2651 || document.shopcart.ColorID.value == 2652 || document.shopcart.ColorID.value == 2653) && document.shopcart.Option105.checked == false && document.shopcart.Option106.checked == false)
		{
			document.shopcart.ColorID.value = 0;
			document.shopcart.ColorID.selectedIndex = 0; 
			//document.shopcart.ColorID2.value = 0;
			//document.shopcart.ColorID2.selectedIndex = 0; 
			document.shopcart.IsSelectedC2.value = 0;
			document.shopcart.IsSelectedC.value = 0;
			document.getElementById("BlindColor").src = "http://www.selectblindscanada.ca/images/selectcolor.gif";
			document.shopcart.Option109.disabled = false;//Privacy Liner--Blackout 
			document.shopcart.Option110.disabled = false;//Privacy Liner--Light Filter				
			alert("Please note for Colours: Vancouver: Mink, Vancouver: Spice, Vancouver: Straw, Vancouver: Mocha - Maximum Blind Width is 72 inches for a single blind; however, these colours are available in longer widths if you select the 2 Blinds on 1 Headrail option or the 3 Blinds on 1 Headrail option.")
		}
	
	
	
	
	

	if( document.shopcart.Option109 && document.shopcart.Option110){
		if (document.shopcart.ColorID.value == 2651 || document.shopcart.ColorID.value == 2652 || document.shopcart.ColorID.value == 2653 || (document.shopcart.ColorID.value >= 2596 && document.shopcart.ColorID.value <= 2601))
		{
			document.shopcart.Option109.disabled = true;//Privacy Liner--Blackout 
			document.shopcart.Option110.disabled = true;//Privacy Liner--Light Filter
		}
		else
		{
			if(document.shopcart.Option109.checked == true)
				{//
					document.shopcart.Option110.disabled = true;//Privacy Liner--Light Filter
				}
				else if(document.shopcart.Option110.checked == true){//Privacy Liner--Light Filter
					document.shopcart.Option109.disabled = true;//Privacy Liner--Blackout 
				}
				else
				{//enable all
				if(iMultipleBlinds != 1)
					{
						document.shopcart.Option109.disabled = false;//Privacy Liner--Blackout 
						document.shopcart.Option110.disabled = false;//Privacy Liner--Light Filter
					}
				}
		}
	}
	
	
	
		if( document.shopcart.Option105 && document.shopcart.Option106){
	if(document.shopcart.Option105.checked == true)
		{//2 in 1 headrail
			//document.shopcart.Option106.disabled = true;//3 in 1 headrail
			document.shopcart.Option107.disabled = true;//TDBU
		}
		else if(document.shopcart.Option106.checked == true){//3 in 1 headrail
			//document.shopcart.Option105.disabled = true;//2 in 1 headrail
			document.shopcart.Option107.disabled = true;//TDBU
		}
		else
		{//enable all
		
			//allow, but dont require 2 on 1 or 3 on 1
		 //if(iMultipleBlinds != 1)
			//{
				//document.shopcart.Option105.disabled = false;//2 in 1 headrail
				//document.shopcart.Option106.disabled = false;//3 in 1 headrail
				
				
				
			//}
		}
	}
	
	var blindWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
	var blindHeight = document.shopcart.HeightInches.value + document.shopcart.Height8ths.value;
	if(blindWidth >= 72 || blindWidth <= 12 || blindHeight >= 96){
	document.shopcart.Option107.checked = false; //tdbu
	document.shopcart.Option107.disabled = true;//tdbu
	}
	
	
	if( document.shopcart.Option105)
	{
	    if(document.shopcart.Option105.checked == true)
		    {//cont cord loop
			    document.shopcart.Option104.disabled = true;
			    document.shopcart.Option104.checked = false;
		    }
        else if(document.shopcart.Option106.checked == true)
		    {//cont cord loop
			    document.shopcart.Option104.disabled = true;
			    document.shopcart.Option104.checked = false;
		    }		    
	    else if(document.shopcart.Option104.checked == true)
		    {//cont cord loop
			    document.shopcart.Option105.disabled = true;
			    document.shopcart.Option105.checked = false;
			    document.shopcart.Option106.disabled = true;
			    document.shopcart.Option106.checked = false;			    
		    }	
		else
		    { 
		        if(document.shopcart.Option104.checked == false)
		        {
                document.shopcart.Option104.disabled = false;
			    document.shopcart.Option104.checked = false;
			    }
		        if(document.shopcart.Option105.checked == false)
		        {			    
                document.shopcart.Option105.disabled = false;
			    document.shopcart.Option105.checked = false;	
			    }		    
			}
	}

	
	
}



	
	if(document.shopcart.pid.value == 674 || document.shopcart.pid.value == 685 || document.shopcart.pid.value == 686){
		
	//1/2" Double Cell Light Filter Extreme Honeycomb
	if( document.shopcart.Option100 && document.shopcart.Option101)
	{
	
				        if (document.shopcart.Option6.checked == true && document.shopcart.LiftLeftBlind2.value == document.shopcart.LiftRightBlind2.value)
				            {
				            alert("Sorry, Lift Cord for 2 Blinds on 1 Headrail must be split with one blind on the left and one on the right or the opposite.")
							if(document.shopcart.LiftLeftBlind2.value == "L") document.shopcart.LiftRightBlind2.value = "R";
							                else document.shopcart.LiftRightBlind2.value = "L";
				            }	
	
	    if(document.shopcart.Option6.checked == true)
		{
			document.shopcart.Option101.disabled = true;//tdbu
			document.shopcart.Option100.disabled = true;//2on1
		}
		else if(document.shopcart.Option100.checked == true)
		{
			document.shopcart.Option101.disabled = true;//tdbu
			document.shopcart.Option6.disabled = true;//2on1
		}
		else if(document.shopcart.Option101.checked == true){//Cordless Child Safety System
			document.shopcart.Option100.disabled = true;//tdbu
			document.shopcart.Option6.disabled = true;//2on1
		}
		else
		{//enable all
				document.shopcart.Option100.disabled = false;//tdbu
				document.shopcart.Option101.disabled = false;//Cordless Child Safety System
				document.shopcart.Option6.disabled = false;//2on1

		}
	
	}
	
	var blindWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
	if(blindWidth > 72){
	document.shopcart.Option100.checked = false; //tdbu
	document.shopcart.Option100.disabled = true;//tdbu
	}
	
}



/*
	if(document.shopcart.pid.value == 684){	
	//2" premium faux wood
	if( document.shopcart.Option50 && document.shopcart.Option51){
		if(document.shopcart.Option50.checked == true)
		{//2 in 1 headrail
			document.shopcart.Option51.disabled = true;//3 in 1 headrail			
		}
		else if(document.shopcart.Option51.checked == true){//3 in 1 headrail
			document.shopcart.Option50.disabled = true;//2 in 1 headrail
		}
		else
		{//enable all

		 if(iMultipleBlinds != 1)
			{
				document.shopcart.Option50.disabled = false;//2 in 1 headrail
				document.shopcart.Option51.disabled = false;//3 in 1 headrail
			}
		}
	
	}
}
*/



	if(document.shopcart.pid.value == 117 || document.shopcart.pid.value == 648 || document.shopcart.pid.value == 683){	
	//2" premium faux wood
	if( document.shopcart.Option50 && document.shopcart.Option51){
		//if(document.shopcart.Option50.checked == true)
		//{//2 in 1 headrail
			//document.shopcart.Option51.disabled = true;//3 in 1 headrail			
		//}
		//else if(document.shopcart.Option51.checked == true){//3 in 1 headrail
		if(document.shopcart.Option51.checked == true){//3 in 1 headrail
			//document.shopcart.Option50.disabled = true;//2 in 1 headrail
			//if(document.shopcart.pid.value == 117)
			document.shopcart.Option9.disabled = true;//Battery Operated
		}
		else
		{//enable all
		
			//if(document.shopcart.pid.value == 117)
			if(document.shopcart.Option9.checked != true)
			document.shopcart.Option9.disabled = false;//Battery Operated 
			//allow, but dont require 2 on 1 or 3 on 1
		 //if(iMultipleBlinds != 1)
			//{
				//document.shopcart.Option50.disabled = false;//2 in 1 headrail
				//document.shopcart.Option51.disabled = false;//3 in 1 headrail
			//}
		}
	
	}
}



/*
	if(document.shopcart.pid.value == 8){	
	//1" premium alumin
	if( document.shopcart.Option52 && document.shopcart.Option53){
	if(document.shopcart.Option52.checked == true)
		{//2 in 1 headrail
			document.shopcart.Option53.disabled = true;//3 in 1 headrail
		}
		else if(document.shopcart.Option53.checked == true){//3 in 1 headrail
			document.shopcart.Option52.disabled = true;//2 in 1 headrail
		}
		else
		{//enable all
		
			//allow, but dont require 2 on 1 or 3 on 1
		 if(iMultipleBlinds != 1)
			{
				document.shopcart.Option52.disabled = false;//2 in 1 headrail
				document.shopcart.Option53.disabled = false;//3 in 1 headrail
			}
		}
	
	}
}
	*/
	
	if(document.shopcart.pid.value == 688 || document.shopcart.pid.value == 687){	
	//Legacy Roman -  Blackout and Light Filtering
	if( document.shopcart.Option32 && document.shopcart.Option118){
	if(document.shopcart.Option32.checked == true)
		{//2 in 1 headrail
			document.shopcart.Option118.disabled = true;//Hubbled
		}
		else if(document.shopcart.Option118.checked == true){//Hubbled
			document.shopcart.Option32.disabled = true;//cutout
		}
		else
		{//enable all
		
		document.shopcart.Option32.disabled = false;//cutout
		document.shopcart.Option118.disabled = false;//Hubbled
		}
	
	}
}


	
	
	
	if(document.shopcart.pid.value == 153){
	if(document.shopcart.Option19 && document.shopcart.Option36){
		if(document.shopcart.Option36.checked == true){//cont. cord checked
			document.shopcart.Option19.disabled = true;//Top-up Bottom Down
			
		}
		else if(document.shopcart.Option19.checked == true){//Top-up Bottom Down
			//document.shopcart.Option21.disabled = true;//cont. cord checked
			document.shopcart.Option36.disabled = true;//cont. cord checked
			}
		else{//enable all
			//document.shopcart.Option21.disabled = false;//cont. cord checked
			document.shopcart.Option36.disabled = false;//cont. cord checked
			document.shopcart.Option19.disabled = false;//Top-up Bottom Down
			}
		}
	}	
	
	
if(document.shopcart.pid.value == 137){	
		//Bamboo shades top-up bottom down, 2 in one headrail and contiuous cord
	if(document.shopcart.Option19 && document.shopcart.Option37 && document.shopcart.Option46 && document.shopcart.Option47)
	{
		if(document.shopcart.Option37.checked == true){//cont. cord checked
			document.shopcart.Option19.disabled = true;//Top-up Bottom Down
			document.shopcart.Option46.disabled = true;//2 in 1 headrail
			document.shopcart.Option47.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.shopcart.Option37.disabled = true;//cont. cord checked
			document.shopcart.Option46.disabled = true;//2 in 1 headrail
			document.shopcart.Option47.disabled = true;//3 in 1 headrail
		}
		else if(document.shopcart.Option46.checked == true){//2 in 1 headrail
			//document.shopcart.Option21.disabled = true;//cont. cord checked
			document.shopcart.Option37.disabled = true;//cont. cord checked
			document.shopcart.Option19.disabled = true;//Top-up Bottom Down
			//document.shopcart.Option47.disabled = true;//3 in 1 headrail
		}
		else if(document.shopcart.Option47.checked == true){//3 in 1 headrail
			//document.shopcart.Option21.disabled = true;//cont. cord checked
			document.shopcart.Option37.disabled = true;//cont. cord checked
			document.shopcart.Option19.disabled = true;//Top-up Bottom Down
			//document.shopcart.Option46.disabled = true;//2 in 1 headrail
		}
		else{//enable all
			document.shopcart.Option37.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){
				var blindWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
				if(blindWidth >= 72){
					if(document.shopcart.Option47){
						document.shopcart.Option47.disabled = false;//3 in 1
					}
					if(document.shopcart.Option19){
						document.shopcart.Option19.disabled = true;
					}
					if(document.shopcart.Option46){
						document.shopcart.Option46.disabled = false;//2 in 1 headrail
					}
				}
				else{
					document.shopcart.Option46.disabled = false;//2 in 1 headrail
					document.shopcart.Option47.disabled = false;//3 in 1 headrail
				}
			}
			//else if(iMultipleBlinds != 1){
				//document.shopcart.Option46.disabled = false;//2 in 1 headrail
				//document.shopcart.Option47.disabled = false;//3 in 1 headrail
			//}
			
		}
	}
}










/*
if(document.shopcart.pid.value == 642){	
	//2" Bamboo shades  2 in one headrail 
	if( document.shopcart.Option6 && document.shopcart.Option38){
	if(document.shopcart.Option6.checked == true)
		{//2 in 1 headrail
			document.shopcart.Option38.disabled = true;//3 in 1 headrail
		}
		else if(document.shopcart.Option38.checked == true){//3 in 1 headrail
			document.shopcart.Option6.disabled = true;//2 in 1 headrail
		}
		else{//enable all
		
			//allow, but dont require 2 on 1 or 3 on 1
		 if(iMultipleBlinds != 1){
				document.shopcart.Option6.disabled = false;//2 in 1 headrail
				document.shopcart.Option38.disabled = false;//3 in 1 headrail
			}
		}
	}
}
*/















if(document.shopcart.pid.value == 83 || document.shopcart.pid.value == 814){	
	//Bamboo shades top-up bottom down, 2 in one headrail and contiuous cord
	if(document.shopcart.Option19 && document.shopcart.Option34 && document.shopcart.Option6 && document.shopcart.Option8){
if(document.shopcart.Option34.checked == true){//cont. cord checked
			document.shopcart.Option19.disabled = true;//Top-up Bottom Down
			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.shopcart.Option34.disabled = true;//cont. cord checked
			document.shopcart.Option6.disabled = true;//2 in 1 headrail
			document.shopcart.Option8.disabled = true;//3 in 1 headrail
		}
		else if(document.shopcart.Option6.checked == true){//2 in 1 headrail
			//document.shopcart.Option21.disabled = true;//cont. cord checked
			document.shopcart.Option34.disabled = true;//cont. cord checked
			document.shopcart.Option19.disabled = true;//Top-up Bottom Down
			//document.shopcart.Option8.disabled = true;//3 in 1 headrail
		}
		else if(document.shopcart.Option8.checked == true){//3 in 1 headrail
			//document.shopcart.Option21.disabled = true;//cont. cord checked
			document.shopcart.Option34.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.Option34.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(iMultipleBlinds != 1){
				//document.shopcart.Option6.disabled = false;//2 in 1 headrail
				//document.shopcart.Option8.disabled = false;//3 in 1 headrail
			//}
		}
	}
}

if(document.shopcart.pid.value == 84){	
	//Bamboo shades top-up bottom down, 2 in one headrail and contiuous cord
	if(document.shopcart.Option73 && document.shopcart.Option34 && document.shopcart.Option6 && document.shopcart.Option8){

		if(document.shopcart.Option34.checked == true){//cont. cord checked
			document.shopcart.Option73.disabled = true;//Top-up Bottom Down
			document.shopcart.Option6.disabled = true;//2 in 1 headrail
			document.shopcart.Option8.disabled = true;//3 in 1 headrail
		}
		else if(document.shopcart.Option73.checked == true){//Top-up Bottom Down
			//document.shopcart.Option21.disabled = true;//cont. cord checked
			document.shopcart.Option34.disabled = true;//cont. cord checked
			document.shopcart.Option6.disabled = true;//2 in 1 headrail
			document.shopcart.Option8.disabled = true;//3 in 1 headrail
		}
		else if(document.shopcart.Option6.checked == true){//2 in 1 headrail
			//document.shopcart.Option21.disabled = true;//cont. cord checked
			document.shopcart.Option34.disabled = true;//cont. cord checked
			document.shopcart.Option73.disabled = true;//Top-up Bottom Down
			//document.shopcart.Option8.disabled = true;//3 in 1 headrail
		}
		else if(document.shopcart.Option8.checked == true){//3 in 1 headrail
			//document.shopcart.Option21.disabled = true;//cont. cord checked
			document.shopcart.Option34.disabled = true;//cont. cord checked
			document.shopcart.Option73.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.Option34.disabled = false;//cont. cord checked
			document.shopcart.Option73.disabled = false;//Top-up Bottom Down
			
			//if(iMultipleBlinds != 1){
				//document.shopcart.Option6.disabled = false;//2 in 1 headrail
				//document.shopcart.Option8.disabled = false;//3 in 1 headrail
			//}
		}
	}
}
	


	//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
			if(document.shopcart.Option119) document.shopcart.Option119.disabled = true;//CordlessTDBU
			
		}
		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
			if(document.shopcart.Option119) document.shopcart.Option119.disabled = true;//CordlessTDBU
		}
		else if(document.shopcart.Option6.checked == true){//2 in 1 headrail
		    
			document.shopcart.Option18.disabled = true;//Top-up Bottom Down
			if (document.shopcart.pid.value != 782)
			{
           	document.shopcart.Option11.disabled = true;//top-up if cont. checked
			document.shopcart.Option16.disabled = true;//Cordless
			}
			if(document.shopcart.Option119) document.shopcart.Option119.disabled = true;//CordlessTDBU
			
		}
		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
			if(document.shopcart.Option119) document.shopcart.Option119.disabled = true;//CordlessTDBU
			document.getElementById('FeatureOption4').disabled=true;
		}
		else if(document.shopcart.Option119)
		{
			if(document.shopcart.Option119.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
				document.shopcart.Option16.disabled = true;//Cordless
				if(document.getElementById('FeatureOption4'))
				document.getElementById('FeatureOption4').disabled=true;
				}
				else
				{
				if(document.getElementById('FeatureOption4'))
				document.getElementById('FeatureOption4').disabled=false;
				document.shopcart.Option11.disabled = false;//top-up if cont. checked
				document.shopcart.Option18.disabled = false;//Top-up Bottom Down
				if(iMultipleBlinds != 1){
				document.shopcart.Option6.disabled = false;//2 in 1 headrail
				}
				document.shopcart.Option16.disabled = false;//Cordless
					if(document.shopcart.Option119) 
						{
						var blindWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
						var blindHeight = document.shopcart.HeightInches.value + document.shopcart.Height8ths.value;	
						if((blindWidth >= 18 && blindWidth <= 96) && blindHeight <= 84) document.shopcart.Option119.disabled = false;//CordlessTDBU
						else document.shopcart.Option119.disabled = true;//CordlessTDBU
						}
				
				}
				
		}
		else{//enable all
			document.getElementById('FeatureOption4').disabled=false;
			document.shopcart.Option11.disabled = false;//top-up if cont. checked
			document.shopcart.Option18.disabled = false;//Top-up Bottom Down
			if(iMultipleBlinds != 1){
				document.shopcart.Option6.disabled = false;//2 in 1 headrail
			}
			document.shopcart.Option16.disabled = false;//Cordless
			if(document.shopcart.Option119) 
				{
				var blindWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
				var blindHeight = document.shopcart.HeightInches.value + document.shopcart.Height8ths.value;	
				if((blindWidth >= 18 && blindWidth <= 96) && blindHeight <= 84) document.shopcart.Option119.disabled = false;//CordlessTDBU
				else document.shopcart.Option119.disabled = true;//CordlessTDBU
				}
		}
	}
	else if(document.shopcart.Option18 && document.shopcart.Option11 && document.shopcart.Option6 && document.shopcart.pid.value != 710){
		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 = false;//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 = false;//2 in 1 headrail
			}
		}
	}




	
	// not allow routless and remote control
	DisableRoutless();
	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;
		}
	}
	
	if (document.shopcart.pid.value == 69) {
	    if (document.shopcart.Option6) {

	        if (document.shopcart.Option16.checked == true || document.shopcart.Option18.checked == true || document.shopcart.Option119.checked == true) {
	            document.shopcart.FeatureOption4.disabled = true;
	        }
	        else document.shopcart.FeatureOption4.disabled = false;
	    }
	}



if (document.shopcart.pid.value == 789)
{
	if(document.shopcart.Option192)
	{
	
	if(testWidth <= 72) 
	    {
	    document.shopcart.Option192.disabled =true;
	    document.shopcart.Option192.checked =false;
	    }
	else 
	    {
	    document.shopcart.Option192.disabled =false;
	    }
	
	}
}


if (document.shopcart.pid.value == 781 || document.shopcart.pid.value == 782 || document.shopcart.pid.value == 783)
{
	if(document.shopcart.Option6)
	{
	
	if(document.shopcart.Option6.checked == false && document.shopcart.Option11.checked == false && document.shopcart.Option16.checked == false && document.shopcart.Option119.checked == false  && document.shopcart.Option18.checked == false)
	{
	if(testWidth < 22) 
	    {
	    document.shopcart.Option11.disabled =true;
	    document.shopcart.Option11.checked =false;
	    }
	else 
	    {
	    document.shopcart.Option11.disabled =false;
	    }

	if(testWidth < 18 || testHeight > 84) 
	    {
	    document.shopcart.Option119.disabled =true;
	    document.shopcart.Option119.checked =false;	    
	    }
	else 
	    {
	    document.shopcart.Option119.disabled =false;
	    }

if(testWidth < 18 || testHeight > 84 || testWidth > 66) 
	    {
	    document.shopcart.Option16.disabled =true;
	    document.shopcart.Option16.checked =false;  
	    }
	else 
	    {
	    document.shopcart.Option16.disabled = false;
	    }	    
	
	 if (testWidth < 18 || testHeight > 84 || testWidth > 72) {
	                document.shopcart.Option18.disabled = true;
	                document.shopcart.Option18.checked = false;
	            }
	            else {
	                document.shopcart.Option18.disabled = false;
	            }
	}
	
  }
}








if (document.shopcart.pid.value == 817 || document.shopcart.pid.value == 818)
{
	if(document.shopcart.Option129)
	{
    
    //alert("wwww");	
    
//      Continuous Cord Loop [128] 
//  Cordless Child Safety System [129] 
//  Cordless Top Down Bottom Up [119] 
//  Top Down / Bottom Up [127] 
  
  
   if(document.shopcart.Option128.checked)
	    {
	    document.shopcart.Option129.checked = false;
	    document.shopcart.Option129.disabled = true;
	    document.shopcart.Option119.checked = false;
	    document.shopcart.Option119.disabled = true;
	    document.shopcart.Option127.checked = false;
	    document.shopcart.Option127.disabled = true;	    	    	    
	    }	
	    else if(document.shopcart.Option129.checked)
	    {
	    document.shopcart.Option119.checked = false;
	    document.shopcart.Option119.disabled = true;
	    document.shopcart.Option127.checked = false;
	    document.shopcart.Option127.disabled = true;	    	    	    
	    }	
	    else if(document.shopcart.Option119.checked)
	    {
	    document.shopcart.Option127.checked = false;
	    document.shopcart.Option127.disabled = true;	    	    	    
	    }	    
        else
    {
    	
    
	if(testWidth > 84 || testHeight > 96) 
	    {
	    document.shopcart.Option127.disabled =true;
	    document.shopcart.Option127.checked =false;	    
	    }
	else 
	    {
	    document.shopcart.Option127.disabled =false;
	    //document.shopcart.Option127.checked =false;
	    }
	    
	    
        if(testWidth < 19.380 || testHeight > 84) 
	    {
	    document.shopcart.Option129.disabled =true;
	    document.shopcart.Option129.checked =false;	    
	    document.shopcart.Option119.disabled =true;
	    document.shopcart.Option119.checked =false;	    
	    }
	else 
	    {
	    document.shopcart.Option129.disabled =false;
	    //document.shopcart.Option129.checked =false;
	    document.shopcart.Option119.disabled =false;
	    //document.shopcart.Option119.checked =false;	    
	    }	    
	
}	
	
    }
}




if (document.shopcart.pid.value == 813 || document.shopcart.pid.value == 816)
{
	if(document.shopcart.Option6)
	{
    		
    	    
  if(document.shopcart.Option6.checked)
	    {
//	    document.shopcart.Option8.checked = false;
//	    document.shopcart.Option8.disabled = true;
	    document.shopcart.Option128.checked = false;
	    document.shopcart.Option128.disabled = true;
	    document.shopcart.Option119.checked = false;
	    document.shopcart.Option119.disabled = true;
	    document.shopcart.Option12.checked = false;
	    document.shopcart.Option12.disabled = true;	    	    	    
	    }	    
  else if(document.shopcart.Option8.checked)
	    {
//	   	document.shopcart.Option6.checked = false;
//	    document.shopcart.Option6.disabled = true;
	    document.shopcart.Option128.checked = false;
	    document.shopcart.Option128.disabled = true;
	    document.shopcart.Option119.checked = false;
	    document.shopcart.Option119.disabled = true;
	    document.shopcart.Option12.checked = false;
	    document.shopcart.Option12.disabled = true;    
	    }
  else if(document.shopcart.Option128.checked)
	    {
	   	document.shopcart.Option6.checked = false;
	    document.shopcart.Option6.disabled = true;
	    document.shopcart.Option8.checked = false;
	    document.shopcart.Option8.disabled = true;
	    document.shopcart.Option119.checked = false;
	    document.shopcart.Option119.disabled = true;
	    document.shopcart.Option12.checked = false;
	    document.shopcart.Option12.disabled = true;    
	    }
  else if(document.shopcart.Option119.checked)
	    {
	   	document.shopcart.Option6.checked = false;
	    document.shopcart.Option6.disabled = true;
	    document.shopcart.Option8.checked = false;
	    document.shopcart.Option8.disabled = true;
	    document.shopcart.Option128.checked = false;
	    document.shopcart.Option128.disabled = true;
	    document.shopcart.Option12.checked = false;
	    document.shopcart.Option12.disabled = true;    
	    }	    	    
  else if(document.shopcart.Option12.checked)
	    {
	   	document.shopcart.Option6.checked = false;
	    document.shopcart.Option6.disabled = true;
	    document.shopcart.Option8.checked = false;
	    document.shopcart.Option8.disabled = true;
	    document.shopcart.Option128.checked = false;
	    document.shopcart.Option128.disabled = true;
	    document.shopcart.Option119.checked = false;
	    document.shopcart.Option119.disabled = true;    
	    }	
	    else
	    {
	    
	    //TDBU  max restriction
	        if (testWidth > 72) {
	        document.shopcart.Option12.checked = false;
	        document.shopcart.Option12.disabled = true;
	        }
	        else
	        {
	        document.shopcart.Option12.checked = false;
	        document.shopcart.Option12.disabled = false;
	        }
	        
	        //Cordless tdbu  - W  84 H  - 72
	        if (testWidth > 84 || testHeight > 72) {
	        document.shopcart.Option119.checked = false;
	        document.shopcart.Option119.disabled = true;
	        }
	        else
	        {
	        document.shopcart.Option119.checked = false;
	        document.shopcart.Option119.disabled = false;
	        }    
            //Continuous cord loop: Max width 120	
            if (testWidth > 120) {
	        document.shopcart.Option128.checked = false;
	        document.shopcart.Option128.disabled = true;
	        }
	        else
	        {
	        document.shopcart.Option128.checked = false;
	        document.shopcart.Option128.disabled = false;
	        }            
	        
	        document.shopcart.Option6.checked = false;
	        document.shopcart.Option6.disabled = false;
	        document.shopcart.Option8.checked = false;
	        document.shopcart.Option8.disabled = false;	        
	    }	    

	
    }
}







if (document.shopcart.pid.value == 710) {
	    if (document.shopcart.Option6) {
	        
	        if (document.shopcart.Option119) {
	            if (document.shopcart.Option119.checked == true) {
	                document.shopcart.FeatureOption4.disabled = true;
	            }
	            else document.shopcart.FeatureOption4.disabled = false;
	        }

	        if (document.shopcart.Option6.checked) {
	            document.shopcart.Option140.checked = false;
	            document.shopcart.Option140.disabled = true;
	            document.shopcart.Option119.checked = false;
	            document.shopcart.Option119.disabled = true;
	            document.shopcart.Option18.checked = false;
	            document.shopcart.Option18.disabled = true;
	        }
	        else if (document.shopcart.Option11.checked) {
	            document.shopcart.Option140.checked = false;
	            document.shopcart.Option140.disabled = true;
	            document.shopcart.Option119.checked = false;
	            document.shopcart.Option119.disabled = true;
	            document.shopcart.Option18.checked = false;
	            document.shopcart.Option18.disabled = true;
	        }
	        else if (document.shopcart.Option140.checked) {
	            document.shopcart.Option6.checked = false;
	            document.shopcart.Option6.disabled = true;
	            document.shopcart.Option11.checked = false;
	            document.shopcart.Option11.disabled = true;
	            document.shopcart.Option119.checked = false;
	            document.shopcart.Option119.disabled = true;
	            document.shopcart.Option18.checked = false;
	            document.shopcart.Option18.disabled = true;
	        }
	        else if (document.shopcart.Option119.checked) {
	            document.shopcart.Option6.checked = false;
	            document.shopcart.Option6.disabled = true;
	            document.shopcart.Option11.checked = false;
	            document.shopcart.Option11.disabled = true;
	            document.shopcart.Option140.checked = false;
	            document.shopcart.Option140.disabled = true;
	            document.shopcart.Option18.checked = false;
	            document.shopcart.Option18.disabled = true;
	        }
	        else if (document.shopcart.Option18.checked) {
	            document.shopcart.Option6.checked = false;
	            document.shopcart.Option6.disabled = true;
	            document.shopcart.Option11.checked = false;
	            document.shopcart.Option11.disabled = true;
	            document.shopcart.Option140.checked = false;
	            document.shopcart.Option140.disabled = true;
	            document.shopcart.Option119.checked = false;
	            document.shopcart.Option119.disabled = true;
	        }
	        else if (document.shopcart.Option7.checked) {
	        }
	        else {

	            if (testWidth > 72 || testHeight > 96 || testHeight < 12) {
	                document.shopcart.Option18.checked = false;
	                document.shopcart.Option18.disabled = true;
	            }
	            else {
	                document.shopcart.Option18.checked = false;
	                document.shopcart.Option18.disabled = false;
	            }

	            if (testWidth > 84 || testHeight > 84) {
	                document.shopcart.Option140.checked = false;
	                document.shopcart.Option140.disabled = true;
	                document.shopcart.Option119.checked = false;
	                document.shopcart.Option119.disabled = true;
	            }
	            else {
	                document.shopcart.Option140.checked = false;
	                document.shopcart.Option140.disabled = false;
	                document.shopcart.Option119.checked = false;
	                document.shopcart.Option119.disabled = false;
	            }

	           
	            
	            if (testWidth < 44) {
	                document.shopcart.Option11.checked = false;
	                document.shopcart.Option11.disabled = true;
	            }
	            else {
	                document.shopcart.Option11.checked = false;
	                document.shopcart.Option11.disabled = false;
	            }


	            document.shopcart.Option6.checked = false;
	            document.shopcart.Option6.disabled = false;
	            document.shopcart.Option7.checked = false;
	            document.shopcart.Option7.disabled = false;

	        }


	    }
	}
	


if (document.shopcart.pid.value == 766)
{				
    if(document.shopcart.Option116)
    {
     if(document.shopcart.Option116.checked)
	    {
	    document.shopcart.Option127.checked = false;
	    document.shopcart.Option127.disabled = true;

	    }
	    else if(document.shopcart.Option21.checked)
	    {
	    document.shopcart.Option127.checked = false;
	    document.shopcart.Option127.disabled = true;
	    }
	    else if(document.shopcart.Option127.checked)
	    {
	    document.shopcart.Option116.checked = false;
	    document.shopcart.Option116.disabled = true;
	    document.shopcart.Option21.checked = false;
	    document.shopcart.Option21.disabled = true;	    
	    }	   
	    else
	    {
        if(testWidth >= 18)
	        {		  
	        document.shopcart.Option21.checked = false;
	        document.shopcart.Option21.disabled = false;	      
	        }
	        else
	        {		  
	        document.shopcart.Option21.checked = false;
	        document.shopcart.Option21.disabled = true;	      
	        }	  


	    if(testWidth <= 66)
	        {		  
	        document.shopcart.Option127.checked = false;
	        document.shopcart.Option127.disabled = false;	      
	        }
	        else
	        {		  
	        document.shopcart.Option127.checked = false;
	        document.shopcart.Option127.disabled = true;	      
	        }	  
        if(testWidth >= 24)
	        {		  
	        document.shopcart.Option116.checked = false;
	        document.shopcart.Option116.disabled = false;	      
	        }
	        else
	        {		  
	        document.shopcart.Option116.checked = false;
	        document.shopcart.Option116.disabled = true;	      
	        }	      	              
	    }		     
     }
}



if (document.shopcart.pid.value == 673)
{				
    if(document.shopcart.Option18)
    {
      if(testWidth <= 72)
	        {		
	        if(!document.shopcart.Option18.checked)
	            {  
	            document.shopcart.Option18.checked = false;
	            document.shopcart.Option18.disabled = false;	      
	            }
	        }
	        else
	        {		  
	        document.shopcart.Option18.checked = false;
	        document.shopcart.Option18.disabled = true;	      
	        }	      	
    }
}




if (document.shopcart.pid.value == 770)
{				
    if(document.shopcart.Option173)
    {
    
    if(document.shopcart.FeatureOption110.value == 293)
    	{
	    document.shopcart.Option173.checked = false;
	    document.shopcart.Option173.disabled = true;
	    }
	  else if(document.shopcart.Option173.checked)
    	{
	    document.shopcart.Option173.disabled = false;
	    }    
	    else
	    {
	    document.shopcart.Option173.checked = false;
	    document.shopcart.Option173.disabled = false;
	    }
    }
}


if (document.shopcart.pid.value == 768 || document.shopcart.pid.value == 769)
{				
    if(document.shopcart.Option171)
    {
    if(document.shopcart.FeatureOption1.value == 2)document.shopcart.FeatureOption54.disabled = true;
    else document.shopcart.FeatureOption54.disabled = false;
    
   if(document.shopcart.Option169.checked)
	    {
	    document.shopcart.Option170.checked = false;
	    document.shopcart.Option170.disabled = true;
        document.getElementById('BlackoutLinerColourDiv').style.display = "Block";
        document.getElementById('PrivacyLinerColourDiv').style.display = "None";	
        document.shopcart.FeatureOption108.disabled = true;   
        document.shopcart.FeatureOption109.disabled = false;                
	    }
	    else if(document.shopcart.Option170.checked)
	    {
	    document.shopcart.Option169.checked = false;
	    document.shopcart.Option169.disabled = true;
        document.getElementById('BlackoutLinerColourDiv').style.display = "None";
        document.getElementById('PrivacyLinerColourDiv').style.display = "Block";	   
        document.shopcart.FeatureOption108.disabled = false;   
        document.shopcart.FeatureOption109.disabled = true;     
	    }
	    else
	    {
	    document.shopcart.Option169.checked = false;
	    document.shopcart.Option169.disabled = false;
	    document.shopcart.Option170.checked = false;
	    document.shopcart.Option170.disabled = false;	
        document.getElementById('BlackoutLinerColourDiv').style.display = "None";
        document.getElementById('PrivacyLinerColourDiv').style.display = "None";	
        document.shopcart.FeatureOption108.disabled = true;   
        document.shopcart.FeatureOption109.disabled = true;    
	    }
	    
 if(document.shopcart.Option52.checked)
	    {
	    document.shopcart.Option171.checked = false;
	    document.shopcart.Option171.disabled = true;
	    }	    
  else if(document.shopcart.Option171.checked)
	    {
	    document.shopcart.Option172.checked = false;
	    document.shopcart.Option172.disabled = true;
	    document.shopcart.Option52.checked = false;
	    document.shopcart.Option52.disabled = true;	    
	    }
	    else if(document.shopcart.Option172.checked)
	    {
	    document.shopcart.Option171.checked = false;
	    document.shopcart.Option171.disabled = true;
	    }
	    else
	    {
	        if (testWidth < 20) {
	        document.shopcart.Option171.checked = false;
	        document.shopcart.Option171.disabled = true;
	        }
	        else
	        {
	        document.shopcart.Option171.checked = false;
	        document.shopcart.Option171.disabled = false;
	        }
	         if (testWidth < 24 || testWidth > 96) {
	        document.shopcart.Option172.checked = false;
	        document.shopcart.Option172.disabled = true;
	        }
	        else
	        {
	        document.shopcart.Option172.checked = false;
	        document.shopcart.Option172.disabled = false;
	        }    
	        document.shopcart.Option52.checked = false;
	        document.shopcart.Option52.disabled = false;
	    }	    
	    
    
    
    if (testWidth < 13) 
    {
    document.shopcart.TapeColorID.disabled = true;
    }
    else if(document.shopcart.ColorID.value == 3569 || document.shopcart.ColorID.value == 3570 || document.shopcart.ColorID.value == 3571  || document.shopcart.ColorID.value == 3584  || document.shopcart.ColorID.value == 3586 || document.shopcart.ColorID.value == 3560 || document.shopcart.ColorID.value == 3568)
    {
    if(document.shopcart.TapeColorID.value != 0)
        {
        document.shopcart.TapeColorID.disabled = true;
        document.shopcart.TapeColorID.value = 0;
        SetPreviewColor(0,2);
        alert('Edge Binding is not available with this colour.');
        }
    }
    else 
    {		
                document.shopcart.TapeColorID.disabled = false;
    }

if(document.shopcart.ColorID.value == 3559 || document.shopcart.ColorID.value == 3562 || document.shopcart.ColorID.value == 3563  || document.shopcart.ColorID.value == 3564  || document.shopcart.ColorID.value == 3565 || document.shopcart.ColorID.value == 3567 || document.shopcart.ColorID.value == 3574)
    if(document.shopcart.TapeColorID.value == 0)
        alert('We recommend ordering the optional Edge Binding with this colour.');

    
    }
}



if (document.shopcart.pid.value == 808)
{			
    if(document.shopcart.Option52)
    {
    
        if (
    	        (
    	        (document.shopcart.FeatureOption2.value == 4 && document.shopcart.FeatureOption4.value == 9)
    	        ||
    	        (document.shopcart.FeatureOption2.value == 5 && document.shopcart.FeatureOption4.value == 10)
    	         )
    	        && (testWidth < 22 || testHeight < 22)
    	    ) 
    	    {
			alert('Blinds under 22" need to have split controls. Please choose opposite side for the location of the Tilter Location and the Lift Cord Location.');
            if (document.shopcart.FeatureOption2.value == 4) document.shopcart.FeatureOption4.value = 10;
            if (document.shopcart.FeatureOption2.value == 5) document.shopcart.FeatureOption4.value = 9;
			}
			
			
			 if (document.shopcart.Option52.checked == true && document.shopcart.LiftLeftBlind2.value == document.shopcart.TilterLeftBlind2.value)
				            {
				            alert('Blinds under 22" need to have split controls. Please choose opposite side for the location of the Tilter Location and the Lift Cord Location.');
							if(document.shopcart.LiftLeftBlind2.value == "L") 
							    document.shopcart.TilterLeftBlind2.value = "R";
			                else document.shopcart.TilterLeftBlind2.value = "L";
				            }	
				            
            if (document.shopcart.Option52.checked == true && document.shopcart.LiftRightBlind2.value == document.shopcart.TilterRightBlind2.value)
				            {
				            alert('Blinds under 22" need to have split controls. Please choose opposite side for the location of the Tilter Location and the Lift Cord Location.');
							if(document.shopcart.LiftRightBlind2.value == "L") 
							    document.shopcart.TilterRightBlind2.value = "R";
			                else document.shopcart.TilterRightBlind2.value = "L";
				            }					            

    }
}



if (document.shopcart.pid.value == 767)
{			
    if(document.shopcart.Option52)
    {
    
    
    if(document.shopcart.FeatureOption3.value == 7 && (document.shopcart.ColorID.value == 3547 || document.shopcart.ColorID.value == 3548))
		{
			document.shopcart.FeatureOption3.value = 6;		
			alert("Please note: Tilter Control: Wand is not available for colours: Black and Espresso.")
		}


        if (
    	        (
    	        (document.shopcart.FeatureOption2.value == 4 && document.shopcart.FeatureOption94.value == 238)
    	        ||
    	        (document.shopcart.FeatureOption2.value == 5 && document.shopcart.FeatureOption94.value == 239)
    	         )
    	        && (testWidth < 15)
    	    ) {
			alert('Blinds under 15" need to have split controls. Please choose opposite side for the location of the Tilter Location and the Lift Cord Location.');
            if (document.shopcart.FeatureOption2.value == 4) document.shopcart.FeatureOption94.value = 239;
            if (document.shopcart.FeatureOption2.value == 5) document.shopcart.FeatureOption94.value = 238;
			}
    
    
        if(document.shopcart.Option52.checked)
	    {
	    document.shopcart.Option53.checked = false;
	    //document.shopcart.Option53.disabled = true;
	    document.shopcart.Option42.checked = false;
	    document.shopcart.Option42.disabled = true;
	    }
	    else if(document.shopcart.Option53.checked)
	    {
	    document.shopcart.Option52.checked = false;
	    //document.shopcart.Option52.disabled = true;
	    document.shopcart.Option42.checked = false;
	    document.shopcart.Option42.disabled = true;
	    }
	    else if(document.shopcart.Option42.checked)
	    {
	    document.shopcart.Option52.checked = false;
	    document.shopcart.Option52.disabled = true;
	    document.shopcart.Option53.checked = false;
	    document.shopcart.Option53.disabled = true;
	    document.shopcart.Option168.checked = false;
	    document.shopcart.Option168.disabled = true;	
	    document.shopcart.TapeColorID.value = 0;
	    document.shopcart.TapeColorID.disabled = true;
	    }	 
        else if(document.shopcart.Option168.checked)
	    {
	    document.shopcart.Option42.checked = false;
	    document.shopcart.Option42.disabled = true;
	    document.shopcart.TapeColorID.disabled = true;	   
	    }	    	
	    else if (document.shopcart.TapeColorID.value != 0)
	    {
	    document.shopcart.Option42.checked = false;
	    document.shopcart.Option42.disabled = true;
	    }       
	    else
	    {
	    document.shopcart.Option52.checked = false;
	    document.shopcart.Option52.disabled = false;
	    document.shopcart.Option53.checked = false;
	    document.shopcart.Option53.disabled = false;
	    document.shopcart.Option168.checked = false;
	    document.shopcart.Option168.disabled = false;	
	    document.shopcart.Option42.checked = false;
	    document.shopcart.Option42.disabled = false;		
	    document.shopcart.TapeColorID.disabled = false;		        
	    }
    }
}




if (document.shopcart.pid.value == 722)
{				
    if(document.shopcart.Option128)
    {
    	            if(testWidth < 20)
			        document.shopcart.Option128.disabled = true;
                    else
                    document.shopcart.Option128.disabled = false;
    }
}



if (document.shopcart.pid.value == 738)
{				
    if(document.shopcart.Option168)
    {
    	    if(
    	        (document.shopcart.FeatureOption2.value == 4 && document.shopcart.FeatureOption4.value == 9) 
    	        || 
    	        (document.shopcart.FeatureOption2.value == 5 && document.shopcart.FeatureOption4.value == 10)
    	    )
    	    {
			alert('Blinds need to have split controls. Please choose opposite side for the location of the Tilter Location and the Lift Cord Location.');
			if(document.shopcart.FeatureOption2.value == 4) document.shopcart.FeatureOption4.value = 10;
			if(document.shopcart.FeatureOption2.value == 5) document.shopcart.FeatureOption4.value = 9;
			}
      
    }
}


if (document.shopcart.pid.value == 779 || document.shopcart.pid.value == 780)
{
   if (document.shopcart.Option177)
	 {
	 
	 if (document.shopcart.FeatureOption3.value == 7 && document.shopcart.FeatureOption7.value != 13) 
		    {

				document.shopcart.FeatureOption7.value = 13;
				alert("When choosing Tilter Control: Wand you need to choose Draw Type: One-Way Draw.");
			}		
	 
	 }

}



if (document.shopcart.pid.value == 749)
{
   if (document.shopcart.Option129)
	 {
	 
	 
	 if(document.shopcart.Option129.checked)
	    {
	    document.shopcart.Option75.checked = false;
	    document.shopcart.Option75.disabled = true;
	    }
	    else if(document.shopcart.Option75.checked)
	    {
	    document.shopcart.Option129.checked = false;
	    document.shopcart.Option129.disabled = true;
	    }
	    else
	     {
	    document.shopcart.Option75.checked = false;
	    document.shopcart.Option75.disabled = false;
	    document.shopcart.Option129.checked = false;
	    document.shopcart.Option129.disabled = false;
	    }
	 	
	 
	 }

}


if (document.shopcart.pid.value == 784)
{				
   if (document.shopcart.Option52)
	 {
	 
	 
	  
    if(document.shopcart.FeatureOption3.value == 7 && (document.shopcart.ColorID.value == 3908))
		{
			document.shopcart.FeatureOption3.value = 6;		
			alert("Please note: Tilter Control: Wand is not available for colours: Dark Walnut - stain.")
		}
	 
        if(
    	        (document.shopcart.FeatureOption2.value == 4 && document.shopcart.FeatureOption4.value == 9) 
    	        || 
    	        (document.shopcart.FeatureOption2.value == 5 && document.shopcart.FeatureOption4.value == 10)
    	    )
    	    {
    	        if(testWidth > 12 && testWidth < 18)
    	        {
			    alert('Blinds need to have split controls. Please choose opposite side for the location of the Tilter Location and the Lift Cord Location.');
			    if(document.shopcart.FeatureOption2.value == 4) document.shopcart.FeatureOption4.value = 10;
			    if(document.shopcart.FeatureOption2.value == 5) document.shopcart.FeatureOption4.value = 9;
			    }
			}
	 
	 
	         if (document.shopcart.Option52.checked)
			        {
			        document.shopcart.Option53.checked = false;
			        //document.shopcart.Option53.disabled = true;
			        document.shopcart.Option42.checked = false;
			        document.shopcart.Option42.disabled = true;
                    }
              else if (document.shopcart.Option53.checked)
			        {
			        document.shopcart.Option52.checked = false;
			        //document.shopcart.Option52.disabled = true;
			        document.shopcart.Option42.checked = false;
			        document.shopcart.Option42.disabled = true;
                    }
              else if (document.shopcart.Option42.checked)
			        {
			        document.shopcart.Option52.checked = false;
			        document.shopcart.Option52.disabled = true;
			        document.shopcart.Option53.checked = false;
			        document.shopcart.Option53.disabled = true;
                    document.shopcart.TapeColorID.disabled = true;
			        document.shopcart.TapeColorID.value = 0;			        
                    }   
			  else if (document.shopcart.TapeColorID.value != 0)
			        {
			        document.shopcart.Option42.checked = false;
			        document.shopcart.Option42.disabled = true;
			        }	
			  else {
			  		document.shopcart.Option52.checked = false;
			        document.shopcart.Option52.disabled = false;
			        document.shopcart.Option53.checked = false;
			        document.shopcart.Option53.disabled = false;
			        
//                    if(
//                        (testWidth <= 107 && testHeight <= 48)
//                        ||
//                        (testWidth <= 96 && testHeight <= 60)
//                        ||
//                        (testWidth <= 60 && testHeight <= 72)
//                        ||
//                        (testWidth <= 36 && testHeight <= 84)   
//                    ) 

                    if(testWidth <= 107 && testHeight <= 96)                              
                    {
			        document.shopcart.Option42.checked = false;
			        document.shopcart.Option42.disabled = false;
			        }
			        else{
			        document.shopcart.Option42.checked = false;
			        document.shopcart.Option42.disabled = true;
			        }			        
                    document.shopcart.TapeColorID.disabled = false;
			        document.shopcart.TapeColorID.value = 0;	       
                   } 
                                     
	 
	 }
}





if (document.shopcart.pid.value == 800 || document.shopcart.pid.value == 801 || document.shopcart.pid.value == 802  || document.shopcart.pid.value == 803 || document.shopcart.pid.value == 804 || document.shopcart.pid.value == 805 || document.shopcart.pid.value == 806  || document.shopcart.pid.value == 807)
{				
   if (document.shopcart.Option197)
	 { 
	 
	         if (document.shopcart.Option197.checked)
			        {
			        document.shopcart.Option198.checked = false;
			        document.shopcart.Option198.disabled = true;
			        document.shopcart.Option199.checked = false;
			        document.shopcart.Option199.disabled = true;
			        document.shopcart.Option200.checked = false;
			        document.shopcart.Option200.disabled = true;			        
                    }
              else if (document.shopcart.Option198.checked)
			        {
			      	document.shopcart.Option197.checked = false;
			        document.shopcart.Option197.disabled = true;
			        document.shopcart.Option199.checked = false;
			        document.shopcart.Option199.disabled = true;
			        document.shopcart.Option200.checked = false;
			        document.shopcart.Option200.disabled = true;	
                    }
              else if (document.shopcart.Option199.checked)
			        {
			        document.shopcart.Option198.checked = false;
			        document.shopcart.Option198.disabled = true;
			        document.shopcart.Option197.checked = false;
			        document.shopcart.Option197.disabled = true;
			        document.shopcart.Option200.checked = false;
			        document.shopcart.Option200.disabled = true;			        
                    }  
              else if (document.shopcart.Option200.checked)
			        {
			        document.shopcart.Option198.checked = false;
			        document.shopcart.Option198.disabled = true;
			        document.shopcart.Option199.checked = false;
			        document.shopcart.Option199.disabled = true;
			        document.shopcart.Option197.checked = false;
			        document.shopcart.Option197.disabled = true;			        
                    }                      
			  else {
			  		document.shopcart.Option197.checked = false;
			        document.shopcart.Option197.disabled = false;			  
			  		document.shopcart.Option198.checked = false;
			        document.shopcart.Option198.disabled = false;
			        document.shopcart.Option199.checked = false;
			        document.shopcart.Option199.disabled = false;
			        document.shopcart.Option200.checked = false;
			        document.shopcart.Option200.disabled = false;	
                   }                             
	 }
}


if (document.shopcart.pid.value == 777)
{				

        if (document.shopcart.Option119) 
        {
	        if (document.shopcart.Option119.checked == true) {
	            document.shopcart.FeatureOption4.disabled = true;
	        }
	        else document.shopcart.FeatureOption4.disabled = false;
	    }

   if (document.shopcart.Option116)
	 {
			     if (document.shopcart.Option116.checked)
			        {
			        document.shopcart.Option16.checked = false;
			        document.shopcart.Option16.disabled = true;
			        document.shopcart.Option119.checked = false;
			        document.shopcart.Option119.disabled = true;
			        document.shopcart.Option127.checked = false;
			        document.shopcart.Option127.disabled = true;	
			        
			        
			        if(testWidth >= 44)
			            {
			                
			                document.shopcart.Option21.disabled = false;			        
			            }
			            else
			            {   
			                document.shopcart.Option21.checked = false;
			                document.shopcart.Option21.disabled = true;			        
			            }
			        
			        		        			        
			        }
			      else if (document.shopcart.Option21.checked)
			        {
			        document.shopcart.Option16.checked = false;
			        document.shopcart.Option16.disabled = true;		        
			        document.shopcart.Option119.checked = false;
			        document.shopcart.Option119.disabled = true;
			        document.shopcart.Option127.checked = false;
			        document.shopcart.Option127.disabled = true;	
			        }
                else if (document.shopcart.Option16.checked)
			        {
			        document.shopcart.Option116.checked = false;
			        document.shopcart.Option116.disabled = true;
			        document.shopcart.Option21.checked = false;
			        document.shopcart.Option21.disabled = true;	
	                document.shopcart.Option119.checked = false;
	                document.shopcart.Option119.disabled = true;
			        document.shopcart.Option127.checked = false;
			        document.shopcart.Option127.disabled = true;	
			        }	
                else if(document.shopcart.Option119.checked)
			        {
			            document.shopcart.Option116.checked = false;
			            document.shopcart.Option116.disabled = true;
			            document.shopcart.Option21.checked = false;
			            document.shopcart.Option21.disabled = true;			        
			            document.shopcart.Option16.checked = false;
			            document.shopcart.Option16.disabled = true;
			            document.shopcart.Option127.checked = false;
			            document.shopcart.Option127.disabled = true;	
			        }    		
                else if (document.shopcart.Option127.checked)
			        {
			        document.shopcart.Option116.checked = false;
			        document.shopcart.Option116.disabled = true;
			        document.shopcart.Option21.checked = false;
			        document.shopcart.Option21.disabled = true;			        
			        document.shopcart.Option16.checked = false;
			        document.shopcart.Option16.disabled = true;
			        document.shopcart.Option119.checked = false;
			        document.shopcart.Option119.disabled = true;	
			        }				        		        		        
			      else
			      {
			            document.shopcart.Option116.checked = false;
			            document.shopcart.Option116.disabled = false;
    			        
			            if(testWidth >= 22)
			            {
			                document.shopcart.Option21.checked = false;
			                document.shopcart.Option21.disabled = false;			        
			            }
			            else
			            {
			                document.shopcart.Option21.checked = false;
			                document.shopcart.Option21.disabled = true;			        
			            }
			            
			            

    			        
                        if(testWidth < 84 && testWidth >= 18)
			            {
			            document.shopcart.Option16.checked = false;
			            document.shopcart.Option16.disabled = false;
			            }
			            else
			            {
			            document.shopcart.Option16.checked = false;
			            document.shopcart.Option16.disabled = true;	
			            }
    			        
			            if(testWidth >= 18 && testWidth < 84)
			            {
			                document.shopcart.Option119.checked = false;
			                document.shopcart.Option119.disabled = false;
			            }
			            else
			            {
			                document.shopcart.Option119.checked = false;
			                document.shopcart.Option119.disabled = true;	
			            }
			            
			            document.shopcart.Option127.checked = false;
			            document.shopcart.Option127.disabled = false;			            
			        			        
			      }  
			      	      
			        
	}
}



if (document.shopcart.pid.value == 778)
{				
   if (document.shopcart.Option116)
	 {
			     if (document.shopcart.Option116.checked)
			        {
			        document.shopcart.Option16.checked = false;
			        document.shopcart.Option16.disabled = true;
			            
			        document.shopcart.Option127.checked = false;
			        document.shopcart.Option127.disabled = true;	
			        
			        
			        if(testWidth >= 44)
			            {
			                
			                document.shopcart.Option21.disabled = false;			        
			            }
			            else
			            {   
			                document.shopcart.Option21.checked = false;
			                document.shopcart.Option21.disabled = true;			        
			            }
			        		        			        
			        }
			      else if (document.shopcart.Option21.checked)
			        {
			        document.shopcart.Option16.checked = false;
			        document.shopcart.Option16.disabled = true;
                       
			        document.shopcart.Option127.checked = false;
			        document.shopcart.Option127.disabled = true;	
			        }
                else if (document.shopcart.Option16.checked)
			        {
			        document.shopcart.Option116.checked = false;
			        document.shopcart.Option116.disabled = true;
			        document.shopcart.Option21.checked = false;
			        document.shopcart.Option21.disabled = true;	
			           
			        document.shopcart.Option127.checked = false;
			        document.shopcart.Option127.disabled = true;	
			        }	
             
                else if (document.shopcart.Option127.checked)
			        {
			        document.shopcart.Option116.checked = false;
			        document.shopcart.Option116.disabled = true;
			        document.shopcart.Option21.checked = false;
			        document.shopcart.Option21.disabled = true;			        
			        document.shopcart.Option16.checked = false;
			        document.shopcart.Option16.disabled = true;
			           
			        }				        		        		        
			      else
			      {
			          			        	      
			      
			      		document.shopcart.Option127.checked = false;
			            document.shopcart.Option127.disabled = false;	
			            document.shopcart.Option116.checked = false;
			            document.shopcart.Option116.disabled = false;
    			        
			            if(testWidth >= 22)
			            {
			                document.shopcart.Option21.checked = false;
			                document.shopcart.Option21.disabled = false;			        
			            }
			            else
			            {
			                document.shopcart.Option21.checked = false;
			                document.shopcart.Option21.disabled = true;			        
			            }
    			        
                        if(testWidth < 84 && testWidth >= 18)
			            {
			            document.shopcart.Option16.checked = false;
			            document.shopcart.Option16.disabled = false;
			            }
			            else
			            {
			            document.shopcart.Option16.checked = false;
			            document.shopcart.Option16.disabled = true;	
			            }
    			        
			           
			        			        
			      }  
			      	      
			        
	}
}


if (document.shopcart.pid.value == 762 || document.shopcart.pid.value == 764)
{				
   if (document.shopcart.Option116)
	 {
			    
			     if (document.shopcart.Option116.checked)
			        {
			        document.shopcart.Option117.checked = false;
			        //document.shopcart.Option117.disabled = true;
			        }
			      else if (document.shopcart.Option117.checked)
			        {
			        document.shopcart.Option116.checked = false;
			        //document.shopcart.Option116.disabled = true;
			        }
			      else
			      {
			        document.shopcart.Option117.checked = false;
			        //document.shopcart.Option117.disabled = false;			      
			      	document.shopcart.Option116.checked = false;
			        //document.shopcart.Option116.disabled = false;
			      }  
			      
            if (document.shopcart.FeatureOption1.value == 2) // outside
		    {
                //hold down brackets
				document.shopcart.FeatureOption54.disabled = true;
				document.shopcart.FeatureOption54.value = 93;
			}		
			
			
			if(testWidth >= 13 && testWidth <= 18)
			{
			if((document.shopcart.FeatureOption2.value == 4 && document.shopcart.FeatureOption94.value == 238) || (document.shopcart.FeatureOption2.value == 5 && document.shopcart.FeatureOption94.value == 239))
			alert('Blinds 13" - 18"  wide need to have split controls. Please choose opposite side for the location of the Tilt control and the Lift Cord.');
			}	      
			        
	}
}


if (document.shopcart.pid.value == 13)
	if(document.shopcart.Option6)
    if(testWidth <= 12)
    {
            if(document.shopcart.TiltLocation.disabled == false)
	        alert('Note that on this blind, when choosing width of 12" or less, the tilter location comes standard in the center.'); 
            document.shopcart.TiltLocation.disabled =true;

    }
    else
     document.shopcart.TiltLocation.disabled =false;



if (document.shopcart.pid.value == 64)
{
	if(document.shopcart.Option18)
	{
	
	if(testWidth < 18) 
	    {
	    document.shopcart.Option18.disabled =true;
	    document.shopcart.Option18.checked =false;
	    }
	else 
	    {
	    document.shopcart.Option18.disabled = false;
	    }
	
	}
}



if (document.shopcart.pid.value == 3)
{
	if(testHeight > 73 && testWidth >= 84) 
	    {
	    alert('Sorry, this item is only available up to a maximum height of 73" AT A WIDTH OF 96". Please choose smaller Height!'); 
	    document.shopcart.HeightInches.focus();
	    }
}

if (document.shopcart.pid.value == 810)
{
	if(testHeight > 72 && testWidth >= 84) 
	    {
	    alert('Sorry, this item is only available up to a maximum height of 72" in widths ranging from 84" to 96". Please choose smaller Height!'); 
	    document.shopcart.HeightInches.focus();
	    }
}




if (document.shopcart.pid.value == 728)
{				
    if(document.shopcart.Option81)
    {
    
            if (document.shopcart.Option119) 
        {
	        if (document.shopcart.Option119.checked == true) {
	            document.shopcart.FeatureOption4.disabled = true;
	        }
	        else document.shopcart.FeatureOption4.disabled = false;
	    }
    
        if(document.shopcart.Option81.checked)
	    {
	    document.shopcart.Option16.checked = false;
	    document.shopcart.Option16.disabled = true;
	    document.shopcart.Option119.checked = false;
	    document.shopcart.Option119.disabled = true;
	    document.shopcart.Option18.checked = false;
	    document.shopcart.Option18.disabled = true;	
	    }
	    else if(document.shopcart.Option11.checked)
	    {
	    document.shopcart.Option16.checked = false;
	    document.shopcart.Option16.disabled = true;
	    document.shopcart.Option119.checked = false;
	    document.shopcart.Option119.disabled = true;
	    document.shopcart.Option18.checked = false;
	    document.shopcart.Option18.disabled = true;	
	    }
        else if(document.shopcart.Option16.checked)
	    {
	    document.shopcart.Option81.checked = false;
	    document.shopcart.Option81.disabled = true;
        document.shopcart.Option11.checked = false;
	    document.shopcart.Option11.disabled = true;	    
	    document.shopcart.Option119.checked = false;
	    document.shopcart.Option119.disabled = true;
	    document.shopcart.Option18.checked = false;
	    document.shopcart.Option18.disabled = true;	
	    }	   
        else if(document.shopcart.Option119.checked)
	    {
	    document.shopcart.Option81.checked = false;
	    document.shopcart.Option81.disabled = true;
        document.shopcart.Option11.checked = false;
	    document.shopcart.Option11.disabled = true;	    
	    document.shopcart.Option16.checked = false;
	    document.shopcart.Option16.disabled = true;
	    document.shopcart.Option18.checked = false;
	    document.shopcart.Option18.disabled = true;	
	    }	
        else if(document.shopcart.Option18.checked)
	    {
	    document.shopcart.Option81.checked = false;
	    document.shopcart.Option81.disabled = true;
        document.shopcart.Option11.checked = false;
	    document.shopcart.Option11.disabled = true;	    
	    document.shopcart.Option16.checked = false;
	    document.shopcart.Option16.disabled = true;
	    document.shopcart.Option119.checked = false;
	    document.shopcart.Option119.disabled = true;	
	    }	
	    else
	    {
	     if(testWidth >= 18)
	        {	
	        document.shopcart.Option81.checked = false;
	        document.shopcart.Option81.disabled = false;
            document.shopcart.Option11.checked = false;
	        document.shopcart.Option11.disabled = false;
	        }
	        else   
	        {	
	        document.shopcart.Option81.checked = false;
	        document.shopcart.Option81.disabled = true;
            document.shopcart.Option11.checked = false;
	        document.shopcart.Option11.disabled = true;
	        }
	        if(testWidth >= 18 && testWidth <= 84)
	        {	    
	        document.shopcart.Option16.checked = false;
	        document.shopcart.Option16.disabled = false;
	        }
	        else
	        {
	        document.shopcart.Option16.checked = false;
	        document.shopcart.Option16.disabled = true;
	        }
	        
            if(testWidth <= 84)
	        {	    
	        document.shopcart.Option119.checked = false;
	        document.shopcart.Option119.disabled = false;
	        }
	        else
	        {
	        document.shopcart.Option119.checked = false;
	        document.shopcart.Option119.disabled = true;
	        }	        

	    document.shopcart.Option18.checked = false;
	    document.shopcart.Option18.disabled = false;		    
	    }  	      	     
    
    
    }
}



	
	
}

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 ColorID2 = 0;// = document.shopcart.ColorID.value;	
	var TapeColorID = 0;
	

	//set javascript check
	document.shopcart.jsBrowserCheck.value = "1";

    if(ID > 0)
    {
        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;
	        //ColorID2 = document.shopcart.ColorID2.value;	
	        if(document.shopcart.TapeColorID)
	        {
		        TapeColorID = ID;
		        document.shopcart.TapeColorID.value = ID;
	        }
        }
    }
    else
    {
        if(ColorType == 1)
        {//blinds
        
        }
        else
        {
        //tape color
            ColorID = document.shopcart.ColorID.value;
            TapeColorID = ID;
            document.shopcart.TapeColorID.value = ID;
        }
    }
	
	if(ColorID == 0 || ColorID < 0){//No color selected, Set all color to nothing
		//Set blind sections to empty
		if(eleColorImage3)
		{
		
		    //divSelectColor.className = "SelectColor";
		    eleColorImage.src = "http://www.selectblindscanada.ca/images/productDetails/selectColor1.png";
		    eleTapeColorImage.src = "http://www.selectblindscanada.ca/images/productDetails/selectColor2.png";
		    eleColorImage3.src = "http://www.selectblindscanada.ca/images/productDetails/selectColor3.png";
		}
		else
	    {
	        eleColorImage.src = "http://www.selectblindscanada.ca/images/productDetails/selectColor.png";
	    }
		
	
		//Set tape color
		if(eleTapeColorImage){
			if(TapeColorID == 0){//No tape selected
				eleTapeColorImage.style.background="";
			}
			else{//Show tape color
				//eleTapeColorImage.src = "http://www.selectblindscanada.ca/images/tapes/tape_" + TapeColorID + ".jpg";
				eleTapeColorImage.style.background="url(http://www.selectblindscanada.ca/images/tapes/tape_" + TapeColorID + ".jpg)";
			}
		}
	}
	else{//Color Selected
		//Set color on blind sections
		
		
		eleColorImage.src = "http://www.selectblindscanada.ca/images/blinds/enlarge/blindcolor_" + ColorID + ".jpg";
		
		if(eleColorImage3){eleColorImage3.src = "http://www.selectblindscanada.ca/images/blinds/enlarge/blindcolor_" + ColorID + ".jpg";}
		if(eleTapeColorImage){
			if(TapeColorID == 0){//No tape selected
				if(eleColorImage3){
					eleTapeColorImage.src = "http://www.selectblindscanada.ca/images/blinds/enlarge/blindcolor_" + ColorID + ".jpg";
				}
				else{//old products
					eleTapeColorImage.src = "http://www.selectblindscanada.ca/images/spacer.gif";
				}
			}
			else{//Set to tape color
				eleTapeColorImage.src = "http://www.selectblindscanada.ca/images/tapes/tape_" + TapeColorID + ".jpg";
			}
		}
	}
}




function SetPreviewColorPlusName(ID,ColorType,ColorName)
{
	var eleTapeColorImage = document.getElementById("TapeColor");
	var eleColorImage = document.getElementById("BlindColor");
	var eleColorImage3 = document.getElementById("BlindColor3");
	var ColorID = 0;// = document.shopcart.ColorID.value;
	//var ColorID2 = 0;// = document.shopcart.ColorID.value;	
	var TapeColorID = 0;
	

	//set javascript check
	document.shopcart.jsBrowserCheck.value = "1";

    if(ID > 0)
    {
        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;
	        //ColorID2 = document.shopcart.ColorID2.value;	
	        if(document.shopcart.TapeColorID)
	        {
		        TapeColorID = ID;
		        document.shopcart.TapeColorID.value = ID;
	        }
        }
    }
    else
    {
        if(ColorType == 1)
        {//blinds
        
        }
        else
        {
        //tape color
            ColorID = document.shopcart.ColorID.value;
            TapeColorID = ID;
            document.shopcart.TapeColorID.value = ID;
        }
    }
	
	if(ColorID == 0 || ColorID < 0){//No color selected, Set all color to nothing
	
	document.getElementById("ColorNameToShow").innerHTML ='';
	
		//Set blind sections to empty
		if(eleColorImage3)
		{
		
		    //divSelectColor.className = "SelectColor";
		    eleColorImage.src = "http://www.selectblindscanada.ca/images/productDetails/selectColor1.png";
		    eleTapeColorImage.src = "http://www.selectblindscanada.ca/images/productDetails/selectColor2.png";
		    eleColorImage3.src = "http://www.selectblindscanada.ca/images/productDetails/selectColor3.png";
		}
		else
	    {
	        eleColorImage.src = "http://www.selectblindscanada.ca/images/productDetails/selectColor.png";
	    }
		
	
		//Set tape color
		if(eleTapeColorImage){
			if(TapeColorID == 0){//No tape selected
				eleTapeColorImage.style.background="";
			}
			else{//Show tape color
				//eleTapeColorImage.src = "http://www.selectblindscanada.ca/images/tapes/tape_" + TapeColorID + ".jpg";
				eleTapeColorImage.style.background="url(http://www.selectblindscanada.ca/images/tapes/tape_" + TapeColorID + ".jpg)";
			}
		}
	}
	else{//Color Selected
		//Set color on blind sections
		document.getElementById("ColorNameToShow").innerHTML ='&#160;Selected:<b>' +  ColorName + '</b>';
		
		eleColorImage.src = "http://www.selectblindscanada.ca/images/blinds/enlarge/blindcolor_" + ColorID + ".jpg";
		
		if(eleColorImage3){eleColorImage3.src = "http://www.selectblindscanada.ca/images/blinds/enlarge/blindcolor_" + ColorID + ".jpg";}
		if(eleTapeColorImage){
			if(TapeColorID == 0){//No tape selected
				if(eleColorImage3){
					eleTapeColorImage.src = "http://www.selectblindscanada.ca/images/blinds/enlarge/blindcolor_" + ColorID + ".jpg";
				}
				else{//old products
					eleTapeColorImage.src = "http://www.selectblindscanada.ca/images/spacer.gif";
				}
			}
			else{//Set to tape color
				eleTapeColorImage.src = "http://www.selectblindscanada.ca/images/tapes/tape_" + TapeColorID + ".jpg";
			}
		}
	}
}



function validatePayment(frmEle){




var entry;
entry=replace(frmEle.Address.value,'<br>',' ');
frmEle.Address.value= entry;





	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 == "MC") type="MasterCard";
		if(frmEle.PaymentID.value == "VI") type="Visa";
		if(frmEle.PaymentID.value == "DI") type="Discover";
		if(frmEle.PaymentID.value == "AM") 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.expMonth.value == ""){
		alert("Please enter Expiry Month");
		frmEle.expMonth.focus();
		return false;
	}
	
	if(frmEle.expYear.value == ""){
		alert("Please enter Expiry Year");
		frmEle.expYear.focus();
		return false;
	}
	
	
		if(frmEle.cvv2.value.length < 3){
			
			alert("Please enter the Security Code 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.City.value == ""){
		alert("Please enter your City");
		frmEle.City.focus();
		return false;
	}
		
if(frmEle.State.value == "" || frmEle.State.value == "0"){
		alert("Please enter your Province/State");
		frmEle.State.focus();
		return false;
	}
		
		
		
		if(frmEle.Zip.value == ""){
			alert("Please enter your postal or zip code");
			frmEle.Zip.focus();
			return false;
		}
		else
		{
		objRegExp = /^\D{1}\d{1}\D{1}\s\d{1}\D{1}\d{1}$/
		objRegExpus =/(^\d{5}$)|(^\d{5}-\d{4}$)/
		if(!objRegExp.test(frmEle.Zip.value) && !objRegExpus.test(frmEle.Zip.value))
			{
				alert("Please enter your correct postal or zip code");
				frmEle.Zip.focus();
				return false;
			}
		}
		
			if(frmEle.measure_disclaimer.checked == false){
		alert("Please read the Measuring Instructions and Colour Disclaimer and agree to the terms");
		frmEle.measure_disclaimer.focus();
		return false;
	}
	
	}
	if(frmEle.PaymentType[1].checked){//Bill Me Later
	}
	if(frmEle.PaymentType[2])
	{
		if(frmEle.PaymentType[2].checked){//Alternative methods
			if(frmEle.Alternative.checked == false){
				alert("Please select Call for Credit Card if you selected Alternative Payment Method");
				return false;
			}
		}
	}
	
	if(frmEle.measure_disclaimer.checked == false){
		alert("Please read the Measuring Instructions and Colour Disclaimer and agree to the terms");
		frmEle.measure_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[1].checked = true; //03.02.06
	}
	
	//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)

	{//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);
}


function bulidSampleCart(frmEle)
{

if(frmEle.Sample.value !="")
{
var sSelSamples = "";var sLastSampleProName = "";var sSelSampleProName = "";

//alert(frmEle.Sample.value);
var aItemID = frmEle.Sample.value.split(",");
	if (aItemID.length > 0){
	
		for(j=aItemID.length-1;j>=0;j--)
		{//loop each item
			
	     var aItemID2 = aItemID[j].split("_");
		
		//alert(aItemID2[0]);alert(aItemID2[1]);
		sSelSampleProName = eval("document.samplesForm.spn" + aItemID[j] + ".value");
		if(sLastSampleProName != sSelSampleProName) sSelSamples += "<br><div class='box2' style='padding:3;'><b>" + sSelSampleProName + "</b> <a href='#' onclick='document.samplesForm.pid.value=" + aSelectedItemID2[1] + ";document.samplesForm.submit();'><u>More</u></a></div>";
		sSelSamples += "<li style='padding-left:10;'>" + eval("document.samplesForm.scn" + aItemID2[1] + ".value") + "&#160;<a href='samples.aspx?p=7&amp;rmid="+ aItemID[j] +"&amp;r=1'><u>Remove</u></a></li>"  //<img src='./images/icons/delete.gif' alt='Remove Sample'/>
		sLastSampleProName = sSelSampleProName;
		}
	
	}
	
	//alert(sSelSamples);
			var sHeader = "";
		var sFooter = "";
		document.getElementById("SelectedSamples").innerHTML = sHeader + sSelSamples + sFooter;

 }
}


//Sample Scripts
function validateSamples(frmEle,useDhtml,CID){
	var count = 0;var BambooCount = 0;
	var sSelSamples = "";var SampleValue = "";
	var ItemID = 0;var sLastSampleProName = "";var sSelSampleProName = "";
	
	var lfrmEle = document.samplesForm;
	
	var sSelectedSamples = lfrmEle.Sample.value;
	var sCheckedValues = "";
					var tmpch=0;
					var tempCID=0;
					if(CID) tempCID =CID;
	
					// update session
					if(document.samplesForm['ch'+tempCID])
							tmpch=eval("document.samplesForm.ch" + tempCID + ".value");
					//alert(tmpch);
					
					if(useDhtml == 3)
					{
					tmpch = 1;
					useDhtml = 1;
					}
					
					
					if(tempCID)
					{
						if(tmpch == 1)
						{
						
						LoadXMLDoc("./sessionUpdater.aspx?pid="+ CID+"&r=1"); 
						if(document.samplesForm['ch'+tempCID])
						         lfrmEle.elements["ch"+CID].value = 0;
						}
						else
						{
						LoadXMLDoc("./sessionUpdater.aspx?pid="+ CID); 
						if(document.samplesForm['ch'+tempCID])
								lfrmEle.elements["ch"+CID].value = 1;
						}
					}
					
					
	if(lfrmEle.SampleCheckbox){
		//add each item to the form value and display the selected results
		if(lfrmEle.SampleCheckbox.length){
			for(x=lfrmEle.SampleCheckbox.length-1;x>=0;x--){//loop each checked item
			
				if(document.samplesForm['ch'+tempCID])
				{
					if(lfrmEle.elements["ch"+CID])
						if(lfrmEle.elements["ch"+CID].value == 0 && lfrmEle.SampleCheckbox[x].value == CID)
						{
						lfrmEle.SampleCheckbox[x].checked = false;
						lfrmEle.elements["ch"+CID].value = 0;
						}
				}
				
			
				if(lfrmEle.SampleCheckbox[x].checked){
				

				
					//Update Number of selected samples
					count++
					ItemID = lfrmEle.SampleCheckbox[x].value;
					
					if(sCheckedValues != "") sCheckedValues += ",";
					sCheckedValues += ItemID;
					 var aItemID2 = ItemID.split("_");
					if(useDhtml == 1){//Setup inner html for list of selected samples
						sSelSampleProName = eval("document.samplesForm.spn" + ItemID + ".value");
						if(sLastSampleProName != sSelSampleProName) sSelSamples += "<br><div class='box2' style='padding:3;'><b>" + sSelSampleProName + "</b> <a href='#' onclick='document.samplesForm.pid.value=" + aItemID2[1] + ";document.samplesForm.submit();'><u>More</u></a></div>";
						
						//sSelSamples += "<li style='padding-left:10;'>" + eval("document.samplesForm.scn" + ItemID + ".value") + "</li>"
						sSelSamples += "<li style='padding-left:10;'>" 
						+ eval("document.samplesForm.scn" 
						+ ItemID 
						+ ".value") 
						+ "&#160;<a href='javascript:validateSamples(\"" 
						+ "document."
						+ lfrmEle.name 
						+"\","
						+ 3 
						+ ",\"" 
						+ lfrmEle.SampleCheckbox[x].value
						+ "\");'><u>Remove</u></a></li>"  // <img src='./images/icons/delete.gif' alt='Remove Sample'/>
						
						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")
							BambooCount++;
					}
					if(lfrmEle.Sample.value != ""){//setup form values for selected items
						var aSelectedItems = lfrmEle.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)
							lfrmEle.Sample.value += "," + ItemID;
					}
					else{
						lfrmEle.Sample.value = ItemID;
					}
					
				}
			}
		}
		else{//only one
			if(lfrmEle.SampleCheckbox.checked){
				//Update Number of selected samples
				count++
				ItemID = lfrmEle.SampleCheckbox.value;
				if(sCheckedValues != "") sCheckedValues += ",";
				sCheckedValues += ItemID;
				 var aItemID2 = ItemID.split("_");
				if(useDhtml == 1){//Setup inner html for list of selected samples
					sSelSampleProName = eval("document.samplesForm.spn" + ItemID + ".value");
					if(sLastSampleProName != sSelSampleProName) sSelSamples += "<br><div class='box2' style='padding:3;'><b>" + sSelSampleProName + "</b> <a href='#' onclick='document.samplesForm.pid.value=" + aItemID2[1] + ";document.samplesForm.submit();'><u>More</u></a></div>";
					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")
						BambooCount++;
				}
				if(lfrmEle.Sample.value != ""){//setup form values for selected items
					var aSelectedItems = lfrmEle.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)
						lfrmEle.Sample.value += "," + ItemID;
				}
				else{
					lfrmEle.Sample.value = ItemID;
				}
			}
		}
		if(lfrmEle.Sample.value != ""){//double check that each item is still selected
			var aSelectedItems2 = lfrmEle.Sample.value.split(",");
			var bFound2 = false;
			var sCurValue = lfrmEle.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] == lfrmEle.ProductID.value){//if product id is the current product
					
				}
				else{//add to value by default since passed from another product
				//alert(aSelectedItems2[j].value);
				if(aSelectedItems2[j] == CID)
					{
					
					}
					else
					{
					

					if(sNewValue != "") sNewValue += ",";
					sNewValue += aSelectedItems2[j];
					count ++;
					
					if(useDhtml == 1)
					{//Setup inner html for list of selected samples
						sSelSampleProName = eval("document.samplesForm.spn" + aSelectedItems2[j] + ".value");
						if(sLastSampleProName != sSelSampleProName) sSelSamples += "<br><div class='box2' style='padding:3;'><b>" + sSelSampleProName + "</b> <a href='#' onclick='document.samplesForm.pid.value=" + aSelectedItemID2[1] + ";document.samplesForm.submit();'><u>More</u></a></div>";
						
						//sSelSamples += "<li style='padding-left:10;'>" + eval("document.samplesForm.scn" + aSelectedItems2[j] + ".value") + "</li>"
						
						
						sSelSamples += "<li style='padding-left:10;'>" 
						+ eval("document.samplesForm.scn" 
						+ aSelectedItems2[j] 
						+ ".value") 
						+ "&#160;<a href='javascript:validateSamples(\"" 
						+ "document."
						+ lfrmEle.name 
						+"\","
						+ 3 
						+ ",\"" 
						+ aSelectedItems2[j]
						+ "\");'><u>Remove</u></a></li>"  // <img src='./images/icons/delete.gif' alt='Remove Sample'/>
						
						
						
						sLastSampleProName = sSelSampleProName;
					}
					
					} //mine
				}
			}
			if(sCheckedValues != "" && sNewValue != "")sNewValue = "," + sNewValue;
			lfrmEle.Sample.value = sCheckedValues + sNewValue;
		}
	}
	
	if(lfrmEle.Sample.value == "" && lfrmEle.p.value == 2){ //count == 0
		alert("Please select at least one Sample");
		document.samplesForm.p.value = 1;
		//Hide Sample list
		if(useDhtml == 1){//document.all.SelectedSamples.style.display="none";
			MM_showHideLayers('SelectedSamples','','hide');
		}
		return false;
	}
	if(count > 20){
		alert("Please remove one or more samples from your samples cart so that you do not have more than 20, and then click the 'Finalize order' button to complete your order for free samples. If you need to order more than 20 samples, please contact us for assistance.");
		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;
	}
}






//Sample Scripts
function AddColorToCart(CID_PID){

	//LoadXMLDoc("../sessionUpdater.aspx?pid=" + CID); 
    var samples = document.getElementById("Sample");
    
    samples.value += "," + CID_PID;
	document.samplesForm.submit();
}


function validateSampleUser(frmEle){
	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.value == "" || frmEle.State.value == "0"){
		alert("Please enter your Province");
		frmEle.State.focus();
		return false;
	}
	
	
    if(frmEle.State.value == "out")
	{
	var answer = confirm("SelectBlindsCanada.ca only accepts orders from and deliveries to Canadian addresses. For shipments to other countries, including the USA, visit SelectBlinds.com. Click OK to go to SelectBlinds.com now. Otherwise, click 'Cancel' and choose your province.")
     if (answer)
		{
		win = top;
		win.opener = top;
		win.close ();
		window.open("http://www.selectblinds.com"); 
		}
     else
		{
		frmEle.State.focus();
			return false;
		}
	}
	
	if(frmEle.Zip.value == ""){
		alert("Please enter your postal code in the format X0X 0X0");
		frmEle.Zip.focus();
		return false;
	}
	else
	{
	objRegExp = /^\D{1}\d{1}\D{1}\s\d{1}\D{1}\d{1}$/
	if(!objRegExp.test(frmEle.Zip.value))
		{
			alert("Please enter your postal code in the format X0X 0X0");
			frmEle.Zip.focus();
			return false;
		}
	}
	
	if(frmEle.Phone.value == ""){
		alert("Please enter a Daytime Phone Number");
		frmEle.Phone.focus();
		return false;
	}
	
		if(frmEle.Phone2.value == ""){
		alert("Please enter a Evening Phone Number");
		frmEle.Phone2.focus();
		return false;
	}
	
	
	if(frmEle.Email.value != frmEle.Email2.value){
			alert("The e-mail addresses do not match; please review them and make sure they are the same");
			frmEle.Email.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("Your e-mail address appears to be incomplete. Please make sure it is correct.");
			frmEle.Email.focus();
			return false;
		}
	 }
	
	if(frmEle.Shipping.value != "0"){
		if(frmEle.Phone.value == ""){
			alert("Your Phone is required for the overnight delivery");
			frmEle.Phone.focus();
			return false;
		}
	}
	
	if(frmEle.Planning.value == "0"){
		alert("Please let us know when you are planning to buy your blinds.");
		frmEle.Planning.focus();
		return false;
	}
	
	
var pcodes2=new Array("A0K");
	
	
var pcodes=new Array("A0A4H0");


var inwords;
var zizi2;

zizi2=replace(frmEle.Zip.value,' ','');
zizi2 =zizi2.substring(0, 3);

for(var ii=0;ii<pcodes2.length;ii++)
{
if(pcodes2[ii] == zizi2)    
	{
	inwords="YES";	
	}
}



var zizi;
zizi=replace(frmEle.Zip.value,' ','');
for(var i=0;i<pcodes.length;i++)
{
if(pcodes[i] == zizi)    
	{
	inwords="YES";	
	}
}




if(frmEle.Shipping.value == "15" && inwords=="YES")
		{
			alert("Overnight shipping of samples in not available to this postal code. Please choose CanPost shipping to have your samples delivered to you free via Canada Post regular mail.");
			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.cvv2.value.length < 3){
			
			alert("Please enter the Security Code on the credit card.");
			frmEle.cvv2.focus();
			return false;
		}
		
		if(frmEle.BillState.value == "" || frmEle.BillState.value == "0"){
		alert("Please enter a Province");
		frmEle.BillState.focus();
		return false;
	}
	

	
	if(frmEle.BillState.value == "out")
	{
	var answer = confirm("SelectBlinds.ca only accepts orders from and deliveries to Canadian addresses. For shipments to other countries, including the USA, visit SelectBlinds.com. Click OK to go to SelectBlinds.com now. Otherwise, click 'Cancel' and choose your province.")
     if (answer)
		{
		win = top;
		win.opener = top;
		win.close ();
		window.open("http://www.selectblinds.com"); 
		}
     else
		{
		frmEle.BillState.focus();
			return false;
		}
	}	
		
		
		
		
		
		
		
		
		
		
		
		
		
	if(frmEle.BillZip.value == ""){
		alert("Please enter your postal code in the format X0X 0X0");
		frmEle.BillZip.focus();
		return false;
	}
	else
	{
	objRegExp = /^\D{1}\d{1}\D{1}\s\d{1}\D{1}\d{1}$/
	if(!objRegExp.test(frmEle.BillZip.value))
		{
			alert("Please enter your postal code in the format X0X 0X0");
			frmEle.BillZip.focus();
			return false;
		}
	}
	

MM_showHideLayers('PaymentDiv','','show');	
}






function validateUserLogin(frmEle){

if(frmEle.username){
		if(frmEle.username.value == ""){
			alert("Please enter your Email");
			frmEle.username.focus();
			return false;
		}
		var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
		var check=/@[\w\-]+\./;
		var checkend=/\.[a-zA-Z]{2,4}$/;
		
		emailad = frmEle.username.value;
		
		if(((emailad.search(exclude) != -1)||(emailad.search(check))
		== -1)||(emailad.search(checkend) == -1)){
	  		alert("Your e-mail address appears to be incomplete. Please make sure it is correct.");
			frmEle.username.focus();
			return false;
		}
	 }
}





function AddToSpecialPlace(obj)
{
    val = obj.value.toLowerCase();
    LoadXMLDoc("https://www.selectblindscanada.ca/RegistrationFormUpdater.aspx?email="+ val); 
    //alert(val);
}

function AddToSpecialPlaceSamples(obj)
{
    val = obj.value.toLowerCase();
    LoadXMLDoc("https://www.selectblindscanada.ca/RegistrationFormUpdaterSamples.aspx?email="+ val); 
    //alert(val);
}





//User scripts
function validateUser(frmEle){


if(frmEle.atype.value == "A")
	{
				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;
					}
				}
				
				if(frmEle.PasswordReminderID.value == "0"){
					alert("Please enter your Secret Question");
					frmEle.PasswordReminderID.focus();
					return false;
				}
				
				if(frmEle.PasswordReminderAnswer.value == ""){
					alert("Please enter your Secret Answer");
					frmEle.PasswordReminderAnswer.focus();
					return false;
				}
	
}


	if(frmEle.shipping[0].checked==false && frmEle.shipping[1].checked == false)
	{
			alert("Please choose YES if your shipping address is the same as the billing and NO if it's different");
			frmEle.shipping[1].focus();
			return false;
		}
	
	
	
	
	
		if(frmEle.Email.value != frmEle.Email2.value){
			alert("The e-mail addresses do not match; please review them and make sure they are the same");
			frmEle.Email.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("Your e-mail address appears to be incomplete. Please make sure it is correct.");
			frmEle.Email.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.value == "" || frmEle.State.value == "0"){
		alert("Please enter a Province");
		frmEle.State.focus();
		return false;
	}
	
	
	if(frmEle.State.value == "out")
	{
	var answer = confirm("SelectBlindsCanada.ca only accepts orders from and deliveries to Canadian addresses. For shipments to other countries, including the USA, visit SelectBlinds.com. Click OK to go to SelectBlinds.com now. Otherwise, click 'Cancel' and choose your province.")
     if (answer)
		{
		win = top;
		win.opener = top;
		win.close ();
		window.open("http://www.selectblinds.com"); 
		}
     else
		{
		frmEle.State.focus();
			return false;
		}
	}
	

	
	function validateValue( strValue, strMatchPattern ) {
/************************************************
DESCRIPTION: Validates that a string a matches
  a valid regular expression value.

PARAMETERS:
   strValue - String to be tested for validity
   strMatchPattern - String containing a valid
      regular expression match pattern.

RETURNS:
   True if valid, otherwise false.
*************************************************/
var objRegExp = new RegExp( strMatchPattern);

 //check if string matches pattern
 return objRegExp.test(strValue);
}



	
	
	
	if(frmEle.Zip.value == ""){
		alert("Please enter your postal code in the format X0X 0X0");
		frmEle.Zip.focus();
		return false;
	}
	else
	{
	objRegExp = /^\D{1}\d{1}\D{1}\s\d{1}\D{1}\d{1}$/
	if(!objRegExp.test(frmEle.Zip.value))
		{
			alert("Please enter your postal code in the format X0X 0X0");
			frmEle.Zip.focus();
			return false;
		}
	}
	
	
	if(frmEle.Phone.value == ""){
		alert("Please enter a Daytime Phone Number");
		frmEle.Phone.focus();
		return false;
	}
	
	if(frmEle.Phone2.value == ""){
		alert("Please enter a Evening Phone Number");
		frmEle.Phone2.focus();
		return false;
	}
	
	
	if(frmEle.shipping[1].checked)
	
	//if(frmEle.shipping.value == "1")
	{
	
	
						if(frmEle.SFirstName.value == ""){
						alert("Please enter your Shipping First Name");
						frmEle.SFirstName.focus();
						return false;
					}
					if(frmEle.SLastName.value == ""){
						alert("Please enter your Shipping Last Name");
						frmEle.SLastName.focus();
						return false;
					}
					if(frmEle.SAddress.value == ""){
						alert("Please enter your Shipping Address");
						frmEle.SAddress.focus();
						return false;
					}
					
					
					
					
					
					if(frmEle.SCity.value == ""){
						alert("Please enter your Shipping City");
						frmEle.SCity.focus();
						return false;
					}
					if(frmEle.SState.value == "" || frmEle.SState.value == "0"){
						alert("Please enter a Shipping Province");
						frmEle.SState.focus();
						return false;
					}
					
					
					if(frmEle.SState.value == "out")
					{
					var answer = confirm("SelectBlindsCanada.ca only accepts orders from and deliveries to Canadian addresses. For shipments to other countries, including the USA, visit SelectBlinds.com. Click OK to go to SelectBlinds.com now. Otherwise, click 'Cancel' and choose your province.")
					if (answer)
						{
						win = top;
						win.opener = top;
						win.close ();
						window.open("http://www.selectblinds.com"); 
						}
					else
						{
						frmEle.SState.focus();
							return false;
						}
					}
	
						if(frmEle.SZip.value == ""){
						alert("Please enter your postal code in the format X0X 0X0");
						frmEle.SZip.focus();
						return false;
					}
					else
					{
					objRegExp = /^\D{1}\d{1}\D{1}\s\d{1}\D{1}\d{1}$/
					if(!objRegExp.test(frmEle.SZip.value))
						{
							alert("Please enter your postal code in the format X0X 0X0");
							frmEle.SZip.focus();
							return false;
						}
					}
					
						if(frmEle.SPhone.value == ""){
						alert("Please enter a Shipping Phone Number");
						frmEle.SPhone.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.cvv2.value.length < 3){
			
			alert("Please enter the Security Code on the credit card.");
			frmEle.cvv2.focus();
			return false;
		}

	if(frmEle.BillAddress.value == ""){
		alert("Please enter a Address");
		frmEle.BillAddress.focus();
		return false;
	}

	if(frmEle.BillCity.value == ""){
		alert("Please enter a City");
		frmEle.BillCity.focus();
		return false;
	}
	
		
		
	if(frmEle.BillState.value == "" || frmEle.BillState.value == "0"){
		alert("Please enter a Province");
		frmEle.BillState.focus();
		return false;
	}
	
	
	if(frmEle.BillState.value == "out")
	{
	var answer = confirm("SelectBlindsCanada.ca only accepts orders from and deliveries to Canadian addresses. For shipments to other countries, including the USA, visit SelectBlinds.com. Click OK to go to SelectBlinds.com now. Otherwise, click 'Cancel' and choose your province.")
     if (answer)
		{
		win = top;
		win.opener = top;
		win.close ();
		window.open("http://www.selectblinds.com"); 
		}
     else
		{
		frmEle.BillState.focus();
			return false;
		}
	}
		
		
		
		
		if(frmEle.BillZip.value == ""){
		alert("Please enter your postal code in the format X0X 0X0");
		frmEle.BillZip.focus();
		return false;
		}
		else
		{
		objRegExp = /^\D{1}\d{1}\D{1}\s\d{1}\D{1}\d{1}$/
		if(!objRegExp.test(frmEle.BillZip.value))
			{
				alert("Please enter your postal code in the format X0X 0X0");
				frmEle.BillZip.focus();
				return false;
			}
		}
		
		
	
		if(frmEle.Email)
		{
			if(frmEle.Email.value == ""){
				alert("Please enter a 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("Your e-mail address appears to be incomplete. Please make sure it is correct.");
				frmEle.Email.focus();
				return false;
			}
	 }
		
		
		

}

//Generic Scripts
function ToDollarsAndCents(n) 
{ 
   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){

if(tabName != 'descriptionLayer'){
MM_showHideLayers('StackingLayer','','hide');
}

	MM_showHideLayers('descriptionLayer','','hide');
	MM_showHideLayers('infoLayer','','hide');
	MM_showHideLayers('colorsLayer','','hide');
	MM_showHideLayers('shippingLayer','','hide');
	if(document.getElementById('ReviewLayerCount')) MM_showHideLayers('reviewLayer','','hide');	
	MM_showHideLayers(tabName,'','show');
	
	MM_swapImage('descTransImage','','http://www.selectblindscanada.ca/images/pronav/leftOff.jpg');
	MM_swapImage('colorsTransImage','','http://www.selectblindscanada.ca/images/pronav/leftOff.jpg');
	MM_swapImage('infoTransImage','','http://www.selectblindscanada.ca/images/pronav/leftOff.jpg');
	MM_swapImage('shippingTransImage','','http://www.selectblindscanada.ca/images/pronav/leftOff.jpg');
	if(document.getElementById('ReviewLayerCount'))  MM_swapImage('reviewTransImage','','http://www.selectblindscanada.ca/images/pronav/leftOff.jpg');
	
	
	if(tabName == 'descriptionLayer'){
	MM_showHideLayers('dis57','','hide');
		MM_swapImage('descriptionImage','','http://www.selectblindscanada.ca/images/pronav/DescriptionOn.jpg');
		MM_swapImage('descTransImage','','http://www.selectblindscanada.ca/images/pronav/leftOn.jpg');
	}
	else{
		MM_swapImage('descriptionImage','','http://www.selectblindscanada.ca/images/pronav/DescriptionOff.jpg');
	}
	if(tabName == 'infoLayer'){
	MM_showHideLayers('dis57','','hide');
		MM_swapImage('infoImage','','http://www.selectblindscanada.ca/images/pronav/FeaturesOn.jpg');
		MM_swapImage('infoTransImage','','http://www.selectblindscanada.ca/images/pronav/leftOn.jpg');
		MM_swapImage('colorsTransImage','','http://www.selectblindscanada.ca/images/pronav/leftcurve.jpg');
	}
	else{
		MM_swapImage('infoImage','','http://www.selectblindscanada.ca/images/pronav/FeaturesOff.jpg');
	}
	if(tabName == 'colorsLayer'){
	MM_showHideLayers('dis57','','show');
		MM_swapImage('colorsImage','','http://www.selectblindscanada.ca/images/pronav/ColorsOn.jpg');
		MM_swapImage('colorsTransImage','','http://www.selectblindscanada.ca/images/pronav/leftOn.jpg');
		MM_swapImage('descTransImage','','http://www.selectblindscanada.ca/images/pronav/leftcurve.jpg');
	}
	else{
		MM_swapImage('colorsImage','','http://www.selectblindscanada.ca/images/pronav/ColorsOff.jpg');
	}
	
	
	if(tabName == 'shippingLayer'){
		MM_showHideLayers('dis57','','hide');
		if(document.getElementById('ReviewLayerCount'))
			{
			MM_swapImage('shippingImage','','http://www.selectblindscanada.ca/images/pronav/ShippingOn2.jpg');
			MM_swapImage('shippingTransImage','','http://www.selectblindscanada.ca/images/pronav/leftOn.jpg');
			MM_swapImage('infoTransImage','','http://www.selectblindscanada.ca/images/pronav/leftcurve.jpg');
			}
		else
		{
		MM_swapImage('shippingImage','','http://www.selectblindscanada.ca/images/pronav/ShippingOn.jpg');
	    MM_swapImage('shippingTransImage','','http://www.selectblindscanada.ca/images/pronav/leftOn.jpg');
		MM_swapImage('infoTransImage','','http://www.selectblindscanada.ca/images/pronav/leftcurve.jpg');
		}
	}
	else
	{
		if(document.getElementById('ReviewLayerCount')) 
			MM_swapImage('shippingImage','','http://www.selectblindscanada.ca/images/pronav/ShippingOff2.jpg');
		else
			MM_swapImage('shippingImage','','http://www.selectblindscanada.ca/images/pronav/ShippingOff.jpg');
	}
	
	
	
	
	
	if(document.getElementById('ReviewLayerCount')) 
	{
		if(tabName == 'reviewLayer'){
			MM_showHideLayers('dis57','','hide');
			MM_swapImage('reviewImage','','http://www.selectblindscanada.ca/images/pronav/ReviewOn.jpg');
			MM_swapImage('reviewTransImage','','http://www.selectblindscanada.ca/images/pronav/leftOn.jpg');
			MM_swapImage('reviewTransImage','','http://www.selectblindscanada.ca/images/pronav/leftcurve.jpg');
		}
		else{
			MM_swapImage('reviewImage','','http://www.selectblindscanada.ca/images/pronav/ReviewOff.jpg');
		}
	}
	
}
function changeStyle(id, newClass) {
	identity=document.getElementById(id);
	identity.className=newClass;
}





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 replace(string,text,by) {
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}


function DO_that() {

	if(document.getElementById('pdHROptionsDouble')) document.getElementById('pdHROptionsDouble').style.display = "block";
	if(document.getElementById('OnOneType')) document.getElementById('OnOneType').value = "2";
	if(document.getElementById('FeatureOption4')) document.getElementById('FeatureOption4').disabled=true;
	if(document.getElementById('FeatureOption2')) document.getElementById('FeatureOption2').disabled=true;
	if(document.shopcart.pid.value == 677 || document.shopcart.pid.value == 13 || document.shopcart.pid.value == 87 || document.shopcart.pid.value == 100 || document.shopcart.pid.value == 110 || document.shopcart.pid.value == 117 || document.shopcart.pid.value == 648 || document.shopcart.pid.value == 670 || document.shopcart.pid.value == 675 || document.shopcart.pid.value == 711)
	
	
	if (document.getElementById('MoneySavingTip').value == "0") 
	{

	alert("Money Saving Tip: You can save money by ordering 2 or 3 separate blinds instead of multiple blinds on a single headrail. You'll save the 2on1/3on1 additional charge, and also eliminate the $85 oversize shipping surcharge if your blind is more than 94 inches wide. Your blinds will also be easier to install and safer from possible shipping damage. Choose the Common Valance option and you'll get one valance to cover all the blinds' headrails for a uniform look. Make sure to let us know the size of the valance in the 'notes' section.");

	document.getElementById('MoneySavingTip').value = "1";
	}

}

function DO_that2() {
	if(document.getElementById('OnOneType')) document.getElementById('OnOneType').value = "0";
	if(document.getElementById('pdHROptionsDouble')) document.getElementById('pdHROptionsDouble').style.display = "None";
	
	if(document.getElementById('FeatureOption4')) document.getElementById('FeatureOption4').disabled=false;
	if(document.getElementById('FeatureOption2')) document.getElementById('FeatureOption2').disabled=false;
}

function DO_that3() {
	if(document.getElementById('pdHROptionsTriple')) document.getElementById('pdHROptionsTriple').style.display = "block";
	if(document.getElementById('OnOneType3')) document.getElementById('OnOneType3').value = "3";
	if(document.getElementById('FeatureOption4')) document.getElementById('FeatureOption4').disabled=true;
	if(document.getElementById('FeatureOption2')) document.getElementById('FeatureOption2').disabled=true;
	if(document.shopcart.pid.value == 677 || document.shopcart.pid.value == 13 || document.shopcart.pid.value == 87 || document.shopcart.pid.value == 100 || document.shopcart.pid.value == 110 || document.shopcart.pid.value == 117 || document.shopcart.pid.value == 648 || document.shopcart.pid.value == 670 || document.shopcart.pid.value == 675)
	if (document.getElementById('MoneySavingTip').value == "0") 
	{

	alert("Money Saving Tip: You can save money by ordering 2 or 3 separate blinds instead of multiple blinds on a single headrail. You'll save the 2on1/3on1 additional charge, and also eliminate the $85 oversize shipping surcharge if your blind is more than 94 inches wide. Your blinds will also be easier to install and safer from possible shipping damage. Choose the Common Valance option and you'll get one valance to cover all the blinds' headrails for a uniform look. Make sure to let us know the size of the valance in the 'notes' section.");

	document.getElementById('MoneySavingTip').value = "1";
	}

	}
	
	
function Print2on1And3on1Msg() {
us = document.getElementById("2on1PopUp");
if(us)
{
	var winX = screen.width;
	if (winX == '1600') us.style.left = 1070;
	if (winX == '1440') us.style.left = 990;
	if (winX == '1400') us.style.left = 970;
	if (winX == '1280') us.style.left = 908;
	if (winX == '1152') us.style.left = 845;
	if (winX == '1024') us.style.left = 780;
	if (winX == '800') us.style.left = 750;

	MM_showHideLayers('2on1PopUp','','show');
	MM_showHideLayers('size_not_availablepop','','hide');
}
}

function DO_that4() {
	if(document.getElementById('pdHROptionsTriple'))document.getElementById('pdHROptionsTriple').style.display = "None";
	if(document.getElementById('OnOneType3'))document.getElementById('OnOneType3').value = "0";
	if(document.getElementById('FeatureOption4')) document.getElementById('FeatureOption4').disabled=false;
	if(document.getElementById('FeatureOption2')) document.getElementById('FeatureOption2').disabled=false;
	}
	
function DO_that5() {	
	document.getElementById('CommonOne').style.display = "block";
	document.getElementById('CommonType').value = "1";
}
function DO_that6() {
	document.getElementById('CommonOne').style.display = "None";
	document.getElementById('CommonType').value = "0";
}

function DO_that7() {
	if(document.getElementById('TwoConns')) document.getElementById('TwoConns').style.display = "block";
	if(document.getElementById('OnOneType2')) document.getElementById('OnOneType2').value = "4";
	

}

function DO_that8() {
	document.getElementById('OnOneType2').value = "0";
	if(document.getElementById('TwoConns')) document.getElementById('TwoConns').style.display = "None";
	
}
function NotExactSize3OnOne(frmEle) 
{


if((eval(frmEle.WidthInches.value)+eval(frmEle.Width8ths.value)) != (eval(frmEle.LeftBlindWidth3.value)+eval(frmEle.LeftBlindWidth8ths3.value)+eval(frmEle.RightBlindWidth3.value)+eval(frmEle.RightBlindWidth8ths3.value)+eval(frmEle.MiddleBlindWidth3.value)+eval(frmEle.MiddleBlindWidth8ths3.value))){alert("The widths entered for the 3 on 1 option should total the width of your whole window opening, that all 3 blinds will hang in. Please review the widths entered.");frmEle.LeftBlindWidth3.focus(); return 1;}
}

function NotExactSize2OnOne(frmEle) 
{

if((eval(frmEle.WidthInches.value)+eval(frmEle.Width8ths.value)) != (eval(frmEle.LeftBlindWidth2.value)+eval(frmEle.LeftBlindWidth8ths2.value)+eval(frmEle.RightBlindWidth2.value)+eval(frmEle.RightBlindWidth8ths2.value))){alert("The widths entered for the 2 on 1 option should total the width of your whole window opening, that all 2 blinds will hang in. Please review the widths entered.");frmEle.LeftBlindWidth2.focus();return 1;}

}

function NotExactSize2Conns(frmEle) 
{


if((eval(frmEle.WidthInches.value)+eval(frmEle.Width8ths.value)) != (eval(frmEle.LeftBlindWidth2c.value)+eval(frmEle.LeftBlindWidth8ths2c.value)+eval(frmEle.RightBlindWidth2c.value)+eval(frmEle.RightBlindWidth8ths2c.value))){alert("The widths entered for the 2 connections option should total the width of your whole window opening, that all 2 blinds will hang in. Please review the widths entered.");frmEle.LeftBlindWidth2c.focus();return 1;}

}


<!-- Copyright 2006,2007 Bontrager Connection, LLC
// http://bontragerconnection.com/ and http://www.willmaster.com/
// Version: July 28, 2007
var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
	rX = self.pageXOffset;
	rY = self.pageYOffset;
	}
else if(document.documentElement && document.documentElement.scrollTop) {
	rX = document.documentElement.scrollLeft;
	rY = document.documentElement.scrollTop;
	}
else if(document.body) {
	rX = document.body.scrollLeft;
	rY = document.body.scrollTop;
	}
if(document.all) {
	cX += rX; 
	cY += rY;
	}
d.style.left = (cX+10) + "px";
d.style.top = (cY+10) + "px";
}
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}
//-->



function hideRow(divName) {
	
	var browserType;

	if (document.layers) {browserType = "nn4"}
	if (document.all) {browserType = "ie"}
	if (window.navigator.userAgent.toLowerCase().match("gecko")) {
	 browserType= "gecko"
	}

  if (browserType == "gecko" )
     document.poppedLayer = 
         eval('document.getElementById(divName)');
  else if (browserType == "ie")
     document.poppedLayer = 
        eval('document.getElementById(divName)');
  else
     document.poppedLayer =   
        eval('document.layers[divName]');
   //document.poppedLayer.style.visibility = "collapse";
   document.poppedLayer.style.display = "none";
   
}


function showRow(divName, divStyleDisplay) {
	if (typeof divStyleDisplay == 'undefined' ) divStyleDisplay = 'table-row';
	var browserType;

	if (document.layers) {browserType = "nn4"}
	if (document.all) {browserType = "ie"}
	if (window.navigator.userAgent.toLowerCase().match("gecko")) {
	 browserType= "gecko"
	}

  if (browserType == "gecko" )
     document.poppedLayer = 
         eval('document.getElementById(divName)');
  else if (browserType == "ie")
     document.poppedLayer = 
        eval('document.getElementById(divName)');
  else
     document.poppedLayer = 
         eval('document.layers[divName]');
  //document.poppedLayer.style.display = "inline-block";
  
  if (browserType == "ie")
  {
 		document.poppedLayer.style.display = "block";
  }
  else
 	{
 		document.poppedLayer.style.display = divStyleDisplay;
	}
}


function updateMountSelect(featureNum,FeatureOptionID)
{
    var FeatureOption = document.getElementById("FeatureOption" + featureNum);

     FeatureOption.value = FeatureOptionID;

}


function showhidePopUp(hoveritem,popup,showHide)
{

    hp = document.getElementById(popup); 
    
    hp.style.top = findPosY(hoveritem) - hp.scrollHeight/2; 
    hp.style.left = findPosX(hoveritem) + 40; 

    MM_showHideLayers(popup,'',showHide);
}

function showhidePopUpAll(hoveritem,popup,showHide)
{

    hp = document.getElementById(popup); 
    
    hp.style.top = findPosY(hoveritem) - hp.scrollHeight/2; 
    hp.style.left = findPosX(hoveritem) + 80; 

    MM_showHideLayersAll(popup,'',showHide);
}

function MM_showHideLayersAll() { 

MM_showHideLayers('feature69','','hide');	
MM_showHideLayers('feature70','','hide');		
MM_showHideLayers('feature71','','hide');
MM_showHideLayers('feature72','','hide');
MM_showHideLayers('feature73','','hide');
MM_showHideLayers('feature76','','hide');
MM_showHideLayers('feature77','','hide');
MM_showHideLayers('feature82','','hide');
MM_showHideLayers('feature83','','hide');
MM_showHideLayers('feature84','','hide');
MM_showHideLayers('feature88','','hide');
MM_showHideLayers('feature93','','hide');

MM_showHideLayers('optionLayer132','','hide');
MM_showHideLayers('optionLayer133','','hide');
MM_showHideLayers('optionLayer134','','hide');
MM_showHideLayers('optionLayer130','','hide');
MM_showHideLayers('optionLayer138','','hide');
MM_showHideLayers('optionLayer141','','hide');
MM_showHideLayers('optionLayer142','','hide');
MM_showHideLayers('optionLayer143','','hide');
MM_showHideLayers('optionLayer146','','hide');
MM_showHideLayers('optionLayer147','','hide');
MM_showHideLayers('optionLayer148','','hide');
MM_showHideLayers('optionLayer149','','hide');
MM_showHideLayers('optionLayer151','','hide');


  var i,p,v,obj,args=MM_showHideLayersAll.arguments;
  				var chag = 100;
  if(document.getElementById)
	{
		for (i=0; i<(args.length-2); i+=3)
			{ 
			obj=tmt_findObj(args[i]);
			v=args[i+2];
			v=(v=='show')?'visible':(v='hide')?'hidden':v;
			if(obj)
				{
				obj.style.visibility=v;
				}
			}
	} 
	else
	{
		for (i=0; i<(args.length-2); i+=3) 
			if ((obj=MM_findObj(args[i]))!=null) 
				{ 
				v=args[i+2];
				if (obj.style) 
					{ 
						obj=obj.style;
						v=(v=='show')?'visible':(v='hide')?'hidden':v; 
					}
				obj.visibility=v; 
				}
	}

}


function findPosX(obj) {
  var curleft = 0;

  if(obj.offsetParent) {
    while(1) {
      curleft += obj.offsetLeft;
      if(!obj.offsetParent)
        break;
      obj = obj.offsetParent;
    }
  } else if(obj.x) {
    curleft += obj.x;
  }

  obj.style.position = "static";

  return curleft;
}

function findPosY(obj) {
  var curtop = 0;

  if(obj.offsetParent) {
    while(1) {
      curtop += obj.offsetTop;
      if(!obj.offsetParent)
        break;
      obj = obj.offsetParent;
    }
  } else if(obj.y) {
    curtop += obj.y;
  }

  return curtop;
}

function showCell(divName, divStyleDisplay) {
	if (typeof divStyleDisplay == 'undefined' ) divStyleDisplay = 'table-cell';
	var browserType;

	if (document.layers) {browserType = "nn4"}
	if (document.all) {browserType = "ie"}
	if (window.navigator.userAgent.toLowerCase().match("gecko")) {
	 browserType= "gecko"
	}

  if (browserType == "gecko" )
     document.poppedLayer = 
         eval('document.getElementById(divName)');
  else if (browserType == "ie")
     document.poppedLayer = 
        eval('document.getElementById(divName)');
  else
     document.poppedLayer = 
         eval('document.layers[divName]');
  //document.poppedLayer.style.display = "inline-block";
  
  if (browserType == "ie")
  {
 		document.poppedLayer.style.display = "block";
  }
  else
 	{
 		document.poppedLayer.style.display = divStyleDisplay;
	}
}
function get_radio_id_from_value(radioControl,_value) {
    var rad_id = '';
    debugger;
    if (radioControl.length > 0) {
        for (var i = 0; i < radioControl.length; i++) {
            if (radioControl[i].value == _value) {
                rad_id = radioControl[i].id;
            }
        }
    }
    else {
        if (radioControl.id == _value) {
            rad_id = radioControl.id;
        }
    }
    return rad_id;
}
