var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			   string: navigator.userAgent,
			   subString: "iPhone",
			   identity: "iPhone/iPod"
	    },
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();
function writeToConsole(msg)
{
	var browser = BrowserDetect.browser;
	if(browser == 'Firefox'){
		//console.log(msg);
	}
}
function clearConsole()
{
	var browser = BrowserDetect.browser;
	if(browser == 'Firefox'){
		//console.clear();
	}	
}
function convertInches(){
    var formobj = document.quote;
    var Width_ft = parseInt(formobj.Width_ft.value);
    var Width_inch = parseInt(formobj.Width_inch.value);
    var Lenght_ft = parseInt(formobj.Lenght_ft.value);
    var Length_inch = parseInt(formobj.Length_inch.value);
    if(Width_inch > 11)
    {
      formobj.Width_ft.value = 0;
      Width_ft = Math.abs((parseInt(Width_inch/12)));
      Width_inch = Math.abs(parseInt(Width_inch%12));
      formobj.Width_inch.value = Width_inch;
      formobj.Width_ft.value = Width_ft;
    }
    
    if(Length_inch > 11){
      formobj.Lenght_ft.value = 0;
      Lenght_ft = Math.abs((parseInt(Length_inch/12)));
      Length_inch = Math.abs(parseInt(Length_inch%12));
      formobj.Lenght_ft.value = Lenght_ft;
      formobj.Length_inch.value = Length_inch;
    }

    if(Width_ft == 0 && Width_inch > 0){
      formobj.Width_ft.value = 0;
      Width_ft = Math.abs((parseInt(Width_inch/12)));
      Width_inch = Math.abs(parseInt(Width_inch%12));
      formobj.Width_inch.value = Width_inch;
      formobj.Width_ft.value = Width_ft;
    }
    if(Lenght_ft == 0 && Length_inch > 0){
      formobj.Lenght_ft.value = 0;
      Lenght_ft = Math.abs((parseInt(Length_inch/12)));
      Length_inch = Math.abs(parseInt(Length_inch%12));
      formobj.Lenght_ft.value = Lenght_ft;
      formobj.Length_inch.value = Length_inch;
    }
}
//END Border Width Options for SMall Boucle Sorrento Resort Deco with Tan border August 18, 2009

function BorderWidthOptions() {
	var obj = document.quote;
	var boucle = '';
    var WeaveNumber = obj.Weave.options[obj.Weave.selectedIndex].value;
    var selectedBorder = obj.Border.options[obj.Border.selectedIndex].value;
    //alert(WeaveNumber +' '+ selectedBorder);	
    if((WeaveNumber == '3026' || WeaveNumber == '3021' || WeaveNumber == '3031' || WeaveNumber=='3033') && selectedBorder=='i')
    {
    	boucle = ' <option value=\"3.50_g\">1/2\" - Top Stitch</option> ';
    }
	var strOptionFG =  '<select name=\"Border_Width\" id=\"Border_Width\"' +
						' onChange=\"makequote()\"  size=\"1\"  style=\"width:240px\"> ' + 
						' <option>Choose A Stitch</option> ' +
						boucle +                                                    
						' <option value=\"3.50_a\">1 1/4\" - Top Stitch</option> ' +
						//Removed as of 8/4/10
						//' <option value=\"10.00_c\">1 1/4\" - Blind Stitch</option>' +
						//' <option value=\"10.00_b\">1 1/2\" - Blind Stitch</option>' +                                                   
						' </select>';
	var strOptionOthers =  '<select name=\"Border_Width\" id=\"Border_Width\"' +
						' onChange=\"makequote()\" size=\"1\"  style=\"width:240px\"> ' +
						' <option>Choose A Stitch</option> ' +
						boucle +            
						' <option value=\"3.50_a\">1 1/4\" - Top Stitch</option> ' +
						' <option value=\"4.00_d\">2 1/4\" - Top Stitch</option> ' +
						' <option value=\"10.00_e\">2\" - Blind Stitch</option> ' +
						//Removed as of 8/4/10
						//' <option value=\"10.00_f\">2 3/4\" - Blind Stitch</option> ' +
						' </select>';
	if (selectedBorder =="f" ||  selectedBorder == "g") {
         document.getElementById("borderOPT").innerHTML = strOptionFG;
	} else {
         document.getElementById("borderOPT").innerHTML = strOptionOthers;
	}
	makequote();
	document.getElementById("btn_makeorder").Enabled = false;
	document.getElementById("quotedprice").value = '';	
}
function cornerOptions()
{
	var formobj = document.quote;
    for (var i = 0; i < 4; i++) {
        if (formobj.Shape[i].checked) {
            Shape = formobj.Shape[i].value;
            break;
       }
    }	
	var strOptionFG =  '<select name=\"Corner\" id=\"Corner\"' +
						' onChange=\"makequote()\"  size=\"1\"  style=\"width:240px\"> ' + 
						' <option value="0">Standard Corner</option> ' +                                                                                             
						' </select>';
	var strOptionOthers =  '<select name=\"Corner\" id=\"Corner\"' +
						' onChange=\"makequote()\" size=\"1\"  style=\"width:240px\"> ' +
						' <option value="0">Standard Corner</option> ' +
						' <option value="60.00">Mitered Corners - Add $60</option> ' +
						' </select>';
	//No mitered corners option for oval and round shaped rugs
	if (Shape == 'Oval' ||  Shape  == 'Round') {
         document.getElementById("cornerOPT").innerHTML = strOptionFG;
	} else {
         document.getElementById("cornerOPT").innerHTML = strOptionOthers;
	}
	makequote();
}

function checkForm()
{
	var obj = document.quote;
	var xprice = document.getElementById("quotedprice").value;
	if(xprice == '' || xprice == 0.00)
	{
		alert('Please check your entries');
		return false;
	}
	if(document.getElementById("Border_Width").value == ''){
		alert('Please check Border Width');
		return false;
	}
}

//END Border Width Options for SMall Boucle Sorrento Resort Deco with Tan border August 18, 2009

//END Shape option by: Dna Claremont Design August 7, 2009

function dna_shapeoptions()
{
	var formobj = document.quote;
	var Shape = '';
	var widthFeetBox = document.getElementById("Width_ft");
	var widthInchBox = document.getElementById("Width_inch");
	var lengthFeetBox = document.getElementById("Lenght_ft");
	var lengthInchBox = document.getElementById("Length_inch");	
	var DiameterFeetBox = document.getElementById("Diameter_ft");
	var DiameterInchBox = document.getElementById("Diameter_inch");
	var Diameter_row = document.getElementById("Diameter_row");
	var Width_row = document.getElementById("Width_row");
	var Length_row = document.getElementById("Length_row");
	var Diameter_row_spacer = '';//document.getElementById("Diameter_row_spacer");
	var Width_row_spacer = '';//document.getElementById("Width_row_spacer");
	var Length_row_spacer = ''//document.getElementById("Length_row_spacer");

    for (var i = 0; i < 4; i++) {
        if (formobj.Shape[i].checked) {
            Shape = formobj.Shape[i].value;
            break;
       }
    }
	//alert('Shape: '+Shape);
	if(Shape==''){alert("Please select a shape."); return;}
	    if(Shape=='Round')
	    {
	    	Diameter_row.style.display = '';
	    	//Diameter_row_spacer.style.display = '';
	    	Width_row.style.display = 'none';
	    	Length_row.style.display = 'none';
	    	//Width_row_spacer.style.display = 'none';
	    	//Length_row_spacer.style.display = 'none';    	
	    	widthFeetBox.value = DiameterFeetBox.value;
	    	widthInchBox.value = DiameterInchBox.value;
			lengthFeetBox.value = widthFeetBox.value;
			lengthInchBox.value = widthInchBox.value;
	    } else {
	    	DiameterFeetBox.value = widthFeetBox.value;
	    	DiameterInchBox.value = widthInchBox.value;
	    	Diameter_row.style.display = 'none';
	    	//Diameter_row_spacer.style.display = 'none';
	    	Width_row.style.display = '';
	    	Length_row.style.display = '';
	    	//Width_row_spacer.style.display = '';
	    	//Length_row_spacer.style.display = '';        	
	    }
    document.getElementById("Custom_ShapeName").value = Shape;
    document.getElementById("Custom_Shape").value = Shape;
    return Shape;
}
//END Shape option by: Dna Claremont Design August 7, 2009

function setAnError(element)
{
	document.getElementById("quotedprice").value = '$0.00';	
}

