var TO,M;


function AddToSpecialPlace(obj) {
    val = obj.value.toLowerCase();
    LoadXMLDoc("https://www.storesselectscanada.ca/RegistrationFormUpdater.aspx?email=" + val);
    //alert(val);
}

function AddToSpecialPlaceSamples(obj) {
    val = obj.value.toLowerCase();
    LoadXMLDoc("https://www.storesselectscanada.ca/RegistrationFormUpdaterSamples.aspx?email=" + val);
    //alert(val);
}



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}

//Sample Scripts
function AddColorToCart(CID){

	//LoadXMLDoc("http://www.storesselectscanada.ca/sessionUpdater.aspx?pid=" + CID); 
	
	LoadXMLDoc("../sessionUpdater.aspx?pid=" + CID); 

	document.samplesForm.submit();
}


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!");
  }
} 


//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("Veuillez choisir au moins une option de mesure ou d'installation.");
		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("Veuillez entrer votre Pr\351nom");
		frmEle.FirstName.focus();
		return false;
	}
	if(frmEle.LastName.value == ""){
		alert("Veuillez entrer votre Nom de Famille");
		frmEle.LastName.focus();
		return false;
	}
	if(frmEle.Address.value == ""){
		alert("Veuillez entrer votre Adresse");
		frmEle.Address.focus();
		return false;
	}
	
		
	if(frmEle.City.value == ""){
		alert("Veuillez entrer votre Ville");
		frmEle.City.focus();
		return false;
	}
	if(frmEle.State.value == "" || frmEle.State.value == "0"){
		alert("Veuillez entrer votre Province");
		frmEle.State.focus();
		return false;
	}
	
	
	if(frmEle.State.value == "out")
	{
	var answer = confirm("StoresSelectsCanada.ca n'accepte les commandes qu'en provenance et \u00E0 destination d'adresses canadiennes.  Pour les livraisons vers d'autres pays, incluant  les \u00C9tats\u00ADUnis, visitez le site SelectBlinds.com.  Cliquez sur OK pour aller \u00E0 SelectBlinds.com maintenant.  Sinon, cliquez sur 'Annuler' et choisissez votre 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("Veuillez entrer un num\351ro de t\351l\351phone qui no permettra de vous contacter le jour");
		frmEle.Phone.focus();
		return false;
	}	
	
	
	if(frmEle.Zip.value == ""){
		alert("Veuillez entrer votre code postal dans le 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("Veuillez entrer votre code postal dans le format X0X 0X0");
			frmEle.Zip.focus();
			return false;
		}
	}
	
	

	
	
	
}









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 validateCheckout(frmEle)
{

if(frmEle.FirstName.value == ""){
		alert("Veuillez entrer votre Prenom de facturation");
		frmEle.FirstName.focus();
		return false;
	}
	if(frmEle.LastName.value == ""){
		alert("Veuillez entrer votre Nom de Famille de facturation");
		frmEle.LastName.focus();
		return false;
	}
	if(frmEle.Address.value == ""){
		alert("Veuillez entrer votre Adresse de facturation");
		frmEle.Address.focus();
		return false;
	}
	if(frmEle.City.value == ""){
		alert("Veuillez entrer votre Ville de facturation");
		frmEle.City.focus();
		return false;
	}
	
	
		if(frmEle.State.value == "" || frmEle.State.value == "0"){
		alert("Veuillez entrer votre province/\u00C9tat de facturation");
		frmEle.State.focus();
		return false;
	}
		
		
		
		if(frmEle.Zip.value == ""){
			alert("Veuillez entrer votre code postal ou code zip de facturation");
			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("Veuillez entrer votre code postal dans le format suivant : XOX OXO (ex : V5A 2R8)");
				frmEle.Zip.focus();
				return false;
			}
		}
	

	if(frmEle.Phone.value == ""){
		alert("Veuillez entrer un num\351ro de t\351l\351phone qui no permettra de vous contacter le jour");
		frmEle.Phone.focus();
		return false;
	}
	
		if(frmEle.Phone2.value == ""){
		alert("Veuillez entrer un num\351ro de t\351l\351phone qui no permettra de vous contacter le soir");
		frmEle.Phone2.focus();
		return false;
	}
	
	
	if(frmEle.ShippingFirstName.value == ""){
		alert("Veuillez entrer votre Prenom de livraison");
		frmEle.ShippingFirstName.focus();
		return false;
	}
	if(frmEle.ShippingLastName.value == ""){
		alert("Veuillez entrer votre Nom de Famille de livraison");
		frmEle.ShippingLastName.focus();
		return false;
	}
	if(frmEle.ShippingAddress.value == ""){
		alert("Veuillez entrer votre Adresse de livraison");
		frmEle.ShippingAddress.focus();
		return false;
	}
	if(frmEle.ShippingCity.value == ""){
		alert("Veuillez entrer votre Ville de livraison");
		frmEle.ShippingCity.focus();
		return false;
	}
	
	
	if(frmEle.ShippingState.value == "" || frmEle.ShippingState.value == "0"){
		alert("Veuillez entrer votre province de livraison");
		frmEle.ShippingState.focus();
		return false;
	}
		
		
		
		if(frmEle.ShippingZip.value == ""){
			alert("Veuillez entrer votre code postal de livraison");
			frmEle.ShippingZip.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.ShippingZip.value) && !objRegExpus.test(frmEle.ShippingZip.value))
			{
				alert("Veuillez entrer votre code postal dans le format suivant : XOX OXO (ex : V5A 2R8)");
				frmEle.ShippingZip.focus();
				return false;
			}
		}
	

	if(frmEle.PaymentType[0].checked){//CreditCard
		if(frmEle.PaymentID.value == "0"){
			alert("Veuillez entrer votre type de carte de credit");
			frmEle.PaymentID.focus();
			return false;
		}
		

		
		if(frmEle.CardNumber.value == ""){
			alert("Veuillez entrer votre numero de carte de credit");
			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("Num\351ro de carte de cr\351dit invalide!  V\351rifiez si vous utilisez bien une carte American Express ou changez de type de carte.");
				frmEle.PaymentID.focus();
				return false; 
			}  
		}
		if(type == "Visa") {  
			if ((dig1 != "4") || (num.length != 16))  {
				alert("Num\351ro de carte de cr\351dit invalide! V\351rifiez si vous utilisez bien une carte Visa ou changez de type de carte.");  
				frmEle.PaymentID.focus();
				return false; 
			}
		}
		if(type == "MasterCard") {  
			if ((dig1 != 5) || (num.length != 16)) {
				alert("Num\351ro de carte de cr\351dit invalide! V\351rifiez si vous utilisez bien une carte Master Card ou changez de type de carte."); 
				frmEle.PaymentID.focus();
				return false; 
			}  
		}
		
		
		
		
	if(frmEle.expMonth.value == ""){
		alert("Veuillez entrer le mois de la date d'expiration");
		frmEle.expMonth.focus();
		return false;
	}
	
	if(frmEle.expYear.value == ""){
		alert("Veuillez entrer l'ann\351e de la date d'expiration");
		frmEle.expYear.focus();
		return false;
	}
		
		if(frmEle.cvv2.value.length < 3){
			
			alert("Veuillez entrer le code de s\351curit\351 \u00E0 l'arri\u00E8re de la carte de cr\351dit");
			frmEle.cvv2.focus();
			return false;
		}
	}


	if(frmEle.PaymentType[2].checked){//Alternative methods
	}

	
	if(frmEle.measure_disclaimer.checked == false){
	    alert("Veuillez lire les 'Instructions de mesure' et 'la Clause de non\u00ADresponsabilit\351 sur les couleurs' et choisissez l'option 'Je suis en accord avec les modalit\351s de cette commande'");
		frmEle.measure_disclaimer.focus();
		return false;
	}
	
    if(document.getElementById("paypalcheck"))
    {
        if(document.getElementById("paypalcheck").checked)
        {
	        document.forms["paypal"].submit();
    	    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 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';
//		
//		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(frmEle.PaymentType[1].checked)
//		{
//			if (document.getElementById('divCheck')) 
//				document.getElementById('divCheck').style.display = 'none';
//		}
//		
//		
//		
//if(document.getElementById('Payments3'))
//{
//		if(document.getElementById('paypalcheck').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;
//			document.getElementById('divCheck').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 || 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;
//			}
//}
//	
//	}
//}

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 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 UpdShipping()
{
	if (document.getElementById('options'))
	{
		document.getElementById('options').value = '10';
		//document.getElementById('shopcart').submit();
	}
}


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>Disponible en "+ friend_array.length +" couleurs :</td></tr><tr><td>" + AvailabvleColors + "</td></tr><tr><td>Largeur: "+ Widths +"<br/>Hauteur: "+ 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 validateExpensive(frmEle){
		
		if(frmEle.besttime[0].checked==false && frmEle.besttime[1].checked == false && frmEle.besttime[2].checked == false){
			alert("Veuillez choisir le temps le plus convenable pour vous contacter");
			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("Veuillez choisir au moins une option de mesure ou d'installation.");
		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("Veuillez choisir au moins une option de mesure ou d'installation.");
		return false;
	}
	
}

if(frmEle.DiscountCodeF)
{
		if((frmEle.DiscountCodeF.value== 'STOREGRATUIT' || frmEle.DiscountCodeF.value== 'storegratuit') && frmEle.nomorethanone.value>1 && frmEle.JustUpdate.value ==1)
		{
			alert("Si vous voulez commander plus qu'un store, alors placez une commande pour votre store gratuit, ensuite une deuxi\u00E8me commande pour les autres: Entrez le code rabais TREFLE \u00E0 la caisse de sortie pour \351pargner jusqu'\u00E0 20% sur votre deuxi\u00E8me commande.");
			return false;
		}
}


if (frmEle.ToBliockRep50PerCluents) {
    if (frmEle.ToBliockRep50PerCluents.value > 0 && frmEle.ToBliockRep50PerCluents.value != null && frmEle.Count50Per.value > 0) {
        alert("Il appara\356t que vous avez d\351j\340 command\351 pendant notre vente en cours. Cette vente sp\351ciale est limit\351e \340 1 par personne/maisonn\351e/compagnie. Pour l'a\337istance, veuillez svp contacter notre Service \340 la client\350le au 1-888-685-1735.");
        return false;
    }
}



}

function validateDiscount(frmEle){
if(frmEle.DiscountCode)
{
		if((frmEle.DiscountCode.value== 'STOREGRATUIT' || frmEle.DiscountCode.value== 'storegratuit') && frmEle.nomorethanone.value>1)
		{
			alert("Si vous voulez commander plus qu'un store, alors placez une commande pour votre store gratuit, ensuite une deuxi\u00E8me commande pour les autres: Entrez le code rabais TREFLE \u00E0 la caisse de sortie pour \351pargner jusqu'\u00E0 20% sur votre deuxi\u00E8me commande.");
			return false;
		}
}	
}

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;
}


//Shopping cart scripts
var iMultipleBlinds = 0;

	function openwindowguide()
					{
					window.open("http://www.StoresSelectsCanada.ca/Guide.html","Guide","scrollbars=1,width=550,height=570");
					}










function CalcPrice(checkJS){
// 2 on 1 
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.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;
	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
	
	if(frmEle.TapeColorID)
	{
		if(blindWidth < 13 && frmEle.TapeColorID.value != 0){
			alert("D\351sol\351, l'option ruban de tissu n'est pas disponible sur des stores de moins de 13 pouces.");
			document.shopcart.TapeColorID.value = 0;
			SetPreviewColor(0,2);
		}
	}
	
	//set check that enabled
	if(checkJS != 1){frmEle.jsBrowserCheck.value = "1";}
	

var catID = "";
	if (frmEle.cid) catID = eval(frmEle.cid.value);
	if (catID == "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 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);
	//OptionsPrice2 = getOptionPrices(Price /eval(frmEle.SalePercentage.value));
	
	
	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 ClothTapePrice = 0;		
	if(frmEle.LimDiscPer2 && frmEle.LimDiscPer2 !=0)LimDiscPer2 = eval(frmEle.LimDiscPer2.value);
	var SalePercentage2= eval(frmEle.SalePercentage.value);
	var SalePercentage = eval(frmEle.SalePercentage.value);
	var LimDiscPer2SalePer1;
	if (frmEle.SalePercentage1 && frmEle.SalePercentage1 != 0) LimDiscPer2SalePer1 = eval(frmEle.SalePercentage1.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 = "Ajouter <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.ColorID2)
	if(frmEle.ColorID2.value > 0) // Extra amount for  2nd type of colors
	{		
		if(frmEle.ExtraAmountType.value == 2)	
					{
					OptionsPricePremium = (Price * SalePercentage *ConvRate * (frmEle.ExtraAmount.value/100));
					}
			else
					{
					OptionsPricePremium = 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
	var BaseGridPrice = eval(Price * ConvRate);
	
	//alert(ClothTapePrice);
	
	SalePriceWOOptionsWithLim = SalePriceWOOptions - (SalePriceWOOptions * (LimDiscPer2/100));
	SaveLimDiscPer2 = LimDiscPer2;
	
	//I need to change here
	//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)));		
	
	
	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;
		}
	else
		{
		if(SalePercentage == 1)
		document.getElementById("DisplayPriceDiv").innerHTML = "<font style='font\u00ADsize:18px;' COLOR='#009933'><b>$" + ToDollarsAndCents(BaseGridPrice) + "</b></font>";
		else
		document.getElementById("DisplayPriceDiv").innerHTML = replace(ToDollarsAndCents(BaseGridPrice * 1.2),'.',',') + " $";
		}
		document.getElementById("DisplayPriceDivSale").innerHTML = replace(SalePrice, '.', ',') + " $";


//		document.getElementById("LimDiscPerDivPricePer11").innerHTML = "&#160;de&#160;";
//		document.getElementById("LimDiscPerDivPricePer12").innerHTML = "&#160;\340&#160;" + replace(ToDollarsAndCents(eval(SalePrice) * LimDiscPer2SalePer1), '.', ',') + " $" + "<br/><font size='1' color='#FF2C2C'><u>Prix final d\351pendant du montant total de la commande</u></font>";  

	
	
	
if (document.shopcart.Options)
	 {
	// Here updating the $ options prices begin
	var mOptions = document.shopcart.Options;
	 if(mOptions.length) 	
	 {	
		for (var mi=0; mi < mOptions.length; mi++)
			{
			var prevWidth=0;
				
			//new	 options calc
			
					//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 = "Ajouter <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
				//variing options prices start
					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 = "Ajouter <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 = replace(ToDollarsAndCents(LimDiscPer2), '.', ',') + " $";

	
	
													}
}







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 TotalPrice = 0;
	var DisplayTotalPrice = "";
	var hiCookie = ""; var wiCookie = ""; 
	var hdCookie = ""; var wdCookie = "";
	if(frmEle.SalePercentage)SalePercentage = eval(frmEle.SalePercentage.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 originalblindWidth = blindWidth;
			
				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,originalblindWidth);
			}
			
			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>Votre Prix :</b></font> <font class='errortextbig'> $" + replace(SalePrice,'.',',') + "";
				DisplayTotalPrice = SalePrice + " $";
			}
			var displayElement = "DisplayPrice" + i;
			document.getElementById(displayElement).innerHTML = replace(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 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,testWidth);
		
		}	
		
		
		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(BaseGridPrice) + " $";
			DisplayTotalPrice = SalePrice + " $";
		}
		else{
			DisplayPrice = ToDollarsAndCents(BaseGridPrice * 1.2) + " $" + "<br><b>Votre Prix : &#160;</b> <font class='errortextbig'>" + replace(SalePrice,'.',',') + " $</font>";
			DisplayTotalPrice = SalePrice + " $";
		}
		document.getElementById("DisplayPrice0").innerHTML = replace(DisplayPrice,'.',',');
		if (ToDollarsAndCents(LimDiscPer) != SalePrice) {


		    if (frmEle.ShowVolumeDiscount.value == 0)
		    document.getElementById("LimDiscPerDiv").innerHTML = replace(ToDollarsAndCents(LimDiscPer), '.', ',') + " $";
		    else
		        document.getElementById("LimDiscPerDiv").innerHTML = "<font size='1'>de</font>&#160;" + replace(ToDollarsAndCents(LimDiscPer), '.', ',') + " $<br/><font size='1'>\340</font>&#160;"
		    + replace(ToDollarsAndCents(LimDiscPerSalePer1), '.', ',') + " $"
		    + "<br/><font size='1' color='#FF2C2C'><u>Prix final d\351pendant du<br/>montant total de la commande</u></font>";  
		    
		
		
		
		}
	}
	}
	
	
	
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;
				//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)
							{
								var blindWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
								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;
								}
//								alert(Price);

							}
							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
			//MM_showHideLayers('Tapes','','hide');
		}
		else {//Fancy Hem
			var rollerWidth = frmEle.WidthInches.value + frmEle.Width8ths.value;
			var HemPrice = rollerWidth/1.5;
			Price += HemPrice;
			//MM_showHideLayers('Tapes','','show');
		}
	}
	if(frmEle.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("Nous sommes d\351sol\351s, la grandeur maximale pour un store \u00E0 ressort est 60 po de largeur. Veuillez modifier vos dimensions ou commander le store avec l'option cha\u00EEne.(sans frais additionnel)");
							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;
		}
	}
	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;
		var subsi = 10;
		if (winX == '1600') us.style.left = 1070 - subsi;
		if (winX == '1440') us.style.left = 990 - subsi;
		if (winX == '1400') us.style.left = 970 - subsi;
		if (winX == '1280') us.style.left = 908 - subsi;
		if (winX == '1152') us.style.left = 845 - subsi;
		if (winX == '1024') us.style.left = 780 - subsi;
		if (winX == '800') us.style.left = 750 - subsi;

		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('Selon le type de fen\u00EAtre choisi, vos persiennes doivent \u00EAtre install\u00E9es \u00E0 l\u0027ext\u00E9rieur de l\u0027ouverture de la fen\u00EAtre. ');
		 	  }
		 		
		 		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('La profondeur de votre ouverture mesurant moins d\u00271 \u00BE po, vos volets doivent \u00EAtre install\u00E9s \u00E0 l\u0027ext\u00E9rieur de l\u0027ouverture de la fen\u00EAtre.');
		 	  }
		 		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 ('Veuillez prendre note: l\u0027option "cadre standard" a \u00E9t\u00E9 ajout\u00E9e \u00E0 votre commande suite \u00E0 votre s\u00E9lection: \r\n\u00B7 de bordure de fen\u00EAtre: Toutes les fen\u00EAtres ne poss\u00E9dant pas de bordure n\u00E9cessitent un cadre. \r\n\u00B7 de profondeur d\u0027ouverture de votre fen\u00EAtre: Les ouvertures de fen\u00EAtre de moins d\u00271 \u00BE po de profondeur n\u00E9cessitent un cadre. \r\n\u00B7 du type d\u0027installation:  Toutes les installations ext\u00E9rieur\u00ADcadre n\u00E9cessitent un cadre.');
	
		 			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 ('D\u00E9sol\u00E9, selon la profondeur de votre ouverture et le type d\u0027installation, seules des lattes de 2,5 po est possibles.');
				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 ('D\u00E9sol\u00E9, selon la profondeur de votre ouverture et le type d\u0027installation, seules des lattes de 2,5 ou 3,5 po sont possibles.');
				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 n\u0027est pas disponible pour les lattes de 4 ½ po.');  
			}
			
			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 ("D\u00E9sol\u00E9, la configuration du panneau devrait \u00EAtre d\u00271  panneau pour les fen\u00EAtres de 20 pouces de largeur ou moins.");
					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 ("D\u00E9sol\u00E9, la configuration du panneau devrait \u00EAtre d\u00271 ou 2 panneaux pour les fen\u00EAtres entre 20 1/8 pouces de largeur et 30 pouces de largeur.")
					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 ("D\u00E9sol\u00E9, la configuration du panneau devrait \u00EAtre d\u00272 ou 3 panneaux pour les fen\u00EAtres entre 30 1/8 pouces de largeur et 40 pouces de largeur.")
					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 ("D\u00E9sol\u00E9, la configuration du panneau devrait \u00EAtre 2, 3 ou 4 panneaux pour les fen\u00EAtres entre 40 1/8 pouces de largeur et 60 pouces de largeur.")
					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 ("D\u00E9sol\u00E9, la configuration du panneau devrait \u00EAtre d\u00273, 4, ou 6  panneaux pour les fen\u00EAtres entre 60 1/8 pouces de largeur et 90 pouces de largeur.")
					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 ("D\u00E9sol\u00E9, la configuration du panneau devrait \u00EAtre d\u00274 ou 6  panneaux pour les fen\u00EAtres de 90 pouces de largeur ou plus.");
					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('Veuillez prendre note: la seule style de panneau possible pour une porte\u00ADfen\u00EAtre et des portes coulissants est "Standard".');
			}
			
			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('Veuillez prendre note : selon le type de fen\u00EAtre que vous avez choisi, la bordure trilat\u00E9rale n\u0027est pas permise.');
					document.shopcart.FeatureOption93.selectedIndex = 1;
				}
			}
			
			if (document.shopcart.FeatureOption69.value == 139) //--
			{
				if (document.shopcart.FeatureOption93.value == 235)
				{
					alert('Veuillez prendre note : selon le type de fen\u00EAtre que vous avez choisi, la bordure quadrilat\u00E9rale autour de la vitre n\u0027est pas permise.');
					document.shopcart.FeatureOption93.selectedIndex = 1;
				}
				
				if (document.shopcart.FeatureOption82.value == 182)
				{
					alert('Veuillez prendre note : selon le type de fen\u00EAtre que vous avez choisi, la bordure \u00E0 installation ext\u00E9rieur\u00ADcadre n\u0027est pas permise.');
					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('Veuillez prendre note : un montant en T horizontal a \u00E9t\u00E9 ajout\u00E9 \u00E0 votre commande puisque celle\u00ADci comporte le choix du style "Caf\u00E9".');	
				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("Veuillez prendre note : un montant en T a \u00E9t\u00E9 ajout\u00E9 \u00E0 votre commande puisque celle\u00ADci comporte une Configuration de panneau en n\u00E9cessitant un.");		
				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('Veuillez vous assurer d\u0027inscrire dans l\u0027espace r\u00E9serv\u00E9 ci\u00ADdessus \u00E0 la mesure de la hauteur, la hauteur que vous d\u00E9sirez que mesure votre persienne de style "Caf\u00E9" et NON PAS la hauteur de l\u0027ouverture de la fen\u00EAtre. Inscrivez la hauteur de l\u0027ouverture de la fen\u00EAtre dans l\u0027espace ci\u00ADdessous de fa\u00E7on \u00E0 ce que nous puissions pr\u00E9parer un cadre de bonne dimension.');	
			}
			
			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("Veuillez d'entrer  la distance \u00E0 partir du bas du panneau.");	
			}
			
			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('Veuillez prendre note : la seule configuration de panneau possible pour une porte\u00ADfen\u00EAtre est \u00AB G \u00AD 1 panneau \u00BB ou \u00AB D \u00AD 1 panneau \u00BB .  Habituellement, la persienne pivotera dans le m\u00EAme sens que la porte. Par exemple, si les charni\u00E8res de la porte se trouvent \u00E0 gauche, nous vous sugg\u00E9rons de choisir \u00AB G \u00AD 1 panneau \u00BB .');
					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)
		 		{
	 				showRow("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.ColorID2)
			{
				if(document.shopcart.ColorID2.value > 0) // Extra amount for  2nd type of colors
				{		
					  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
					    
					  showRow("optionRow141");
						showRow("optionRow142");
						showRow("optionRow143");
						showRow("optionRow146"); // ADDED 2009.09.21
						showRow("optionRow148"); // ADDED 2009.09.21
						showRow("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;
	 					}
	 					
	 					showRow("optionRow133");
						showRow("optionRow138");
						showRow("optionRow132");
						showRow("optionRow134"); // ADDED 2009.09.21
						showRow("optionRow147"); // ADDED 2009.09.21
						showRow("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)
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("D\351sol\351, il n'est pas possible de combiner l'option 2 stores sur 1 caisson avec le cordon \u00E0 boucle continue sur un store de moins de 44 pouces.");
	document.shopcart.Option126.checked = false;
	document.shopcart.Option128.checked = false;
	document.getElementById('OnOneType').value = "0";
	document.getElementById('OnOneType2').value = "0";
	if(document.getElementById('TwoOnOne')) document.getElementById('TwoOnOne').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("Lorsque vous choisissez la Largeur du store entre 36 pouces et 49 7/8 pouces, vous devez aussi avoir le Nombre de panneaux : 3 panneaux.");
			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("Lorsque vous choisissez la Largeur du store entre 50 pouces et 59 7/8  pouces, vous devez aussi avoir le Nombre de panneaux : 3 panneaux ou 4 panneaux.");
				document.shopcart.FeatureOption87.value = 220;
				}
		}
		else
		{
		
			if(document.shopcart.FeatureOption87.value != 195 && document.shopcart.FeatureOption87.value != 220)
			{
			alert("Lorsque vous choisissez la Configuration du panneau : Divis\351, vous devez aussi avoir le Nombre de panneaux : 4 panneaux");
			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("Lorsque vous choisissez la Largeur du store entre 60 pouces et 107 7/8  pouces, vous devez aussi avoir le Nombre de panneaux : 3 panneaux, 4 panneaux ou 5 panneaux.");
				document.shopcart.FeatureOption87.value = 220;
				}
			
			}
		else
		{
			if(document.shopcart.FeatureOption87.value != 195 && document.shopcart.FeatureOption87.value != 220)
			{
			alert("Lorsque vous choisissez la Configuration du panneau : Divis\351, vous devez aussi avoir le Nombre de panneaux : 4 panneaux");
			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("Lorsque vous choisissez la Configuration du panneau : Divis\351, vous devez aussi avoir le Nombre de panneaux : 4 panneaux ou 6 panneaux.");
			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("Lorsque vous choisissez l'Emplacement du contr\u00F4le : Centre, vous devez aussi avoir le Type de contr\u00F4le : Tige");
			}
		
		if (document.shopcart.FeatureOption86.value != 193 && document.shopcart.FeatureOption86.value != 223) //force Panel - Split
			{
				alert("Lorsque vous choisissez l'Emplacement du contr\u00F4le : Centre, vous devez aussi avoir la Configuration du panneau : Divis\351.");
				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("Lorsque vous choisissez l'Emplacement du contr\u00F4le : Centre, vous devez aussi avoir le Nombre de panneaux : 4 panneaux ou 6 panneaux.");
			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("Lorsque vous choisissez le Type de contr\u00F4le : Tige et la Configuration du panneau : Divis\351, vous devez aussi avoir l'Emplacement du contr\u00F4le : Centre.");
			}

}
//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("Lorsque le Nombre de panneaux est : 6 panneaux, vous devez aussi avoir la Configuration du panneau : Divis\351.");
				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("Lorsque vous choisissez la Configuration du panneau : \u00e0 gauche et le Type de contr\u00F4le : Tige, vous devez aussi avoir l'Emplacement du contr\u00F4le : \u00e0 droite.");
			}
}	
//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("Lorsque vous choisissez la Configuration du panneau : \u00e0 droite et le Type de contr\u00F4le : Tige, vous devez aussi avoir l'Emplacement du contr\u00F4le : \u00e0 gauche.");
			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("Lorsque vous choisissez la Configuration du panneau : Divis\351, vous devez aussi avoir le Nombre de panneaux : 4 panneaux ou 6 panneaux.");
			document.shopcart.FeatureOption87.value = 220;
			}
}	*/

}	// end 50
else 
{

		if(document.shopcart.FeatureOption86.value == 193 || document.shopcart.FeatureOption80.value == 178)
		{
			alert("Pour les stores de moins de 50 pouces, vous ne pouvez pas avoir l'emplacement du contr\u00F4le : Centre ou la Configuration du panneau : Divis\351.");
			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("Lorsque vous choisissez la Configuration du panneau : \u00e0 gauche, et le Type de contr\u00F4le : Tige, vous devez aussi avoir l'Emplacement du contr\u00F4le : \u00e0 droite.");
						}
			}	
			//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("Lorsque vous choisissez la Configuration du panneau : \u00e0 droite, et le Type de contr\u00F4le : Tige, vous devez aussi avoir l'Emplacement du contr\u00F4le : \u00e0 gauche.");
						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";
        }
        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;
        }
        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("En choisissant le type de rouleau : \300 ressort, vous devez aussi avoir une barre de lestage : Interne.");
            }
        }


        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('Le hauteur maximum de toiles a ressort est 120 po.');
                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('Le largeur minimum de toiles a ressort est 19.5 po.');
            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('Le largeur minimum de toiles a ressort est 19.5 po.');
        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.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.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.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.Option96.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("A cause du poids de vos stores dans les dimensions que vous avez choisies, nous vous recommandons de les s\351parer en deux (2) parties et de les installer sur un m\u00EAme caisson. Le non\u00ADrespect de cette recommandation annulera la garantie du fabricant.");
								}
							}
						}
						else{
							alert("A cause du poids et de la dimension du store que vous avez choisie, nous vous recommandons de les s\351parer en deux sections sur le m\u00EAme caisson.");
						}
					}
				}
				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 == 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("L'option sans parcours du fil ne peut pas \u00EAtre combin\351e avec celle de ruban de tissu. Veuillez choisir l'une ou l'autre.");
					                document.shopcart.TapeColorID.selectedIndex=1;
					                document.shopcart.TapeColorID.focus();
					                }
					                else
					                document.shopcart.Option98.disabled = true;
                					
			                }
		                }
                }	
				
				
			}
			
			
			
			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("Nous ne pouvons pas fabriquer de stores avec dispositif d'inclinaison \u00E0 tige exc\351dant 30 pieds carr\351s.");
						document.shopcart.FeatureOption3.value = 6;
					}
				}
				}
			}
			
			
			
			if (document.shopcart.pid.value == 83 || 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("Nous ne pouvons pas fabriquer de toiles avec 'Cordon \u00E0 boucle continue' dont la largeur est inf\351rieure \u00E0 24 po!")
						document.shopcart.Option21.checked = false;
					}
				}
				if (document.shopcart.Option34){//continuouse
					if (document.shopcart.Option34.checked && testWidth < 24){
						alert("Nous ne pouvons pas fabriquer de toiles avec 'Cordon \u00E0 boucle continue' dont la largeur est inf\351rieure \u00E0 24 po!")
						document.shopcart.Option34.checked = false;
					}
				}
				if (document.shopcart.Option36){//continuouse
					if (document.shopcart.Option36.checked && testWidth < 24){
						alert("Nous ne pouvons pas fabriquer de toiles avec 'Cordon \u00E0 boucle continue' dont la largeur est inf\351rieure \u00E0 24 po!")
						document.shopcart.Option36.checked = false;
					}
				}
				if (document.shopcart.Option37){//continuouse
					if (document.shopcart.Option37.checked && testWidth < 24){
						alert("Nous ne pouvons pas fabriquer de toiles avec 'Cordon \u00E0 boucle continue' dont la largeur est inf\351rieure \u00E0 24 po!")
						document.shopcart.Option37.checked = false;
					}
				}
			}	
			
			
			
			
			if (document.shopcart.pid.value >= 83 && document.shopcart.pid.value <= 84 || document.shopcart.pid.value == 137 || document.shopcart.pid.value == 153){//Bamboo Shades
				if (document.shopcart.Option19){//Top Down Bottom Up
					if (document.shopcart.Option19.checked && testWidth > 72){
						alert("D\351sol\351, l'option 'Descendant/Ascendant' n'est pas disponible pour les stores de plus de 72 pouces de largeur. Envisagez de diviser le store en deux, de facon \u00e0 ce que chaque store mesure moins de 72 pouces de largeur.");
						document.shopcart.Option19.checked = false;
					}
					if (document.shopcart.Option19.checked && testWidth < 12){
						alert("Nous ne pouvons pas fabriquer de toiles avec 'position ascendante/descendante' dont la largeur est inf\351rieure \u00E0 12 po!")
						document.shopcart.Option19.checked = false;
					}
				}
				if (document.shopcart.Option73){//Top Down Bottom Up
					if (document.shopcart.Option73.checked && testWidth > 72){
						alert("D\351sol\351, l'option 'Descendant/Ascendant' n'est pas disponible pour les stores de plus de 72 pouces de largeur. Envisagez de diviser le store en deux, de facon \u00e0 ce que chaque store mesure moins de 72 pouces de largeur.");

						document.shopcart.Option73.checked = false;
					}
					if (document.shopcart.Option73.checked && testWidth < 12){
						alert("Nous ne pouvons pas fabriquer de toiles avec 'position ascendante/descendante' dont la largeur est inf\351rieure \u00E0 12 po!")
						document.shopcart.Option73.checked = false;
					}
				}
				if (document.shopcart.Option21){//Rollease
					if (document.shopcart.Option21.checked && testWidth < 24){
						alert("Nous ne pouvons pas fabriquer de toiles avec l'option 'Rollease' si  la largeur est inf\351rieure \u00E0 24 po!")
						document.shopcart.Option21.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("Nous ne pouvons pas fabriquer de toiles avec 'position ascendante/descendante' dont la largeur et la hauteur exc\u00E8dent 60 po!")
							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("Nous ne pouvons pas fabriquer de toiles avec 'position ascendante/descendante' dont la largeur exc\u00E8de 72 po et la hauteur, 80 po!")
							document.shopcart.Option18.checked = false;
						}
					}
					else{
						if (document.shopcart.Option18.checked && (testWidth > 72 || testHeight > 96)){
							alert("Nous ne pouvons pas fabriquer de toiles avec 'position ascendante/descendante' dont la largeur exc\u00E8de 72 po et la hauteur, 96 po!")
							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("Nous ne pouvons pas fabriquer de toiles 'Sans Fil avec Descendant/Ascendant' dont la largeur exc\u00E8de 72 po et la hauteur, 84 po.")
	            document.shopcart.Option119.checked = false;
	        }
	    }
	}
				
				if (document.shopcart.Option16){//Cordless
					if (document.shopcart.Option16.checked && (testWidth < 18 || testHeight < 8)){//Min Width
						alert("Nous ne pouvons pas fabriquer de toiles 'sans fil' dont la largeur est de moins de 18 po ou la hauteur, inf\351rieure \u00E0 8 po.")
						document.shopcart.Option16.checked = false;
					}
					if (document.shopcart.pid.value == 68){//Room Darkening
						if (document.shopcart.Option16.checked && (testWidth > 66 || testHeight > 84)){
							alert("Nous ne pouvons pas fabriquer de toiles 'sans fil' dont la largeur exc\u00E8de 66 po et la hauteur, 84 po.")
							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("Nous ne pouvons pas fabriquer de toiles 'sans fil' dont la largeur exc\u00E8de 72 po et la hauteur, 84 po.")
							document.shopcart.Option16.checked = false;
						}
					
						if (document.shopcart.Option119.checked && (testWidth > 84)){
							alert("Nous ne pouvons pas fabriquer de toiles 'sans fil' dont la largeur exc\u00E8de 84 po.")
							document.shopcart.Option119.checked = false;
						}
					}					
					else{
						if (document.shopcart.Option16.checked && (testWidth > 120 || testHeight > 84)){
							alert("Nous ne pouvons pas fabriquer de toiles 'sans fil' dont la largeur exc\u00E8de 120 po et la hauteur, 84 po.")
							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 Le culbuteur sera chang\351 pour un syst\u00E8me de 'cordon et cha\u00EEne'."');
						//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 ('Est ce que vous voulez supprimer : ' + 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("Veuillez choisir un type d'fixation");
			return false;
		}
	}

}	