//Price = (Width * Length * Weave Price) + ((Width + Length) * 2 * Binding)
function makequote() {
	clearConsole();
	convertInches();
	var Shape = 'Rectangle';
	var Shape = dna_shapeoptions();
	if(Shape==''){return;}
	WeaveBox = document.getElementById('Weave');
	document.getElementById('WeaveNumber').value = WeaveBox.options[WeaveBox.selectedIndex].value;
	document.getElementById('WeaveName').value = WeaveBox.options[WeaveBox.selectedIndex].text;
	document.getElementById('WeaveName').value = (document.getElementById('WeaveName').value).replace(/^\s*|\s*$/g,'');
	//var WeaveBox = document.quote.Weave;
	CornerBox = document.getElementById("Corner");
	Border = document.getElementById("Border").value;
	//CornerBox = document.forms[0].Corner;
	Border_WidthBox = document.getElementById("Border_Width");
	document.getElementById('BorderWidthName').value = Border_WidthBox.options[Border_WidthBox.selectedIndex].text;
	//Border_WidthBox = document.forms[0].Border_Width;
	BorderWidthCode = '';
	widthFeetBox = document.getElementById("Width_ft");
	widthInchBox = document.getElementById("Width_inch");
	lengthFeetBox = document.getElementById("Lenght_ft");
	lengthInchBox = document.getElementById("Length_inch");
	CustomShapeBox = document.getElementById("Custom_Shape");
	DiameterFeetBox = document.getElementById("Diameter_ft");
	DiameterInchBox = document.getElementById("Diameter_inch");
	
    if(Shape=='Round')
    {
    	widthFeetBox.value = DiameterFeetBox.value;
    	widthInchBox.value = DiameterInchBox.value;
		lengthFeetBox.value = DiameterFeetBox.value;
		lengthInchBox.value = DiameterInchBox.value;
    } else {
    	DiameterFeetBox.value = widthFeetBox.value;
    	DiameterInchBox.value = widthInchBox.value;     	
    }
	
	//alert(Border_WidthBox.options[Border_WidthBox.selectedIndex].value);
	//alert(widthFeetBox.value);
	var	weavetext = WeaveBox.options[WeaveBox.selectedIndex].text;
	var a = weavetext.indexOf("$")+1;
	var b = weavetext.indexOf("/sq");
	WeaveBoxValue = weavetext.substring(a,b);
	//alert(WeaveBoxValue);
	//- Comment dahil we are getting the price from the text of the Weave.
	//WeaveBoxValue = WeaveBox.options[WeaveBox.selectedIndex].value;
	CornerBoxValue = CornerBox.options[CornerBox.selectedIndex].value;
	CornerBoxName = CornerBox.options[CornerBox.selectedIndex].text;
	Border_WidthBoxValue = Border_WidthBox.options[Border_WidthBox.selectedIndex].value;
	Border_WidthBoxSplit =  Border_WidthBoxValue.split("_");
	document.getElementById('BorderWidthCode').value = Border_WidthBoxValue;
	Border_WidthBoxValue = Border_WidthBoxSplit[0];
	CustomShapeBoxValue = '';
	//Border_WidthBox.options[Border_WidthBox.selectedIndex].value = Border_WidthBoxSplit[0];
	document.getElementById("Weavex").value = WeaveBox.options[WeaveBox.selectedIndex].text;
	document.getElementById("CornerName").value = CornerBox.options[CornerBox.selectedIndex].text;
	document.getElementById("Border_WidthName").value = Border_WidthBox.options[Border_WidthBox.selectedIndex].value+' '+Border_WidthBox.options[Border_WidthBox.selectedIndex].text;
	document.getElementById("Custom_ShapeName").value = Shape;
	// This is the computation for rugpads
	
	
	
	
	padayon =  true;
	if(Border == ''){
		padayon = false;
		document.getElementById("quotedprice").value = '';
		//alert('Please select a Border Color');
		return;
	}	
	
	var errfield = '';
	if(document.getElementById('BorderWidthCode').value == 'Choose A Stitch'){
		document.getElementById("quotedprice").value = '';
		return;
	}
	if(document.getElementById("Border_Width").value == ''){
		document.getElementById("quotedprice").value = '';
		return;
	}
	
	//checkcorner();
	checkbordercolor();
	checkbordertype();
	// initialize padayon to true for computation;
	var
	wFt = 0;
	wIn = 0;
	lFt = 0;
	lIn = 0;
	


/*	if (widthFeetBox.value =='' ) widthFeetBox.value = 1;
	if (widthInchBox.value =='') widthInchBox.value = 3;
	if (lengthFeetBox.value == '') lengthFeetBox.value = 1;
	if (lengthInchBox.value == '') lengthInchBox.value = 3;
*/	
	if (widthFeetBox.value =='' ) {
		wFt = 0;
		document.getElementById("Width_ft").value = 0;
	} else {
		wFt = widthFeetBox.value;
	}
	if (widthInchBox.value =='') {
		wIn = 0;
		document.getElementById("Width_inch").value = 0;
	} else {
		wIn = 	widthInchBox.value;
	}
	if (lengthFeetBox.value == '') {
		lFt = 0;
		document.getElementById("Lenght_ft").value = 0;
	} else {
		lFt = lengthFeetBox.value;	
	}
	if (lengthInchBox.value == '') {
		lIn = 0;
		document.getElementById("Length_inch").value = 0;
	} else {
		lIn = lengthInchBox.value;	
	}

	var TotalWidthInches = ((parseFloat(wFt) * 12)  +  parseFloat(wIn));
	var TotalLengthInches = ((parseFloat(lFt) * 12)  +  parseFloat(lIn));
	wFt = widthFeetBox.value = parseInt(TotalWidthInches / 12);
	wIn = widthInchBox.value = Math.round(parseFloat(TotalWidthInches % 12),2);
	lFt = lengthFeetBox.value = parseInt(TotalLengthInches / 12);
	lIn = lengthInchBox.value = Math.round(parseFloat(TotalLengthInches % 12),2);
	DiameterFeetBox.value = parseInt(TotalWidthInches / 12);
	DiameterInchBox.value = Math.round(parseFloat(TotalWidthInches % 12),2);
	
	var TotalWidth = (parseFloat(wFt)  + parseFloat(wIn/12));
	var TotalLength = (parseFloat(lFt)  + parseFloat(lIn/12));
//	if (widthFeetBox.value != '' || widthInchBox.value != '' || lengthFeetBox.value != '' || lengthInchBox.value != '') {
	if (TotalWidth > 0 && TotalLength > 0 && padayon == true) {
		/*
		if (!validateNumeric(widthFeetBox.value)) {
			alert('width in feet is not valid number');
			padayon = false;
		}
		if (!validateNumeric(widthInchBox.value)) {
			alert('width in inch(s) is not valid number');
			padayon = false;
		}
		if (!validateNumeric(lengthFeetBox.value)) {
			alert('length in feet is not valid number');
			padayon = false;
		}
		if (!validateNumeric(lengthInchBox.value)) {
			alert('length in inch(s) is not valid number');
			padayon = false;
		}
		*/
		//padayon = true;
		if(padayon) {
			writeToConsole('================================ Dna Console ==============================');
			writeToConsole('================================ New Computation ==============================');
			writeToConsole('================================ Start ==============================');
			writeToConsole('Price = (Width * Length * Material Price) + ((Width + Length) * 2 * Binding)');
		//-- perform the computation here
			//get the total width in inches
			//TotalWidth = (parseFloat(widthFeetBox.value)  + parseFloat(widthInchBox.value/12)) *2;
			//TotalWidth = (parseFloat(wFt)  + parseFloat(wIn/12)) *2;
			//TotalWidth = (parseFloat(wFt)  + parseFloat(wIn/12));
			//alert(TotalWidth);
			//get total length in inches
			//TotalLength = (parseFloat(lengthFeetBox.value)  + parseFloat(lengthInchBox.value/12))*2;
			//TotalLength = (parseFloat(lFt)  + parseFloat(lIn/12))*2;
			//TotalLength = (parseFloat(lFt)  + parseFloat(lIn/12));
			//alert(TotalLength);
			//get  total area
			//TotArea = (parseFloat(widthFeetBox.value)  + parseFloat(widthInchBox.value/12)) * (parseFloat(lengthFeetBox.value)  + parseFloat(lengthInchBox.value/12));
			writeToConsole('Width: ' + wFt + ' x ' + wIn);
			writeToConsole('Length: ' + lFt + ' x ' + lIn);
			writeToConsole('Total Width: ' + TotalWidth);
			writeToConsole('Total Length: ' + TotalLength);
			writeToConsole('Total Width (inches): ' + TotalWidthInches);
			writeToConsole('Total Length (inches): ' + TotalLengthInches);
			if(TotalWidthInches > 0 && TotalLengthInches > 0){
				if(TotalWidthInches < 12){
					alert('Minimum width is 1 ft.');
					setAnError('');
					return false;
				}
				if(TotalWidthInches > 156){
					alert('Maximum width is 13 ft.');
					setAnError('');
					return false;
				}
				if(TotalLengthInches < 36){
					alert('Minimum length is 3 ft.');
					setAnError('');
					return false;
				}
				if(TotalLengthInches > 1080){
					alert('Maximum length is 90 ft.');
					setAnError('');
					return false;
				}
			}
			
			//Removed as of 8/4/10
			//Check Width Restrictions for the following sizes: 2x3, 2'6x8, 3x5, 4x6, 5x8, 6x9, 8x10, 9x12 Customers should not be able to order standard size rugs 
			
			//var boxWidthCode = document.getElementById('BorderWidthCode').value;
			//if(TotalWidthInches > 0 && TotalLengthInches > 0){
			//	if(boxWidthCode == '3.50_a' && CornerBoxValue == 0 && Shape == 'Rectangle'){
			//		writeToConsole('TotalWidthInches: ' + TotalWidthInches + ' TotalLengthInches: ' + TotalLengthInches);
			//		if(TotalWidthInches == 30 && TotalLengthInches == 96){
			//			alert('Size: 2\'6 x 8 cannot be ordered as Custom Size.');
			//			setAnError('');
			//			return false;
			//		}
			//		if(TotalWidthInches == 24 && TotalLengthInches == 36){
			//			alert('Size 2 x 3 can be ordered through our standard sizes for custom borders.');
			//			setAnError('');
			//			return false;
			//		}
			//		if(TotalWidthInches == 36 && TotalLengthInches == 60){
			//			alert('Size 3 x 5 can be ordered through our standard sizes for custom borders.');
			//			setAnError('');
			//			return false;
			//		}
			//		if(TotalWidthInches == 48 && TotalLengthInches == 72){
			//			alert('Size 4 x 6 can be ordered through our standard sizes for custom borders.');
			//			setAnError('');
			//			return false;
			//		}
			//		if(TotalWidthInches == 60 && TotalLengthInches == 96){
			//			alert('Size 5 x 8 can be ordered through our standard sizes for custom borders.');
			//			setAnError('');
			//			return false;
			//		}
			//		if(TotalWidthInches == 72 && TotalLengthInches == 108){
			//			alert('Size 6 x 9 can be ordered through our standard sizes for custom borders.');
			//			setAnError('');
			//			return false;
			//		}
			//		if(TotalWidthInches == 96 && TotalLengthInches == 120){
			//			alert('Size 8 x 10 can be ordered through our standard sizes for custom borders.');
			//			setAnError('');
			//			return false;
			//		}
			//		if(TotalWidthInches == 96 && TotalLengthInches == 144){
			//			alert('Size 8 x 12 can be ordered through our standard sizes for custom borders.');
			//			setAnError('');
			//			return false;
			//		}
			//		if(TotalWidthInches == 108 && TotalLengthInches == 144){
			//			alert('Size 9 x 12 can be ordered through our standard sizes for custom borders.');
			//			setAnError('');
			//			return false;
			//		}
			//		if(TotalWidthInches == 144 && TotalLengthInches == 180){
			//			alert('Size 12 x 15 can be ordered through our standard sizes for custom borders.');
			//			setAnError('');
			//			return false;
			//		}
			//	}
			//}
			
			TotArea = (parseFloat(wFt)  + parseFloat(wIn/12)) * (parseFloat(lFt)  + parseFloat(lIn/12));
			//--Total Linear Lenght of the product
			TotLinLength = parseFloat(TotalWidth) + parseFloat(TotalLength);
			//alert(TotLinLength);
			//-- Check value of Weave price
			//--Check for the limit of width. Bamboo limit = 6'7";  others = 13"
			writeToConsole('Total Area (TotArea): ' + TotArea);
			writeToConsole('Total in Length (TotLinLength): ' + TotLinLength);
			xstring = WeaveBox.options[WeaveBox.selectedIndex].text.substring(0,6);
			//alert(xstring.substring(0,6));
			if (xstring == 'Bamboo') {
			//	alert(xstring+' '+'bamboo');
				if(parseFloat(widthFeetBox.value) + parseFloat(widthInchBox.value/12) > 6.59) {
					alert("Bamboo weave's max width is only 6 feet & 7 inches");
					document.getElementById("Width_ft").value = '';
					document.getElementById("Width_inch").value = '';
					return;
				}
			} else {
			//	alert(xstring+' '+'other');;
				xstring = WeaveBox.options[WeaveBox.selectedIndex].value;
				if(xstring == "3001") {
					if(parseFloat(widthFeetBox.value) + parseFloat(widthInchBox.value/12) > 12) {
						alert("Rug Pad's max width is only 12 feet");
						document.getElementById("Width_ft").value = '';
						document.getElementById("Width_inch").value = '';
						return;
					}
					if(parseFloat(lengthFeetBox.value) + parseFloat(lengthInchBox.value/12) > 30) {
						alert("Rug Pad's max length is only 30 feet");
						document.getElementById("Lenght_ft").value = '';
						document.getElementById("Length_inch").value = '';
						return;
					}
				}
			}
			//alert(WeaveBoxPrice);
			//-- Check value of Corners
			if (!validateNumeric(CornerBox.options[CornerBox.selectedIndex].value)) {
				CornerBoxPrice = 0;
			} else {
				CornerBoxPrice = CornerBox.options[CornerBox.selectedIndex].value;
			}
			//-- Check value of Border width
			if (!validateNumeric(Border_WidthBoxValue)) {
				Border_WidthBoxPrice = 0;
			} else {
				   //for 1/2" 3/50_g & 1 1/4" topstitch binding 3.50_a
				   //binding = $2.00 if width * length <= 50
				   //binding = $5.50 if width * length > 50
				    var wf = parseFloat(TotalWidth * TotalLength);
					var boxWidthCode = document.getElementById('BorderWidthCode').value;
					var boxWidthName = document.getElementById('BorderWidthName').value;
					writeToConsole('Get binding price.')
					writeToConsole('TotalWidth * TotalLength = ' + wf)
					writeToConsole('Border Width : ' + boxWidthName);
					writeToConsole('Border Width Code : ' + boxWidthCode);
					if(boxWidthCode == '3.50_g' || boxWidthCode == '3.50_a'){
						if(wf <= 50){
							Border_WidthBoxValue = 2.00;
							writeToConsole('binding = $2.00 if width * length <= 50 : 2.00');
						}
						if(wf > 50){
							Border_WidthBoxValue = 5.50;
							writeToConsole('binding = $5.50 if width * length > 50 : 5.50');
						}
					}
					//for 2 1/4" topstitch binding 4.00_d
		   			//binding = $2.50 if width * length <= 50
					//binding = $6.50 if width * length > 50
					if(boxWidthCode == '4.00_d'){
						if(wf <= 50){
							Border_WidthBoxValue = 2.50;
							writeToConsole('binding = $2.50 if width * length <= 50 : 2.50');
						}
						if(wf > 50){
							Border_WidthBoxValue = 6.50;
							writeToConsole('binding = $6.50 if width * length > 50 : 6.50');
						}
					}
				   //for 1 1/4", 1 1/2", 2" & 2 1/4" blindstitch binding 10.00_c 10.00_b 10.00_e 10.00_f
				   //binding = $6.25 if width * length <= 50
				   //binding = $15.50 if width * length > 50
					if(boxWidthCode == '10.00_c' || boxWidthCode == '10.00_b' || boxWidthCode == '10.00_e' || boxWidthCode == '10.00_f'){
						if(wf <= 50){
							Border_WidthBoxValue = 6.25;
							writeToConsole('binding = $6.25 if width * length <= 50 : 6.25');
						}
						if(wf > 50){
							Border_WidthBoxValue = 15.50;
							writeToConsole('binding = $15.50 if width * length > 50 : 15.50');
						}
					}
			    writeToConsole('Binding: ' + Border_WidthBoxValue);
			    document.getElementById('BindingPrice').value = Border_WidthBoxValue;
				Border_WidthBoxPrice = Border_WidthBoxValue;
			}
			if(Border_WidthBoxPrice == ''){
				return;
			}
			if(WeaveBox.options[WeaveBox.selectedIndex].value != "choose a weave")
				WeaveBoxValue = GetWeaveAmount(Shape,WeaveBox.options[WeaveBox.selectedIndex].value,wFt,wIn,lFt,lIn);
			else
				alert("Please select a weave.");
			//-- Computation for selected special shapes
			if(CustomShapeBoxValue != '') {
				//alert('For specials shape rugs, please call us at \n (323) 233 - 6666 \n (800) 661 - 7847 \n or email us to info@naturalarearugs.com');
				if(document.getElementById("btn_makeorder")){
					document.getElementById("btn_makeorder").Enabled = false;
				}
				return;
				/*
				xQuotePrice = (parseFloat(TotLinLength) * parseFloat(Border_WidthBoxPrice)) +(parseFloat(TotArea)*parseFloat(WeaveBoxPrice))+ parseFloat(CornerBoxPrice);
				if(TotalWidth == TotalLength) {
					QuotePrice = ComputeSpecialShape(vn_length,xQuotePrice);
					//alert(QuotePrice);
				} else {
					alert('Special shape should have the same length and width');
					lengthFeetBox.value = widthFeetBox.value;
					lengthInchBox.value = widthInchBox.value;
					vn_length = parseFloat(lengthFeetBox.value)  + parseFloat(lengthInchBox.value/12);
					makequote();
					//alert(vn_length+' - '+xQuotePrice)
					QuotePrice = ComputeSpecialShape(vn_length,xQuotePrice);
				}
				*/
			} else {
				if(document.getElementById("btn_makeorder")){
					document.getElementById("btn_makeorder").enabled = true;
				}
			}
			//alert(TotLinLength ,' ', WeaveBoxPrice ,' ', CornerBoxPrice ,' ', Border_WidthBoxPrice);
			//alert(parseFloat(TotArea)*parseFloat(WeaveBoxPrice)+' '+parseFloat(TotLinLength) * parseFloat(Border_WidthBoxPrice));
	        //document.getElementById("quotedprice").value = '$'+Math.round(QuotePrice*100)/100;
			//ORIGINAL CODE TO DISPLAY ::: COMMENTED BY CLOD FOR PROMO DISCOUNTS ::: USE THIS TO ROLL BACK REGULAR PRICES
			// TEMP CODE FOR PROMO ONLY ::: REMOVE ONCE PROMO ENDS
			//SaleQuotePrice = QuotePrice * .80; 		
			//Saved = QuotePrice - SaleQuotePrice;
			//alert(QuotePrice + " = " + SaleQuotePrice);
			//document.getElementById("quotedprice").value = '$'+SaleQuotePrice.toFixed(2);
			//document.getElementById("PromoSaved").innerHTML = 'You Save: $'+Saved.toFixed(2);
		} else {
			//alert('please check your entries');
			document.getElementById("btn_makeorder").enabled = false;
			document.getElementById("quotedprice").value = '0.00';
		}
	}
}







// 01/30/09 



// This function determines the amount of the weave selected.