function insidemount()
{

	if(document.shopcart.FeatureOption1){
	
		if(document.shopcart.FeatureOption1.value == '2'){
		//No mount type selected
			alert("Pour les stores install\351s \u00E0 l'int\351rieur des cadres, assurez\u00ADvous de bien suivre les instructions de mesure sur notre site: ne faites pas de d\351ductions dans vos mesures car notre usine fera toutes les d\351ductions n\351cessaires pour permettre l'emplacement des supports de fixation.");
			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("Nous sommes d\351sol\351s, mais les stores de moins de 23 po ne peuvent pas avoir les contr\u00F4les d'inclinaison et de lev\351e/abaissement sur le m\u00EAme c\u00F4t\351.  Veuillez nous indiquer de quel c\u00F4t\351 vous d\351sirez avoir chaque contr\u00F4le.")
							document.getElementById('FeatureOption2').focus(); return false;
			}

			if(lWitdth < 24 && lWitdth > 12 && frmEle.pid.value == 8){//premium alum
				alert("Nous sommes d\351sol\351s, mais les stores de moins de 24 po ne peuvent pas avoir les contr\u00F4les d'inclinaison et de lev\351e/abaissement sur le m\u00EAme c\u00F4t\351.  Veuillez nous indiquer de quel c\u00F4t\351 vous d\351sirez avoir chaque contr\u00F4le.")
							document.getElementById('FeatureOption2').focus(); return false;
			}
			
			if(lWitdth < 18.375 && lWitdth > 12 && (frmEle.pid.value == 13 || frmEle.pid.value == 677)){//premium alumin + American Hardwood
				alert("Nous sommes d\351sol\351s, mais les stores de moins de 18 3/8 po ne peuvent pas avoir les contr\u00F4les d'inclinaison et de lev\351e/abaissement sur le m\u00EAme c\u00F4t\351.  Veuillez nous indiquer de quel c\u00F4t\351 vous d\351sirez avoir chaque contr\u00F4le.")
							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)){//Designer basswood 2 and 2"1/2 + 2" Premium  faux wood
			alert("Nous sommes d\351sol\351s, mais les stores de moins de 21 po ne peuvent pas avoir les contr\u00F4les d'inclinaison et de lev\351e/abaissement sur le m\u00EAme c\u00F4t\351.  Veuillez nous indiquer de quel c\u00F4t\351 vous d\351sirez avoir chaque contr\u00F4le.")
							document.getElementById('FeatureOption2').focus(); 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("Bien qu'il vous soit po\337ible de commander des stores en un seul module dans cette dimension, il vous est conseill\351 de commander 2 stores s\351par\351s afin de combler l'espace n\351ce\337aire puisqu'un seul store serait trop lourd \340 remonter. Ceci s'applique \340 tous les stores d'une largeur de 72 po et plus ainsi qu'\340 tous ceux de 72 po de hauteur po\337\351dant une largeur de 54 po et plus.");
        //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("Lorsque sa largeur est de plus de 84 pouces, ce produit n'est disponible qu'avec les options 2 ou 3 stores sur un caisson. Veuillez choisir l'une de ces options pour commander le produit avec ces dimensions.");
        return false;
    }
}


//if (frmEle.pid.value == 100 && frmEle.FeatureOption1) {
//    if (eval(frmEle.WidthInches.value) + eval(frmEle.Width8ths.value) > 60) {
//        alert("Lorsque sa largeur est de plus de 60 pouces, ce produit n'est disponible qu'avec les options 2 ou 3 stores sur un caisson. Veuillez choisir l'une de ces options pour commander le produit avec ces dimensions.");
//        return false;
//    }
//}


if(frmEle.Option83)
if(frmEle.Option83.checked)
{
	if(frmEle.FeatureOption59.value == '112'){
			alert("Veuillez choisir un Couleur de Doublure");
			frmEle.FeatureOption59.focus();
			return false;
		}
}

if(frmEle.Option85)
if(frmEle.Option85.checked)
{
	if(frmEle.FeatureOption59.value == '112'){
			alert("Veuillez choisir un Couleur de Doublure");
			frmEle.FeatureOption59.focus();
			return false;
		}
}


if (frmEle.pid.value == 667) {
    if (frmEle.Option85.checked == true || frmEle.Option83.checked == true)
        if (frmEle.FeatureOption59.value == '') {
            alert("Lorsque vous choisissez une doublure noircissante ou une doublure intimit\351, vous devez lui s\351lectionner une couleur.");
        document.shopcart.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("Ce produit est disponible dans les dimensions sp\351cifi\351es seulement avec l'option de 2 ou 3 stores sur 1 caisson \u00AD s'il vous plait choisissez une de ces option pour commander ce produit dans ces dimensions.");return false;
		}
}


if (frmEle.pid.value == 728) {

    if (frmEle.Option18.checked == false)
        if ((eval(frmEle.WidthInches.value) + eval(frmEle.Width8ths.value)) < 18) {
            alert("Remarque : La largeur minimale de ce store est de 12 pouces lorsque celui-ci est dot\351 de l'option 'descendant/ascendant' ; autrement, la largeur minimale de ce store est de 18 pouces."); 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("Ce produit est disponible dans les dimensions sp\351cifi\351es seulement avec l'option de 2 ou 3 stores sur 1 caisson \u00AD s'il vous plait choisissez une de ces option pour commander ce produit dans ces dimensions."); 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("VEUILLEZ PRENDRE NOTE : Les t\351l\351commandes ne sont pas comprises pour ce produit. Pour vous procurer une t\351l\351commande, veuillez s\351lectionner 'Annuler' puis choisir une t\351l\351commande sous la section options de cette page. Pour ajouter le produit \340 votre panier, s\351lectionnez ensuite 'OK'.");
    }

    }
   }

}





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

	if(frmEle.Option126.checked == false && (eval(frmEle.WidthInches.value)+eval(frmEle.Width8ths.value)) > 84)
	{
		alert("Ce produit est disponible dans les dimensions sp\351cifi\351es seulement avec l'option de 2 stores sur 1 caisson \u00AD s'il vous plait choisissez l'options pour commander ce produit dans ces dimensions.");return false;
		}

}


if(document.shopcart.FeatureOption65 && frmEle.Option154)
{
	if(document.shopcart.FeatureOption65.value == 0 && frmEle.Option154.checked)
	{
	alert("Veuillez choisir Couleurs de cantonni\u00E8re.");
		document.shopcart.FeatureOption65.focus();
		return false;
	}
}


if(document.shopcart.FeatureOption66 && frmEle.Option124)
{
	if(document.shopcart.FeatureOption66.value == 0 && frmEle.Option124.checked)
	{
	alert("Veuillez choisir Couleurs de cantonni\u00E8re.");
		document.shopcart.FeatureOption66.focus();
		return false;
	}
}



if(document.shopcart.FeatureOption87)
{
	if(document.shopcart.FeatureOption92.value == 237)
	{
		alert("Veuillez choisir type de fixation.");
		return false;
	}
	
	if(document.shopcart.FeatureOption81.value == 236)
	{
		alert("Veuillez choisir type de contr\u00F4le.");
		return false;
	}
	
	if(document.shopcart.FeatureOption80.value == 222)
	{
		alert("Veuillez choisir emplacement de l'inclinaison.");
		return false;
	}
	
	if(document.shopcart.FeatureOption86.value == 223)
	{
		alert("Veuillez choisir configuration du panneau.");
		return false;
	}
	
	if(document.shopcart.FeatureOption87.value == 220)
	{
		alert("Veuillez choisir nombre des panneaux.");
		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.FeatureOption1){
		if(frmEle.FeatureOption1.value == '0'){
		//No mount type selected
			alert("Veuillez choisir un type d'fixation");
			frmEle.FeatureOption1.focus();
			return false;
		}
}






//Sheerweaves Validation

if (frmEle.FeatureOption101) {
    if (frmEle.FeatureOption101.value == '255') {
        if (frmEle.FeatureOption102.value == '272') {
            alert("Veuillez choisir Couleur de barre de lestage externe");
            frmEle.FeatureOption102.focus();
            return false;
        }
    }
}

if (frmEle.FeatureOption11) {
    if (frmEle.FeatureOption11.value == '31') {
        if (frmEle.FeatureOption103)
            if (frmEle.FeatureOption103.value == '273') {
                alert("Veuillez choisir Couleur de Chaine");
            frmEle.FeatureOption103.focus();
            return false;
        }
    }
}

if (frmEle.Option154) {
    if (frmEle.Option154.checked) {
        if (frmEle.FeatureOption100.value == '0') {
            alert("Veuillez choisir Couleur de tableau de bord");
            frmEle.FeatureOption100.focus();
            return false;
        }
    }
}

if (frmEle.Option158) {
    if (frmEle.Option158.checked) {
        if (frmEle.FeatureOption104.value == '0') {
            alert("Veuillez choisir Couleur de tableau de bord");
            frmEle.FeatureOption104.focus();
            return false;
        }
    }
}

if (frmEle.Option124) {
    if (frmEle.Option124.checked) {
        if (frmEle.FeatureOption66.value == '0') {
            alert("Veuillez choisir Couleurs de cantonni\u00E8re");
            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("Veuillez prendre note: l'hauteur du rail de s\u00E9paration doit \u00EAtre plus bas que l'hauteur du panneau.");
				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]="un type d\u0027ouverture";
	features[1][0]="71"; features[1][1]="un profondeur d\u0027ouverture de votre fen\u00EAtre";
	features[2][0]="72"; features[2][1]="un type d\u0027installation";
	features[3][0]="73"; features[3][1]="une dimension des lattes";
	features[4][0]="77"; features[4][1]="un style de panneau";
	features[5][0]="76"; features[5][1]="une configuration du panneau";
	features[6][0]="88"; features[6][1]="une couleur de charni\u00E8re de porte";
	features[7][0]="82"; features[7][1]="un emplacement du cadre";
	features[8][0]="83"; features[8][1]="un style de cadre d\u00E9coratif";
	features[9][0]="84"; features[9][1]="un style du panneau d\u00E9coratif";
	features[10][0]="96"; features[10][1]="un mat\u00E9riel du fen\u00EAtre";
  features[11][0]="97"; features[11][1]="un mat\u00E9riel du fen\u00EAtre";
 
	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("Veuillez choisir " + 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("Veuillez choisir une bordure de porte");
					frmEle.FeatureOption93.focus();
					return false;
				}
			}
		}
		else
		{
			if(frmEle.FeatureOption70){
				if(frmEle.FeatureOption70.value == '0'){
				//No mount type selected
					alert("Veuillez choisir une bordure de fen\u00EAtre");
					frmEle.FeatureOption70.focus();
					return false;
				}
			}
		}
		
		if((frmEle.FeatureOption69.value == 140 || frmEle.FeatureOption69.value == 232)
			&& ((eval(frmEle.WidthInches.value)+eval(frmEle.Width8ths.value)) > 30))
		{
			alert('Veuillez prendre note : la largeur maximale pour 1 panneau est de 30 poucees"');
			return false;
		}
		
				
		if(frmEle.FeatureOption69.value == 232 && !frmEle.Option149.checked)
		{
			alert('Vous poss\u00E9dez une porte\u00ADfen\u00EAtre munie d\u0027un levier, mais n\u0027avez pas s\u00E9lectionn\u00E9 l\u0027option Ajour pour porte\u00ADfen\u00EAtre. Veuillez svp confirmer que vous n\u0027avez pas besoin d\u0027un ajour parce que: \r\n\r\n\u00B7 vous pr\u00E9voyez remplacer le levier par une poign\u00E9e ou \r\n\r\n\u00B7 encore parce que l\u0027espace de d\u00E9gagement est tel que le levier ne g\u00EAnera pas la persienne. \r\n\r\n Si l\u0027espace de d\u00E9gagement n\u0027est pas suffisant, vous devrez remplacer votre levier par une poign\u00E9e ou choisir l\u0027option Ajour pour porte\u00ADfen\u00EAtre.');
		}
		
	}

// END SHUTTERS VALIDATIONS	

	if(frmEle.FeatureOption8){
		if(frmEle.FeatureOption8.value == '0'){
		//No mount type selected
			alert("Veuillez choisir un type d'fixation");
			frmEle.FeatureOption8.focus();
			return false;
		}
	}
	
	
	if(frmEle.FeatureOption56){
		if(frmEle.FeatureOption56.value == 97){
		//No Standard Privacy Liner
			alert("Veuillez choisir un Couleur de doublure standard");
			frmEle.FeatureOption56.focus();
			return false;
		}
	}
	
	
	
	if(frmEle.ColorID2)
	{
		if(frmEle.ColorID.value == "0" && frmEle.ColorID2.value == "0"){//No color selected
			alert("Veuillez choisir une couleur");
			frmEle.ColorID.focus();
			return false;
		}
	}
	else if(frmEle.ColorID.value == "0"){//No color selected
		alert("Veuillez choisir une couleur");
		frmEle.ColorID.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("Le ruban de bordage n'est pas offert avec cette couleur de store en bambou.");
			frmEle.TapeColorID.value=0;
			frmEle.ColorID.focus;
			return false;
		}
	}
	if(frmEle.TapeColorID && (frmEle.pid.value == "9" || frmEle.pid.value == "31" || frmEle.pid.value == "54" || frmEle.pid.value == "55" || frmEle.pid.value == "56" || frmEle.pid.value == "57" || frmEle.pid.value == "58"))
	{//Roller, require trim color
		//if(frmEle.TapeColorID.value == "0"){
		//	alert("Please select a trim color");
		//	frmEle.TapeColorID.focus();
		//	return false;
		//}
	}
	//Rollers
	if(frmEle.FeatureOption10){//Hem Style Option(Roller)
		if(frmEle.FeatureOption10.value != 24){//NOT Plain
			if(frmEle.FeatureOption10){//Hem Style Option(Roller)
				if(frmEle.TapeColorID){//Are trim colors there?
					if(frmEle.TapeColorID.value == 0){//Trim color must be chosen
						alert("Veuillez choisir une couleur de galons lorsque vous utilisez un ourlet d\351coratif.");
						frmEle.TapeColorID.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("Veuillez choisir une couleur de galons lorsque vous utilisez un ourlet ordinaire.");
					frmEle.TapeColorID.focus();
					return false;
				}
			}
		}
	}
	//Small size
	if(frmEle.WidthInches.value < 13.5 && frmEle.pid.value == 100){//1" designer basswood
		alert("AVIS : Les stores de moins de 13,5 po sont dot\351s d'un culbuteur au centre et aucun cordon de lev\351e en standard.")
	}
	if(frmEle.WidthInches.value < 23 && (frmEle.pid.value == 38 || frmEle.pid.value == 39 || frmEle.pid.value == 42 || frmEle.pid.value == 46)){//hunter douglas blinds
		alert("AVIS : Les stores de moins de 23 po sont dot\351s de contr\u00F4les s\351par\351s en standard.")
	}
	if(frmEle.WidthInches.value < 14 && (frmEle.pid.value == 87 || frmEle.pid.value == 120)){//2" designer fauxwood
		alert("AVIS : Les stores de moins de 14 po peuvent poss\351der un culbuteur au centre et aucun cordon de lev\351e.")
	}
	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("AVIS : Les stores de moins de 12 po sont dot\351s d'un culbuteur au centre et aucun cordon de lev\351e en standard.")
		}
	}
	
}

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("Vous ne pouvez pas choisir de rubans sur les stores sans parcours de c\u00E2ble!  L'option 'sans parcours de c\u00E2ble' a \351t\351 supprim\351e.");
					document.shopcart.Option2.checked = false;
				}
			}
			if(document.shopcart.Option9){//Remote
				document.shopcart.Option9.disabled = true;
				if(document.shopcart.Option9.checked == true){
					alert("Vous ne pouvez pas choisir de rubans sur les stores avec t\351l\351commande!  L'option de la t\351l\351commande a \351t\351 supprim\351e.");
					document.shopcart.Option9.checked = false;
				}
			}
			
				if(document.shopcart.Option41){//Remote
				document.shopcart.Option41.disabled = true;
				if(document.shopcart.Option41.checked == true){
					alert("Vous ne pouvez pas choisir de rubans sur les stores avec t\351l\351commande!  L'option de la t\351l\351commande a \351t\351 supprim\351e.");
					document.shopcart.Option41.checked = false;
				}
			}
		}
	}
	
	//new routeless
	
	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("L'option sans parcours du fil ne peut pas \u00EAtre combin\351e avec celle de ruban de tissu. Veuillez choisir l'une ou l'autre.");
					//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("L'option sans parcours du fil ne peut pas \u00EAtre combin\351e avec celle de ruban de tissu. Veuillez choisir l'une ou l'autre.");
					document.shopcart.TapeColorID.selectedIndex=1;
					document.shopcart.TapeColorID.focus();
					}
					else
					document.shopcart.Option113.disabled = true;
					
			}
		}
}
	
	
	
		if(document.shopcart.Option43){//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("Vous ne pouvez pas choisir de rubans sur les stores sans parcours de c\u00E2ble!  L'option 'sans parcours de c\u00E2ble' a \351t\351 supprim\351e.");
					document.shopcart.Option43.checked = false;
				}
			}
			if(document.shopcart.Option9){//Remote
				document.shopcart.Option9.disabled = true;
				if(document.shopcart.Option9.checked == true){
					alert("Vous ne pouvez pas choisir de rubans sur les stores avec t\351l\351commande!  L'option de la t\351l\351commande a \351t\351 supprim\351e.");
					document.shopcart.Option9.checked = false;
				}
			}
			
				if(document.shopcart.Option41){//Remote
				document.shopcart.Option41.disabled = true;
				if(document.shopcart.Option41.checked == true){
					alert("Vous ne pouvez pas choisir de rubans sur les stores avec t\351l\351commande!  L'option de la t\351l\351commande a \351t\351 supprim\351e.");
					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("Vous ne pouvez pas choisir de rubans sur les stores sans parcours de c\u00E2ble!  L'option 'sans parcours de c\u00E2ble' a \351t\351 supprim\351e.");
					document.shopcart.Option44.checked = false;
				}
			}
			if(document.shopcart.Option9){//Remote
				document.shopcart.Option9.disabled = true;
				if(document.shopcart.Option9.checked == true){
					alert("Vous ne pouvez pas choisir de rubans sur les stores avec t\351l\351commande!  L'option de la t\351l\351commande a \351t\351 supprim\351e.");
					document.shopcart.Option9.checked = false;
				}
			}
			
				if(document.shopcart.Option41){//Remote
				document.shopcart.Option41.disabled = true;
				if(document.shopcart.Option41.checked == true){
					alert("Vous ne pouvez pas choisir de rubans sur les stores avec t\351l\351commande!  L'option de la t\351l\351commande a \351t\351 supprim\351e.");
					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("Vous ne pouvez pas choisir de rubans sur les stores sans parcours de c\u00E2ble!  L'option 'sans parcours de c\u00E2ble' a \351t\351 supprim\351e.");
					document.shopcart.Option45.checked = false;
				}
			}
			if(document.shopcart.Option9){//Remote
				document.shopcart.Option9.disabled = true;
				if(document.shopcart.Option9.checked == true){
					alert("Vous ne pouvez pas choisir de rubans sur les stores avec t\351l\351commande!  L'option de la t\351l\351commande a \351t\351 supprim\351e.");
					document.shopcart.Option9.checked = false;
				}
			}
			
				if(document.shopcart.Option41){//Remote
				document.shopcart.Option41.disabled = true;
				if(document.shopcart.Option41.checked == true){
					alert("Vous ne pouvez pas choisir de rubans sur les stores avec t\351l\351commande!  L'option de la t\351l\351commande a \351t\351 supprim\351e.");
					document.shopcart.Option41.checked = false;
				}
			}
		}
	}
	
	
	
	

	
	
				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("Vous ne pouvez pas choisir de rubans sur les stores sans parcours de c\u00E2ble!  L'option 'sans parcours de c\u00E2ble' a \351t\351 supprim\351e.");
					document.shopcart.Option42.checked = false;
				}
			}
			if(document.shopcart.Option9){//Remote
				document.shopcart.Option9.disabled = true;
				if(document.shopcart.Option9.checked == true){
					alert("Vous ne pouvez pas choisir de rubans sur les stores avec t\351l\351commande!  L'option de la t\351l\351commande a \351t\351 supprim\351e.");
					document.shopcart.Option9.checked = false;
				}
			}
			
				if(document.shopcart.Option41){//Remote
				document.shopcart.Option41.disabled = true;
				if(document.shopcart.Option41.checked == true){
					alert("Vous ne pouvez pas choisir de rubans sur les stores avec t\351l\351commande!  L'option de la t\351l\351commande a \351t\351 supprim\351e.");
					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) {
	            document.shopcart.Option165.checked = false;
	            document.shopcart.Option165.disabled = true;
	            document.shopcart.Option166.checked = false;
	            document.shopcart.Option166.disabled = true;
	        }


	        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;
	        }

	        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("Vous ne pouvez pas choisir de rubans sur les stores sans parcours de c\u00E2ble!  L'option 'sans parcours de c\u00E2ble' a \351t\351 supprim\351e.");
					document.shopcart.Option28.checked = false;
				}
			}
			if(document.shopcart.Option30){//Powertilt
				document.shopcart.Option30.disabled = true;
				if(document.shopcart.Option30.checked == true){
					alert("Vous ne pouvez pas choisir de rubans sur les stores avec t\351l\351commande!  L'option de la t\351l\351commande a \351t\351 supprim\351e.");
					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 >= 60 && document.shopcart.FeatureOption11.value == 30)
		{
			document.shopcart.FeatureOption11.value = 31
			alert("La toile \u00E0 ressort n'est pas disponible pour les largeurs plus de 60 pouces")
		}

    }




    if (document.shopcart.pid.value == 57) {
        if (document.shopcart.FeatureOption11) {

            if (testWidth > 78 && (document.shopcart.ColorID2.value == 4031 || document.shopcart.ColorID2.value == 4034 || document.shopcart.ColorID2.value == 4036 || document.shopcart.ColorID2.value == 3037 || document.shopcart.ColorID2.value == 4038 || document.shopcart.ColorID2.value == 4039 || document.shopcart.ColorID2.value == 4028 || document.shopcart.ColorID2.value == 4029 || document.shopcart.ColorID2.value == 4030 || document.shopcart.ColorID2.value == 519 || document.shopcart.ColorID2.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("Veuillez prendre note pour les couleurs : Coton,Naturel,Nuage,Lin,Grain,Neige,Recolte,Glace,Noir,Blanc,Lin \u00AD la largeur maximale du store est de 78 pouces.")
            }

        }
    }	
	
	
	
	
	if(document.shopcart.pid.value == 58) 
	{
		if(testWidth > 84 && (document.shopcart.ColorID2.value == 3167 || document.shopcart.ColorID2.value == 3168 || document.shopcart.ColorID2.value == 3169))
		{
			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("Veuillez prendre note pour les couleurs su\351d\351 : Saddele, Prairie, Mocassin \u00AD la largeur maximale du store est de 84 pouces.")
		}
		
		
		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.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("Veuillez prendre note pour les couleurs : Blanc coton, Naturel \u00AD la largeur maximale du store est de 78 1/4 pouces.")
        }

//        alert(testWidth);
//        alert(document.shopcart.FeatureOption11.value);
//        alert(document.shopcart.ColorID.value);
        if ((testWidth >= 17 && testWidth <= 60) && document.shopcart.FeatureOption11.value == 30 && (document.shopcart.ColorID2.value == 3167 || document.shopcart.ColorID2.value == 3168 || document.shopcart.ColorID2.value == 3169)) 
                {
                    document.shopcart.FeatureOption11.value = 31
                    alert("La toile \u00E0 ressort n'est pas disponible pour les couleurs: Saddele, Prairie, Mocassin.")
                }

	
	}


	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.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("Nous ne pouvons pas fabriquer des stores \u00E0 panneau simple de plus de 34 po de large."); document.shopcart.FeatureOption45.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption46.value == 72) //two panel split
				{
					if (testWidth < 22) {alert("Nous ne pouvons pas fabriquer de stores \u00E0 deux panneaux s\351par\351s de moins de 22 po de large."); document.shopcart.FeatureOption45.selectedIndex = 0;}
					if (testWidth > 53) {alert("Nous ne pouvons pas fabriquer de stores \u00E0 deux panneaux s\351par\351s de plus de 53 po de large."); 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("Nous ne pouvons pas fabrique de stores \u00E0 deux panneaux de moins de 22 po de large."); document.shopcart.FeatureOption45.selectedIndex = 0;}
					if (testWidth > 53) {alert("Nous ne pouvons pas fabriquer de stores \u00E0 deux panneaux de plus de 53 po de large."); document.shopcart.FeatureOption45.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption46.value == 75) //Four Panel Bifold Split
				{
					if (testWidth < 36) {alert("Nous ne pouvons pas fabriquer de stores pliants en deux sections et \u00E0 quatre panneaux s\351par\351s de moins de 36 po de large."); document.shopcart.FeatureOption45.selectedIndex = 0;}
					if (testWidth > 105) {alert("Nous ne pouvons pas fabriquer de stores pliants en deux sections et \u00E0 quatre panneaux s\351par\351s de plus de 105 po de large."); 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("Nous ne pouvons pas fabriquer de stores \u00E0 panneau simple de moins de 22 po de large."); document.shopcart.FeatureOption45.selectedIndex = 0;}
					if (testWidth > 28) {alert("Nous ne pouvons pas fabriquer de stores \u00E0 panneau simple de plus de 28 po de large."); document.shopcart.FeatureOption45.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption46.value == 72) //two panel split
				{
					if (testWidth < 30) {alert("Nous ne pouvons pas fabriquer de stores \u00E0 deux panneaux s\351par\351s de moins de 30 po de large."); document.shopcart.FeatureOption45.selectedIndex = 0;}
					if (testWidth > 48) {alert("Nous ne pouvons pas fabriquer de stores \u00E0 deux panneaux s\351par\351s de plus de 48 po de large."); 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("Nous ne pouvons pas fabriquer de stores \u00E0 deux panneaux de moins de 30 po de large."); document.shopcart.FeatureOption45.selectedIndex = 0;}
					if (testWidth > 48) {alert("Nous ne pouvons pas fabriquer de stores \u00E0 deux panneaux de plus de 48 po de large."); document.shopcart.FeatureOption45.selectedIndex = 0;}
				}
				if (document.shopcart.FeatureOption46.value == 75) //Four Panel Bifold Split
				{
					if (testWidth < 44) {alert("Nous ne pouvons pas fabriquer de stores pliants en deux sections et \u00E0 quatre panneaux s\351par\351s de moins de 44 po de large."); document.shopcart.FeatureOption45.selectedIndex = 0;}
					if (testWidth > 95) {alert("Nous ne pouvons pas fabriquer de stores pliants en deux sections et \u00E0 quatre panneaux s\351par\351s de plus de 95 po de large."); document.shopcart.FeatureOption45.selectedIndex = 0;}
				}
			}
		}
	}