function GetWeaveAmount(Shape,Mat,wFt,wIn,lFt,lIn)
{
		var totFWidth = parseFloat(wFt) + parseFloat(wIn/12);
		var totFLength = parseFloat(lFt) + parseFloat(lIn/12);
		writeToConsole('Weave: ' + Mat);
		switch(Mat)
		{
 		//Sisal - 3.15
			case "3021":
			case "3026":
			case "3031":
			case "3033":
			case "3037":
			case "3038":	Mat="3.15"; 
							QuotePrice = (parseFloat(TotLinLength) * parseFloat(Border_WidthBoxPrice)) +(parseFloat(TotArea)*parseFloat(Mat));
							switch(Math.ceil(totFWidth))
							{
								case 2: QuotePrice = (((totFWidth + totFLength) * 2) * parseFloat(Border_WidthBoxPrice)) + parseFloat(CornerBoxPrice); break;
								case 3: QuotePrice = QuotePrice - (QuotePrice * 0.25) + parseFloat(CornerBoxPrice);break;
								case 4: QuotePrice = QuotePrice - (QuotePrice * 0.23) + parseFloat(CornerBoxPrice);break;
								case 5: QuotePrice = QuotePrice - (QuotePrice * 0.15) + parseFloat(CornerBoxPrice);break;
								case 6: QuotePrice = QuotePrice - (QuotePrice * 0.07) + parseFloat(CornerBoxPrice);break;
								//case 7: QuotePrice = QuotePrice - (QuotePrice * 0.07) + parseFloat(CornerBoxPrice);break;
								case 8: QuotePrice = QuotePrice + (QuotePrice * 0.03) + parseFloat(CornerBoxPrice);break;
								case 9: QuotePrice = QuotePrice + (QuotePrice * 0.08) + parseFloat(CornerBoxPrice);break;
								case 10: QuotePrice = QuotePrice + (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								case 11: 
								case 12: QuotePrice = QuotePrice + (QuotePrice * 0.15) + parseFloat(CornerBoxPrice);break;
								case 13: QuotePrice = QuotePrice + (QuotePrice * 0.20) + parseFloat(CornerBoxPrice);break;
							}
							break;	
			//Sisal with same mat but diff %
			case "3023":	Mat="3.15"; 
							QuotePrice = (parseFloat(TotLinLength) * parseFloat(Border_WidthBoxPrice)) +(parseFloat(TotArea)*parseFloat(Mat));
							switch(Math.ceil(totFWidth))
							{
								case 2: QuotePrice = (((totFWidth + totFLength) * 2) * parseFloat(Border_WidthBoxPrice)) + parseFloat(CornerBoxPrice); break;
								case 3: QuotePrice = QuotePrice - (QuotePrice * 0.20) + parseFloat(CornerBoxPrice); break;
								case 4: QuotePrice = QuotePrice - (QuotePrice * 0.15) + parseFloat(CornerBoxPrice);break;
								case 5: QuotePrice = QuotePrice - (QuotePrice * 0.05) + parseFloat(CornerBoxPrice);break;
								//case 6: QuotePrice = QuotePrice - (QuotePrice * 0.07) + parseFloat(CornerBoxPrice);break;
								//case 7: QuotePrice = QuotePrice - (QuotePrice * 0.07) + parseFloat(CornerBoxPrice);break;
								case 8: QuotePrice = QuotePrice + (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								case 9: QuotePrice = QuotePrice + (QuotePrice * 0.15) + parseFloat(CornerBoxPrice);break;
								case 10: QuotePrice = QuotePrice + (QuotePrice * 0.18) + parseFloat(CornerBoxPrice);break;
								case 11: QuotePrice = QuotePrice + (QuotePrice * 0.20) + parseFloat(CornerBoxPrice);break;
								case 12: 
								case 13: QuotePrice = QuotePrice + (QuotePrice * 0.25) + parseFloat(CornerBoxPrice);break;
							}
							break;	
			//Sisal - 3.39
			case "3022":
			case "3024":
			case "3025":
			case "3032":
			case "3034":					
			case "3035":				
			case "3036":					
			case "4913":	Mat="3.39"; 
							QuotePrice = (parseFloat(TotLinLength) * parseFloat(Border_WidthBoxPrice)) +(parseFloat(TotArea)*parseFloat(Mat));
							switch(Math.ceil(totFWidth))
							{
								case 2: QuotePrice = (((totFWidth + totFLength) * 2) * parseFloat(Border_WidthBoxPrice)) + parseFloat(CornerBoxPrice); break;
								case 3: QuotePrice = QuotePrice - (QuotePrice * 0.25) + parseFloat(CornerBoxPrice);break;
								case 4: QuotePrice = QuotePrice - (QuotePrice * 0.23) + parseFloat(CornerBoxPrice);break;
								case 5: QuotePrice = QuotePrice - (QuotePrice * 0.15) + parseFloat(CornerBoxPrice);break;
								case 6: QuotePrice = QuotePrice - (QuotePrice * 0.07) + parseFloat(CornerBoxPrice);break;
								//case 7: QuotePrice = QuotePrice - (QuotePrice * 0.07) + parseFloat(CornerBoxPrice);break;
								case 8: QuotePrice = QuotePrice + (QuotePrice * 0.03) + parseFloat(CornerBoxPrice);break;
								case 9: QuotePrice = QuotePrice + (QuotePrice * 0.08) + parseFloat(CornerBoxPrice);break;
								case 10: QuotePrice = QuotePrice + (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								case 11: 
								case 12: QuotePrice = QuotePrice + (QuotePrice * 0.15) + parseFloat(CornerBoxPrice);break;
								case 13: QuotePrice = QuotePrice + (QuotePrice * 0.20) + parseFloat(CornerBoxPrice);break;
							}
							break;
			//Sisal - 3.99
			case "3017":
			case "3018":
			case "3027":
			case "3028":
			case "3029":
			case "3030":    Mat="3.99"; 
							QuotePrice = (parseFloat(TotLinLength) * parseFloat(Border_WidthBoxPrice)) +(parseFloat(TotArea)*parseFloat(Mat));
							switch(Math.ceil(totFWidth))
							{
								case 2: QuotePrice = (((totFWidth + totFLength) * 2) * parseFloat(Border_WidthBoxPrice)) + parseFloat(CornerBoxPrice); break;
								case 3: QuotePrice = QuotePrice - (QuotePrice * 0.20) + parseFloat(CornerBoxPrice); break;
								case 4: QuotePrice = QuotePrice - (QuotePrice * 0.15) + parseFloat(CornerBoxPrice);break;
								case 5: QuotePrice = QuotePrice - (QuotePrice * 0.05) + parseFloat(CornerBoxPrice);break;
								//case 6: QuotePrice = QuotePrice - (QuotePrice * 0.07) + parseFloat(CornerBoxPrice);break;
								//case 7: QuotePrice = QuotePrice - (QuotePrice * 0.07) + parseFloat(CornerBoxPrice);break;
								case 8: QuotePrice = QuotePrice + (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								case 9: QuotePrice = QuotePrice + (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								case 10: QuotePrice = QuotePrice + (QuotePrice * 0.15) + parseFloat(CornerBoxPrice);break;
								case 11: QuotePrice = QuotePrice + (QuotePrice * 0.17) + parseFloat(CornerBoxPrice);break;
								case 12: QuotePrice = QuotePrice + (QuotePrice * 0.20) + parseFloat(CornerBoxPrice);break;
								case 13: QuotePrice = QuotePrice + (QuotePrice * 0.25) + parseFloat(CornerBoxPrice);break;
							}
							break;	
			//Sisal - 4.49			
			case "3019":
			case "3020":
			case "3039":	Mat="4.49"; 
							QuotePrice = (parseFloat(TotLinLength) * parseFloat(Border_WidthBoxPrice)) +(parseFloat(TotArea)*parseFloat(Mat));
							switch(Math.ceil(totFWidth))
							{
								case 2: QuotePrice = (((totFWidth + totFLength) * 2) * parseFloat(Border_WidthBoxPrice)) + parseFloat(CornerBoxPrice); break;
								case 3: QuotePrice = QuotePrice - (QuotePrice * 0.25) + parseFloat(CornerBoxPrice); break;
								case 4: QuotePrice = QuotePrice - (QuotePrice * 0.20) + parseFloat(CornerBoxPrice);break;
								case 5: QuotePrice = QuotePrice - (QuotePrice * 0.15) + parseFloat(CornerBoxPrice);break;
								case 6: QuotePrice = QuotePrice - (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								case 7: QuotePrice = QuotePrice - (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								//case 8: QuotePrice = QuotePrice + (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								//case 9: QuotePrice = QuotePrice + (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								case 10: QuotePrice = QuotePrice + (QuotePrice * 0.05) + parseFloat(CornerBoxPrice);break;
								case 11: QuotePrice = QuotePrice + (QuotePrice * 0.05) + parseFloat(CornerBoxPrice);break;
								case 12: QuotePrice = QuotePrice + (QuotePrice * 0.05) + parseFloat(CornerBoxPrice);break;
								case 13: QuotePrice = QuotePrice + (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
							}
							break;	
			//Mt Grass 3.19
			case "3006":
			case "3007":
			case "3008": 	Mat="3.19"; 
							QuotePrice = (parseFloat(TotLinLength) * parseFloat(Border_WidthBoxPrice)) +(parseFloat(TotArea)*parseFloat(Mat));
							switch(Math.ceil(totFWidth))
							{
								case 2: QuotePrice = (((totFWidth + totFLength) * 2) * parseFloat(Border_WidthBoxPrice)) + parseFloat(CornerBoxPrice); break;
								case 3: QuotePrice = QuotePrice - (QuotePrice * 0.25) + parseFloat(CornerBoxPrice); break;
								case 4: QuotePrice = QuotePrice - (QuotePrice * 0.22) + parseFloat(CornerBoxPrice);break;
								case 5: QuotePrice = QuotePrice - (QuotePrice * 0.15) + parseFloat(CornerBoxPrice);break;
								case 6: QuotePrice = QuotePrice - (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								case 7: QuotePrice = QuotePrice - (QuotePrice * 0.05) + parseFloat(CornerBoxPrice);break;
								//case 8: QuotePrice = QuotePrice + (QuotePrice * 0.05) + parseFloat(CornerBoxPrice);break;
								case 9: QuotePrice = QuotePrice + (QuotePrice * 0.05) + parseFloat(CornerBoxPrice);break;
								case 10: QuotePrice = QuotePrice + (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								case 11: QuotePrice = QuotePrice + (QuotePrice * 0.12) + parseFloat(CornerBoxPrice);break;
								case 12: QuotePrice = QuotePrice + (QuotePrice * 0.15) + parseFloat(CornerBoxPrice);break;
								case 13: QuotePrice = QuotePrice + (QuotePrice * 0.20) + parseFloat(CornerBoxPrice);break;
							}
							break;	
			//Seagrass
			case "3011":
			case "3010": 	Mat="1.94"; 
							QuotePrice = (parseFloat(TotLinLength) * parseFloat(Border_WidthBoxPrice)) +(parseFloat(TotArea)*parseFloat(Mat));
							switch(Math.ceil(totFWidth))
							{
								case 2: QuotePrice = (((totFWidth + totFLength) * 2) * parseFloat(Border_WidthBoxPrice)) + parseFloat(CornerBoxPrice); break;
								case 3: if(Math.floor(totFLength)>=7)
											QuotePrice = QuotePrice - (QuotePrice * 0.20) + parseFloat(CornerBoxPrice);
										else
											QuotePrice = QuotePrice - (QuotePrice * 0.35) + parseFloat(CornerBoxPrice);
										break;
								case 4: QuotePrice = QuotePrice - (QuotePrice * 0.18) + parseFloat(CornerBoxPrice);break;
								case 5: QuotePrice = QuotePrice - (QuotePrice * 0.08) + parseFloat(CornerBoxPrice);break;
								//case 6: QuotePrice = QuotePrice - (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								case 7: QuotePrice = QuotePrice + (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								case 8: QuotePrice = QuotePrice + (QuotePrice * 0.15) + parseFloat(CornerBoxPrice);break;
								case 9: QuotePrice = QuotePrice + (QuotePrice * 0.25) + parseFloat(CornerBoxPrice);break;
								case 10: QuotePrice = QuotePrice + (QuotePrice * 0.28) + parseFloat(CornerBoxPrice);break;
								case 11: QuotePrice = QuotePrice + (QuotePrice * 0.35) + parseFloat(CornerBoxPrice);break;
								case 12: QuotePrice = QuotePrice + (QuotePrice * 0.35) + parseFloat(CornerBoxPrice);break;
								case 13: QuotePrice = QuotePrice + (QuotePrice * 0.45) + parseFloat(CornerBoxPrice);break;
							}
							break;		
			case "3009": 	Mat="2.52"; 
							QuotePrice = (parseFloat(TotLinLength) * parseFloat(Border_WidthBoxPrice)) +(parseFloat(TotArea)*parseFloat(Mat));
							switch(Math.ceil(totFWidth))
							{
								case 2: QuotePrice = (((totFWidth + totFLength) * 2) * parseFloat(Border_WidthBoxPrice)) + parseFloat(CornerBoxPrice); break;
								case 3: QuotePrice = QuotePrice - (QuotePrice * 0.25) + parseFloat(CornerBoxPrice); break;
								case 4: QuotePrice = QuotePrice - (QuotePrice * 0.27) + parseFloat(CornerBoxPrice);break;
								case 5: QuotePrice = QuotePrice - (QuotePrice * 0.17) + parseFloat(CornerBoxPrice);break;
								case 6: QuotePrice = QuotePrice - (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								case 7: QuotePrice = QuotePrice - (QuotePrice * 0.05) + parseFloat(CornerBoxPrice);break;
								case 8: QuotePrice = QuotePrice + (QuotePrice * 0.05) + parseFloat(CornerBoxPrice);break;
								case 9: QuotePrice = QuotePrice + (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								case 10: QuotePrice = QuotePrice + (QuotePrice * 0.12) + parseFloat(CornerBoxPrice);break;
								case 11: QuotePrice = QuotePrice + (QuotePrice * 0.13) + parseFloat(CornerBoxPrice);break;
								case 12: QuotePrice = QuotePrice + (QuotePrice * 0.20) + parseFloat(CornerBoxPrice);break;
								case 13: QuotePrice = QuotePrice + (QuotePrice * 0.25) + parseFloat(CornerBoxPrice);break;
							}
							break;								
			//Wool
			case "3040":
			case "3012":
			case "3014":
			case "3013":
			case "3150":
			case "3016":
			case "4195":
			case "3015": 	Mat="4.39";
							QuotePrice = (parseFloat(TotLinLength) * parseFloat(Border_WidthBoxPrice)) +(parseFloat(TotArea)*parseFloat(Mat));
							switch(Math.ceil(totFWidth))
							{
								case 2: QuotePrice = (((totFWidth + totFLength) * 2) * parseFloat(Border_WidthBoxPrice)) + parseFloat(CornerBoxPrice); break;
								case 3: QuotePrice = QuotePrice - (QuotePrice * 0.20) + parseFloat(CornerBoxPrice); break;
								case 4: QuotePrice = QuotePrice - (QuotePrice * 0.15) + parseFloat(CornerBoxPrice);break;
								case 5: QuotePrice = QuotePrice - (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								case 6: QuotePrice = QuotePrice - (QuotePrice * 0.05) + parseFloat(CornerBoxPrice);break;
								//case 7: QuotePrice = QuotePrice + (QuotePrice * 0.05) + parseFloat(CornerBoxPrice);break;
								case 8: QuotePrice = QuotePrice + (QuotePrice * 0.05) + parseFloat(CornerBoxPrice);break;
								case 9: 
								case 10: QuotePrice = QuotePrice + (QuotePrice * 0.10) + parseFloat(CornerBoxPrice);break;
								case 11: 
								case 12: QuotePrice = QuotePrice + (QuotePrice * 0.15) + parseFloat(CornerBoxPrice);break;
								case 13: QuotePrice = QuotePrice + (QuotePrice * 0.20) + parseFloat(CornerBoxPrice);break;
							}
							break;	
			default: alert("Please select a weave."); return Mat;
		}
	writeToConsole('Material Price: ' + Mat);
	//writeToConsole('QuotePrice after Material: ' + QuotePrice);
	writeToConsole('Price = (Width * Length * Material Price) + ((Width + Length) * 2 * Binding)');
	writeToConsole('Price = (' + totFWidth + ' * ' + totFLength + ' * ' + Mat + ') + ((' + totFWidth + ' + ' + totFLength + ') * 2 * ' + Border_WidthBoxPrice + ')');
	QuotePrice = (totFWidth * totFLength * Mat) + (totFWidth + totFLength) * 2 * Border_WidthBoxPrice;
	QuotePrice = dna_shapeprice(QuotePrice,Shape,Mat,wFt,wIn,lFt,lIn,TotLinLength,TotArea);
	writeToConsole('Corner: ' + CornerBoxName);
	
	writeToConsole('Corner Price: ' + CornerBoxPrice);
	QuotePrice = parseFloat(QuotePrice) + parseFloat(CornerBoxPrice);
	
	//Add $120 for 150 sq. ft. and up
	if (TotArea >= 150)
	{
		QuotePrice = parseFloat(QuotePrice) + 120;
	}
	
	writeToConsole('Final Quoted Price = ' + QuotePrice);
	document.getElementById("quotedprice").value = '$'+QuotePrice.toFixed(2);
	document.getElementById('MaterialPrice').value = Mat;
	document.getElementById('TotalWidth').value = totFWidth;
	document.getElementById('TotalLength').value = totFLength;
	writeToConsole('================================ End ==============================');
	return Mat;
}

function dna_shapeprice(quotedprice_new,Shape,Mat,wFt,wIn,lFt,lIn,TotLinLength,TotArea,TotalWidth,TotalLength)
{
   //for oval, round and octagonal shapes
   //if width and length <= 6’, additional charge is $75
   //if width and length >= 6’ 1”, additional charge is $110
   //if width and length >= 8’ 1”, additional charge is $150
	var totalinlength_two = TotLinLength / 2;
	writeToConsole('Price before Shape Option: ' + quotedprice_new);
	writeToConsole('Shape: ' + Shape);
	writeToConsole('(Width + Length) / 2: ' + totalinlength_two);
    if(Shape == 'Oval' || Shape == 'Round' || Shape == 'Octagon'){
    	writeToConsole('Width and Length (TotalWidth + TotalLength): ' + totalinlength_two);
	    if(totalinlength_two <= 6)
	    {
	    	quotedprice_new = parseFloat(quotedprice_new) + 75;
	    	document.getElementById('ShapeOptionPrice').value = 75;
	    	writeToConsole('if width and length <= 6\', additional charge is $75.');
	    	writeToConsole('New Price: ' + (quotedprice_new - 75) + ' + ' + 75 + ' = ' + quotedprice_new);
	    }
	    if(totalinlength_two > 6 && totalinlength_two <= 8)
	    {
	    	quotedprice_new = parseFloat(quotedprice_new) + 110;
	    	document.getElementById('ShapeOptionPrice').value = 110;
	    	writeToConsole('if width and length >= 6\' 1\", additional charge is $110.');
	    	writeToConsole('New Price: ' + (quotedprice_new - 110) + ' + ' + 110 + ' = ' + quotedprice_new);
	    }
    	if(totalinlength_two > 8)
	    {
	    	quotedprice_new = parseFloat(quotedprice_new) + 150;
	    	document.getElementById('ShapeOptionPrice').value = 150;
	    	writeToConsole('if width and length >= 8\' 1\", additional charge is $150.');
	    	writeToConsole('New Price: ' + (quotedprice_new - 150) + ' + ' + 150 + ' = ' + quotedprice_new);
	    }
		return parseFloat(quotedprice_new);    
    }
	return quotedprice_new;	
}



function ComputeWidthPrice(vn_length,QuotePrice) {
	if((vn_length > 18 ) && (vn_length <= 25)) {
		NewQuotePrice = parseFloat(QuotePrice) + parseFloat(QuotePrice * (10/100));	
		//NewQuotePrice = parseFloat(QuotePrice) + 200;	
		return NewQuotePrice;
	}
	if (vn_length > 25) {
		NewQuotePrice = parseFloat(QuotePrice + 200);
		return NewQuotePrice;
	}	
}

function ComputeSpecialShape(vn_length,xQuotePrice) {
	if((vn_length >= 7) && (vn_length < 8)) {
		return parseFloat(xQuotePrice + 100);
	} else { return xQuotePrice }
	if((vn_length >= 8) && (vn_length <= 9)) {
		return parseFloat(xQuotePrice + 150);
	} else { return xQuotePrice }
	if(vn_length > 9) {
		return parseFloat(xQuotePrice + 200);
	} else { return xQuotePrice }
}

function makeQuoteBroadloom() {
	convertInches();
	WeaveBox = document.getElementById('Weave');
	widthFeetBox = document.getElementById("Width_ft");
	widthInchBox = document.getElementById("Width_inch");
	lengthFeetBox = document.getElementById("Lenght_ft");
	lengthInchBox = document.getElementById("Length_inch");
	var	weavetext = WeaveBox.options[WeaveBox.selectedIndex].text;
	var a = weavetext.indexOf("$")+1;
	var b = weavetext.indexOf("/sq");
	WeaveBoxValue = weavetext.substring(a,b);
	
	document.getElementById('WeaveNumber').value = WeaveBox.options[WeaveBox.selectedIndex].value;
	document.getElementById('WeaveName').value = WeaveBox.options[WeaveBox.selectedIndex].text;
	document.getElementById('WeaveName').value = (document.getElementById('WeaveName').value).replace(/^\s*|\s*$/g,'');
	
	padayon =  true;
	var
		wFt = 0;
		wIn = 0;
		lFt = 0;
		lIn = 0;
    document.getElementById("Weavex").value = WeaveBox.options[WeaveBox.selectedIndex].text;

	if (widthFeetBox.value =='' ) {
		wFt = 0;
		document.getElementById("Width_ft").value = 0;
	} else {
		wFt = parseFloat(widthFeetBox.value);
	}
	if (widthInchBox.value =='') {
		wIn = 0;
		document.getElementById("Width_inch").value = 0;
	} else {
		wIn = 	parseFloat(widthInchBox.value);
	}
	if (lengthFeetBox.value == '') {
		lFt = 0;
		document.getElementById("Lenght_ft").value = 0;
	} else {
		lFt = parseFloat(lengthFeetBox.value);	
	}
	if (lengthInchBox.value == '') {
		lIn = 0;
		document.getElementById("Length_inch").value = 0;
	} else {
		lIn = parseFloat(lengthInchBox.value);
	}
    
	var TotalWidthInches = ((parseFloat(wFt) * 12)  +  parseFloat(wIn));
	var TotalLengthInches = ((parseFloat(lFt) * 12)  +  parseFloat(lIn));
	wFt = widthFeetBox.value = parseInt(TotalWidthInches / 12);
	wIn = widthInchBox.value = Math.round(parseFloat(TotalWidthInches % 12),2);
	lFt = lengthFeetBox.value = parseInt(TotalLengthInches / 12);
	lIn = lengthInchBox.value = Math.round(parseFloat(TotalLengthInches % 12),2);
	
	var TotalWidth = (parseFloat(wFt)  +  parseFloat(wIn/12));
	var TotalLength = (parseFloat(lFt)  +  parseFloat(lIn/12));
	
	document.getElementById('TotalWidth').value = TotalWidth;
	document.getElementById('TotalLength').value = TotalLength;
		
	if (wFt != '' || wIn != '' || lFt != '' || lIn != '') {
		padayon = true;
		if(padayon) {
			var
			//TotalWidth = 0;
			TotalWidth = (parseFloat(wFt)  + parseFloat(wIn/12));
			TotalLength = (parseFloat(lFt)  + parseFloat(lIn/12));
			TotArea = (parseFloat(wFt)  + parseFloat(wIn/12)) * (parseFloat(lFt)  + parseFloat(lIn/12));
			TotLinLength = parseFloat(TotalWidth) + parseFloat(TotalLength);
			xstring = WeaveBox.options[WeaveBox.selectedIndex].text.substring(0,6);
			if (xstring == 'Bamboo') {
				if(parseFloat(wFt) + parseFloat(wIn/12) > 6.59) {
					alert("Bamboo weave's max width is only 6 feet & 7 inches");
					document.getElementById("Width_ft").value = '';
					document.getElementById("Width_inch").value = '';
					return;
				}
			}
			if(WeaveBox.options[WeaveBox.selectedIndex].value != "choose a weave")
			{
				if (WeaveBox.options[WeaveBox.selectedIndex].value == "3001")
				{
					if(parseFloat(wFt) + parseFloat(wIn/12) > 12) {
						alert("Rug Pad's max width is only 12 feet");
						document.getElementById("Width_ft").value = '0';
						document.getElementById("Width_inch").value = '0';
						return;
					}
					if(parseFloat(lFt) + parseFloat(lIn/12) > 30) {
						alert("Rug Pad's max length is only 30 feet");
						document.getElementById("Lenght_ft").value = '0';
						document.getElementById("Length_inch").value = '0';
						return;
					}
				} else {
					if(TotalWidthInches > 158) {
						alert("Maximum width is only 13 feet 2 inches");
						document.getElementById("Width_ft").value = '0';
						document.getElementById("Width_inch").value = '0';
						return;
					}
					if(TotalWidth > 0 && TotalWidth < 1) {
						alert("Minimum width is 1 Ft");
						document.getElementById("Width_ft").value = '0';
						document.getElementById("Width_inch").value = '0';
						return;
					}
					if(TotalLength > 0 && TotalLength > 90) {
						alert("Maximum Length is 90 ft");
						document.getElementById("Lenght_ft").value = '0';
						document.getElementById("Length_inch").value = '0';
						return;
					}
					if(TotalLength > 0 && TotalLength < 3) {
						alert("Minimum length is 3 ft");
						document.getElementById("Lenght_ft").value = '0';
						document.getElementById("Length_inch").value = '0';
						return;
					}
				}
				WeaveBoxPrice= GetWeaveAmountBroadloom(WeaveBox.options[WeaveBox.selectedIndex].value);
			}
			else
			alert("Please select a weave.");
			QuotePrice = parseFloat(TotArea)*parseFloat(WeaveBoxPrice);
			
			//Add $120 for 150 sq. ft. and up
			if (TotArea >= 150)
			{
				QuotePrice = parseFloat(QuotePrice) + 120;
			}
			
			document.getElementById('MaterialPrice').value = parseFloat(WeaveBoxPrice);
			document.getElementById("quotedprice").value = '$'+QuotePrice.toFixed(2);
		} else {
			alert('please check your entries');
		}
	}
}

function GetWeaveAmountBroadloom(Mat)
{
		switch(Mat)
		{
			case "3001": Mat="0.99"; 
							 break;	
			//Sisal - 3.15
			case "3021":
			case "3023":
			case "3026":
			case "3031":	
			case "3033":
			case "3037":					
			case "3038":
			case "4913":	Mat="3.15"; 
							 break;	
			//Sisal - 3.39
			case "3022":
			case "3024":
			case "3025":
			case "3032":
			case "3034":					
			case "3035":				
			case "3036":					
			case "4913":	Mat="3.39"; 
							 break;	
			//Sisal - 3.99
			case "3017":
			case "3018":
			case "3027":
			case "3028":
			case "3029":
			case "3030":    Mat="3.99";
							break;	
			//Sisal - 4.49			
			case "3019":
			case "3020":
			case "3039":	Mat="4.49"; 
							break;	
			//Mt Grass 3.19
			case "3006":
			case "3007":
			case "3008": 	Mat="3.19"; 
							break;	
			//Seagrass
			case "3011":
			case "3010": 	Mat="1.94"; 
							break;		
			case "3009": 	Mat="2.52"; 
							break;								
			//Wool
			case "3040":
			case "3012":
			case "3014":
			case "3013":
			case "3150":
			case "3016":
			case "4195":
			case "3015": 	Mat="4.39"; break;	
			default: alert("Please select a weave."); return Mat;
		}
	return Mat;
}
function checkcorner() {
	var obj = document.quote;
	var i ;
	if(obj.Weave.value=="3001") {
		obj.Corner.options[0].text = "None";
		obj.Corner.selectedIndex = 0;
		obj.Border_Width.options[0].text = "None";
		obj.Border_Width.selectedIndex = 0;
	} else {
		obj.Corner.options[0].text = "Standard Corner";
		// 2007.06.06 Michael Fang, Update to remove prices in option as per Mr. Moe's Request
		//obj.Border_Width.options[0].text = '1 1/4" - Top Stitch - $5.00 / lin.ft.';
		/* commented by clod 2007.07.20 - reason : bug */
		//obj.Border_Width.options[0].text = '1 1/4" - Top Stitch'  
	}
}
function checkbordercolor() {
	var obj = document.quote;
		vs_selectedborder = obj.Border.options[obj.Border.selectedIndex].value;
	// This Array Sets the Colors unavailable for certain borders	
	the_color = new Array();
	/* ---Changed Border So All is available  
	the_color[0] = "f";
	the_color[1] = "g";
	*/
	the_border =  new Array();
	the_border[0] = "1";
	the_border[1] = "3";
	the_border[2] = "4";
	the_border[3] = "5";
	the_border[4] = "6";
	the_border[5] = "7";
	for(i=0; i < the_color.length; i++) {
		if(the_color[i] == vs_selectedborder) {
			for(ii = 0; ii < the_border.length; ii++) {
				//alert(obj.Border_Width.selectedIndex +'xx'+ the_border[ii]);
				if(obj.Border_Width.selectedIndex == the_border[ii]){
					alert(obj.Border_Width.options[obj.Border_Width.selectedIndex].text+' is unavailable for the selected border color');
					obj.Border.selectedIndex = 0;
					return;
				}
			}
			break;
		}
	}
}

function checkbordertype() {
	var obj = document.quote;
	ar_weave = new Array();
	ar_weave[0] = '3004';
	ar_weave[1] = '3005';
	vs_selectedweave = obj.Weave.options[obj.Weave.selectedIndex].value;
	for(ii=0; ii < ar_weave.length; ii++) {
		if(ar_weave[ii] == vs_selectedweave) {
			if(obj.Border_Width.selectedIndex == 1 ) {
				alert('2 1/4" Top Stitch is not applicable to bamboo rugs');
				obj.Border_Width.selectedIndex = 0;
				return;
			}
			if(obj.Border_Width.selectedIndex >=2 && obj.Border_Width.selectedIndex <= 7) {
				alert('Blind Stitch is not applicable to bamboo rugs');
				obj.Border_Width.selectedIndex = 0;
				return;
			}
			if(obj.Corner.selectedIndex == 1) {
				alert('Mitered corners is not applicable to bamboo rugs');
				obj.Corner.selectedIndex = 0;
				return;
			}
		}
	}
}
function  validateNumeric( strValue ) {
/******************************************************************************
DESCRIPTION: Validates that a string contains only valid numbers.
PARAMETERS:
   strValue - String to be tested for validity
RETURNS:
   True if valid, otherwise false.
******************************************************************************/
  var objRegExp  =  /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/;
  //check for numeric characters
  return objRegExp.test(strValue);
}
function addCurrency( strValue ) {
/************************************************
DESCRIPTION: Formats a number as currency.
PARAMETERS:
  strValue - Source string to be formatted
REMARKS: Assumes number passed is a valid
  numeric value in the rounded to 2 decimal
  places.  If not, returns original value.
*************************************************/
  var objRegExp = /-?[0-9]+\.[0-9]{2}$/;
    if( objRegExp.test(strValue)) {
      objRegExp.compile('^-');
      strValue = addCommas(strValue);
      if (objRegExp.test(strValue)){
        strValue = '(' + strValue.replace(objRegExp,'') + ')';
      }
      return '$' + strValue;
    }
    else
      return strValue;
}
function validateUSDate( strValue ) {
/************************************************
DESCRIPTION: Validates that a string contains only
    valid dates with 2 digit month, 2 digit day,
    4 digit year. Date separator can be ., -, or /.
    Uses combination of regular expressions and
    string parsing to validate date.
    Ex. mm/dd/yyyy or mm-dd-yyyy or mm.dd.yyyy
PARAMETERS:
   strValue - String to be tested for validityR
ETURNS:
   True if valid, otherwise false.
REMARKS:
   Avoids some of the limitations of the Date.parse()
   method such as the date separator character.
*************************************************/
  var objRegExp = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/
  //check to see if in correct format
  if(!objRegExp.test(strValue))
    return false; //doesn't match pattern, bad date
  else{
  	var strSeparator = strValue.substring(2,3) //find date separator
    var arrayDate = strValue.split(strSeparator); //split date into month, day, year
    //create a lookup for months not equal to Feb.
    var arrayLookup = { '01' : 31,'03' : 31, '04' : 30,'05' : 31,'06' : 30,'07' : 31,
                        '08' : 31,'09' : 30,'10' : 31,'11' : 30,'12' : 31}
    var intDay = parseInt(arrayDate[1],10); 
    //check if month value and day value agree
    if(arrayLookup[arrayDate[0]] != null) {
      if(intDay <= arrayLookup[arrayDate[0]] && intDay != 0)
        return true; //found in lookup table, good date
    }
    //check for February (bugfix 20050322)
    //bugfix  for parseInt kevin
    //bugfix  biss year  O.Jp Voutat
    var intMonth = parseInt(arrayDate[0],10);
    if (intMonth == 2) { 
       var intYear = parseInt(arrayDate[2]);
       if (intDay > 0 && intDay < 29) {
           return true;
       }
       else if (intDay == 29) {
         if ((intYear % 4 == 0) && (intYear % 100 != 0) || 
             (intYear % 400 == 0)) {
              // year div by 4 and ((not div by 100) or div by 400) ->ok
             return true;
         }   
       }
    }
  }  
  return false; //any other values, bad date
}

var Cards = new makeArray(8);
Cards[0] = new CardType("MasterCard", "51,52,53,54,55", "16");
var MasterCard = Cards[0];
Cards[1] = new CardType("VisaCard", "4", "13,16");
var VisaCard = Cards[1];
Cards[2] = new CardType("AmExCard", "34,37", "15");
var AmExCard = Cards[2];
Cards[3] = new CardType("DinersClubCard", "30,36,38", "14");
var DinersClubCard = Cards[3];
Cards[4] = new CardType("DiscoverCard", "6011", "16");
var DiscoverCard = Cards[4];
Cards[5] = new CardType("enRouteCard", "2014,2149", "15");
var enRouteCard = Cards[5];
Cards[6] = new CardType("JCBCard", "3088,3096,3112,3158,3337,3528", "16");
var JCBCard = Cards[6];
var LuhnCheckSum = Cards[7] = new CardType();

function CheckCardNumber() {
	var tmpyear,i,x;
		obj =  document.quote;
	x = "";
	for(i=0;i < obj.PayCard.length; i++) {
		if (obj.PayCard[i].checked)
			x = "cardselected";
	}
	if(x == "") {
		alert('Please select a card');
		return;
	}
	if (obj.CCnumber.value.length == 0) {
		alert("Please enter a Card Number.");
		obj.CCnumber.focus();
		return;
	}

	if (obj.ExpYear.value > 96)
		tmpyear = "19" + obj.ExpYear.value;
	else if (obj.ExpYear.value < 21)
		tmpyear = "20" + obj.ExpYear.value;
	else {
		alert("The Expiration Year is not valid.");
		return;
	}
	tmpmonth = obj.ExpMonth.value;
// The following line doesn't work in IE3, you need to change it
// to something like "(new CardType())...".
// if (!CardType().isExpiryDate(tmpyear, tmpmonth)) {
	if (!(new CardType()).isExpiryDate(tmpyear, tmpmonth)) {
		alert("This card has already expired.");
		return;
	}
	for(i=0;i < obj.PayCard.length; i++) {
		if (obj.PayCard[i].checked)
			card = obj.PayCard[i].value;
	}
	var retval = eval(card + ".checkCardNumber(\"" + obj.CCnumber.value + "\", " + tmpyear + ", " + tmpmonth + ");");
	cardname = "";
	if (retval)
	// comment this out if used on an order form
		//alert("This card number appears to be valid.");
		return true;
	else {
	// The cardnumber has the valid luhn checksum, but we want to know which
	// cardtype it belongs to.
		for (var n = 0; n < Cards.size; n++) {
			if (Cards[n].checkCardNumber(obj.CCnumber.value, tmpyear, tmpmonth)) {
				cardname = Cards[n].getCardType();
				break;
   			}
		}
		if (cardname.length > 0) {
			alert("This looks like a " + cardname + " number, not a " + card + " number.");
		}
		else {
			alert("This card number is not valid. Please remove any alpha character \n or space between the card number");
  		}
	}
}
/*************************************************************************\
Object CardType([String cardtype, String rules, String len, int year, 
                                        int month])
cardtype    : type of card, eg: MasterCard, Visa, etc.
rules       : rules of the cardnumber, eg: "4", "6011", "34,37".
len         : valid length of cardnumber, eg: "16,19", "13,16".
year        : year of expiry date.
month       : month of expiry date.
eg:
var VisaCard = new CardType("Visa", "4", "16");
var AmExCard = new CardType("AmEx", "34,37", "15");
\*************************************************************************/
function CardType() {
	var n;
	var argv = CardType.arguments;
	var argc = CardType.arguments.length;
	this.objname = "object CardType";
	var tmpcardtype = (argc > 0) ? argv[0] : "CardObject";
	var tmprules = (argc > 1) ? argv[1] : "0,1,2,3,4,5,6,7,8,9";
	var tmplen = (argc > 2) ? argv[2] : "13,14,15,16,19";
	this.setCardNumber = setCardNumber;  // set CardNumber method.
	this.setCardType = setCardType;  // setCardType method.
	this.setLen = setLen;  // setLen method.
	this.setRules = setRules;  // setRules method.
	this.setExpiryDate = setExpiryDate;  // setExpiryDate method.
	this.setCardType(tmpcardtype);
	this.setLen(tmplen);
	this.setRules(tmprules);
	if (argc > 4)
	this.setExpiryDate(argv[3], argv[4]);
	this.checkCardNumber = checkCardNumber;  // checkCardNumber method.
	this.getExpiryDate = getExpiryDate;  // getExpiryDate method.
	this.getCardType = getCardType;  // getCardType method.
	this.isCardNumber = isCardNumber;  // isCardNumber method.
	this.isExpiryDate = isExpiryDate;  // isExpiryDate method.
	this.luhnCheck = luhnCheck;// luhnCheck method.
	return this;
}
/*************************************************************************\
boolean checkCardNumber([String cardnumber, int year, int month])
return true if cardnumber pass the luhncheck and the expiry date is
valid, else return false.
\*************************************************************************/
function checkCardNumber() {
	var argv = checkCardNumber.arguments;
	var argc = checkCardNumber.arguments.length;
	var cardnumber = (argc > 0) ? argv[0] : this.cardnumber;
	var year = (argc > 1) ? argv[1] : this.year;
	var month = (argc > 2) ? argv[2] : this.month;
	this.setCardNumber(cardnumber);
	this.setExpiryDate(year, month);
	if (!this.isCardNumber())
		return false;
	if (!this.isExpiryDate())
		return false;
	return true;
}

/*************************************************************************\
String getCardType()
return the cardtype.
\*************************************************************************/
function getCardType() {
	return this.cardtype;
}
/*************************************************************************\
String getExpiryDate()
return the expiry date.
\*************************************************************************/
function getExpiryDate() {
	return this.month + "/" + this.year;
}
/*************************************************************************\
boolean isCardNumber([String cardnumber])
return true if cardnumber pass the luhncheck and the rules, else return
false.
\*************************************************************************/

function isCardNumber() {
	var argv = isCardNumber.arguments;
	var argc = isCardNumber.arguments.length;
	var cardnumber = (argc > 0) ? argv[0] : this.cardnumber;
	if (!this.luhnCheck())
		return false;
	for (var n = 0; n < this.len.size; n++)
		if (cardnumber.toString().length == this.len[n]) {
			for (var m = 0; m < this.rules.size; m++) {
				var headdigit = cardnumber.substring(0, this.rules[m].toString().length);
				if (headdigit == this.rules[m])					
					return true;
			}
			return false;
		}
	return false;
}
/*************************************************************************\
boolean isExpiryDate([int year, int month])
return true if the date is a valid expiry date,
else return false.
\*************************************************************************/
function isExpiryDate() {
	var argv = isExpiryDate.arguments;
	var argc = isExpiryDate.arguments.length;
	year = argc > 0 ? argv[0] : this.year;
	month = argc > 1 ? argv[1] : this.month;
	if (!isNum(year+""))
		return false;
	if (!isNum(month+""))
		return false;
	today = new Date();
	expiry = new Date(year, month);
	if (today.getTime() > expiry.getTime())
		return false;
	else
		return true;
}

/*************************************************************************\
boolean isNum(String argvalue)
return true if argvalue contains only numeric characters,
else return false.
\************************************************************************/
function isNum(argvalue) {
	argvalue = argvalue.toString();
	if (argvalue.length == 0)
		return false;
	for (var n = 0; n < argvalue.length; n++)
		if (argvalue.substring(n, n+1) < "0" || argvalue.substring(n, n+1) > "9")
			return false;
		return true;
}

/*************************************************************************\
boolean luhnCheck([String CardNumber])
return true if CardNumber pass the luhn check else return false.
Reference: http://www.ling.nwu.edu/~sburke/pub/luhn_lib.pl
\*************************************************************************/
function luhnCheck() {
	var argv = luhnCheck.arguments;
	var argc = luhnCheck.arguments.length;
	var CardNumber = argc > 0 ? argv[0] : this.cardnumber;
	if (! isNum(CardNumber)) {
		return false;
 	}
	var no_digit = CardNumber.length;
	var oddoeven = no_digit & 1;
	var sum = 0;
	for (var count = 0; count < no_digit; count++) {
		var digit = parseInt(CardNumber.charAt(count));
		if (!((count & 1) ^ oddoeven)) {
			digit *= 2;
			if (digit > 9)
				digit -= 9;
		}
		sum += digit;
	}
	if (sum % 10 == 0)
		return true;
	else
		return false;
}
/*************************************************************************\
ArrayObject makeArray(int size)
return the array object in the size specified.
\*************************************************************************/
function makeArray(size) {
	this.size = size;
	return this;
}
/*************************************************************************\
CardType setCardNumber(cardnumber)
return the CardType object.
\*************************************************************************/
function setCardNumber(cardnumber) {
	this.cardnumber = cardnumber;
	return this;
}
/*************************************************************************\
CardType setCardType(cardtype)
return the CardType object.
\*************************************************************************/
function setCardType(cardtype) {
	this.cardtype = cardtype;
	return this;
}
/*************************************************************************\
CardType setExpiryDate(year, month)
return the CardType object.
\*************************************************************************/
function setExpiryDate(year, month) {
	this.year = year;
	this.month = month;
	return this;
}

/*************************************************************************\
CardType setLen(len)
return the CardType object.
\*************************************************************************/
function setLen(len) {
// Create the len array.
	if (len.length == 0 || len == null)
		len = "13,14,15,16,19";
	var tmplen = len;
	n = 1;
	while (tmplen.indexOf(",") != -1) {
		tmplen = tmplen.substring(tmplen.indexOf(",") + 1, tmplen.length);
		n++;
	}
	this.len = new makeArray(n);
	n = 0;
	while (len.indexOf(",") != -1) {
		var tmpstr = len.substring(0, len.indexOf(","));
		this.len[n] = tmpstr;
		len = len.substring(len.indexOf(",") + 1, len.length);
		n++;
	}
	this.len[n] = len;
	return this;
}
/*************************************************************************\
CardType setRules()
return the CardType object.
\*************************************************************************/
function setRules(rules) {
// Create the rules array.
	if (rules.length == 0 || rules == null)
		rules = "0,1,2,3,4,5,6,7,8,9";
	var tmprules = rules;
	n = 1;
	while (tmprules.indexOf(",") != -1) {
		tmprules = tmprules.substring(tmprules.indexOf(",") + 1, tmprules.length);
		n++;
	}
	this.rules = new makeArray(n);
	n = 0;
	while (rules.indexOf(",") != -1) {
		var tmpstr = rules.substring(0, rules.indexOf(","));
		this.rules[n] = tmpstr;
		rules = rules.substring(rules.indexOf(",") + 1, rules.length);
		n++;
	}
	this.rules[n] = rules;
	return this;
}

















var ref   = escape(document.referrer)+" ";
var entry = escape(unescape(location.href));
//document.write( '<' + 'script language="javascript" src="http://www.naturalarearugs.com/axroi/script.php?ref=' + ref + '&entry=' + entry+ '"><' + '/script>' );

function makeorder() {
	
	var msg = 'Order this custom size rug?';
	var obj =  document.quote;
	fromPage = 'BroadloomPage'; 
	xmail = obj.Email;
	totalBox = document.getElementById("quotedprice");
	total = totalBox.value;
	total = total.substring(1);
	
  if(obj.quotedprice.value == '' || obj.quotedprice.value == '0.00'){
    alert('Please check Custom Order details.');
    return;
  }
	
	if(fromPage == "") {
		if (obj.Custom_Shape.value != '') {
			//alert('For specials shape rugs, please call us at \n (323) 582-4999 \n (800) 661 - 7847 \n or email us to info@naturalarearugs.com');
			return;
		}
	}	
		if(checkFields(fromPage) && checkPersonInfo()) {
			if(validateEmail(xmail.value)) {
					if (SaveCustomer()) {
						if(total < 10)
						{
							alert("Min. amount of purchase is $10.");
							return;
						}
						else
						{
							document.quote.action = 'custom_order_grid.php';					
							document.quote.submit();
						}
					}
			} else {
				alert('Email is invalid');
				return;
			}
		}
		
}
function validateEmail(strValue) {
	emailRe = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
	//emailRe = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/
	phoneRe = /^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,3})|(\(?\d{2,3}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/

	return emailRe.test(strValue);
}

function checkFields(fromPage) {
	obj = document.quote;
	
	//PROMPT FOR OUT OF STOCK : ADDED BY CLOD - 2007.11.12 
	// Out Of Stock :  Mountaingrass Basketweave
	if(obj.Weave.value == "out_stock_mountaingrass_basketweave") {
		obj.Weave.value = "choose_a_weave"
		alert('Sorry, this material (Mountain Grass - Basketweave) is currently out of stock, but is Expected to ship by Jan. 31, 2008... Please select another weave.');
		promptTest();
	}	
	
	if(obj.Weave.value == "out_stock_mountaingrass_everest") {
		obj.Weave.value = "choose_a_weave"
		alert('Sorry, this material (Mountain Grass - Everest) is currently out of stock, but is Expected to ship by Jan. 31, 2008... Please select another weave.');
		promptTest();
	}	
		
		
	if(fromPage == "") {
		if(obj.Weave.value != "3001") {
			//if(obj.Weave.value == "choose_a_weave" || obj.Width_ft.value == "" || obj.Width_ft.value == "0" || obj.Lenght_ft.value == "" || obj.Lenght_ft.value == "0" || obj.Border.value == "" || obj.Border_Width.value == "") {
			if(obj.Border_Width.value == "" || obj.Weave.value == "choose_a_weave" || obj.Width_ft.value == "" || obj.Width_ft.value == "0" || obj.Lenght_ft.value == "" || obj.Lenght_ft.value == "0" || obj.Border.value == "") {
				alert('Please check Border, Weave, Stitch, Width and Length. They must not be blank or zero');
				return  false;
			} else { return true; }
		} else {
			//if(obj.Weave.value == "choose_a_weave" || obj.Border_Width.value == "" || obj.Width_ft.value == "" || obj.Width_ft.value == "0" || obj.Lenght_ft.value == "" || obj.Lenght_ft.value == "0" ) {
			if(obj.Border_Width.value == "" || obj.Weave.value == "choose_a_weave" || obj.Width_ft.value == "" || obj.Width_ft.value == "0" || obj.Lenght_ft.value == "" || obj.Lenght_ft.value == "0" ) {
				alert('Please check Weave, Stitch, Width and Length. They must not be blank or zero');
				return  false;
			} else { return true; }
		}
				
	}
	if(fromPage == "BroadloomPage") {
		if(obj.Weave.value == "choose_a_weave" || obj.Width_ft.value == "" || obj.Width_ft.value == "0" || obj.Lenght_ft.value == "" || obj.Lenght_ft.value == "0" ) {
			alert('Please check  Weave , Width and Length. They must not be blank or zero');
			return  false;
		} else { return true; }
	}
		
}

function promptOutOfStock() {
	//DISABLE OUT OF STOCK ITEMS - ADDED BY CLOD : 2007-11-12
	if (WeaveBox.options[WeaveBox.selectedIndex].value == "out_stock_mountaingrass_basketweave") { 
		window.open("http://www.naturalarearugs.com/customsizes_os.php?material=Basketweave Mountain Grass","CustomerService",'menubar=0,resizable=0,status=0,scrollbars=0,width=520,height=360') 
 
	}
	
	if (WeaveBox.options[WeaveBox.selectedIndex].value == "out_stock_mountaingrass_everest") { 
		window.open("http://www.naturalarearugs.com/customsizes_os.php?material=Everest Mountain Grass","CustomerService",'menubar=0,resizable=0,status=0,scrollbars=0,width=520,height=360') 
 
	}
	
}

function promptTest() {
	promptOutOfStock();
}


function checkPersonInfo() {
	obj = document.quote;
	var msg = '';
	var State = document.getElementById('State').value;
	var StateSelected = obj.StateSelected.value;
	if(State != "")
	{
		obj.StateSelected.value = State;
	}
	var ObjRegExp = /^\s+$/ ;

	if (obj.Name.value == '' ) {
		msg = ' Name ';
	}
	if(obj.Address.value == "") {
		msg = msg + '\n' + " Address ";
	}
	if(obj.City.value == "") {
		msg = msg +'\n'+" City ";
	}
	if(obj.StateSelected.value == "") {
		msg = msg + '\n'+ " State ";
	}
	if(obj.Zip.value == "") {
		msg =  msg + '\n'+ " Zip ";
	}
    if(obj.TelNum.value == "") {
      msg =  msg + '\n'+ " Telephone Number ";
    }
    if(obj.TelNum.value != "" && !isNum(obj.TelNum.value)) {
        msg =  msg + '\n'+ " Telephone Number ";
    }
    if(obj.TelAreaCode.value != "" && !isNum(obj.TelAreaCode.value)) {
        msg =  msg + '\n'+ " Telephone Number ";
    }
  if(obj.Email.value == "") {
    msg =  msg + '\n'+ " Email Address ";
  }
	if(msg != "") {
		alert('Please enter \n'+msg);
		msg = '';
		return false;
	} else {return true;}
}
function getBorder_a() {
	var obj = document.quote;
	var WeaveValue  = obj.Weave.value;
	if (WeaveValue != "choose_a_weave") {
		if(WeaveValue == "3004") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/fairmont/fairmonta270.jpg";
		} 			
		if(WeaveValue == "3005") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/rosemont/rosemonta270.jpg";
		} 			
		if(WeaveValue == "3007") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/basketweave/mgrass_basketweavea270.jpg";
		} 			
		if(WeaveValue == "3008") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/everest/mgrass_everesta270.jpg";
		} 			
		if(WeaveValue == "3009") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_basketweavea270.jpg";
		} 			
		if(WeaveValue == "3010") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_beacha270.jpg";
		} 			
		if(WeaveValue == "3011") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_hpanamaa270.jpg";
		} 			
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/chelsea/wool_chelseaa270.jpg";
		} 			
		if(WeaveValue == "3012") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/heritage/wool_heritagea270.jpg";
		} 			
		if(WeaveValue == "3014") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/icon/wool_icona270.jpg";
		} 			
		if(WeaveValue == "3013") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/majesty/wool_majestya270.jpg";
		}
		if(WeaveValue == "3150") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/manhattan/wool_manhattana270.jpg";
		}		
		if(WeaveValue == "3016") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/sonoma/wool_sonomaa270.jpg";
		} 			
		if(WeaveValue == "2947") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_capria270.jpg";
		} 			
		if(WeaveValue == "3006") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/aspen/mgrass_aspena270.jpg";
		} 			
		if(WeaveValue == "3015") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/ritz/wool_ritza270.jpg";
		} 			
		if(WeaveValue == "3017") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/amalfi/sisal_amalfia270.jpg";
		} 			
		if(WeaveValue == "3018") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_capria270.jpg";
		} 			
		if(WeaveValue == "3019") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/mozambique/sisal_mozama270.jpg";
		} 			
		if(WeaveValue == "3020") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tanzania/sisal_tanzaniaa270.jpg";
		} 			
		if(WeaveValue == "3021") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/deco/sisal_decoa270.jpg";
		} 			
		if(WeaveValue == "3022") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/florence/sisal_florencea270.jpg";
		} 			
		if(WeaveValue == "3023") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/fullpanama/sisal_fpanamaa270.jpg";
		} 			
		if(WeaveValue == "3024") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/hboucle/sisal_hbouclea270.jpg";
		} 			
		if(WeaveValue == "3025") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/milano/sisal_milanoa270.jpg";
		} 			
		if(WeaveValue == "3026") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/resort/sisal_resorta270.jpg";
		} 			
		if(WeaveValue == "3027") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rio/sisal_rioa270.jpg";
		} 			
		if(WeaveValue == "3028") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/riviera/sisal_rivieraa270.jpg";
		} 			
		if(WeaveValue == "3029") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rustic/sisal_rustica270.jpg";
		} 			
		if(WeaveValue == "3030") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/seaside/sisal_seasidea270.jpg";
		} 			
		if(WeaveValue == "3031") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sboucle/sisal_sbouclea270.jpg";
		} 			
		if(WeaveValue == "3032") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sienna/sisal_siennaa270.jpg";
		} 			
		if(WeaveValue == "3033") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sorrento/sisal_sorrentoa270.jpg";
		} 			
		if(WeaveValue == "3034") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/studio/sisal_studioa270.jpg";
		} 			
		if(WeaveValue == "3035") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tuscany/sisal_tuscanya270.jpg";
		} 			
		if(WeaveValue == "3036") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/valencia/sisal_valenciaa270.jpg";
		} 			
		if(WeaveValue == "3037") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/venice/sisal_venicea270.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/verona/sisal_veronaa270.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/verona/sisal_veronaa270.jpg";
		} 			
		if(WeaveValue == "3039") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/vienna/sisal_viennaa270.jpg";
		} 
		if(WeaveValue == "4195") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/prestige/wool_prestigea270.jpg";
		}
		if(WeaveValue == "4913") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/princeton/sisal_princetona270.jpg";
		}
					
	} else {
	
	}
}
function getBorder_b() {
	var obj = document.quote;
	var WeaveValue  = obj.Weave.value;
	if (WeaveValue != "choose_a_weave") {
		if(WeaveValue == "3004") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/fairmont/fairmontb270.jpg";
		} 			
		if(WeaveValue == "3005") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/rosemont/rosemontb270.jpg";
		} 			
		if(WeaveValue == "3007") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/basketweave/mgrass_basketweaveb270.jpg";
		} 			
		if(WeaveValue == "3008") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/everest/mgrass_everestb270.jpg";
		} 			
		if(WeaveValue == "3009") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_basketweaveb270.jpg";
		} 			
		if(WeaveValue == "3010") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_beachb270.jpg";
		} 			
		if(WeaveValue == "3011") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_hpanamab270.jpg";
		} 			
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/chelsea/wool_chelseab270.jpg";
		} 			
		if(WeaveValue == "3012") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/heritage/wool_heritageb270.jpg";
		} 			
		if(WeaveValue == "3014") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/icon/wool_iconb270.jpg";
		} 			
		if(WeaveValue == "3013") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/majesty/wool_majestyb270.jpg";
		}
		if(WeaveValue == "3150") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/manhattan/wool_manhattanb270.jpg";
		}
		if(WeaveValue == "3016") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/sonoma/wool_sonomab270.jpg";
		} 			
		if(WeaveValue == "2947") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprib270.jpg";
		} 			
		if(WeaveValue == "3006") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/aspen/mgrass_aspenb270.jpg";
		} 			
		if(WeaveValue == "3015") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/ritz/wool_ritzb270.jpg";
		} 			
		if(WeaveValue == "3017") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/amalfi/sisal_amalfib270.jpg";
		} 			
		if(WeaveValue == "3018") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprib270.jpg";
		} 			
		if(WeaveValue == "3019") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/mozambique/sisal_mozamb270.jpg";
		} 			
		if(WeaveValue == "3020") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tanzania/sisal_tanzaniab270.jpg";
		} 			
		if(WeaveValue == "3021") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/deco/sisal_decob270.jpg";
		} 			
		if(WeaveValue == "3022") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/florence/sisal_florenceb270.jpg";
		} 			
		if(WeaveValue == "3023") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/fullpanama/sisal_fpanamab270.jpg";
		} 			
		if(WeaveValue == "3024") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/hboucle/sisal_hboucleb270.jpg";
		} 			
		if(WeaveValue == "3025") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/milano/sisal_milanob270.jpg";
		} 			

		if(WeaveValue == "3026") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/resort/sisal_resortb270.jpg";
		} 			
		if(WeaveValue == "3027") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rio/sisal_riob270.jpg";
		} 			
		if(WeaveValue == "3028") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/riviera/sisal_rivierab270.jpg";
		} 			
		if(WeaveValue == "3029") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rustic/sisal_rusticb270.jpg";
		} 			
		if(WeaveValue == "3030") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/seaside/sisal_seasideb270.jpg";
		} 			
		if(WeaveValue == "3031") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sboucle/sisal_sboucleb270.jpg";
		} 			
		if(WeaveValue == "3032") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sienna/sisal_siennab270.jpg";

		} 			
		if(WeaveValue == "3033") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sorrento/sisal_sorrentob270.jpg";
		} 			
		if(WeaveValue == "3034") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/studio/sisal_studiob270.jpg";
		} 			
		if(WeaveValue == "3035") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tuscany/sisal_tuscanyb270.jpg";
		} 			
		if(WeaveValue == "3036") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/valencia/sisal_valenciab270.jpg";
		} 			
		if(WeaveValue == "3037") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/venice/sisal_veniceb270.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/verona/sisal_veronab270.jpg";
		} 			
		if(WeaveValue == "3039") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/vienna/sisal_viennab270.jpg";
		} 	
		if(WeaveValue == "4195") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/prestige/wool_prestigeb270.jpg";
		}	
		if(WeaveValue == "4913") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/princeton/sisal_princetonb270.jpg";
		}
	} else {
	
	}
}
function getBorder_c() {
	var obj = document.quote;
	var WeaveValue  = obj.Weave.value;
	if (WeaveValue != "choose_a_weave") {
		if(WeaveValue == "3004") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/fairmont/fairmontc270.jpg";
		} 			

		if(WeaveValue == "3005") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/rosemont/rosemontc270.jpg";
		} 			
		if(WeaveValue == "3007") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/basketweave/mgrass_basketweavec270.jpg";
		} 			
		if(WeaveValue == "3008") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/everest/mgrass_everestc270.jpg";
		} 			
		if(WeaveValue == "3009") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_basketweavec270.jpg";
		} 			
		if(WeaveValue == "3010") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_beachc270.jpg";
		} 			
		if(WeaveValue == "3011") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_hpanamac270.jpg";
		} 			
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/chelsea/wool_chelseac270.jpg";
		} 			
		if(WeaveValue == "3012") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/heritage/wool_heritagec270.jpg";
		} 			
		if(WeaveValue == "3014") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/icon/wool_iconc270.jpg";
		} 			
		if(WeaveValue == "3013") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/majesty/wool_majestyc270.jpg";
		}
		if(WeaveValue == "3150") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/manhattan/wool_manhattanc270.jpg";
		} 			
		if(WeaveValue == "3016") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/sonoma/wool_sonomac270.jpg";
		} 			
		if(WeaveValue == "2947") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_capric270.jpg";
		} 			
		if(WeaveValue == "3006") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/aspen/mgrass_aspenc270.jpg";
		} 			
		if(WeaveValue == "3015") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/ritz/wool_ritzc270.jpg";
		} 			
		if(WeaveValue == "3017") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/amalfi/sisal_amalfic270.jpg";
		} 			
		if(WeaveValue == "3018") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_capric270.jpg";
		} 			
		if(WeaveValue == "3019") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/mozambique/sisal_mozamc270.jpg";
		} 			
		if(WeaveValue == "3020") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tanzania/sisal_tanzaniac270.jpg";
		} 			
		if(WeaveValue == "3021") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/deco/sisal_decoc270.jpg";
		} 			
		if(WeaveValue == "3022") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/florence/sisal_florencec270.jpg";
		} 			
		if(WeaveValue == "3023") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/fullpanama/sisal_fpanamac270.jpg";
		} 			
		if(WeaveValue == "3024") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/hboucle/sisal_hbouclec270.jpg";
		} 			
		if(WeaveValue == "3025") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/milano/sisal_milanoc270.jpg";
		} 			
		if(WeaveValue == "3026") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/resort/sisal_resortc270.jpg";
		} 			
		if(WeaveValue == "3027") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rio/sisal_rioc270.jpg";
		} 			
		if(WeaveValue == "3028") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/riviera/sisal_rivierac270.jpg";
		} 			
		if(WeaveValue == "3029") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rustic/sisal_rusticc270.jpg";
		} 			
		if(WeaveValue == "3030") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/seaside/sisal_seasidec270.jpg";
		} 			
		if(WeaveValue == "3031") {

			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sboucle/sisal_sbouclec270.jpg";
		} 			
		if(WeaveValue == "3032") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sienna/sisal_siennac270.jpg";
		} 			
		if(WeaveValue == "3033") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sorrento/sisal_sorrentoc270.jpg";
		} 			
		if(WeaveValue == "3034") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/studio/sisal_studioc270.jpg";
		} 			
		if(WeaveValue == "3035") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tuscany/sisal_tuscanyc270.jpg";
		} 			
		if(WeaveValue == "3036") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/valencia/sisal_valenciac270.jpg";
		} 			
		if(WeaveValue == "3037") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/venice/sisal_venicec270.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/verona/sisal_veronac270.jpg";
		} 			
		if(WeaveValue == "3039") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/vienna/sisal_viennac270.jpg";
		} 	
		if(WeaveValue == "4195") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/prestige/wool_prestigec270.jpg";
		}	
		if(WeaveValue == "4913") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/princeton/sisal_princetonc270.jpg";
		}
	} else {
	
	}
}
function getBorder_d() {
	var obj = document.quote;
	var WeaveValue  = obj.Weave.value;
	if (WeaveValue != "choose_a_weave") {
		if(WeaveValue == "3004") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/fairmont/fairmontd270.jpg";
		} 			
		if(WeaveValue == "3005") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/rosemont/rosemontd270.jpg";
		} 			
		if(WeaveValue == "3007") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/basketweave/mgrass_basketweaved270.jpg";
		} 			
		if(WeaveValue == "3008") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/everest/mgrass_everestd270.jpg";
		} 			
		if(WeaveValue == "3009") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_basketweaved270.jpg";
		} 			
		if(WeaveValue == "3010") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_beachd270.jpg";
		} 			
		if(WeaveValue == "3011") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_hpanamad270.jpg";
		} 			
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/chelsea/wool_chelsead270.jpg";
		} 			
		if(WeaveValue == "3012") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/heritage/wool_heritaged270.jpg";
		} 			
		if(WeaveValue == "3014") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/icon/wool_icond270.jpg";
		} 			
		if(WeaveValue == "3013") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/majesty/wool_majestyd270.jpg";
		}
		if(WeaveValue == "3150") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/manhattan/wool_manhattand270.jpg";
		}
		if(WeaveValue == "3016") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/sonoma/wool_sonomad270.jpg";
		} 			
		if(WeaveValue == "2947") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprid270.jpg";
		} 			
		if(WeaveValue == "3006") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/aspen/mgrass_aspend270.jpg";
		} 			
		if(WeaveValue == "3015") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/ritz/wool_ritzd270.jpg";
		} 			
		if(WeaveValue == "3017") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/amalfi/sisal_amalfid270.jpg";
		} 			
		if(WeaveValue == "3018") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprid270.jpg";
		} 			
		if(WeaveValue == "3019") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/mozambique/sisal_mozamd270.jpg";
		} 			
		if(WeaveValue == "3020") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tanzania/sisal_tanzaniad270.jpg";
		} 			
		if(WeaveValue == "3021") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/deco/sisal_decod270.jpg";
		} 			
		if(WeaveValue == "3022") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/florence/sisal_florenced270.jpg";
		} 			
		if(WeaveValue == "3023") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/fullpanama/sisal_fpanamad270.jpg";
		} 			
		if(WeaveValue == "3024") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/hboucle/sisal_hboucled270.jpg";
		} 			
		if(WeaveValue == "3025") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/milano/sisal_milanod270.jpg";
		} 			
		if(WeaveValue == "3026") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/resort/sisal_resortd270.jpg";
		} 			
		if(WeaveValue == "3027") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rio/sisal_riod270.jpg";
		} 			
		if(WeaveValue == "3028") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/riviera/sisal_rivierad270.jpg";
		} 			
		if(WeaveValue == "3029") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rustic/sisal_rusticd270.jpg";
		} 			
		if(WeaveValue == "3030") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/seaside/sisal_seasided270.jpg";
		} 			
		if(WeaveValue == "3031") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sboucle/sisal_sboucled270.jpg";
		} 			
		if(WeaveValue == "3032") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sienna/sisal_siennad270.jpg";
		} 			
		if(WeaveValue == "3033") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sorrento/sisal_sorrentod270.jpg";
		} 			
		if(WeaveValue == "3034") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/studio/sisal_studiod270.jpg";
		} 			
		if(WeaveValue == "3035") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tuscany/sisal_tuscanyd270.jpg";
		} 			
		if(WeaveValue == "3036") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/valencia/sisal_valenciad270.jpg";
		} 			
		if(WeaveValue == "3037") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/venice/sisal_veniced270.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/verona/sisal_veronad270.jpg";
		} 			
		if(WeaveValue == "3039") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/vienna/sisal_viennad270.jpg";
		} 	
		if(WeaveValue == "4195") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/prestige/wool_prestiged270.jpg";
		}		
		if(WeaveValue == "4913") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/princeton/sisal_princetond270.jpg";
		}
	} else {
	
	}
}
function getBorder_e() {
	var obj = document.quote;
	var WeaveValue  = obj.Weave.value;
	if (WeaveValue != "choose_a_weave") {
		if(WeaveValue == "3004") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/fairmont/fairmonte270.jpg";
		} 			
		if(WeaveValue == "3005") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/rosemont/rosemonte270.jpg";
		} 			
		if(WeaveValue == "3007") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/basketweave/mgrass_basketweavee270.jpg";
		} 			
		if(WeaveValue == "3008") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/everest/mgrass_evereste270.jpg";
		} 			
		if(WeaveValue == "3009") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_basketweavee270.jpg";
		} 			
		if(WeaveValue == "3010") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_beache270.jpg";
		} 			
		if(WeaveValue == "3011") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_hpanamae270.jpg";
		} 			
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/chelsea/wool_chelseae270.jpg";
		} 			
		if(WeaveValue == "3012") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/heritage/wool_heritagee270.jpg";
		} 			
		if(WeaveValue == "3014") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/icon/wool_icone270.jpg";
		} 			
		if(WeaveValue == "3013") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/majesty/wool_majestye270.jpg";
		}
		if(WeaveValue == "3150") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/manhattan/wool_manhattane270.jpg";
		}
		if(WeaveValue == "3016") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/sonoma/wool_sonomae270.jpg";
		} 			
		if(WeaveValue == "2947") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprie270.jpg";
		} 			
		if(WeaveValue == "3006") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/aspen/mgrass_aspene270.jpg";
		} 			
		if(WeaveValue == "3015") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/ritz/wool_ritze270.jpg";
		} 			
		if(WeaveValue == "3017") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/amalfi/sisal_amalfie270.jpg";
		} 			
		if(WeaveValue == "3018") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprie270.jpg";
		} 			
		if(WeaveValue == "3019") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/mozambique/sisal_mozame270.jpg";
		} 			
		if(WeaveValue == "3020") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tanzania/sisal_tanzaniae270.jpg";
		} 			
		if(WeaveValue == "3021") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/deco/sisal_decoe270.jpg";
		} 			
		if(WeaveValue == "3022") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/florence/sisal_florencee270.jpg";
		} 			
		if(WeaveValue == "3023") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/fullpanama/sisal_fpanamae270.jpg";
		} 			
		if(WeaveValue == "3024") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/hboucle/sisal_hbouclee270.jpg";
		} 			
		if(WeaveValue == "3025") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/milano/sisal_milanoe270.jpg";
		} 			
		if(WeaveValue == "3026") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/resort/sisal_resorte270.jpg";
		} 			
		if(WeaveValue == "3027") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rio/sisal_rioe270.jpg";
		} 			
		if(WeaveValue == "3028") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/riviera/sisal_rivierae270.jpg";
		} 			
		if(WeaveValue == "3029") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rustic/sisal_rustice270.jpg";
		} 			
		if(WeaveValue == "3030") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/seaside/sisal_seasidee270.jpg";
		} 			
		if(WeaveValue == "3031") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sboucle/sisal_sbouclee270.jpg";
		} 			
		if(WeaveValue == "3032") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sienna/sisal_siennae270.jpg";
		} 			
		if(WeaveValue == "3033") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sorrento/sisal_sorrentoe270.jpg";
		} 			
		if(WeaveValue == "3034") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/studio/sisal_studioe270.jpg";
		} 			
		if(WeaveValue == "3035") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tuscany/sisal_tuscanye270.jpg";
		} 			
		if(WeaveValue == "3036") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/valencia/sisal_valenciae270.jpg";
		} 			
		if(WeaveValue == "3037") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/venice/sisal_venicee270.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/verona/sisal_veronae270.jpg";
		} 			
		if(WeaveValue == "3039") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/vienna/sisal_viennae270.jpg";
		} 	
		if(WeaveValue == "4195") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/prestige/wool_prestigee270.jpg";
		}	
		if(WeaveValue == "4913") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/princeton/sisal_princetone270.jpg";
		}
	} else {
	
	}
}
function getBorder_f() {
	var obj = document.quote;
	var WeaveValue  = obj.Weave.value;
	if (WeaveValue != "choose_a_weave") {
		if(WeaveValue == "3004") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/fairmont/fairmontf270.jpg";
		} 			
		if(WeaveValue == "3005") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/rosemont/rosemontf270.jpg";
		} 			
		if(WeaveValue == "3007") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/basketweave/mgrass_basketweavef270.jpg";
		} 			
		if(WeaveValue == "3008") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/everest/mgrass_everestf270.jpg";
		} 			
		if(WeaveValue == "3009") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_basketweavef270.jpg";
		} 			
		if(WeaveValue == "3010") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_beachf270.jpg";
		} 			
		if(WeaveValue == "3011") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_hpanamaf270.jpg";
		} 			
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/chelsea/wool_chelseaf270.jpg";
		} 			
		if(WeaveValue == "3012") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/heritage/wool_heritagef270.jpg";
		} 			
		if(WeaveValue == "3014") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/icon/wool_iconf270.jpg";
		} 			
		if(WeaveValue == "3013") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/majesty/wool_majestyf270.jpg";
		}
		if(WeaveValue == "3150") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/manhattan/wool_manhattanf270.jpg";
		}
		if(WeaveValue == "3016") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/sonoma/wool_sonomaf270.jpg";
		} 			
		if(WeaveValue == "2947") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprif270.jpg";
		} 			
		if(WeaveValue == "3006") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/aspen/mgrass_aspenf270.jpg";
		} 			
		if(WeaveValue == "3015") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/ritz/wool_ritzf270.jpg";
		} 			
		if(WeaveValue == "3017") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/amalfi/sisal_amalfif270.jpg";
		} 			
		if(WeaveValue == "3018") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprif270.jpg";
		} 			
		if(WeaveValue == "3019") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/mozambique/sisal_mozamf270.jpg";
		} 			
		if(WeaveValue == "3020") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tanzania/sisal_tanzaniaf270.jpg";
		} 			
		if(WeaveValue == "3021") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/deco/sisal_decof270.jpg";
		} 			
		if(WeaveValue == "3022") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/florence/sisal_florencef270.jpg";
		} 			
		if(WeaveValue == "3023") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/fullpanama/sisal_fpanamaf270.jpg";
		} 			
		if(WeaveValue == "3024") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/hboucle/sisal_hbouclef270.jpg";
		} 			
		if(WeaveValue == "3025") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/milano/sisal_milanof270.jpg";
		} 			
		if(WeaveValue == "3026") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/resort/sisal_resortf270.jpg";
		} 			
		if(WeaveValue == "3027") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rio/sisal_riof270.jpg";
		} 			
		if(WeaveValue == "3028") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/riviera/sisal_rivieraf270.jpg";
		} 			
		if(WeaveValue == "3029") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rustic/sisal_rusticf270.jpg";
		} 			
		if(WeaveValue == "3030") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/seaside/sisal_seasidef270.jpg";
		} 			
		if(WeaveValue == "3031") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sboucle/sisal_sbouclef270.jpg";
		} 			
		if(WeaveValue == "3032") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sienna/sisal_siennaf270.jpg";
		} 			
		if(WeaveValue == "3033") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sorrento/sisal_sorrentof270.jpg";
		} 			
		if(WeaveValue == "3034") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/studio/sisal_studiof270.jpg";
		} 			
		if(WeaveValue == "3035") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tuscany/sisal_tuscanyf270.jpg";
		} 			
		if(WeaveValue == "3036") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/valencia/sisal_valenciaf270.jpg";
		} 			
		if(WeaveValue == "3037") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/venice/sisal_venicef270.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/verona/sisal_veronaf270.jpg";
		} 			
		if(WeaveValue == "3039") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/vienna/sisal_viennaf270.jpg";
		} 		
		if(WeaveValue == "4195") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/prestige/wool_prestigef270.jpg";
		}
		if(WeaveValue == "4913") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/princeton/sisal_princetonf270.jpg";
		}
	} else {
	
	}
}
function getBorder_g() {
	var obj = document.quote;
	var WeaveValue  = obj.Weave.value;
	if (WeaveValue != "choose_a_weave") {
		if(WeaveValue == "3004") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/fairmont/fairmontg270.jpg";
		} 			
		if(WeaveValue == "3005") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/rosemont/rosemontg270.jpg";
		} 			
		if(WeaveValue == "3007") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/basketweave/mgrass_basketweaveg270.jpg";
		} 			
		if(WeaveValue == "3008") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/everest/mgrass_everestg270.jpg";
		} 			
		if(WeaveValue == "3009") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_basketweaveg270.jpg";
		} 			
		if(WeaveValue == "3010") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_beachg270.jpg";
		} 			
		if(WeaveValue == "3011") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_hpanamag270.jpg";
		} 			
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/chelsea/wool_chelseag270.jpg";
		} 			
		if(WeaveValue == "3012") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/heritage/wool_heritageg270.jpg";
		} 			
		if(WeaveValue == "3014") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/icon/wool_icong270.jpg";
		} 			
		if(WeaveValue == "3013") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/majesty/wool_majestyg270.jpg";
		}
		if(WeaveValue == "3150") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/manhattan/wool_manhattang270.jpg";
		}
		if(WeaveValue == "3016") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/sonoma/wool_sonomag270.jpg";
		} 			
		if(WeaveValue == "2947") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprig270.jpg";
		} 			
		if(WeaveValue == "3006") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/aspen/mgrass_aspeng270.jpg";
		} 			
		if(WeaveValue == "3015") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/ritz/wool_ritzg270.jpg";
		} 			
		if(WeaveValue == "3017") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/amalfi/sisal_amalfig270.jpg";
		} 			
		if(WeaveValue == "3018") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprig270.jpg";
		} 			
		if(WeaveValue == "3019") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/mozambique/sisal_mozamg270.jpg";
		} 			
		if(WeaveValue == "3020") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tanzania/sisal_tanzaniag270.jpg";
		} 			
		if(WeaveValue == "3021") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/deco/sisal_decog270.jpg";
		} 			
		if(WeaveValue == "3022") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/florence/sisal_florenceg270.jpg";
		} 			
		if(WeaveValue == "3023") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/fullpanama/sisal_fpanamag270.jpg";
		} 			
		if(WeaveValue == "3024") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/hboucle/sisal_hboucleg270.jpg";
		} 			
		if(WeaveValue == "3025") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/milano/sisal_milanog270.jpg";
		} 			
		if(WeaveValue == "3026") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/resort/sisal_resortg270.jpg";
		} 			
		if(WeaveValue == "3027") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rio/sisal_riog270.jpg";
		} 			
		if(WeaveValue == "3028") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/riviera/sisal_rivierag270.jpg";
		} 			
		if(WeaveValue == "3029") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rustic/sisal_rusticg270.jpg";
		} 			
		if(WeaveValue == "3030") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/seaside/sisal_seasideg270.jpg";
		} 			
		if(WeaveValue == "3031") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sboucle/sisal_sboucleg270.jpg";
		} 			
		if(WeaveValue == "3032") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sienna/sisal_siennag270.jpg";
		} 			
		if(WeaveValue == "3033") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sorrento/sisal_sorrentog270.jpg";
		} 			
		if(WeaveValue == "3034") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/studio/sisal_studiog270.jpg";
		} 			
		if(WeaveValue == "3035") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tuscany/sisal_tuscanyg270.jpg";
		} 			
		if(WeaveValue == "3036") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/valencia/sisal_valenciag270.jpg";
		} 			
		if(WeaveValue == "3037") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/venice/sisal_veniceg270.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/verona/sisal_veronag270.jpg";
		} 			
		if(WeaveValue == "3039") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/vienna/sisal_viennag270.jpg";
		} 		
		if(WeaveValue == "4195") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/prestige/wool_prestigeg270.jpg";
		}	
		if(WeaveValue == "4913") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/princeton/sisal_princetong270.jpg";
		}
	} else {
	
	}
}
function getBorder_h() {
	var obj = document.quote;
	var WeaveValue  = obj.Weave.value;
	if (WeaveValue != "choose_a_weave") {
		if(WeaveValue == "3004") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/fairmont/fairmonth270.jpg";
		} 			
		if(WeaveValue == "3005") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/rosemont/rosemonth270.jpg";
		} 			
		if(WeaveValue == "3007") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/basketweave/mgrass_basketweaveh270.jpg";
		} 			
		if(WeaveValue == "3008") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/everest/mgrass_everesth270.jpg";
		} 			
		if(WeaveValue == "3009") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_basketweaveh270.jpg";
		} 			
		if(WeaveValue == "3010") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_beachh270.jpg";
		} 			
		if(WeaveValue == "3011") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_hpanamah270.jpg";
		} 			
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/chelsea/wool_chelseah270.jpg";
		} 			
		if(WeaveValue == "3012") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/heritage/wool_heritageh270.jpg";
		} 			
		if(WeaveValue == "3014") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/icon/wool_iconh270.jpg";
		} 			
		if(WeaveValue == "3013") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/majesty/wool_majestyh270.jpg";
		}
		if(WeaveValue == "3150") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/manhattan/wool_manhattanh270.jpg";
		}
		if(WeaveValue == "3016") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/sonoma/wool_sonomah270.jpg";
		} 			
		if(WeaveValue == "2947") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprih270.jpg";
		} 			
		if(WeaveValue == "3006") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/aspen/mgrass_aspenh270.jpg";
		} 			
		if(WeaveValue == "3015") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/ritz/wool_ritzh270.jpg";
		} 			
		if(WeaveValue == "3017") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/amalfi/sisal_amalfih270.jpg";
		} 			
		if(WeaveValue == "3018") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprih270.jpg";
		} 			
		if(WeaveValue == "3019") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/mozambique/sisal_mozamh270.jpg";
		} 			
		if(WeaveValue == "3020") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tanzania/sisal_tanzaniah270.jpg";
		} 			
		if(WeaveValue == "3021") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/deco/sisal_decoh270.jpg";
		} 			
		if(WeaveValue == "3022") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/florence/sisal_florenceh270.jpg";
		} 			
		if(WeaveValue == "3023") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/fullpanama/sisal_fpanamah270.jpg";
		} 			
		if(WeaveValue == "3024") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/hboucle/sisal_hboucleh270.jpg";
		} 			
		if(WeaveValue == "3025") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/milano/sisal_milanoh270.jpg";
		} 			
		if(WeaveValue == "3026") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/resort/sisal_resorth270.jpg";
		} 			
		if(WeaveValue == "3027") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rio/sisal_rioh270.jpg";
		} 			
		if(WeaveValue == "3028") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/riviera/sisal_rivierah270.jpg";
		} 			
		if(WeaveValue == "3029") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rustic/sisal_rustich270.jpg";
		} 			
		if(WeaveValue == "3030") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/seaside/sisal_seasideh270.jpg";
		} 			
		if(WeaveValue == "3031") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sboucle/sisal_sboucleh270.jpg";
		} 			
		if(WeaveValue == "3032") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sienna/sisal_siennah270.jpg";
		} 			
		if(WeaveValue == "3033") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sorrento/sisal_sorrentoh270.jpg";
		} 			
		if(WeaveValue == "3034") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/studio/sisal_studioh270.jpg";
		} 			
		if(WeaveValue == "3035") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tuscany/sisal_tuscanyh270.jpg";
		} 			
		if(WeaveValue == "3036") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/valencia/sisal_valenciah270.jpg";
		} 			
		if(WeaveValue == "3037") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/venice/sisal_veniceh270.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/verona/sisal_veronah270.jpg";
		} 			
		if(WeaveValue == "3039") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/vienna/sisal_viennah270.jpg";
		} 
		if(WeaveValue == "4195") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/prestige/wool_prestigeh270.jpg";
		}			
		if(WeaveValue == "4913") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/princeton/sisal_princetonh270.jpg";
		}
	} else {
	
	}
}
function getBorder_i() {
	var obj = document.quote;
	var WeaveValue  = obj.Weave.value;
	if (WeaveValue != "choose_a_weave") {
		if(WeaveValue == "3004") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/fairmont/fairmonti270.jpg";
		} 			
		if(WeaveValue == "3005") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/rosemont/rosemonti270.jpg";
		} 			
		if(WeaveValue == "3007") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/basketweave/mgrass_basketweavei270.jpg";
		} 			
		if(WeaveValue == "3008") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/everest/mgrass_everesti270.jpg";
		} 			
		if(WeaveValue == "3009") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_basketweavei270.jpg";
		} 			
		if(WeaveValue == "3010") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_beachi270.jpg";
		} 			
		if(WeaveValue == "3011") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_hpanamai270.jpg";
		} 			
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/chelsea/wool_chelseai270.jpg";
		} 			
		if(WeaveValue == "3012") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/heritage/wool_heritagei270.jpg";
		} 			
		if(WeaveValue == "3014") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/icon/wool_iconi270.jpg";
		} 			
		if(WeaveValue == "3013") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/majesty/wool_majestyi270.jpg";
		}
		if(WeaveValue == "3150") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/manhattan/wool_manhattani270.jpg";
		}
		if(WeaveValue == "3016") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/sonoma/wool_sonomai270.jpg";
		} 			
		if(WeaveValue == "2947") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprii270.jpg";
		} 			
		if(WeaveValue == "3006") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/aspen/mgrass_aspeni270.jpg";
		} 			
		if(WeaveValue == "3015") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/ritz/wool_ritzi270.jpg";
		} 			
		if(WeaveValue == "3017") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/amalfi/sisal_amalfii270.jpg";
		} 			
		if(WeaveValue == "3018") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprii270.jpg";
		} 			
		if(WeaveValue == "3019") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/mozambique/sisal_mozami270.jpg";
		} 			
		if(WeaveValue == "3020") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tanzania/sisal_tanzaniai270.jpg";
		} 			
		if(WeaveValue == "3021") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/deco/sisal_decoi270.jpg";
		} 			
		if(WeaveValue == "3022") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/florence/sisal_florencei270.jpg";
		} 			
		if(WeaveValue == "3023") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/fullpanama/sisal_fpanamai270.jpg";
		} 			
		if(WeaveValue == "3024") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/hboucle/sisal_hbouclei270.jpg";
		} 			
		if(WeaveValue == "3025") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/milano/sisal_milanoi270.jpg";
		} 			
		if(WeaveValue == "3026") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/resort/sisal_resorti270.jpg";
		} 			
		if(WeaveValue == "3027") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rio/sisal_rioi270.jpg";
		} 			
		if(WeaveValue == "3028") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/riviera/sisal_rivierai270.jpg";
		} 			
		if(WeaveValue == "3029") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rustic/sisal_rustici270.jpg";
		} 			
		if(WeaveValue == "3030") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/seaside/sisal_seasidei270.jpg";
		} 			
		if(WeaveValue == "3031") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sboucle/sisal_sbouclei270.jpg";
		} 			
		if(WeaveValue == "3032") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sienna/sisal_siennai270.jpg";
		} 			
		if(WeaveValue == "3033") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sorrento/sisal_sorrentoi270.jpg";
		} 			
		if(WeaveValue == "3034") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/studio/sisal_studioi270.jpg";
		} 			
		if(WeaveValue == "3035") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tuscany/sisal_tuscanyi270.jpg";
		} 			
		if(WeaveValue == "3036") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/valencia/sisal_valenciai270.jpg";
		} 			
		if(WeaveValue == "3037") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/venice/sisal_venicei270.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/verona/sisal_veronai270.jpg";
		} 			
		if(WeaveValue == "3039") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/vienna/sisal_viennai270.jpg";
		} 			
		if(WeaveValue == "4195") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/prestige/wool_prestigei270.jpg";
		}
		if(WeaveValue == "4913") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/princeton/sisal_princetoni270.jpg";
		}
	} else {
	
	}
}
function getBorder_j() {
	var obj = document.quote;
	var WeaveValue  = obj.Weave.value;
	if (WeaveValue != "choose_a_weave") {
		if(WeaveValue == "3004") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/fairmont/fairmontj270.jpg";
		} 			
		if(WeaveValue == "3005") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/rosemont/rosemontj270.jpg";
		} 			
		if(WeaveValue == "3007") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/basketweave/mgrass_basketweavej270.jpg";
		} 			
		if(WeaveValue == "3008") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/everest/mgrass_everestj270.jpg";
		} 			
		if(WeaveValue == "3009") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_basketweavej270.jpg";
		} 			
		if(WeaveValue == "3010") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_beachj270.jpg";
		} 			
		if(WeaveValue == "3011") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_hpanamaj270.jpg";
		} 			
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/chelsea/wool_chelseaj270.jpg";
		} 			
		if(WeaveValue == "3012") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/heritage/wool_heritagej270.jpg";
		} 			
		if(WeaveValue == "3014") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/icon/wool_iconj270.jpg";
		} 			
		if(WeaveValue == "3013") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/majesty/wool_majestyj270.jpg";
		}
		if(WeaveValue == "3150") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/manhattan/wool_manhattanj270.jpg";
		}
		if(WeaveValue == "3016") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/sonoma/wool_sonomaj270.jpg";
		} 			
		if(WeaveValue == "2947") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprij270.jpg";
		} 			
		if(WeaveValue == "3006") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/aspen/mgrass_aspenj270.jpg";
		} 			
		if(WeaveValue == "3015") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/ritz/wool_ritzj270.jpg";
		} 			
		if(WeaveValue == "3017") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/amalfi/sisal_amalfij270.jpg";
		} 			
		if(WeaveValue == "3018") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprij270.jpg";
		} 			
		if(WeaveValue == "3019") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/mozambique/sisal_mozamj270.jpg";
		} 			
		if(WeaveValue == "3020") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tanzania/sisal_tanzaniaj270.jpg";
		} 			
		if(WeaveValue == "3021") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/deco/sisal_decoj270.jpg";
		} 			
		if(WeaveValue == "3022") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/florence/sisal_florencej270.jpg";
		} 			
		if(WeaveValue == "3023") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/fullpanama/sisal_fpanamaj270.jpg";
		} 			
		if(WeaveValue == "3024") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/hboucle/sisal_hbouclej270.jpg";
		} 			
		if(WeaveValue == "3025") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/milano/sisal_milanoj270.jpg";
		} 			
		if(WeaveValue == "3026") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/resort/sisal_resortj270.jpg";
		} 			
		if(WeaveValue == "3027") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rio/sisal_rioj270.jpg";
		} 			
		if(WeaveValue == "3028") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/riviera/sisal_rivieraj270.jpg";
		} 			
		if(WeaveValue == "3029") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rustic/sisal_rusticj270.jpg";
		} 			
		if(WeaveValue == "3030") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/seaside/sisal_seasidej270.jpg";
		} 			
		if(WeaveValue == "3031") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sboucle/sisal_sbouclej270.jpg";
		} 			
		if(WeaveValue == "3032") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sienna/sisal_siennaj270.jpg";
		} 			
		if(WeaveValue == "3033") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sorrento/sisal_sorrentoj270.jpg";
		} 			
		if(WeaveValue == "3034") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/studio/sisal_studioj270.jpg";
		} 			
		if(WeaveValue == "3035") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tuscany/sisal_tuscanyj270.jpg";
		} 			
		if(WeaveValue == "3036") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/valencia/sisal_valenciaj270.jpg";
		} 			
		if(WeaveValue == "3037") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/venice/sisal_venicej270.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/verona/sisal_veronaj270.jpg";
		} 			
		if(WeaveValue == "3039") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/vienna/sisal_viennaj270.jpg";
		} 	
		if(WeaveValue == "4195") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/prestige/wool_prestigej270.jpg";
		}		
		if(WeaveValue == "4913") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/princeton/sisal_princetonj270.jpg";
		}
	} else {
	
	}
}
function getBorder_k() {
	var obj = document.quote;
	var WeaveValue  = obj.Weave.value;
	if (WeaveValue != "choose_a_weave") {
		if(WeaveValue == "3004") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/fairmont/fairmontk270.jpg";
		} 			
		if(WeaveValue == "3005") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/rosemont/rosemontk270.jpg";
		} 			
		if(WeaveValue == "3007") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/basketweave/mgrass_basketweavek270.jpg";
		} 			
		if(WeaveValue == "3008") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/everest/mgrass_everestk270.jpg";
		} 			
		if(WeaveValue == "3009") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_basketweavek270.jpg";
		} 			
		if(WeaveValue == "3010") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_beachk270.jpg";
		} 			
		if(WeaveValue == "3011") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_hpanamak270.jpg";
		} 			
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/chelsea/wool_chelseak270.jpg";
		} 			
		if(WeaveValue == "3012") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/heritage/wool_heritagek270.jpg";
		} 			
		if(WeaveValue == "3014") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/icon/wool_iconk270.jpg";
		} 			
		if(WeaveValue == "3013") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/majesty/wool_majestyk270.jpg";
		}
		if(WeaveValue == "3150") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/manhattan/wool_manhattank270.jpg";
		}
		if(WeaveValue == "3016") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/sonoma/wool_sonomak270.jpg";
		} 			
		if(WeaveValue == "2947") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprik270.jpg";
		} 			
		if(WeaveValue == "3006") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/aspen/mgrass_aspenk270.jpg";
		} 			
		if(WeaveValue == "3015") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/ritz/wool_ritzk270.jpg";
		} 			
		if(WeaveValue == "3017") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/amalfi/sisal_amalfik270.jpg";
		} 			
		if(WeaveValue == "3018") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprik270.jpg";
		} 			
		if(WeaveValue == "3019") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/mozambique/sisal_mozamk270.jpg";
		} 			
		if(WeaveValue == "3020") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tanzania/sisal_tanzaniak270.jpg";
		} 			
		if(WeaveValue == "3021") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/deco/sisal_decok270.jpg";
		} 			
		if(WeaveValue == "3022") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/florence/sisal_florencek270.jpg";
		} 			
		if(WeaveValue == "3023") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/fullpanama/sisal_fpanamak270.jpg";
		} 			
		if(WeaveValue == "3024") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/hboucle/sisal_hbouclek270.jpg";
		} 			
		if(WeaveValue == "3025") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/milano/sisal_milanok270.jpg";
		} 			
		if(WeaveValue == "3026") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/resort/sisal_resortk270.jpg";
		} 			
		if(WeaveValue == "3027") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rio/sisal_riok270.jpg";
		} 			
		if(WeaveValue == "3028") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/riviera/sisal_rivierak270.jpg";
		} 			
		if(WeaveValue == "3029") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rustic/sisal_rustick270.jpg";
		} 			
		if(WeaveValue == "3030") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/seaside/sisal_seasidek270.jpg";
		} 			
		if(WeaveValue == "3031") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sboucle/sisal_sbouclek270.jpg";
		} 			
		if(WeaveValue == "3032") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sienna/sisal_siennak270.jpg";
		} 			
		if(WeaveValue == "3033") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sorrento/sisal_sorrentok270.jpg";
		} 			
		if(WeaveValue == "3034") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/studio/sisal_studiok270.jpg";
		} 			
		if(WeaveValue == "3035") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tuscany/sisal_tuscanyk270.jpg";
		} 			
		if(WeaveValue == "3036") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/valencia/sisal_valenciak270.jpg";
		} 			
		if(WeaveValue == "3037") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/venice/sisal_venicek270.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/verona/sisal_veronak270.jpg";
		} 			
		if(WeaveValue == "3039") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/vienna/sisal_viennak270.jpg";
		} 			
		if(WeaveValue == "4195") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/prestige/wool_prestigek270.jpg";
		}
		if(WeaveValue == "4913") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/princeton/sisal_princetonk270.jpg";
		}
	} else {
	
	}
}
function getBorder_l() {
	var obj = document.quote;
	var WeaveValue  = obj.Weave.value;
	if (WeaveValue != "choose_a_weave") {
		if(WeaveValue == "3004") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/fairmont/fairmontl270.jpg";
		} 			
		if(WeaveValue == "3005") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/rosemont/rosemontl270.jpg";
		} 			
		if(WeaveValue == "3007") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/basketweave/mgrass_basketweavel270.jpg";
		} 			
		if(WeaveValue == "3008") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/everest/mgrass_everestl270.jpg";
		} 			
		if(WeaveValue == "3009") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_basketweavel270.jpg";
		} 			
		if(WeaveValue == "3010") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_beachl270.jpg";
		} 			
		if(WeaveValue == "3011") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_hpanamal270.jpg";
		} 			
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/chelsea/wool_chelseal270.jpg";
		} 			
		if(WeaveValue == "3012") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/heritage/wool_heritagel270.jpg";
		} 			
		if(WeaveValue == "3014") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/icon/wool_iconl270.jpg";
		} 			
		if(WeaveValue == "3013") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/majesty/wool_majestyl270.jpg";
		}
		if(WeaveValue == "3150") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/manhattan/wool_manhattanl270.jpg";
		}
		if(WeaveValue == "3016") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/sonoma/wool_sonomal270.jpg";
		} 			
		if(WeaveValue == "2947") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_capril270.jpg";
		} 			
		if(WeaveValue == "3006") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/aspen/mgrass_aspenl270.jpg";
		} 			
		if(WeaveValue == "3015") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/ritz/wool_ritzl270.jpg";
		} 			
		if(WeaveValue == "3017") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/amalfi/sisal_amalfil270.jpg";
		} 			
		if(WeaveValue == "3018") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_capril270.jpg";
		} 			
		if(WeaveValue == "3019") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/mozambique/sisal_mozaml270.jpg";
		} 			
		if(WeaveValue == "3020") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tanzania/sisal_tanzanial270.jpg";
		} 			
		if(WeaveValue == "3021") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/deco/sisal_decol270.jpg";
		} 			
		if(WeaveValue == "3022") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/florence/sisal_florencel270.jpg";
		} 			
		if(WeaveValue == "3023") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/fullpanama/sisal_fpanamal270.jpg";
		} 			
		if(WeaveValue == "3024") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/hboucle/sisal_hbouclel270.jpg";
		} 			
		if(WeaveValue == "3025") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/milano/sisal_milanol270.jpg";
		} 			
		if(WeaveValue == "3026") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/resort/sisal_resortl270.jpg";
		} 			
		if(WeaveValue == "3027") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rio/sisal_riol270.jpg";
		} 			
		if(WeaveValue == "3028") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/riviera/sisal_rivieral270.jpg";
		} 			
		if(WeaveValue == "3029") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rustic/sisal_rusticl270.jpg";

		} 			
		if(WeaveValue == "3030") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/seaside/sisal_seasidel270.jpg";
		} 			
		if(WeaveValue == "3031") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sboucle/sisal_sbouclel270.jpg";
		} 			
		if(WeaveValue == "3032") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sienna/sisal_siennal270.jpg";
		} 			
		if(WeaveValue == "3033") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sorrento/sisal_sorrentol270.jpg";
		} 			
		if(WeaveValue == "3034") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/studio/sisal_studiol270.jpg";
		} 			
		if(WeaveValue == "3035") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tuscany/sisal_tuscanyl270.jpg";
		} 			
		if(WeaveValue == "3036") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/valencia/sisal_valencial270.jpg";
		} 			
		if(WeaveValue == "3037") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/venice/sisal_venicel270.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/verona/sisal_veronal270.jpg";
		} 			
		if(WeaveValue == "3039") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/vienna/sisal_viennal270.jpg";
		} 			
		if(WeaveValue == "4195") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/prestige/wool_prestigel270.jpg";
		}
		if(WeaveValue == "4913") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/princeton/sisal_princetonl270.jpg";
		}
	} else {
	
	}
}
function getBorder_m() {
	var obj = document.quote;
	var WeaveValue  = obj.Weave.value;
	if (WeaveValue != "choose_a_weave") {
		if(WeaveValue == "3004") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/fairmont/fairmontm270.jpg";
		} 			
		if(WeaveValue == "3005") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/rosemont/rosemontm270.jpg";
		} 			
		if(WeaveValue == "3007") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/basketweave/mgrass_basketweavem270.jpg";
		} 			
		if(WeaveValue == "3008") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/everest/mgrass_everestm270.jpg";
		} 			
		if(WeaveValue == "3009") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_basketweavem270.jpg";
		} 			
		if(WeaveValue == "3010") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_beachm270.jpg";
		} 			
		if(WeaveValue == "3011") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_hpanamam270.jpg";
		} 			
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/chelsea/wool_chelseam270.jpg";
		} 			
		if(WeaveValue == "3012") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/heritage/wool_heritagem270.jpg";
		} 			
		if(WeaveValue == "3014") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/icon/wool_iconm270.jpg";
		} 			
		if(WeaveValue == "3013") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/majesty/wool_majestym270.jpg";
		}
		if(WeaveValue == "3150") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/manhattan/wool_manhattanm270.jpg";
		}
		if(WeaveValue == "3016") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/sonoma/wool_sonomam270.jpg";
		} 			
		if(WeaveValue == "2947") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprim270.jpg";
		} 			
		if(WeaveValue == "3006") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/aspen/mgrass_aspenm270.jpg";
		} 			
		if(WeaveValue == "3015") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/ritz/wool_ritzm270.jpg";
		} 			
		if(WeaveValue == "3017") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/amalfi/sisal_amalfim270.jpg";
		} 			
		if(WeaveValue == "3018") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprim270.jpg";
		} 			
		if(WeaveValue == "3019") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/mozambique/sisal_mozamm270.jpg";
		} 			
		if(WeaveValue == "3020") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tanzania/sisal_tanzaniam270.jpg";
		} 			
		if(WeaveValue == "3021") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/deco/sisal_decom270.jpg";
		} 			
		if(WeaveValue == "3022") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/florence/sisal_florencem270.jpg";
		} 			
		if(WeaveValue == "3023") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/fullpanama/sisal_fpanamam270.jpg";
		} 			
		if(WeaveValue == "3024") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/hboucle/sisal_hbouclem270.jpg";
		} 			
		if(WeaveValue == "3025") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/milano/sisal_milanom270.jpg";
		} 			
		if(WeaveValue == "3026") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/resort/sisal_resortm270.jpg";
		} 			
		if(WeaveValue == "3027") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rio/sisal_riom270.jpg";
		} 			
		if(WeaveValue == "3028") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/riviera/sisal_rivieram270.jpg";
		} 			
		if(WeaveValue == "3029") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rustic/sisal_rusticm270.jpg";
		} 			
		if(WeaveValue == "3030") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/seaside/sisal_seasidem270.jpg";
		} 			
		if(WeaveValue == "3031") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sboucle/sisal_sbouclem270.jpg";
		} 			
		if(WeaveValue == "3032") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sienna/sisal_siennam270.jpg";
		} 			
		if(WeaveValue == "3033") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sorrento/sisal_sorrentom270.jpg";
		} 			
		if(WeaveValue == "3034") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/studio/sisal_studiom270.jpg";
		} 			
		if(WeaveValue == "3035") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tuscany/sisal_tuscanym270.jpg";
		} 			
		if(WeaveValue == "3036") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/valencia/sisal_valenciam270.jpg";
		} 			
		if(WeaveValue == "3037") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/venice/sisal_venicem270.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/verona/sisal_veronam270.jpg";
		} 			
		if(WeaveValue == "3039") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/vienna/sisal_viennam270.jpg";
		} 			
		if(WeaveValue == "4195") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/prestige/wool_prestigem270.jpg";
		}
		if(WeaveValue == "4913") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/princeton/sisal_princetonm270.jpg";
		}
	} else {
	
	}
}
function getBorder_n() {
	var obj = document.quote;
	var WeaveValue  = obj.Weave.value;
	if (WeaveValue != "choose_a_weave") {
		if(WeaveValue == "3004") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/fairmont/fairmontn270.jpg";
		} 			
		if(WeaveValue == "3005") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/bamboorugs/rosemont/rosemontn270.jpg";
		} 			
		if(WeaveValue == "3007") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/basketweave/mgrass_basketweaven270.jpg";
		} 			
		if(WeaveValue == "3008") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/everest/mgrass_everestn270.jpg";
		} 			
		if(WeaveValue == "3009") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_basketweaven270.jpg";
		} 			
		if(WeaveValue == "3010") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_beachn270.jpg";
		} 			
		if(WeaveValue == "3011") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/seagrass/sgrass_hpanaman270.jpg";
		} 			
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/chelsea/wool_chelsean270.jpg";
		} 			
		if(WeaveValue == "3012") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/heritage/wool_heritagen270.jpg";
		} 			
		if(WeaveValue == "3014") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/icon/wool_iconn270.jpg";
		} 			
		if(WeaveValue == "3013") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/majesty/wool_majestyn270.jpg";
		}
		if(WeaveValue == "3150") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/manhattan/wool_manhattann270.jpg";
		}
		if(WeaveValue == "3016") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/sonoma/wool_sonoman270.jpg";
		} 			
		if(WeaveValue == "2947") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprin270.jpg";
		} 			
		if(WeaveValue == "3006") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/mountaingrass/aspen/mgrass_aspenn270.jpg";
		} 			
		if(WeaveValue == "3015") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/ritz/wool_ritzn270.jpg";
		} 			
		if(WeaveValue == "3017") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/amalfi/sisal_amalfin270.jpg";
		} 			
		if(WeaveValue == "3018") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/capri/sisal_caprin270.jpg";
		} 			
		if(WeaveValue == "3019") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/mozambique/sisal_mozamn270.jpg";
		} 			
		if(WeaveValue == "3020") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tanzania/sisal_tanzanian270.jpg";
		} 			
		if(WeaveValue == "3021") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/deco/sisal_decon270.jpg";
		} 			
		if(WeaveValue == "3022") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/florence/sisal_florencen270.jpg";
		} 			
		if(WeaveValue == "3023") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/fullpanama/sisal_fpanaman270.jpg";
		} 			
		if(WeaveValue == "3024") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/hboucle/sisal_hbouclen270.jpg";
		} 			
		if(WeaveValue == "3025") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/milano/sisal_milanon270.jpg";
		} 			
		if(WeaveValue == "3026") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/resort/sisal_resortn270.jpg";
		} 			
		if(WeaveValue == "3027") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rio/sisal_rion270.jpg";
		} 			
		if(WeaveValue == "3028") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/riviera/sisal_rivieran270.jpg";
		} 			
		if(WeaveValue == "3029") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/rustic/sisal_rusticn270.jpg";
		} 			
		if(WeaveValue == "3030") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/seaside/sisal_seasiden270.jpg";
		} 			
		if(WeaveValue == "3031") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sboucle/sisal_sbouclen270.jpg";
		} 			
		if(WeaveValue == "3032") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sienna/sisal_siennan270.jpg";
		} 			
		if(WeaveValue == "3033") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/sorrento/sisal_sorrenton270.jpg";
		} 			
		if(WeaveValue == "3034") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/studio/sisal_studion270.jpg";
		} 			
		if(WeaveValue == "3035") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/tuscany/sisal_tuscanyn270.jpg";
		} 			
		if(WeaveValue == "3036") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/valencia/sisal_valencian270.jpg";
		} 			
		if(WeaveValue == "3037") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/venice/sisal_venicen270.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/verona/sisal_veronan270.jpg";
		} 			
		if(WeaveValue == "3039") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/vienna/sisal_viennan270.jpg";
		} 		
		if(WeaveValue == "4195") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/wool/prestige/wool_prestigen270.jpg";
		}	
		if(WeaveValue == "4913") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/sisal-agave/princeton/sisal_princetonn270.jpg";
		}
	} else {
	
	}
}