/*	
	if (document.shopcart.FeatureOption47)
	{
		if (document.shopcart.FeatureOption47.value == 77)
		{
			alert("Please call 866-542-8753 if you have questions regarding this feature.");
		}
	}
	if (document.shopcart.FeatureOption49)
	{
		if (document.shopcart.FeatureOption49.value == 84)
		{
			alert("Please call 866-542-8753 if you have questions regarding this feature.");
		}
	}
*/
	if (document.shopcart.FeatureOption50)
	{
		if (document.shopcart.FeatureOption50.value == 85) 
		{
			if (testHeight >= 62 && testHeight < 72) alert("\u00c0 cause de la hauteur du store que vous avez s\351lectionn\351, nous recommandons d’ajouter un rail de s\351paration.");
			if (testHeight >= 72 && testHeight < 90) document.shopcart.FeatureOption50.selectedIndex = 1;
			if (testHeight >= 90 && testHeight < 96) alert("\u00c0 cause de la hauteur du store que vous avez s\351lectionn\351, nous recommandons d’ajouter deux rails de s\351paration.");
			if (testHeight >= 96) document.shopcart.FeatureOption50.selectedIndex = 2;
		}
		if (document.shopcart.FeatureOption50.value == 136) 
		{
			if (testHeight >= 90 && testHeight < 96) alert("\u00c0 cause de la hauteur du store que vous avez s\351lectionn\351, nous recommandons d’ajouter deux rails de s\351paration.");
			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.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("D\351sol\351, le tirage s\351par\351 n'est disponible qu'avec le m\351canisme d'inclinaison \u00E0 cordon.");
			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("Veuillez prendre note que les stores mesurant moins de 12 pouces sont accompagn\351s d'un dispositif d'inclinaison standard situ\351 au 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("Les stores mesurant de 12 1/8 po \u00E0 17 7/8 po de largeur doivent poss\351der des m\351canismes de contr\u00F4le s\351par\351s. Veuillez choisir des c\u00F4t\351s oppos\351s pour l'emplacement du m\351canisme d'inclinaison et de la corde de remont\351e.");
			}
			
			
	
}



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.ColorID2.value == 2650 || document.shopcart.ColorID2.value == 2651 || document.shopcart.ColorID2.value == 2652 || document.shopcart.ColorID2.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 = "https://www.storesselectscanada.ca/images/selectcolor.gif";
			document.shopcart.Option109.disabled = false;//Privacy Liner--Blackout 
			document.shopcart.Option110.disabled = false;//Privacy Liner--Light Filter				
			alert("Veuillez prendre note pour les couleurs : Vison, Vancouver : Epice, Vancouver : Paille, Vancouver : Moka Ela largeur maximale du store est de 72 pouces pour un store seul ; toutefois, ces couleurs sont disponibles pour de plus grandes largeurs si vous s\351lectionnez l'option 2 stores sur 1 caisson ou l'option 3 stores sur 1 caisson.")			
		}	
	
	
	
	if( document.shopcart.Option109 && document.shopcart.Option110){
		if (document.shopcart.ColorID2.value == 2651 || document.shopcart.ColorID2.value == 2652 || document.shopcart.ColorID2.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 == 684){	
	//1" platinum 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
			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 == 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
			}
		}
	}
}
	
	
	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 == 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("D\351sol\351, le cordon de lev\351e pour 2 stores install\351s sur 1 caisson doit \352tre s\351par\351 avec un store allant vers la droite et un vers la gauche, ou le contraire.")
		            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
	//document.shopcart.Option101.disabled = false;//Cordless Child Safety System
	}
	
}




		//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
						}
						
						if(document.shopcart.Option140) 
						{
						var blindWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
						var blindHeight = document.shopcart.HeightInches.value + document.shopcart.Height8ths.value;	
						if(blindWidth >= 18) document.shopcart.Option140.disabled = false;//CordlessChild
						else document.shopcart.Option140.disabled = true;//CordlessChild
						}						
				
				}
				
		}
		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
				
				if(blindWidth >= 18) document.shopcart.Option140.disabled = false;//CordlessChild
				else document.shopcart.Option140.disabled = true;//CordlessChild
				
				}
					
				
		}
	}
	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.Option81) {

	        if (testWidth < 38.250) {
	            document.shopcart.Option81.disabled = true;
	            document.shopcart.Option81.checked = false;
	        }
	        else {
	            document.shopcart.Option81.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("Le galon lat\u00E9ral n'est pas disponible pour ce coloris.");
            }
        }
        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("Pour ce coloris, nous vous sugg\u00E9rons de commander un 'galon lat\u00E9ral' (en option).");


    }
}


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("Les stores doivent poss\351der des m\351canismes de contr\u00F4le s\351par\351s. Veuillez choisir des c\u00F4t\351s oppos\351s pour l'emplacement du m\351canisme d'inclinaison et de la corde de remont\351e.");
            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("Les stores doivent poss\351der des m\351canismes de contr\u00F4le s\351par\351s. Veuillez choisir des c\u00F4t\351s oppos\351s pour l'emplacement du m\351canisme d'inclinaison et de la corde de remont\351e.");
            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("Les stores doivent poss\351der des m\351canismes de contr\u00F4le s\351par\351s. Veuillez choisir des c\u00F4t\351s oppos\351s pour l'emplacement du m\351canisme d'inclinaison et de la corde de remont\351e.");
            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("Contr\362le de l'inclinaison: Tige n'est pas disponible pour les couleurs noir et 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("Les stores doivent poss\351der des m\351canismes de contr\u00F4le s\351par\351s. Veuillez choisir des c\u00F4t\351s oppos\351s pour l'emplacement du m\351canisme d'inclinaison et de la corde de remont\351e.");
            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("Les stores doivent poss\351der des m\351canismes de contr\u00F4le s\351par\351s. Veuillez choisir des c\u00F4t\351s oppos\351s pour l'emplacement du m\351canisme d'inclinaison et de la corde de remont\351e.");
            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("Au moment de choisir le m\351canisme d'inclinaison : TIGE vous devez s\351lectionner le type de d\351placement : unidirectionnel.");
        }

    }

}


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.ColorID2.value == 3908)) {
            document.shopcart.FeatureOption3.value = 6;
            alert("Contr\362le de l'inclinaison: Tige n'est pas disponible pour les couleurs: Noyer fonc\351 - teinture.")
        }

        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("Les stores mesurant de 12 1/8 po \u00E0 17 7/8 po de largeur doivent poss\351der des m\351canismes de contr\u00F4le s\351par\351s. Veuillez choisir des c\u00F4t\351s oppos\351s pour l'emplacement du m\351canisme d'inclinaison et de la corde de remont\351e.");
                
                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("Les stores mesurant de 13 po \u00E0 18 po de largeur doivent poss\351der des m\351canismes de contr\u00F4le s\351par\351s. Veuillez choisir des c\u00F4t\351s oppos\351s pour l'emplacement du m\351canisme d'inclinaison et de la corde de remont\351e.");
        }

    }
}


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("D\351sol\351, cet article n'est disponible seulement qu'avec une hauteur maximale de 73 po pour le larger de 96 po.");
        document.shopcart.HeightInches.focus();
    }
}

if (document.shopcart.pid.value == 810) {
    if (testHeight > 72 && testWidth >= 84) {
        alert("D\351sol\351, cet article n'est disponible seulement qu'avec une hauteur maximale de 72 po pour les largeurs allant de 84 \340 96 po.");
        document.shopcart.HeightInches.focus();
    }
}


if (document.shopcart.pid.value == 728) {

    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) {
        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;
	var ColorID2 = 0;
	var TapeColorID = 0;
	

	//set javascript check
	document.shopcart.jsBrowserCheck.value = "1";
	
	
	
if(document.shopcart.ExtraAmount && ColorType == 1)
{


	if(document.shopcart.ColorID2.value > 0 && document.shopcart.IsSelectedC.value == 1)
	{
	document.shopcart.ColorID.value = 0;
	document.shopcart.ColorID.selectedIndex = 0;
	document.shopcart.IsSelectedC2.value = 1;
	document.shopcart.IsSelectedC.value = 0;
	}
	else if(document.shopcart.ColorID.value > 0  && document.shopcart.IsSelectedC2.value == 1)
	{
	document.shopcart.ColorID2.value = 0;
	document.shopcart.ColorID2.selectedIndex = 0; 
	document.shopcart.IsSelectedC.value = 1;
	document.shopcart.IsSelectedC2.value = 0;
	}
	else if(document.shopcart.ColorID2.value > 0)
	{
	document.shopcart.IsSelectedC2.value = 1;
	document.shopcart.ColorID.selectedIndex = 0; 
	}
	else if(document.shopcart.ColorID.value > 0)
	{
	document.shopcart.IsSelectedC.value = 1;
	document.shopcart.ColorID2.selectedIndex = 0; 
	}
	
	

		var jColorIDids = document.shopcart.ColorIDids.value.split(",");
		for (var loop=0; loop < jColorIDids.length; loop++)
		{
		if(jColorIDids[loop] == ID)
			{
				document.shopcart.ColorID.value = ID;
				document.shopcart.IsSelectedC.value = 1;
				document.shopcart.ColorID2.selectedIndex = 0; 
			}
		}
	

		var jColorID2ids = document.shopcart.ColorID2ids.value.split(",");
		for (var loop=0; loop < jColorID2ids.length; loop++)
		{
		if(jColorID2ids[loop] == ID)
			{
				document.shopcart.ColorID2.value = ID;
				document.shopcart.IsSelectedC2.value = 1;
				document.shopcart.ColorID.selectedIndex = 0; 
			}
		}
	






	
if(ColorType == 1){//blinds
		ColorID = 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
			ColorID = ID;
			document.shopcart.ColorID.value = ID;
			if(document.shopcart.TapeColorID) TapeColorID = document.shopcart.TapeColorID.value;
		}
		else{//tapes
			ColorID = document.shopcart.ColorID.value;
			if(document.shopcart.TapeColorID){
				TapeColorID = ID;
				document.shopcart.TapeColorID.value = ID;
			}
		}
}
	
	
	if(ColorID == 0 && ColorID2 == 0){//No color selected, Set all color to nothing
		//Set blind sections to empty
		eleColorImage.src = "https://www.storesselectscanada.ca/images/spacer.gif";
		if(eleColorImage3){	eleColorImage3.src = "https://www.storesselectscanada.ca/images/spacer.gif";}
		
		//Set tape color
		if(eleTapeColorImage){
			if(TapeColorID == 0){//No tape selected
				eleTapeColorImage.src = "https://www.storesselectscanada.ca/images/spacer.gif";
			}
			else{//Show tape color
				eleTapeColorImage.src = "https://www.storesselectscanada.ca/images/tapes/tape_" + TapeColorID + ".jpg";
			}
		}
	}
	else{//Color Selected
		//Set color on blind sections
		if (ColorID2 > 0 && ColorType == 1) {ColorID = ColorID2}
		
		eleColorImage.src = "https://www.storesselectscanada.ca/images/blinds/enlarge/blindcolor_" + ColorID + ".jpg";
		
		if(eleColorImage3){eleColorImage3.src = "https://www.storesselectscanada.ca/images/blinds/enlarge/blindcolor_" + ColorID + ".jpg";}
		if(eleTapeColorImage){
			if(TapeColorID == 0){//No tape selected
				if(eleColorImage3){
					eleTapeColorImage.src = "https://www.storesselectscanada.ca/images/blinds/enlarge/blindcolor_" + ColorID + ".jpg";
				}
				else{//old products
					eleTapeColorImage.src = "https://www.storesselectscanada.ca/images/spacer.gif";
				}
			}
			else{//Set to tape color
				eleTapeColorImage.src = "https://www.storesselectscanada.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("Veuillez entrer votre type de carte de credit");
			frmEle.PaymentID.focus();
			return false;
		}
		

		
		if(frmEle.CardNumber.value == ""){
			alert("Veuillez entrer votre numero de carte de credit");
			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); 
		/*var dig2 = num.charAt(1); 
		var dig3 = num.charAt(2); 
		var dig4 = num.charAt(3); 
		var dig5 = num.charAt(4); 
		var dig6 = num.charAt(5); 
		var dig7 = num.charAt(6); 
		var dig8 = num.charAt(7); 
		var dig9 = num.charAt(8); 
		var dig10 = num.charAt(9); 
		var dig11 = num.charAt(10); 
		var dig12 = num.charAt(11); 
		var dig13 = num.charAt(12); 
		var dig14 = num.charAt(13); 
		var dig15 = num.charAt(14); 
		var dig16 = num.charAt(15); */

		if(type == "American Express"){  
			if ((dig1 != "3") || (num.length != 15)) {
				alert("Num\351ro de carte de cr\351dit invalide!  V\351rifiez si vous utilisez bien une carte American Express ou changez de type de carte.");
				frmEle.PaymentID.focus();
				return false; 
			}  
		}
		if(type == "Visa") {  
			if ((dig1 != "4") || (num.length != 16))  {
				alert("Num\351ro de carte de cr\351dit invalide! V\351rifiez si vous utilisez bien une carte Visa ou changez de type de carte.");  
				frmEle.PaymentID.focus();
				return false; 
			}
		}
		if(type == "MasterCard") {  
			if ((dig1 != 5) || (num.length != 16)) {
				alert("Num\351ro de carte de cr\351dit invalide! V\351rifiez si vous utilisez bien une carte Master Card ou changez de type de carte."); 
				frmEle.PaymentID.focus();
				return false; 
			}  
		}
		
		
		
		
	if(frmEle.expMonth.value == ""){
		alert("Veuillez entrer le mois de la date d'expiration");
		frmEle.expMonth.focus();
		return false;
	}
	
	if(frmEle.expYear.value == ""){
		alert("Veuillez entrer l'ann\351e de la date d'expiration");
		frmEle.expYear.focus();
		return false;
	}
		
		
		
		
		
		
		if(frmEle.cvv2.value.length < 3){
			
			alert("Veuillez entrer le code de s\351curit\351 \u00E0 l'arri\u00E8re de la carte de cr\351dit");
			frmEle.cvv2.focus();
			return false;
		}
		if(frmEle.Name.value == ""){
			alert("Veuillez entrer votre nom tel qu'il appara\u00EEt sur la carte de cr\351dit");
			frmEle.Name.focus();
			return false;
		}
		
		
		
		
	
	
	
	
	
	
	
	
	
	

	
		

	if(frmEle.City.value == ""){
		alert("Veuillez entrer votre Ville");
		frmEle.City.focus();
		return false;
	}
		
if(frmEle.State.value == "" || frmEle.State.value == "0"){
		alert("Veuillez entrer votre province/\u00C9tat");
		frmEle.State.focus();
		return false;
	}
		
		
		
		if(frmEle.Zip.value == ""){
			alert("Veuillez entrer votre code postal ou code zip");
			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("Veuillez entrer votre code postal ou zip exact");
				frmEle.Zip.focus();
				return false;
			}
		}
		
		
		

		
		
			if(frmEle.measure_disclaimer.checked == false){
		alert("Veuillez lire les 'Instructions de mesure' et 'l'Avis de non\u00ADresponsabilit\351 sur les couleurs' et choisissez l'option 'J'accepte les conditions'");
		frmEle.measure_disclaimer.focus();
		return false;
	}
	
	}
	if(frmEle.PaymentType[1].checked){//Bill Me Later
	}
	if(frmEle.PaymentType[2].checked){//Alternative methods
		/*if(frmEle.Alternative[0].checked == false && frmEle.Alternative[1].checked == false){
			alert("Please select EITHER Cashier Check/Money Order or Call for Credit Card if you selected Alternative Payment Method");
			//frmEle.frmEle.Alternative[0].focus();
			return false;
		}*/
		if(frmEle.Alternative.checked == false){
			alert("Veuillez choisir l'option 'd'Appel pour la carte de cr\351dit' si vous avez choisi la m\351thode de paiement alternative.");
			//frmEle.frmEle.Alternative[0].focus();
			return false;
		}
	}
	
	if(frmEle.measure_disclaimer.checked == false){
		alert("Veuillez lire les 'Instructions de mesure' et 'l'Avis de non\u00ADresponsabilit\351 sur les couleurs' et choisissez l'option 'J'accepte les conditions'");
		frmEle.measure_disclaimer.focus();
		return false;
	}
	//if(frmEle.color_disclaimer.checked == false){
	//	alert("Please read the color disclaimer agree to the terms! If you are worried about the color we suggest that you order a sample from our sample page.");
	//	frmEle.color_disclaimer.focus();
	//	return false;
	//}
	MM_showHideLayers('PaymentDiv','','show');
}

function validateBMLPayment(frmEle){
	if(frmEle.bdmonth.value == "" || frmEle.bdday.value == "" || frmEle.bdyear.value == ""){
		alert("Please enter your birthdate.");
		frmEle.bdmonth.focus();
		return false;
	}
	//check that applicant is 18 or older
	var dTodaysDate = new Date();
	var dTestDate = new Date((eval(frmEle.bdyear.value) + 18),
                            (eval(frmEle.bdmonth.value) - 1),
                            frmEle.bdday.value);
    if(dTodaysDate < dTestDate){
		alert("The date of birth you entered indicated is less than 18 years of age. Please correct the date of birth or choose another form of payment");
		return false;
    }
	if(frmEle.ssn.value == "" || frmEle.ssn.value.length < 4){
		alert("Please enter the last 4 digits of your Social Security Number.");
		frmEle.ssn.focus();
		return false;
	}
	if(frmEle.consent.checked == false){
		alert("You forgot to check the e-sign consent box.  To continue with your order please check the box and click the 'I Agree and Complete Order' button.  By checking the box you are agreeing to electronic presentment of the Bill Me Later(R) Terms and Conditions.");
		frmEle.consent.focus();
		return false;
	}
	MM_showHideLayers('PaymentDiv','','show');
}

function validatePaymentMethod(clicked){
	frmEle = document.shopcart;
	//REMOVE OPTIONS SELECTED	
	//if bill me later or credit card, remove alternative methods
	if((frmEle.PaymentType[0].checked || frmEle.PaymentType[1].checked) && clicked != 'alternative'){
		frmEle.Alternative.checked = false;
		//frmEle.Alternative[0].checked = false;
		//frmEle.Alternative[1].checked = false;
	}
	//if an alternative method selected, check alternative payment type
	//if(frmEle.Alternative[0].checked || frmEle.Alternative[1].checked){
	if(frmEle.Alternative.checked){
		frmEle.PaymentType[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><b>" + sSelSampleProName + "</b><br>";
		  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>plus</u></a></div>";
		sSelSamples += "<li style='padding-left:10;'>" + eval("document.samplesForm.scn" + aItemID[j] + ".value") + "</li>"
		sLastSampleProName = sSelSampleProName;
		}
	
	}
	
	//alert(sSelSamples);
			var sHeader = "";
		var sFooter = "";
		document.getElementById("SelectedSamples").innerHTML = sHeader + sSelSamples + sFooter;

 }
}



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><b>" + sSelSampleProName + "</b><br>";
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>plus</u></a></div>";		
		sSelSamples += "<li style='padding-left:10;'>" + eval("document.samplesForm.scn" + aItemID[j] + ".value") + "&#160;<a href='samples.aspx?p=7&amp;rmid="+ aItemID[j] +"&amp;r=1'><u>Supprimer</u></a></li>"
		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(tempCID)
					{
						if(tmpch == 1)
						{
						
						LoadXMLDoc("https://www.storesselectscanada.ca/sessionUpdater.aspx?pid="+ CID+"&r=1"); 
						lfrmEle.elements["ch"+CID].value = 0;
						}
						else
						{
						LoadXMLDoc("https://www.storesselectscanada.ca/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><b>" + sSelSampleProName + "</b><br>";
						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>plus</u></a></div>";
						
						sSelSamples += "<li style='padding-left:10;'>" 
						+ eval("document.samplesForm.scn" 
						+ ItemID 
						+ ".value") 
						+ "&#160;<a href='javascript:validateSamples(\"" 
						+ "document."
						+ lfrmEle.name 
						+"\","
						+ useDhtml 
						+ ",\"" 
						+ lfrmEle.SampleCheckbox[x].value
						+ "\");'><u>Supprimer</u></a></li>"
						
						sLastSampleProName = sSelSampleProName;
					
						}
						
					
					var aItemID = ItemID.split("_");
					
			
					//alert(aItemID[1]);
					if (aItemID.length > 0){
						if (aItemID[1] == "60" || aItemID[1] == "62" || aItemID[1] == "83" || aItemID[1] == "84")
							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 += ",";
				var aItemID2 = ItemID.split("_");
				sCheckedValues += ItemID;
				if(useDhtml == 1){//Setup inner html for list of selected samples
					sSelSampleProName = eval("document.samplesForm.spn" + ItemID + ".value");
					//if(sLastSampleProName != sSelSampleProName) sSelSamples += "<br><b>" + sSelSampleProName + "</b><br>";
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>plus</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><b>" + sSelSampleProName + "</b><br>";
						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>plus</u></a></div>";
						
						
						
						sSelSamples += "<li style='padding-left:10;'>" 
						+ eval("document.samplesForm.scn" 
						+ aSelectedItems2[j] 
						+ ".value") 
						+ "&#160;<a href='javascript:validateSamples(\"" 
						+ "document."
						+ lfrmEle.name 
						+"\","
						+ useDhtml 
						+ ",\"" 
						+ aSelectedItems2[j]
						+ "\");'><u>Supprimer</u></a></li>"
						
						
						
						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("Veuillez svp enlever un \351chantillon ou plus de votre panier d'\351chantillons afin que celui\u00ADci n'en compte pas plus de 20 puis cliquez sur le bouton 'compl\351ter la commande' afin d'effectuer votre commande d'\351chantillons gratuits. Si vous avez besoin de plus de 20 \351chantillons, veuillez svp nous contacter pour obtenir de l'aide.");
		return false;
	}
	if(BambooCount > 4){
		alert("Nous vous remercions de l'int\351r\u00EAt que vous avez manifest\351 envers nos stores, mais nous devons limiter la quantit\351 de nos \351chantillons de stores en bambou \u00E0 4 par client.  Veuillez retirer un \351chantillon, puis cliquez sur le bouton 'Livraison' afin de terminer votre transaction.");
		return false;
	}
	if(count > 0 && useDhtml == 1){//Show seleccted sample list
		var sHeader = "";
		var sFooter = "";
		document.getElementById("SelectedSamples").innerHTML = sHeader + sSelSamples + sFooter;
	}
}






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("Les mesures donn\351es pour les 3 stores sur 1 caisson doivent \351galer la largeur totale de la fen\u00EAtre o\u00f9 seront install\351s les 3 stores. Veuillez r\351viser les mesures.");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("Les mesures donn\351es pour les 2 stores sur 1 caisson doivent \351galer la largeur totale de la fen\u00EAtre o\u00f9 seront install\351s les 2 stores. Veuillez r\351viser les mesures.");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("Les mesures donn\351es pour les '2 stores raccord\351s' doivent \351galer la largeur totale de la fen\u00EAtre o\u00f9 seront install\351s les 2 stores. Veuillez r\351viser les mesures."); frmEle.LeftBlindWidth2c.focus(); return 1; }

}