function SaveCustomer() {
	var obj = document.quote;
	if(obj.SaveInformation.checked) {
		if(obj.Password.value != obj.ConfirmPass.value) {
			alert('Password and Confirm password must be the same');
			return false;
		} else {return true;}		
	}  else {
		obj.SaveInformation.value = 'No';
		return true;
	}
}
function gotocheckout() {
	var obj = document.quote;
	obj.action = 'custom_order_grid.php';
	obj.submit();	
}
function showBorder() {
	var obj = document.quote;
	if(obj.Border.value == "a") {
		getBorder_a();
	}
	if(obj.Border.value == "b") {
		getBorder_b();
	}
	if(obj.Border.value == "c") {
		getBorder_c();
	}
	if(obj.Border.value == "d") {
		getBorder_d();
	}
	if(obj.Border.value == "e") {
		getBorder_e();
	}
	if(obj.Border.value == "f") {
		getBorder_f();
	}
	if(obj.Border.value == "g") {
		getBorder_g();
	}
	if(obj.Border.value == "h") {
		getBorder_h();
	}
	if(obj.Border.value == "i") {
		getBorder_i();
	}
	if(obj.Border.value == "j") {
		getBorder_j();
	}
	if(obj.Border.value == "k") {
		getBorder_k();
	}
	if(obj.Border.value == "l") {
		getBorder_l();
	}
	if(obj.Border.value == "m") {
		getBorder_m();
	}
	if(obj.Border.value == "n") {
		getBorder_n();
	}
	if(obj.Weave.value == "3001") {
		obj.the_pic.src = "http://www.naturalhomerugs.com/images/rugpad-22.jpg";	
	}
	obj.CustomImage.value = obj.the_pic.src;
}
function showBorderBroadloom() {
	var obj = document.quote;
	var WeaveValue  = obj.Weave.value;
	if(WeaveValue != "choose_a_weave") {
		if(WeaveValue == "3004") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3004_bamboorug-fairmont-broad.jpg";
		} 			
		if(WeaveValue == "3005") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3005_bamboorug-rosemont-broad.jpg";
		} 			
		if(WeaveValue == "3007") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3007_naturalarearugs_1744_688212broad.jpg";
		} 			
		if(WeaveValue == "3008") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3008_mountain-grass_broad.jpg";
		} 			
		if(WeaveValue == "3009") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3009_naturalarearugs_1744_577388broad.jpg";
		} 			
		if(WeaveValue == "3010") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3010_seagrass_beach_broad.jpg";
		} 			
		if(WeaveValue == "3011") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3011_naturalarearugs_1744_465419broad.jpg";
		} 			
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/chelsea/wool_chelseai270.jpg";
		} 			
		if(WeaveValue == "3012") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3012_wool-heritage-broad.jpg";
		} 			
		if(WeaveValue == "3013") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3013_majesty-broad.jpg";
		}
		if(WeaveValue == "3150") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3150_wool_manhattan_braod.jpg";
		}
		if(WeaveValue == "3014") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3014_wool-icon-broad.jpg";
		} 			
		if(WeaveValue == "3016") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3016_wool-sonoma-broad.jpg";
		} 			
		if(WeaveValue == "2947") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3007_naturalarearugs_1744_688212broad.jpg";
		} 			
		if(WeaveValue == "2958") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/2958_naturalarearugs_1744_577388broad.jpg";
		} 			
		if(WeaveValue == "3006") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3006_aspen_broad.jpg";
		} 			
		if(WeaveValue == "3015") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3015_sisalarearugs-ritz_broad.jpg";
		} 			
		if(WeaveValue == "3017") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3017_sisalarearugs-amalfi-broad.jpg";
		} 			
		if(WeaveValue == "3018") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3018_capri-broad.jpg";
		} 			
		if(WeaveValue == "3019") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3019_classicmozambique-broad.jpg";
		} 			
		if(WeaveValue == "3020") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3020_classictanzania-broad.jpg";
		} 			
		if(WeaveValue == "3021") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3021_sisalarearugs-deco-broad.jpg";
		} 			
		if(WeaveValue == "3022") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3022_sisalarearugs-florence-broad.jpg";
		} 			
		if(WeaveValue == "3023") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3023_naturalarearugs_1744_351039broad.jpg";
		} 			
		if(WeaveValue == "3024") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3024_naturalarearugs_1744_129238broad.jpg";
		} 			
		if(WeaveValue == "3025") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3025_sisalarearugs-milano-broad.jpg";
		} 			
		if(WeaveValue == "3026") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3026_sisalarearugs-resort-broad.jpg";
		} 			
		if(WeaveValue == "3027") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3027_rio-broad.jpg";
		} 			
		if(WeaveValue == "3028") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3028_riviera-broad.jpg";
		} 			
		if(WeaveValue == "3029") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3029_naturalarearugs_1744_239675broad.jpg";
		} 			
		if(WeaveValue == "3030") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3030_seaside-broad.jpg";
		} 			
		if(WeaveValue == "3031") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3031_naturalarearugs_1744_12483broad.jpg";
		} 			
		if(WeaveValue == "3032") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3032_sisalarearugs-sienna-broad.jpg";
		} 			
		if(WeaveValue == "3033") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3033_sorrento-broad.jpg";
		} 			
		if(WeaveValue == "3034") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3034_sisalarearugs-studio-broad.jpg";
		} 			
		if(WeaveValue == "3035") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3035_sisalarearugs-tuscany_broad.jpg";
		} 			
		if(WeaveValue == "3036") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3036_sisalarearugs-valencia_broad.jpg";
		} 			
		if(WeaveValue == "3037") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3037_sisalarearugs-venice-broad.jpg";
		} 			
		if(WeaveValue == "3038") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3038_sisalarearugs-verona-broad.jpg";
		} 			
		if(WeaveValue == "3039") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3039_sisalarearugs-vienna-broad.jpg";
		}
		if(WeaveValue == "3040") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/3040_sisalarearugs-chelsea-broad.jpg";
		}
		if(WeaveValue == "4195") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/4195_wool_prestige_broad.jpg";
		} 	
		if(WeaveValue == "4913") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/Broadloom/4913_sisal-princeton-broad.jpg";
		} 	
		if(WeaveValue == "3001") {
			obj.the_pic.src = "http://www.naturalhomerugs.com/images/rugpad-22.jpg";
		}
		obj.CustomImage.value = obj.the_pic.src;
	}
}
function selectWeave(){
	var thisWeave = '';
	obj = document.quote;	
	
	for (i=0; i < obj.Border.options.length; i++){
		if (obj.Border.options[i].value == ""){
			obj.Border.selectedIndex =  0;
			showBorderBroadloom();
			break;
		}
	}
	
	for (i=0; i < obj.Weave.options.length; i++){
		if (obj.Weave.options[i].value == thisWeave){
			obj.Weave.selectedIndex =  i;
			showBorderBroadloom();
			break;
		}
	}
	
}




function pad_with_zeros(rounded_value, decimal_places) {
    // Convert the number to a string
    var value_string = rounded_value.toString()
    // Locate the decimal point
    var decimal_location = value_string.indexOf(".")
    // Is there a decimal point?
    if (decimal_location == -1) {

        // If no, then all decimal places will be padded with 0s
        decimal_part_length = 0
        
        // If decimal_places is greater than zero, tack on a decimal point
        value_string += decimal_places > 0 ? "." : ""
    }
    else {

        // If yes, then only the extra decimal places will be padded with 0s
        decimal_part_length = value_string.length - decimal_location - 1
    }
    
    // Calculate the number of decimal places that need to be padded with 0s
    var pad_total = decimal_places - decimal_part_length
    
    if (pad_total > 0) {
        
        // Pad the string with 0s
        for (var counter = 1; counter <= pad_total; counter++) 
            value_string += "0"
        }
    return value_string
}