function validateSampleUser(frmEle){
	if(frmEle.FirstName.value == ""){
		alert("Veuillez entrer votre Prenom");
		frmEle.FirstName.focus();
		return false;
	}
	if(frmEle.LastName.value == ""){
		alert("Veuillez entrer votre Nom de Famille");
		frmEle.LastName.focus();
		return false;
	}
	if(frmEle.Address.value == ""){
		alert("Veuillez entrer votre Adresse");
		frmEle.Address.focus();
		return false;
	}
	if(frmEle.City.value == ""){
		alert("Veuillez entrer votre Ville");
		frmEle.City.focus();
		return false;
	}
	
	
	if(frmEle.State.value == "" || frmEle.State.value == "0"){
		alert("Veuillez entrer votre province");
		frmEle.State.focus();
		return false;
	}
	
		if(frmEle.State.value == "out")
	{
	var answer = confirm("StoresSelectsCanada.ca n'accepte les commandes qu'en provenance et \u00E0 destination d'adresses canadiennes.  Pour les livraisons vers d'autres pays, incluant  les \u00C9tats\u00ADUnis, visitez le site SelectBlinds.com.  Cliquez sur OK pour aller \u00E0 SelectBlinds.com maintenant.  Sinon, cliquez sur 'Annuler' et choisissez votre 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("Veuillez entrer votre code postal dans le 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("Veuillez entrer votre code postal dans le format X0X 0X0");
			frmEle.Zip.focus();
			return false;
		}
	}
	
	if(frmEle.Phone.value == ""){
		alert("Veuillez entrer un num\351ro de t\351l\351phone qui no permettra de vous contacter le jour");
		frmEle.Phone.focus();
		return false;
	}
	
		if(frmEle.Phone2.value == ""){
		alert("Veuillez entrer un num\351ro de t\351l\351phone qui no permettra de vous contacter le soir");
		frmEle.Phone2.focus();
		return false;
	}
	
		if(frmEle.Email.value != frmEle.Email2.value){
			alert("Les adresses de courriel ne correspondent pas. S'il vous pla\u00EEt r\351viser et assurez vous qu'ils sont pareils.");
			frmEle.Email.focus();
			return false;
		}
	
	if(frmEle.Email){
		if(frmEle.Email.value == ""){
			alert("Veuillez entrer votre Adresse de Courriel");
			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("Adresse de courriel incorrecte!  Veuillez apporter les changements n\351cessaires.");
			frmEle.Email.focus();
			return false;
		}
	 }
	
	if(frmEle.Shipping.value != "0"){
		if(frmEle.Phone.value == ""){
			alert("Votre num\351ro de t\351l\351phone est requis pour les livraisons le lendemain");
			frmEle.Phone.focus();
			return false;
		}
	}
	
	if(frmEle.Planning.value == "0"){
		alert("s'il vous pla\u00EEt entrer dans combien de temps vous pensez placer votre commande");
		frmEle.Planning.focus();
		return false;
	}
	
var pcodes2=new Array("A0K","A0P","J0M","P0L","P0T","P0V","R0B","V0J","V0P","V0R","V0V","G0G","T0P","X0A","X0B","X0C","X0E","Y0B");
	
	
var pcodes=new Array("A0A4H0","A0B2H0","A0B3A0","A0C2R0","A0E2W0","A0E3B0","A0G2P0","A0G2V0","A0G3V0","A0G4A0","A0G4K0","A0H1N0","A0H1S0","A0H2C0","A0H2J0","A0K1N0","A0K1T0","A0K1V0","A0K2B0","A0K2E0","A0K2J0","A0K2K0","A0K2R0","A0K2Z0","A0K3J0","A0K3K0","A0K3L0","A0K3P0","A0K3Y0","A0K4E0","A0K4K0","A0K4S0","A0K4W0","A0K5S0","A0K5V0","A0K5Y0","A0M1E0","A0M1G0","A0M1H0","A0M1K0","A0M1L0","A0M1M0","A0M1N0","A0N2E0","A0P1A0","A0P1C0","A0P1E0","A0P1G0","A0P1J0","A0P1K0","A0P1L0","A0P1M0","A0P1N0","A0P1P0","A0P1S0","A0R1A0","A0R1B0","A2V2K2","E0B1Y0","E0B3B0","E0G1L0","E0G1R0","E0G1X0","E0G2G0","E0G2J0","E0G2M0","E0G3B0","E0G3H0","E0G3L0","E5G1L1","E5G1M9","E5G2A8","E5G2A9","E5G2G3","E5G2H3","E5G2H4","E5G2H5","E5V1A2","E5V1A3","E5V1A4","G0A1C0","G0A1P0","G0A2V0","G0A4M0","G0B1A0","G0B1B0","G0B1C0","G0B1E0","G0B1G0","G0B1H0","G0B1J0","G0B1K0","G0B1L0","G0B1M0","G0B1N0","G0B1P0","G0G1A0","G0G1B0","G0G1C0","G0G1E0","G0G1G0","G0G1J0","G0G1M0","G0G1N0","G0G1R0","G0G1S0","G0G1T0","G0G1W0","G0G1Z0","G0G2C0","G0G2E0","G0G2G0","G0G2P0","G0G2R0","G0G2T0","G0G2W0","G0G2Y0","G0R1B0","G0R1P0","G0T1E0","G0W3B0","G0W3C0","G0X1C0","G0X1R0","G0X3R0","G4T   ","H0M1A0","J0K1M0","J0L1P0","J0M1A0","J0M1C0","J0M1E0","J0M1G0","J0M1H0","J0M1J0","J0M1K0","J0M1L0","J0M1M0","J0M1N0","J0M1P0","J0M1R0","J0M1S0","J0M1T0","J0M1V0","J0M1W0","J0M1X0","J0M1Y0","J0W2C0","J0Y2M0","J0Y2X0","J0Y3B0","J0Y3C0","P0L1A0","P0L1H0","P0L1N0","P0L1S0","P0L1W0","P0L1X0","P0L1Y0","P0L2A0","P0L2C0","P0L2H0","P0M1C0","P0M1K0","P0M1T0","P0M2H0","P0M2P0","P0M2S0","P0M2Z0","P0S1A0","P0S1H0","P0T1A0","P0T1E0","P0T1L0","P0T1N0","P0T1P0","P0T1Z0","P0T2L0","P0T3A0","P0T3B0","P0V1B0","P0V1C0","P0V1E0","P0V1G0","P0V1J0","P0V1L0","P0V1M0","P0V1N0","P0V1T0","P0V1V0","P0V1W0","P0V1Y0","P0V1Z0","P0V2A0","P0V2B0","P0V2C0","P0V2G0","P0V2H0","P0V2K0","P0V2L0","P0V2M0","P0V2P0","P0V2S0","P0V2Y0","P0V2Z0","P0V3A0","P0V3B0","P0V3C0","P0V3E0","P0X1L0","P0X1P0","P0X1X0","P0Y1A0","P0Y1B0","P0Y1C0","R0B0A0","R0B0B0","R0B0E0","R0B0M0","R0B0N0","R0B0S0","R0B0T0","R0B0V0","R0B0Y0","R0B0Z0","R0B1B0","R0B1C0","R0B1E0","R0B1G0","R0B1H0","R0B1J0","R0B1K0","R0B1L0","R0B1N0","R0B1R0","R0B2B0","R0B2C0","R0B2E0","R0B2H0","R0C0J0","R0C1V0","R0C1X0","R0C2A0","R0C2M0","R0C2P0","R0L1J0","R0L1L0","S0E0S0","S0E1K0","S0J0H0","S0J0W0","S0J1J0","S0J1W0","S0J1Y0","S0J2B0","S0J2L0","S0J2P0","S0J2R0","S0J2T0","S0J2W0","S0J3C0","S0M0G0","S0M0J0","S0M0K0","S0M0M0","S0M0S0","S0M1C0","S0M1G0","S0M1Y0","S0M2H0","S0M3B0","S0M3E0","S0P0B0","S0P0C0","S0P0E0","S0P0G0","S0P0H0","T0A0S0","T0A0W0","T0A3G0","T0G0B0","T0H0R0","T0H0S0","T0H1N0","T0H1R0","T0H1Z0","T0H2G0","T0H2H0","T0H2P0","T0H2W0","T0H2Y0","T0H3C0","T0H4A0","T0H4E0","T0K1Z0","T0P1B0","V0A1C0","V0A1G0","V0A1H0","V0A1K0","V0B1B0","V0B1C0","V0B1J0","V0B1M0","V0C1E0","V0C1R0","V0C1V0","V0C2C0","V0C2L0","V0E1A0","V0E1J0","V0E1L0","V0E1M0","V0E1T0","V0E1V0","V0E1Y0","V0E2G0","V0E2L0","V0E2M0","V0E2N0","V0E2S0","V0E2V0","V0E2Z0","V0E3E0","V0G1A0","V0G1B0","V0G1C0","V0G1E0","V0G1J0","V0G1K0","V0G1M0","V0G1N0","V0G1R0","V0G1S0","V0G1Z0","V0G2B0","V0G2C0","V0G2E0","V0G2J0","V0H1A0","V0H1B0","V0H1J0","V0H1M0","V0H1Y0","V0H2B0","V0J1A0","V0J1B0","V0J1E0","V0J1P0","V0J1R0","V0J1S0","V0J1T0","V0J1X0","V0J2B0","V0J2E0","V0J2G0","V0J2H0","V0J2N0","V0J2P0","V0J2S0","V0J2T0","V0J2V0","V0J2W0","V0J2X0","V0J2Z0","V0J3A0","V0J3B0","V0J3J0","V0J3K0","V0K1A0","V0K1H0","V0K1K0","V0K1L0","V0K1N0","V0K1P0","V0K1R0","V0K1S0","V0K1V0","V0K1Z0","V0K2B0","V0K2H0","V0K2L0","V0K2S0","V0L1B0","V0L1G0","V0L1J0","V0L1K0","V0L1S0","V0L1W0","V0L1X0","V0M1C0","V0N1A0","V0N1E0","V0N1G0","V0N1L0","V0N1M0","V0N1P0","V0N1S0","V0N1V0","V0N1W0","V0N1Z0","V0N2B0","V0N2G0","V0N2J0","V0N2K0","V0N2L0","V0N2N0","V0N2P0","V0N2R0","V0N2V0","V0N2Y0","V0N2Z0","V0N3B0","V0N3C0","V0N3E0","V0N3G0","V0N3H0","V0N3J0","V0N3K0","V0N3L0","V0N3P0","V0N3R0","V0P1A0","V0P1B0","V0P1G0","V0P1H0","V0P1J0","V0P1K0","V0P1L0","V0P1M0","V0P1N0","V0P1P0","V0P1S0","V0P1T0","V0P1V0","V0P1W0","V0P1X0","V0P1Y0","V0P1Z0","V0P2A0","V0P2B0","V0P2C0","V0R1A0","V0R1E0","V0R1N0","V0R1T0","V0R1X0","V0R1Y0","V0R1Z0","V0R2B0","V0R2J0","V0R2P0","V0R2Y0","V0R2Z0","V0R3C0","V0R3G0","V0S1C0","V0S1K0","V0S1L0","V0T1A0","V0T1B0","V0T1C0","V0T1G0","V0T1J0","V0T1K0","V0T1L0","V0T1M0","V0T1N0","V0T1P0","V0T1R0","V0T1S0","v0t1s1","V0T1T0","V0T1V0","V0T1W0","V0T1X0","V0T1Y0","V0T1Z0","V0T2B0","V0V1A0","V0V1B0","V0V1C0","V0V1E0","V0V1H0","V0W1A0","V0X1G0","V0X1L0","V0X1N0","V0X1R0","V0X1W0");


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("Le service de livraison le lendemain n'est pas offert pour les \351chantillons dans votre code postal.  Veuillez choisir la livraison par Postes Canada afin de nous permettre de vous livrer les \351chantillons par le biais de la poste r\351guli\u00E8re.");
			return false;
		}
}
function validateSamplePayment(frmEle){
		if(frmEle.PaymentID.value == "0"){
			alert("Veuillez choisir un type de paiement");
			frmEle.PaymentID.focus();
			return false;
		}
		if(frmEle.CardNumber.value == ""){
			alert("Veuillez entrer votre num\351ro de carte de cr\351dit");
			frmEle.CardNumber.focus();
			return false;
		}
		if(frmEle.BillName.value == ""){
			alert("Veuillez entrer votre nom tel qu'il appara\u00EEt sur la carte de cr\351dit");
			frmEle.BillName.focus();
			return false;
		}
		
		if(frmEle.cvv2.value.length < 3){
			
			alert("Veuillez entrer le code de s\351curit\351 \u00E0 l'arri\u00E8re de la carte de cr\351dit");
			frmEle.cvv2.focus();
			return false;
		}
		
		if(frmEle.BillState.value == "" || frmEle.BillState.value == "0"){
		alert("Veuillez entrer votre Province");
		frmEle.BillState.focus();
		return false;
	}
	

	
	if(frmEle.BillState.value == "out")
	{
	var answer = confirm("StoresSelectsCanada.ca n'accepte les commandes qu'en provenance et \u00E0 destination d'adresses canadiennes.  Pour les livraisons vers d'autres pays, incluant  les \u00C9tats\u00ADUnis, visitez le site SelectBlinds.com.  Cliquez sur OK pour aller \u00E0 SelectBlinds.com maintenant.  Sinon, cliquez sur 'Annuler' et choisissez votre 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("Veuillez entrer votre code postal dans le 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("Veuillez entrer votre code postal dans le format X0X 0X0");
			frmEle.BillZip.focus();
			return false;
		}
	}
}


function validateUserLogin(frmEle){

if(frmEle.username){
		if(frmEle.username.value == ""){
				alert("Veuillez entrer votre Adresse de Courriel");
			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("Adresse de courriel incorrecte!  Veuillez apporter les changements n\351cessaires.");
			frmEle.username.focus();
			return false;
		}
	 }
}



//User scripts
function validateUser(frmEle){



if(frmEle.atype.value == "A")
	{
				if(frmEle.Password)
				{
					if(frmEle.Password.value == ""){
						alert("Veuillez entrer un mot de passe");
						frmEle.Password.focus();
						return false;
					}
					if(frmEle.Password.value != frmEle.Password2.value){
						alert("Le mot de passe ne correspond pas");
						frmEle.Password.focus();
						return false;
					}
				}
				
				if(frmEle.PasswordReminderID.value == "0"){
					alert("Veuillez entrer votre Question Secr\u00E8te");
					frmEle.PasswordReminderID.focus();
					return false;
				}
				
				if(frmEle.PasswordReminderAnswer.value == ""){
					alert("Veuillez entrer votre R\351ponse Secr\u00E8te");
					frmEle.PasswordReminderAnswer.focus();
					return false;
				}
	
}


	if(frmEle.shipping[0].checked==false && frmEle.shipping[1].checked == false)
	{
			alert("Choisir OUI si votre adresse de livraison est la m\u00EAme que celle de facturation et NON si elle est diff\351rente.");
			frmEle.shipping[1].focus();
			return false;
		}
	
	
	
	
	
		if(frmEle.Email.value != frmEle.Email2.value){
			alert("Les adresses de courriel ne sont pas pareilles, s.v.p. r\351viser et assurez\u00ADvous qu'elles soient pareilles.");
			frmEle.Email.focus();
			return false;
		}
	
	if(frmEle.Email){
		if(frmEle.Email.value == ""){
			alert("Veuillez entrer votre Adresse de Courriel");
			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("Adresse de courriel incorrecte!  Veuillez apporter les changements n\351cessaires.");
			frmEle.Email.focus();
			return false;
		}
	 }



	if(frmEle.FirstName.value == ""){
		alert("Veuillez entrer votre Pr\351nom");
		frmEle.FirstName.focus();
		return false;
	}
	if(frmEle.LastName.value == ""){
		alert("Veuillez entrer votre Nom de Famille");
		frmEle.LastName.focus();
		return false;
	}
	if(frmEle.Address.value == ""){
		alert("Veuillez entrer votre Adresse");
		frmEle.Address.focus();
		return false;
	}
	
	
	
	
	
	if(frmEle.City.value == ""){
		alert("Veuillez entrer votre Ville");
		frmEle.City.focus();
		return false;
	}
	if(frmEle.State.value == "" || frmEle.State.value == "0"){
		alert("Veuillez entrer votre Province");
		frmEle.State.focus();
		return false;
	}
	
	
	if(frmEle.State.value == "out")
	{
	var answer = confirm("StoresSelectsCanada.ca n'accepte les commandes qu'en provenance et \u00E0 destination d'adresses canadiennes.  Pour les livraisons vers d'autres pays, incluant  les \u00C9tats\u00ADUnis, visitez le site SelectBlinds.com.  Cliquez sur OK pour aller \u00E0 SelectBlinds.com maintenant.  Sinon, cliquez sur 'Annuler' et choisissez votre 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("Veuillez entrer votre code postal dans le 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("Veuillez entrer votre code postal dans le format X0X 0X0");
			frmEle.Zip.focus();
			return false;
		}
	}
	
	
	if(frmEle.Phone.value == ""){
		alert("Veuillez entrer un num\351ro de t\351l\351phone qui no permettra de vous contacter le jour");
		frmEle.Phone.focus();
		return false;
	}
	
		if(frmEle.Phone2.value == ""){
		alert("Veuillez entrer un num\351ro de t\351l\351phone qui no permettra de vous contacter le soir");
		frmEle.Phone2.focus();
		return false;
	}
	
	
	if(frmEle.shipping[1].checked)
	
	//if(frmEle.shipping.value == "1")
	{
	
	
						if(frmEle.SFirstName.value == ""){
						alert("Veuillez entrer votre Pr\351nom pour la livraison");
						frmEle.SFirstName.focus();
						return false;
					}
					if(frmEle.SLastName.value == ""){
						alert("Veuillez entrer votre Nom de Famille pour la livraison");
						frmEle.SLastName.focus();
						return false;
					}
					if(frmEle.SAddress.value == ""){
						alert("Veuillez entrer votre Adresse pour la livraison");
						frmEle.SAddress.focus();
						return false;
					}
					
					
					
					
					
					if(frmEle.SCity.value == ""){
						alert("Veuillez entrer votre Ville");
						frmEle.SCity.focus();
						return false;
					}
					if(frmEle.SState.value == "" || frmEle.SState.value == "0"){
						alert("Veuillez entrer votre Province pour la livraison");
						frmEle.SState.focus();
						return false;
					}
					
					
					if(frmEle.SState.value == "out")
					{
					var answer = confirm("StoresSelectsCanada.ca n'accepte les commandes qu'en provenance et \u00E0 destination d'adresses canadiennes.  Pour les livraisons vers d'autres pays, incluant  les \u00C9tats\u00ADUnis, visitez le site SelectBlinds.com.  Cliquez sur OK pour aller \u00E0 SelectBlinds.com maintenant.  Sinon, cliquez sur 'Annuler' et choisissez votre 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("Veuillez entrer votre code postal dans le 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("Veuillez entrer votre code postal dans le format X0X 0X0");
							frmEle.SZip.focus();
							return false;
						}
					}
					
						if(frmEle.SPhone.value == ""){
						alert("Veuillez entrer un num\351ro de t\351l\351phone pour la livraison");
						frmEle.SPhone.focus();
						return false;
						}
				
					
					
	
	}
	
	
	
	
	
	
	
	

	
}





















//Gift Card Scripts
function validateGiftCardPayment(frmEle){
		if(frmEle.Amount.value == "0"){
			alert("Veuillez choisir un type de ch\u00E8que\u00ADcadeau");
			frmEle.Amount.focus();
			return false;
		}
		if(frmEle.PaymentID.value == "0"){
			alert("Veuillez choisir un type de paiement");
			frmEle.PaymentID.focus();
			return false;
		}
		if(frmEle.CardNumber.value == ""){
			alert("Veuillez entrer votre num\351ro de carte de cr\351dit");
			frmEle.CardNumber.focus();
			return false;
		}
		if(frmEle.BillName.value == ""){
			alert("Veuillez entrer votre nom tel qu'il appara\u00EEt sur la carte de cr\351dit");
			frmEle.BillName.focus();
			return false;
		}
		
			if(frmEle.cvv2.value.length < 3){
			
			alert("Veuillez entrer le code de s\351curit\351 \u00E0 l'arri\u00E8re de la carte de cr\351dit");
			frmEle.cvv2.focus();
			return false;
		}

	if(frmEle.BillAddress.value == ""){
		alert("Veuillez entrer votre adresse");
		frmEle.BillAddress.focus();
		return false;
	}

	if(frmEle.BillCity.value == ""){
		alert("Veuillez entrer votre ville");
		frmEle.BillCity.focus();
		return false;
	}
	
		
		
	if(frmEle.BillState.value == "" || frmEle.BillState.value == "0"){
		alert("Veuillez entrer votre Province");
		frmEle.BillState.focus();
		return false;
	}
	
	
	if(frmEle.BillState.value == "out")
	{
	var answer = confirm("StoresSelectsCanada.ca n'accepte les commandes qu'en provenance et \u00E0 destination d'adresses canadiennes.  Pour les livraisons vers d'autres pays, incluant  les \u00C9tats\u00ADUnis, visitez le site SelectBlinds.com.  Cliquez sur OK pour aller \u00E0 SelectBlinds.com maintenant.  Sinon, cliquez sur 'Annuler' et choisissez votre 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("Veuillez entrer votre code postal dans le 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("Veuillez entrer votre code postal dans le format X0X 0X0");
				frmEle.BillZip.focus();
				return false;
			}
		}
		
		
	
		if(frmEle.Email)
		{
			if(frmEle.Email.value == ""){
				alert("Veuillez entrer votre adresse de courriel");
				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("Adresse de courriel incorrecte!  Veuillez apporter les changements n\351cessaires.");
				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){
	MM_showHideLayers('descriptionLayer','','hide');
	MM_showHideLayers('infoLayer','','hide');
	MM_showHideLayers('colorsLayer','','hide');
	MM_showHideLayers('shippingLayer','','hide');
	MM_showHideLayers(tabName,'','show');
	
	MM_swapImage('descTransImage','','/images/pronav/leftOff.jpg');
	MM_swapImage('colorsTransImage','','/images/pronav/leftOff.jpg');
	MM_swapImage('infoTransImage','','/images/pronav/leftOff.jpg');
	MM_swapImage('shippingTransImage','','/images/pronav/leftOff.jpg');
	
	
	if(tabName == 'descriptionLayer'){
		MM_swapImage('descriptionImage','','/images/pronav/DescriptionOn2.jpg');
		MM_swapImage('descTransImage','','/images/pronav/leftOn.jpg');
			MM_showHideLayers('dis57','','hide');
	}
	else{
		MM_swapImage('descriptionImage','','/images/pronav/DescriptionOff2.jpg');
	}
	if(tabName == 'infoLayer'){
		MM_swapImage('infoImage','','/images/pronav/FeaturesOn2.jpg');
		MM_swapImage('infoTransImage','','/images/pronav/leftOn.jpg');
		MM_swapImage('colorsTransImage','','/images/pronav/leftcurve.jpg');
			MM_showHideLayers('dis57','','hide');
	}
	else{
		MM_swapImage('infoImage','','/images/pronav/FeaturesOff2.jpg');
	}
	if(tabName == 'colorsLayer'){
		MM_swapImage('colorsImage','','/images/pronav/ColorsOn2.jpg');
		MM_swapImage('colorsTransImage','','/images/pronav/leftOn.jpg');
		MM_swapImage('descTransImage','','/images/pronav/leftcurve.jpg');
			MM_showHideLayers('dis57','','show');
	}
	else{
		MM_swapImage('colorsImage','','/images/pronav/ColorsOff2.jpg');
	}
	if(tabName == 'shippingLayer'){
		MM_swapImage('shippingImage','','/images/pronav/ShippingOn2.jpg');
		MM_swapImage('shippingTransImage','','/images/pronav/leftOn.jpg');
		MM_swapImage('infoTransImage','','/images/pronav/leftcurve.jpg');
			MM_showHideLayers('dis57','','hide');
	}
	else{
		MM_swapImage('shippingImage','','/images/pronav/ShippingOff2.jpg');
	}
	
}
*/




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.storesselectscanada.ca/images/pronav/leftOff.jpg');
	MM_swapImage('colorsTransImage','','http://www.storesselectscanada.ca/images/pronav/leftOff.jpg');
	MM_swapImage('infoTransImage','','http://www.storesselectscanada.ca/images/pronav/leftOff.jpg');
	MM_swapImage('shippingTransImage','','http://www.storesselectscanada.ca/images/pronav/leftOff.jpg');
	if(document.getElementById('ReviewLayerCount'))  MM_swapImage('reviewTransImage','','http://www.storesselectscanada.ca/images/pronav/leftOff.jpg');
	
	
	if(tabName == 'descriptionLayer'){
	MM_showHideLayers('dis57','','hide');
		MM_swapImage('descriptionImage','','http://www.storesselectscanada.ca/images/pronav/DescriptionOn2.jpg');
		MM_swapImage('descTransImage','','http://www.storesselectscanada.ca/images/pronav/leftOn.jpg');
	}
	else{
		MM_swapImage('descriptionImage','','http://www.storesselectscanada.ca/images/pronav/DescriptionOff2.jpg');
	}
	if(tabName == 'infoLayer'){
	MM_showHideLayers('dis57','','hide');
		MM_swapImage('infoImage','','http://www.storesselectscanada.ca/images/pronav/FeaturesOn2.jpg');
		MM_swapImage('infoTransImage','','http://www.storesselectscanada.ca/images/pronav/leftOn.jpg');
		MM_swapImage('colorsTransImage','','http://www.storesselectscanada.ca/images/pronav/leftcurve.jpg');
	}
	else{
		MM_swapImage('infoImage','','http://www.storesselectscanada.ca/images/pronav/FeaturesOff2.jpg');
	}
	if(tabName == 'colorsLayer'){
	MM_showHideLayers('dis57','','show');
		MM_swapImage('colorsImage','','http://www.storesselectscanada.ca/images/pronav/ColorsOn2.jpg');
		MM_swapImage('colorsTransImage','','http://www.storesselectscanada.ca/images/pronav/leftOn.jpg');
		MM_swapImage('descTransImage','','http://www.storesselectscanada.ca/images/pronav/leftcurve.jpg');
	}
	else{
		MM_swapImage('colorsImage','','http://www.storesselectscanada.ca/images/pronav/ColorsOff2.jpg');
	}
	
	
	if(tabName == 'shippingLayer'){
		MM_showHideLayers('dis57','','hide');
		if(document.getElementById('ReviewLayerCount'))
			{
			MM_swapImage('shippingImage','','http://www.storesselectscanada.ca/images/pronav/ShippingOn2.jpg');
			MM_swapImage('shippingTransImage','','http://www.storesselectscanada.ca/images/pronav/leftOn.jpg');
			MM_swapImage('infoTransImage','','http://www.storesselectscanada.ca/images/pronav/leftcurve.jpg');
			}
		else
		{
		MM_swapImage('shippingImage','','http://www.storesselectscanada.ca/images/pronav/ShippingOn2.jpg');
	    MM_swapImage('shippingTransImage','','http://www.storesselectscanada.ca/images/pronav/leftOn.jpg');
		MM_swapImage('infoTransImage','','http://www.storesselectscanada.ca/images/pronav/leftcurve.jpg');
		}
	}
	else
	{
		if(document.getElementById('ReviewLayerCount')) 
			MM_swapImage('shippingImage','','http://www.storesselectscanada.ca/images/pronav/ShippingOff2ext.jpg');
		else
			MM_swapImage('shippingImage','','http://www.storesselectscanada.ca/images/pronav/ShippingOff2.jpg');
	}
	
	
	
	
	
	if(document.getElementById('ReviewLayerCount')) 
	{
		if(tabName == 'reviewLayer'){
			MM_showHideLayers('dis57','','hide');
			MM_swapImage('reviewImage','','http://www.storesselectscanada.ca/images/pronav/ReviewOn.jpg');
			MM_swapImage('reviewTransImage','','http://www.storesselectscanada.ca/images/pronav/leftOn.jpg');
			MM_swapImage('reviewTransImage','','http://www.storesselectscanada.ca/images/pronav/leftcurve.jpg');
		}
		else{
			MM_swapImage('reviewImage','','http://www.storesselectscanada.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() {
	document.getElementById('TwoOnOne').style.display = "block";
	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("Conseil pour \351conomiser de l'argent : Vous pouvez \351conomiser en commandant 2 ou 3 stores s\351par\351s plut\u00F4t que plusieurs stores sur un m\u00EAme caisson. Vous \351conomiserez ainsi les frais suppl\351mentaires pour 2 ou 3 stores sur un caisson et n'encourrez pas la surtaxe de 85$ rattach\351e aux envois hors format si votre store mesure plus de 94 pouces de largeur. De plus, vos stores seront plus faciles \u00E0 installer et risqueront moins d'\u00EAtre endommag\351s au cours de la livraison. S\351lectionnez l'option 'Cantonni\u00E8re commune' et vous obtiendrez une seule cantonni\u00E8re qui couvrira tous les caissons de vos stores afin de leur procurer un aspect uniforme. Assurez\u00ADvous de nous mentionner la grandeur de la cantonni\u00E8re dans la section r\351serv\351e aux 'commentaires'.");
	
	document.getElementById('MoneySavingTip').value = "1";
	}
}

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

function DO_that3() {
	document.getElementById('TreeOnOne').style.display = "block";
	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("Conseil pour \351conomiser de l'argent : Vous pouvez \351conomiser en commandant 2 ou 3 stores s\351par\351s plut\u00F4t que plusieurs stores sur un m\u00EAme caisson. Vous \351conomiserez ainsi les frais suppl\351mentaires pour 2 ou 3 stores sur un caisson et n'encourrez pas la surtaxe de 85$ rattach\351e aux envois hors format si votre store mesure plus de 94 pouces de largeur. De plus, vos stores seront plus faciles \u00E0 installer et risqueront moins d'\u00EAtre endommag\351s au cours de la livraison. S\351lectionnez l'option 'Cantonni\u00E8re commune' et vous obtiendrez une seule cantonni\u00E8re qui couvrira tous les caissons de vos stores afin de leur procurer un aspect uniforme. Assurez\u00ADvous de nous mentionner la grandeur de la cantonni\u00E8re dans la section r\351serv\351e aux 'commentaires'.");
	
	document.getElementById('MoneySavingTip').value = "1";
	}
	

	}
	
	
	
function Print2on1And3on1Msg() {

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

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

}	
	
	
function DO_that4() {
	document.getElementById('TreeOnOne').style.display = "None";
	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";
	
}


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