// JavaScript Document

// ---------------------------------- Calculations ----------------------------------


function TextMultiplier( field, amount )
{
	var total = 0;
  
	if ( parseFloat( field.value ))
		total = parseFloat( field.value ) * amount;

	return( total );
}


function AddWhenChecked( field, amount )
{
	return( field.checked ? amount : 0 );
}


function DisableGroup( group )
{
	if( typeof(group) == 'undefined' ) 
	{ 
		return ''; 
	}
	
	for ( var i = 0; group[i]; ++i )
	{
		var o		= group[i];
		o.disabled	= 'true';
		o.checked	= false;
	}
}


function EnableGroup( group )
{
	if( typeof(group) == 'undefined' ) 
	{ 
		return ''; 
	}
	
	for ( var i = 0; group[i]; ++i )
		group[i].disabled	= '';
		group[0].checked	= true;
}



// InsulationPackage Price
function CalculateInsulationPackage()
{  
	var priceArray		= gAllPrice['InsulationWallRoof'];
	var testValue		= ExtractSingleValue( document.price_quote.InsulationPackage );
	var diameterIndex	= ExtractSelectedIndex( document.price_quote.Diameter );

	if ( testValue == 'Yes' )
	{
		return( priceArray[ diameterIndex ] );
	}

	return (0);
}


// --------------------------------- Totals ---------------------------------

var steelDoors36		= 0;
var standardWindows		= 0;

function UpdateTotal()
{
	var f					= document.price_quote;
	var thetext				= '';
	var yurtDiameterTotal	= 0;
	var standardWindows		= 0;
	var normalWindows		= 0;
	var roundwindow			= 0;
	var screendoors			= 0;
	var awnings36			= 0;
	var awnings48			= 0;
	var awnings60			= 0;
	var frenchdoors48		= 0;
	var frenchdoors60		= 0;
	var frenchdoors48T		= 0;
	var frenchdoors60T		= 0;
	var primaryOwn36		= 0;
	var owndoors36			= 0;
	var owndoors48			= 0;
	var owndoors60			= 0;
	var owndoors36T			= 0;
	var owndoors48T			= 0;
	var owndoors60T			= 0;
	var steeldoors36		= 0;
	var steeldoors36T		= 0;
	var total				= 0;
	var diameter			= ExtractSingleValue( document.price_quote.Diameter );
		diameter			= diameter.substring( 0, diameter.lastIndexOf( "-" ));

  	var custom1 = 0;
  	var custom2 = 0;
  	var custom3 = 0;
  	var custom4 = 0;
  	var custom5 = 0;
  	var custom6 = 0;
  	var custom7 = 0;
  	var custom8 = 0;
  	var subtotal1 = 0;
  	var subtotal2 = 0;
  	var subtotal3 = 0;
  	var subtotal4 = 0;
  	var subtotal5 = 0;
  	var subtotal6 = 0;
  	var subtotal7 = 0;
  	var subtotal8 = 0;
  	
	//Diameter
	try
	{
		yurtDiameterTotal = CalculateGroup( f.Diameter );
		
		if( yurtDiameterTotal == gAllPrice['BasePrice'][0] )
		{
			standardWindows += 2;
			normalWindows	= 2;
		}
		
		else if( yurtDiameterTotal == gAllPrice['BasePrice'][1] )
		{
			standardWindows += 3;
			normalWindows	= 3;
		}
		
		else if( yurtDiameterTotal == gAllPrice['BasePrice'][2] )
		{
			standardWindows += 3;
			normalWindows	= 3;
		}
		
		else
		{
			standardWindows += 4;
			normalWindows	= 4;
		}
		
		WritePrice( 'SubTotalYurtDiameter', yurtDiameterTotal );
		total 	+= yurtDiameterTotal;
		thetext	+= 'diameter=' + ExtractSelectedIndex( f.Diameter ) + '&';
		thetext	+= 'diameterCalculatedTotal=' + yurtDiameterTotal + '&';
  	}
  	catch(e) {}
	
 
	//InsulationPackage
	try
	{
		InsulationPackageTotal = CalculateInsulationPackage();
		WritePrice( 'SubTotalInsulationPackage', InsulationPackageTotal );
		total +=parseFloat( InsulationPackageTotal);
		
		if( InsulationPackageTotal > 0 )
		{
			thetext	+= 'insulationpackage=1&';
			thetext	+= 'insulationpackageCalculatedTotal=' + InsulationPackageTotal + '&';
		}
  	}
  	catch(e) {}
  	
  	try{
	  	document.getElementById('Awning').value = gAllPrice['Awning36'];
	  	document.getElementById('Awning1').value = gAllPrice['Awning36'];
	  	document.getElementById('Awning2').value = gAllPrice['Awning36'];
	  	document.getElementById('Awning3').value = gAllPrice['Awning36'];
	  }
	  catch(e){}
  	
  	try
  	{
  		document.getElementById('Awning4').value = gAllPrice['Awning36'];
  	}
  	catch( error ){}
  	try
  	{
  		document.getElementById('Awning5').value = gAllPrice['Awning36'];
  	}
  	catch( error ){}
  	try
  	{
  		document.getElementById('Awning6').value = gAllPrice['Awning36'];
  	}
  	catch( error ){}
  	try
  	{
  		document.getElementById('Awning7').value = gAllPrice['Awning36'];
  	}
  	catch( error ){}
  	try
  	{
  		document.getElementById('Awning8').value = gAllPrice['Awning36'];
  	}
  	catch( error ){}  	
  	
	//Doorway
	try
	{
		doorwaytotal	= ExtractDropdownValue(f.doorway);
		
		if( doorwaytotal != 0 )
		{
			f.ScreenDoor.checked	= false;
			f.ScreenDoor.disabled	= true;
			
			if( doorwaytotal == gAllPrice['ProvideOwn36Door_Standard'] )
			{
				thetext	+= 'primaryOwn36=1&';
			}
		}
		else
		{
			f.ScreenDoor.disabled	= false;
			thetext	+= 'primarySteel=1&';
		}
		
		thetext	+= 'primaryTtl=' + doorwaytotal + '&';
		WritePrice( 'doorwayprice', doorwaytotal );
		total +=parseFloat( doorwaytotal);
  	}
  	catch(e) {}
  	
	//Doorway upgrades
	try
	{
		screendoor	= f.ScreenDoor.checked ? f.ScreenDoor.value : 0;
		awning		= f.Awning.checked ? f.Awning.value : 0;
		
		subtotal	= parseInt(screendoor) + parseInt(awning);
		
		if( screendoor > 0 )
		{
			screendoors += 1;
		}
		
		if( awning > 0 && awning == gAllPrice['Awning36'] )
		{
			awnings36 += 1;
		}
		if( awning > 0 && awning == gAllPrice['Awning48'] )
		{
			awnings48 += 1;
		}
		else if( awning > 0 && awning == gAllPrice['Awning60'] )
		{
			awnings60 += 1;
		}
		
		WritePrice( 'doorupgradesprice', subtotal );
		total +=parseFloat( subtotal);
  	}
  	catch(e) {}
	
	//Custom1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	try
	{
		custom1	= ExtractDropdownValue(f.customPanel1);
		
//		if( custom1 != 425 && custom1 != 550 && custom1 != 895 )
		if( custom1 != gAllPrice['SteelDoor36'] && custom1 != gAllPrice['SteelDoor36_10Wall'])
		{
			f.ScreenDoor1.checked	= false;
			f.ScreenDoor1.disabled	= true;
		}
		else
		{
			f.ScreenDoor1.disabled	= false;
		}
				
//		if( custom1 != 425 && custom1 != 810 && custom1 != 175 && custom1 != 185 && custom1 != 550 && custom1 != 895 && custom1 != 210 )
		if( custom1 != gAllPrice['SteelDoor36'] 
		&& custom1 != gAllPrice['FrenchDoor48'] 
		&& custom1 != gAllPrice['ProvideOwn36Door'] 
		&& custom1 != gAllPrice['ProvideOwn48Door'] 
		&& custom1 != gAllPrice['SteelDoor36_10Wall'] 
		&& custom1 != gAllPrice['FrenchDoor60'] 
		&& custom1 != gAllPrice['ProvideOwn60Door'] )
		{
			f.Awning1.disabled		= true;
			f.Awning1.checked		= false;
		}
		else
		{
			f.Awning1.disabled		= false;
		}
		
		if( custom1+'' == ''+gAllPrice['Window42x46'] )
		{
			thetext	+= 'additionalwindows=1&'
			standardWindows += 1;
		}		
		else if( custom1 == gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindow=1&';
			thetext	+= 'roundwindowCalculatedTotal=' + gAllPrice['RoundWindow28'] + '&';
			roundwindow += 1;
		}		
		if( custom1 != gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindowCalculatedTotal=' + 0 + '&';
		}	
		if( custom1 == gAllPrice['StovePipe8'] )
		{
			thetext	+= 'stovepipe=1&';
			thetext	+= 'stovepipeCalculatedTotal=65&';
		}
		
		if( custom1 == gAllPrice['SteelDoor36'] )
		{
			steeldoors36 += 1;
		}
		if( custom1 == gAllPrice['SteelDoor36_10Wall'] )
		{		
			steeldoors36T += 1;
		}
		else if( custom1 == gAllPrice['FrenchDoor48'] )
		{
			document.getElementById('Awning1').value = gAllPrice['Awning48'];
			
			frenchdoors48 += 1;
			f.ScreenDoor1.disabled	= true; 
			f.Awning1.disabled		= false; 
		}
		else if( custom1 == gAllPrice['FrenchDoor60'] )
		{
			document.getElementById('Awning1').value = gAllPrice['Awning60'];
			
			frenchdoors60 += 1;
			f.ScreenDoor1.disabled	= true; 
			f.Awning1.disabled		= false; 
		}
		else if( custom1+'' == ''+gAllPrice['ProvideOwn36Door'] )
		{
			owndoors36 += 1;
		    f.ScreenDoor1.disabled	= true; 
			f.Awning1.disabled		= false; 
		}	
		else if( custom1 == gAllPrice['ProvideOwn48Door'] )
		{
			document.getElementById('Awning1').value = gAllPrice['Awning48'];
			
			owndoors48 += 1;
		    f.ScreenDoor1.disabled	= true; 
			f.Awning1.disabled		= false; 
		}
		else if( custom1 == gAllPrice['ProvideOwn60Door'] )
		{
			document.getElementById('Awning1').value = gAllPrice['Awning60'];
			
			owndoors60 += 1;
		    f.ScreenDoor1.disabled	= true; 
			f.Awning1.disabled		= false; 
		}
		
		WritePrice( 'custom1price', custom1 );
		total +=parseFloat( custom1);
		
		screendoor1	= f.ScreenDoor1.checked ? f.ScreenDoor1.value : 0;
		awning1		= f.Awning1.checked ? f.Awning1.value : 0;
		
		if( screendoor1 > 0 )
		{
			screendoors += 1;
		}
		
		if( awning1 > 0 && awning1 == gAllPrice['Awning36'] )
		{
			awnings36 += 1;
		}
		if( awning1 > 0 && awning1 == gAllPrice['Awning48'] )
		{
			awnings48 += 1;
		}
		else if( awning1 > 0 && awning1 == gAllPrice['Awning60'] )
		{
			awnings60 += 1;
		}
		
		subtotal1	= parseInt(screendoor1) + parseInt(awning1);
		
		WritePrice( 'custom1upgradesprice', subtotal1 );
		total +=parseFloat( subtotal1);
  	}
  	catch(e) {}
  	

	//Custom2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	try
	{
		custom2	= ExtractDropdownValue(f.customPanel2);
		
		if( custom2 != gAllPrice['SteelDoor36'] && custom2 != gAllPrice['SteelDoor36_10Wall'] && custom2 != gAllPrice['FrenchDoor60'] )
		{
			f.ScreenDoor2.checked	= false;
			f.ScreenDoor2.disabled	= true;
		}
		else
		{
			f.ScreenDoor2.disabled	= false;
		}
		if( custom2 != gAllPrice['SteelDoor36'] && custom2 != gAllPrice['FrenchDoor48'] 
		&& custom2 != gAllPrice['ProvideOwn36Door'] && custom2 != gAllPrice['ProvideOwn48Door'] && custom2 != gAllPrice['SteelDoor36_10Wall'] 
		&& custom2 != gAllPrice['FrenchDoor60'] && custom2 != gAllPrice['ProvideOwn60Door'] )
		{
			f.Awning2.disabled		= true;
			f.Awning2.checked		= false;
		}
		else
		{
			f.Awning2.disabled		= false;
		}		
		if( custom2 +''== ''+gAllPrice['Window42x46'] )
		{
			thetext	+= 'additionalwindows=1&'
			standardWindows += 1;
		}			
		else if( custom2 == gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindow=1&';
			thetext	+= 'roundwindowCalculatedTotal=' + gAllPrice['RoundWindow28'] + '&';
			roundwindow += 1;
		}		
		if( custom2 != gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindowCalculatedTotal=' + 0 + '&';
		}	
		
		WritePrice( 'custom2price', custom2 );
		total +=parseFloat( custom2);
	
		
		if( custom2 == gAllPrice['SteelDoor36'] )
		{
			steeldoors36 += 1;
		}
		if( custom2 == gAllPrice['SteelDoor36_10Wall'] )
		{		
			steeldoors36T += 1;
		}
		else if( custom2 == gAllPrice['FrenchDoor48'] )
		{
			document.getElementById('Awning2').value = gAllPrice['Awning48'];
			
			frenchdoors48 += 1;
			f.ScreenDoor2.disabled	= true; 
			f.Awning2.disabled		= false; 
		}
		else if( custom2 == gAllPrice['FrenchDoor60'] )
		{
			document.getElementById('Awning2').value = gAllPrice['Awning60'];
			
			frenchdoors60 += 1;
			f.ScreenDoor2.disabled	= true; 
			f.Awning2.disabled		= false; 
		}
		else if( custom2+'' == ''+gAllPrice['ProvideOwn36Door'] )
		{
			owndoors36 += 1;
		    f.ScreenDoor2.disabled	= true; 
			f.Awning2.disabled		= false; 
		}	
		else if( custom2 == gAllPrice['ProvideOwn48Door'] )
		{
			document.getElementById('Awning2').value = gAllPrice['Awning48'];
			
			owndoors48 += 1;
		    f.ScreenDoor2.disabled	= true; 
			f.Awning2.disabled		= false; 
		}		
		else if( custom2 == gAllPrice['ProvideOwn60Door'] )
		{
			document.getElementById('Awning2').value = gAllPrice['Awning60'];
			
			owndoors60 += 1;
		    f.ScreenDoor1.disabled	= true; 
			f.Awning1.disabled		= false; 
		}
		
		screendoor2	= f.ScreenDoor2.checked ? f.ScreenDoor2.value : 0;
		awning2		= f.Awning2.checked ? f.Awning2.value : 0;
		
		if( screendoor2 > 0 )
		{
			screendoors += 1;
		}
		
		if( awning2 > 0 && awning2 == gAllPrice['Awning36'] )
		{
			awnings36 += 1;
		}
		if( awning2 > 0 && awning2 == gAllPrice['Awning48'] )
		{
			awnings48 += 1;
		}
		else if( awning2 > 0 && awning2 == gAllPrice['Awning60'] )
		{
			awnings60 += 1;
		}
		
		subtotal2	= parseInt(screendoor2) + parseInt(awning2);
		
		WritePrice( 'custom2upgradesprice', subtotal2 );
		total +=parseFloat( subtotal2);
  	}
  	catch(e) {}
	
  	
	//Custom3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	try
	{
		custom3	= ExtractDropdownValue(f.customPanel3);
		
		if( custom3 != gAllPrice['SteelDoor36'] && custom3 != gAllPrice['SteelDoor36_10Wall'] && custom3 != gAllPrice['FrenchDoor60'] )
		{
			f.ScreenDoor3.checked	= false;
			f.ScreenDoor3.disabled	= true;
		}
		else
		{
			f.ScreenDoor3.disabled	= false;
		}
		
		if( custom3 != gAllPrice['SteelDoor36'] && custom3 != gAllPrice['FrenchDoor48'] && custom3 != gAllPrice['ProvideOwn36Door'] && custom3 != gAllPrice['ProvideOwn48Door'] && custom3 != gAllPrice['SteelDoor36_10Wall'] && custom3 != gAllPrice['FrenchDoor60'] && custom3 != gAllPrice['ProvideOwn60Door'] )
		{
			f.Awning3.disabled		= true;
			f.Awning3.checked		= false;
		}
		else
		{
			f.Awning3.disabled		= false;
		}
		
		if( custom3 +''== ''+gAllPrice['Window42x46'] )
		{
			thetext	+= 'additionalwindows=1&'
			standardWindows += 1;
		}
		else if( custom3 == gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindow=1&';
			thetext	+= 'roundwindowCalculatedTotal=' + gAllPrice['RoundWindow28'] + '&';
			roundwindow += 1;
		}		
		if( custom3 != gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindowCalculatedTotal=' + 0 + '&';
		}	
		
		WritePrice( 'custom3price', custom3 );
		total +=parseFloat( custom3);
		
		
		if( custom3 == gAllPrice['SteelDoor36'] )
		{
			steeldoors36 += 1;
		}
		else if( custom3 == gAllPrice['FrenchDoor48'] )
		{
			document.getElementById('Awning3').value = gAllPrice['Awning48'];
			
			frenchdoors48 += 1;
			f.ScreenDoor3.disabled	= true; 
			f.Awning3.disabled		= false; 
		}
		else if( custom3 == gAllPrice['FrenchDoor60'] )
		{
			document.getElementById('Awning3').value = gAllPrice['Awning60'];
			
			frenchdoors60 += 1;
			f.ScreenDoor3.disabled	= true; 
			f.Awning3.disabled		= false; 
		}
		else if( custom3 == gAllPrice['SteelDoor36_10Wall'] )
		{		
			steeldoors36T += 1;
			f.ScreenDoor3.disabled	= false; 
			f.Awning3.disabled		= true; 
		}
		else if( custom3+'' == ''+gAllPrice['ProvideOwn36Door'] )
		{
			owndoors36 += 1;
		    f.ScreenDoor3.disabled	= true; 
			f.Awning3.disabled		= false; 
		}	
		else if( custom3 == gAllPrice['ProvideOwn48Door'] )
		{
			document.getElementById('Awning3').value = gAllPrice['Awning48'];
			
			owndoors48 += 1;
		    f.ScreenDoor3.disabled	= true; 
			f.Awning3.disabled		= false; 
		}
		else if( custom3 == gAllPrice['ProvideOwn60Door'] )
		{
			document.getElementById('Awning3').value = gAllPrice['Awning60'];
			
			owndoors60 += 1;
		    f.ScreenDoor1.disabled	= true; 
			f.Awning1.disabled		= false; 
		}

		screendoor3	= f.ScreenDoor3.checked ? f.ScreenDoor3.value : 0;
		awning3		= f.Awning3.checked ? f.Awning3.value : 0;
		
		if( screendoor3 > 0 )
		{
			screendoors += 1;
		}
		
		if( awning3 > 0 && awning3 == gAllPrice['Awning36'] )
		{
			awnings36 += 1;
		}
		if( awning3 > 0 && awning3 == gAllPrice['Awning48'] )
		{
			awnings48 += 1;
		}
		else if( awning3 > 0 && awning3 == gAllPrice['Awning60'] )
		{
			awnings60 += 1;
		}
		
		subtotal3	= parseInt(screendoor3) + parseInt(awning3);
		
		WritePrice( 'custom3upgradesprice', subtotal3 );
		total +=parseFloat( subtotal3);
  	}
  	catch(e) {}
  	

  	
	//Custom4 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	try
	{
		custom4	= ExtractDropdownValue(f.customPanel4);
		
		if( custom4 != gAllPrice['SteelDoor36'] && custom4 != gAllPrice['SteelDoor36_10Wall'] && custom4 != gAllPrice['FrenchDoor60'] )
		{
			f.ScreenDoor4.checked	= false;
			f.ScreenDoor4.disabled	= true;
			
		}
		else
		{
			f.ScreenDoor4.disabled	= false;
		}
		
		if( custom4 != gAllPrice['SteelDoor36'] && custom3 != gAllPrice['FrenchDoor48'] && custom4 != gAllPrice['ProvideOwn36Door'] && custom4 != gAllPrice['ProvideOwn48Door'] && custom4 != gAllPrice['SteelDoor36_10Wall'] && custom4 != gAllPrice['FrenchDoor60'] && custom4 != gAllPrice['ProvideOwn60Door'] )
		{
			f.Awning4.disabled		= true;
			f.Awning4.checked		= false;
		}
		else
		{
			f.Awning4.disabled		= false;
		}
		
		if( custom4 +''== ''+gAllPrice['Window42x46'] )
		{
			thetext	+= 'additionalwindows=1&'
			standardWindows += 1;
		}
		
		else if( custom4 == gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindow=1&';
			thetext	+= 'roundwindowCalculatedTotal=' + gAllPrice['RoundWindow28'] + '&';
			roundwindow += 1;
		}		
		if( custom4 != gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindowCalculatedTotal=' + 0 + '&';
		}	
				
		WritePrice( 'custom4price', custom4 );
		total +=parseFloat( custom4);

		
		if( custom4 == gAllPrice['SteelDoor36'] )
		{
			steeldoors36 += 1;
		}
		else if( custom4 == gAllPrice['FrenchDoor48'] )
		{
			document.getElementById('Awning4').value = gAllPrice['Awning48'];
			
			frenchdoors48 += 1;
			f.ScreenDoor4.disabled	= true; 
			f.Awning4.disabled		= false; 
		}

		else if( custom4 == gAllPrice['FrenchDoor60'] )
		{
			document.getElementById('Awning4').value = gAllPrice['Awning60'];
			
			frenchdoors60 += 1;
			f.ScreenDoor4.disabled	= true; 
			f.Awning4.disabled		= false; 
		}
		else if( custom4 == gAllPrice['SteelDoor36_10Wall'] )
		{		
			steeldoors36T += 1;
			f.ScreenDoor4.disabled	= false; 
			f.Awning4.disabled		= true; 
		}
		
		else if( custom4+'' == ''+gAllPrice['ProvideOwn36Door'] )
		{
			owndoors36 += 1;
		    f.ScreenDoor4.disabled	= true; 
			f.Awning4.disabled		= false; 
		}	
		else if( custom4 == gAllPrice['ProvideOwn48Door'] )
		{
			document.getElementById('Awning4').value = gAllPrice['Awning48'];
			
			owndoors48 += 1;
		    f.ScreenDoor4.disabled	= true; 
			f.Awning4.disabled		= false; 
		}
		else if( custom4 == gAllPrice['ProvideOwn60Door'] )
		{
			document.getElementById('Awning4').value = gAllPrice['Awning60'];
			
			owndoors60 += 1;
		    f.ScreenDoor1.disabled	= true; 
			f.Awning1.disabled		= false; 
		}
		
		screendoor4	= f.ScreenDoor4.checked ? f.ScreenDoor4.value : 0;
		awning4		= f.Awning4.checked ? f.Awning4.value : 0;
		
		if( screendoor4 > 0 )
		{
			screendoors += 1;
		}
		
		if( awning4 > 0 && awning4 == gAllPrice['Awning36'] )
		{
			awnings36 += 1;
		}
		if( awning4 > 0 && awning4 == gAllPrice['Awning48'] )
		{
			awnings48 += 1;
		}
		else if( awning4 > 0 && awning4 == gAllPrice['Awning60'] )
		{
			awnings60 += 1;
		}
		
		subtotal4	= parseInt(screendoor4) + parseInt(awning4);
		
		WritePrice( 'custom4upgradesprice', subtotal4 );
		total +=parseFloat( subtotal4);
  	}
  	catch(e) {}
  	
	//Custom5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	try
	{
		custom5	= ExtractDropdownValue(f.customPanel5);
		
		if( custom5 != gAllPrice['SteelDoor36'] && custom5 != gAllPrice['SteelDoor36_10Wall'] && custom5 != gAllPrice['FrenchDoor60'] )
		{
			f.ScreenDoor5.checked	= false;
			f.ScreenDoor5.disabled	= true;
			
		}
		else
		{
			f.ScreenDoor5.disabled	= false;
		}
		
		if( custom5 != gAllPrice['SteelDoor36'] && custom5 != gAllPrice['FrenchDoor48'] && custom5 != gAllPrice['ProvideOwn36Door'] && custom5 != gAllPrice['ProvideOwn48Door'] && custom5 != gAllPrice['SteelDoor36_10Wall'] && custom5 != gAllPrice['FrenchDoor60'] && custom5 != gAllPrice['ProvideOwn60Door'] )
		{
			f.Awning5.disabled		= true;
			f.Awning5.checked		= false;
		}
		else
		{
			f.Awning5.disabled		= false;
		}
		
		if( custom5 +''== ''+gAllPrice['Window42x46'] )
		{
			thetext	+= 'additionalwindows=1&'
			standardWindows += 1;
		}
		
		else if( custom5 == gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindow=1&';
			thetext	+= 'roundwindowCalculatedTotal=' + gAllPrice['RoundWindow28'] + '&';
			roundwindow += 1;
		}		
		if( custom5 != gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindowCalculatedTotal=' + 0 + '&';
		}	
		
		WritePrice( 'custom5price', custom5 );
		total +=parseFloat( custom5);

		
		if( custom5 == gAllPrice['SteelDoor36'] )
		{
			steeldoors36 += 1;
		}
		else if( custom5 == gAllPrice['FrenchDoor48'] )
		{
			document.getElementById('Awning5').value = gAllPrice['Awning48'];
			
			frenchdoors48 += 1;
			f.ScreenDoor5.disabled	= true; 
			f.Awning5.disabled		= false; 
		}
		else if( custom5 == gAllPrice['FrenchDoor60'] )
		{
			document.getElementById('Awning5').value = gAllPrice['Awning60'];
			
			frenchdoors60 += 1;
			f.ScreenDoor5.disabled	= true; 
			f.Awning5.disabled		= false; 
		}
		else if( custom5 == gAllPrice['SteelDoor36_10Wall'] )
		{		
			steeldoors36T += 1;
			f.ScreenDoor5.disabled	= false; 
			f.Awning5.disabled		= true; 
		}
		else if( custom5+'' == ''+gAllPrice['ProvideOwn36Door'] )
		{
			owndoors36 += 1;
		    f.ScreenDoor5.disabled	= true; 
			f.Awning5.disabled		= false; 
		}	
		else if( custom5 == gAllPrice['ProvideOwn48Door'] )
		{
			document.getElementById('Awning5').value = gAllPrice['Awning48'];
			
			owndoors48 += 1;
		    f.ScreenDoor5.disabled	= true; 
			f.Awning5.disabled		= false; 
		}
		else if( custom5 == gAllPrice['ProvideOwn60Door'] )
		{
			document.getElementById('Awning5').value = gAllPrice['Awning60'];
			
			owndoors60 += 1;
		    f.ScreenDoor1.disabled	= true; 
			f.Awning1.disabled		= false; 
		}
		
		screendoor5	= f.ScreenDoor5.checked ? f.ScreenDoor5.value : 0;
		awning5		= f.Awning5.checked ? f.Awning5.value : 0;
		
		if( screendoor5 > 0 )
		{
			screendoors += 1;
		}
		
		if( awning5 > 0 && awning5 == gAllPrice['Awning36'] )
		{
			awnings36 += 1;
		}
		if( awning5 > 0 && awning5 == gAllPrice['Awning48'] )
		{
			awnings48 += 1;
		}
		else if( awning5 > 0 && awning5 == gAllPrice['Awning60'] )
		{
			awnings60 += 1;
		}
		
		subtotal5	= parseInt(screendoor5) + parseInt(awning5);
		
		WritePrice( 'custom5upgradesprice', subtotal5 );
		total +=parseFloat( subtotal5);
  	}
  	catch(e) {}
  	
	//Custom6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	try
	{
		custom6	= ExtractDropdownValue(f.customPanel6);
		
		if( custom6 != gAllPrice['SteelDoor36'] && custom6 != gAllPrice['SteelDoor36_10Wall'] && custom6 != gAllPrice['FrenchDoor60'] )
		{
			f.ScreenDoor6.checked	= false;
			f.ScreenDoor6.disabled	= true;
			
		}
		else
		{
			f.ScreenDoor6.disabled	= false;
		}
		
		if( custom6 != gAllPrice['SteelDoor36'] && custom6 != gAllPrice['FrenchDoor48'] && custom6 != gAllPrice['ProvideOwn36Door'] && custom6 != gAllPrice['ProvideOwn48Door'] && custom6 != gAllPrice['SteelDoor36_10Wall'] && custom6 != gAllPrice['FrenchDoor60'] && custom6 != gAllPrice['ProvideOwn60Door'] )
		{
			f.Awning6.disabled		= true;
			f.Awning6.checked		= false;
		}
		else
		{
			f.Awning6.disabled		= false;
		}
		
		if( custom6 +''== ''+gAllPrice['Window42x46'] )
		{
			thetext	+= 'additionalwindows=1&'
			standardWindows += 1;
		}
		
		else if( custom6 == gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindow=1&';
			thetext	+= 'roundwindowCalculatedTotal=' + gAllPrice['RoundWindow28'] + '&';
			roundwindow += 1;
		}		
		if( custom6 != gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindowCalculatedTotal=' + 0 + '&';
		}	
		
		WritePrice( 'custom6price', custom6 );
		total +=parseFloat( custom6);

		
		if( custom6 == gAllPrice['SteelDoor36'] )
		{
			steeldoors36 += 1;
		}
		else if( custom6 == gAllPrice['FrenchDoor48'] )
		{
			document.getElementById('Awning6').value = gAllPrice['Awning48'];
			
			frenchdoors48 += 1;
			f.ScreenDoor6.disabled	= true; 
			f.Awning6.disabled		= false; 
		}
		else if( custom6 == gAllPrice['FrenchDoor60'] )
		{
			document.getElementById('Awning6').value = gAllPrice['Awning60'];
			
			frenchdoors60 += 1;
			f.ScreenDoor6.disabled	= true; 
			f.Awning6.disabled		= false; 
		}
		else if( custom6 == gAllPrice['SteelDoor36_10Wall'] )
		{		
			steeldoors36T += 1;
			f.ScreenDoor6.disabled	= false; 
			f.Awning6.disabled		= true; 
		}
		else if( custom6+'' == ''+gAllPrice['ProvideOwn36Door'] )
		{
			owndoors36 += 1;
		    f.ScreenDoor6.disabled	= true; 
			f.Awning6.disabled		= false; 
		}	
		else if( custom6 == gAllPrice['ProvideOwn48Door'] )
		{
			document.getElementById('Awning6').value = gAllPrice['Awning48'];
			
			owndoors48 += 1;
		    f.ScreenDoor6.disabled	= true; 
			f.Awning6.disabled		= false; 
		}
		else if( custom6 == gAllPrice['ProvideOwn60Door'] )
		{
			document.getElementById('Awning6').value = gAllPrice['Awning60'];
			
			owndoors60 += 1;
		    f.ScreenDoor1.disabled	= true; 
			f.Awning1.disabled		= false; 
		}
		
		screendoor6	= f.ScreenDoor6.checked ? f.ScreenDoor6.value : 0;
		awning6		= f.Awning6.checked ? f.Awning6.value : 0;
		
		if( screendoor6 > 0 )
		{
			screendoors += 1;
		}
		
		if( awning6 > 0 && awning6 == gAllPrice['Awning36'] )
		{
			awnings36 += 1;
		}
		if( awning6 > 0 && awning6 == gAllPrice['Awning48'] )
		{
			awnings48 += 1;
		}
		else if( awning6 > 0 && awning6 == gAllPrice['Awning60'] )
		{
			awnings60 += 1;
		}
		
		subtotal6	= parseInt(screendoor6) + parseInt(awning6);
		
		WritePrice( 'custom6upgradesprice', subtotal6 );
		total +=parseFloat( subtotal6);
  	}
  	catch(e) {}
  	
	//Custom7 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	try
	{
		custom7	= ExtractDropdownValue(f.customPanel7);
		
		if( custom7 != gAllPrice['SteelDoor36'] && custom7 != gAllPrice['SteelDoor36_10Wall'] && custom7 != gAllPrice['FrenchDoor60'])
		{
			f.ScreenDoor7.checked	= false;
			f.ScreenDoor7.disabled	= true;
			
		}
		else
		{
			f.ScreenDoor7.disabled	= false;
		}
		
		if( custom7 != gAllPrice['SteelDoor36'] && custom7 != gAllPrice['FrenchDoor48'] && custom7 != gAllPrice['ProvideOwn36Door'] && custom7 != gAllPrice['ProvideOwn48Door'] && custom7 != gAllPrice['SteelDoor36_10Wall'] && custom7 != gAllPrice['FrenchDoor60'] && custom7 != gAllPrice['ProvideOwn60Door'] )
		{
			f.Awning7.disabled		= true;
			f.Awning7.checked		= false;
		}
		else
		{
			f.Awning7.disabled		= false;
		}
		
		if( custom7 +''== ''+gAllPrice['Window42x46'] )
		{
			thetext	+= 'additionalwindows=1&'
			standardWindows += 1;
		}
		
		else if( custom7 == gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindow=1&';
			thetext	+= 'roundwindowCalculatedTotal=' + gAllPrice['RoundWindow28'] + '&';
			roundwindow += 1;
		}		
		if( custom7 != gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindowCalculatedTotal=' + 0 + '&';
		}	
		
		WritePrice( 'custom7price', custom7 );
		total +=parseFloat( custom7);

		if( custom7 == gAllPrice['SteelDoor36'] )
		{
			steeldoors36 += 1;
		}
		else if( custom7 == gAllPrice['FrenchDoor48'] )
		{
			document.getElementById('Awning7').value = gAllPrice['Awning48'];
			
			frenchdoors48 += 1;
			f.ScreenDoor7.disabled	= true; 
			f.Awning7.disabled		= false; 
		}
		else if( custom7 == gAllPrice['FrenchDoor60'] )
		{
			document.getElementById('Awning7').value = gAllPrice['Awning60'];
			
			frenchdoors60 += 1;
			f.ScreenDoor7.disabled	= true; 
			f.Awning7.disabled		= false; 
		}
		else if( custom7 == gAllPrice['SteelDoor36_10Wall'] )
		{		
			steeldoors36T += 1;
			f.ScreenDoor7.disabled	= false; 
			f.Awning7.disabled		= true; 
		}
		else if( custom7+'' == ''+gAllPrice['ProvideOwn36Door'] )
		{
			owndoors36 += 1;
		    f.ScreenDoor7.disabled	= true; 
			f.Awning7.disabled		= false; 
		}	
		else if( custom7 == gAllPrice['ProvideOwn48Door'] )
		{
			document.getElementById('Awning7').value = gAllPrice['Awning48'];
			
			owndoors48 += 1;
		    f.ScreenDoor7.disabled	= true; 
			f.Awning7.disabled		= false; 
		}
		else if( custom7 == gAllPrice['ProvideOwn60Door'] )
		{
			document.getElementById('Awning7').value = gAllPrice['Awning60'];
			
			owndoors60 += 1;
		    f.ScreenDoor1.disabled	= true; 
			f.Awning1.disabled		= false; 
		}
		
		screendoor7	= f.ScreenDoor7.checked ? f.ScreenDoor7.value : 0;
		awning7		= f.Awning7.checked ? f.Awning7.value : 0;
		
		if( screendoor7 > 0 )
		{
			screendoors += 1;
		}
		
		if( awning7 > 0 && awning7 == gAllPrice['Awning36'] )
		{
			awnings36 += 1;
		}
		if( awning7 > 0 && awning7 == gAllPrice['Awning48'] )
		{
			awnings48 += 1;
		}
		else if( awning7 > 0 && awning7 == gAllPrice['Awning60'] )
		{
			awnings60 += 1;
		}
				
		subtotal7	= parseInt(screendoor7) + parseInt(awning7);
		
		WritePrice( 'custom7upgradesprice', subtotal7 );
		total +=parseFloat( subtotal7);
  	}
  	catch(e) {}
  	
	//Custom8 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	try
	{
		custom8	= ExtractDropdownValue(f.customPanel8);
		if( custom8 != gAllPrice['SteelDoor36'] && custom8 != gAllPrice['SteelDoor36_10Wall'] && custom8 != gAllPrice['FrenchDoor60'])
		{
			f.ScreenDoor8.checked	= false;
			f.ScreenDoor8.disabled	= true;
			
		}
		else
		{
			f.ScreenDoor8.disabled	= false;
		}
		
		if( custom8 != gAllPrice['SteelDoor36'] && custom8 != gAllPrice['FrenchDoor48'] && custom8 != gAllPrice['ProvideOwn36Door'] && custom8 != gAllPrice['ProvideOwn48Door'] && custom8 != gAllPrice['SteelDoor36_10Wall'] && custom8 != gAllPrice['FrenchDoor60'] && custom8 != gAllPrice['ProvideOwn60Door'] )
		{
			f.Awning8.disabled		= true;
			f.Awning8.checked		= false;
		}
		else
		{
			f.Awning8.disabled		= false;
		}
		
		if( custom8 +''== ''+gAllPrice['Window42x46'] )
		{
			thetext	+= 'additionalwindows=1&'
			standardWindows += 1;
		}
		
		else if( custom8 == gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindow=1&';
			thetext	+= 'roundwindowCalculatedTotal=' + gAllPrice['RoundWindow28'] + '&';
			roundwindow += 1;
		}		
		if( custom8 != gAllPrice['RoundWindow28'] )
		{
			thetext	+= 'roundwindowCalculatedTotal=' + 0 + '&';
		}	
		
		WritePrice( 'custom8price', custom8 );
		total +=parseFloat( custom8);

		
		if( custom8 == gAllPrice['SteelDoor36'] )
		{
			steeldoors36 += 1;
		}
		else if( custom8 == gAllPrice['FrenchDoor48'] )
		{
			document.getElementById('Awning8').value = gAllPrice['Awning48'];
			
			frenchdoors48 += 1;
			f.ScreenDoor8.disabled	= true; 
			f.Awning8.disabled		= false; 
		}
		else if( custom8 == gAllPrice['FrenchDoor60'] )
		{
			document.getElementById('Awning8').value = gAllPrice['Awning60'];
			
			frenchdoors60 += 1;
			f.ScreenDoor8.disabled	= true; 
			f.Awning8.disabled		= false; 
		}
		else if( custom8 == gAllPrice['SteelDoor36_10Wall'] )
		{		
			steeldoors36T += 1;
			f.ScreenDoor8.disabled	= false; 
			f.Awning8.disabled		= true; 
		}
		else if( custom8+'' == ''+gAllPrice['ProvideOwn36Door'] )
		{
			owndoors36 += 1;
		    f.ScreenDoor8.disabled	= true; 
			f.Awning8.disabled		= false; 
		}	
		else if( custom8 == gAllPrice['ProvideOwn48Door'] )
		{
			document.getElementById('Awning8').value = gAllPrice['Awning48'];
			
			owndoors48 += 1;
		    f.ScreenDoor8.disabled	= true; 
			f.Awning8.disabled		= false; 
		}
		else if( custom8 == gAllPrice['ProvideOwn60Door'] )
		{
			document.getElementById('Awning8').value = gAllPrice['Awning60'];
			
			owndoors60 += 1;
		    f.ScreenDoor1.disabled	= true; 
			f.Awning1.disabled		= false; 
		}
		
		screendoor8	= f.ScreenDoor8.checked ? f.ScreenDoor8.value : 0;
		awning8		= f.Awning8.checked ? f.Awning8.value : 0;
		
		if( screendoor8 > 0 )
		{
			screendoors += 1;
		}
		
		if( awning8 > 0 && awning8 == gAllPrice['Awning36'] )
		{
			awnings36 += 1;
		}
		if( awning8 > 0 && awning8 == gAllPrice['Awning48'] )
		{
			awnings48 += 1;
		}
		else if( awning8 > 0 && awning8 == gAllPrice['Awning60'] )
		{
			awnings60 += 1;
		}
		
		subtotal8	= parseInt(screendoor8) + parseInt(awning8);
		
		WritePrice( 'custom8upgradesprice', subtotal8 );
		total +=parseFloat( subtotal8);
  	}
  	catch(e) {}
  		

	// BronzeTintedDome
	try
	{
		BronzeTintedDomeTotal = f.BronzeTintedDome.checked ? parseInt(f.BronzeTintedDome.value) : 0;
		WritePrice( 'bronzetintedprice', BronzeTintedDomeTotal );
		total +=parseFloat( BronzeTintedDomeTotal);
		
		if( f.BronzeTintedDome.checked )
		{
			thetext	+= 'bronzetinteddome=1&';
			thetext	+= 'bronzetinteddomeCalculatedTotal=' + BronzeTintedDomeTotal + '&';
		}
  	}
  	catch(e) {}
  	
  	try
  	{
	  	if( f.Starfire.checked )
	  	{
	  		thetext	+= 'starfire=1&';
	  		thetext	+= 'starfireCalculatedTotal=0&';
  		}
  	}
  	catch(e) {}


	// FanSupport
	try
	{
		FanSupportTotal = f.FanSupport.checked ? parseInt(f.FanSupport.value) : 0;
		WritePrice( 'fansupportprice', FanSupportTotal );
		total +=parseFloat( FanSupportTotal);
		
		if( f.FanSupport.checked )
		{
			thetext	+= 'fansupport=1&';
			thetext	+= 'fansupportCalculatedTotal=' + FanSupportTotal + '&';
		}
  	}
  	catch(e) {}

  	
	//WindowInsulation - can't do this until we can calculate how many of each type of window
	try
	{
		ischecked = ExtractSingleValue( f.WindowInsulation );
		
		if( ischecked == 'Yes' )
		{
			var windowInsulation = 0;
			
			if( standardWindows > 0 )
			{
				windowInsulation += (standardWindows * gAllPrice['InsulationPerWindow']);
			}
			
			if( roundwindow > 0 )
			{
				windowInsulation += (roundwindow * gAllPrice['InsulationPerWindow']);
			}
	
			WritePrice( 'SubTotalWindowInsulation', windowInsulation );
			total +=parseFloat( windowInsulation);
			
			thetext	+= 'windowinsulation=1&';
			thetext	+= 'windowinsulationCalculatedTotal=' + windowInsulation + '&';
		}
		else
		{
			WritePrice( 'SubTotalWindowInsulation', '0' );
		}
  	}
  	catch(e) {}

	// Tax
	try
	{
		if( f.SalesTax.checked )
		{
			var salestax = total * .05
			total = total + salestax;
			WritePrice( 'taxprice', salestax );
			
			thetext	+= 'taxprice=' + salestax + '&';
		}
		else
		{
			WritePrice( 'taxprice', '0' );
		}
  	}
  	catch(e) {}

	// Update the 'Total' displays
	WritePrice( 'TotalInline', total );
	WritePrice( 'TotalInline2', total );

	if( parseInt(normalWindows) > 0 )
	{
		thetext	+= 'standardwindows=' + normalWindows + '&';
	}
	else
	{
		thetext	+= 'standardwindows=0&';
	}
	
	if( parseInt( standardWindows - normalWindows ) > 0  )
	{
		thetext	+= 'additionalwindows=1&';
	}
	else
	{
		thetext	+= 'additionalwindows=0&';
	}
	
	
	thetext	+= 'additionalwindowsQty=' + parseInt( standardWindows - normalWindows ) + '&';
	thetext	+= 'additionalwindowsCalculatedTotal=' + parseInt( ( standardWindows - normalWindows ) * gAllPrice['Window42x46'] ) + '&';
	thetext	+= 'roundwindowQty=' + parseInt( roundwindow ) + '&';
	thetext	+= 'roundwindowCalculatedTotal=' + parseInt( ( roundwindow  ) * gAllPrice['RoundWindow28'] ) + '&';
	thetext	+= 'calculatedtotaltotal=' + total + '&';
	
	if ( screendoors > 0 )
	{
		thetext	+= 'screendoor=1&';
	}
	
	thetext	+= 'screendoorQty=' + screendoors + '&';
	thetext	+= 'screendoorCalculatedTotal=' + parseInt( screendoors * gAllPrice['ScreenDoorUpgrade'] ) + '&';
	
	// Door Awnings
	if ( awnings36 > 0 )
	{
		thetext	+= 'doorawning36=1&';
	}
	if ( awnings48 > 0 )
	{
		thetext	+= 'doorawning48=1&';
	}
	if ( awnings60 > 0 )
	{
		thetext	+= 'doorawning60=1&';
	}
	
	thetext	+= 'doorawning36Qty=' + ( awnings36 ) + '&';
	thetext	+= 'doorawning36CalculatedTotal=' + ( parseInt( awnings36 * gAllPrice['Awning36'] ) ) + '&';
	thetext	+= 'doorawning48Qty=' + ( awnings48 ) + '&';
	thetext	+= 'doorawning48CalculatedTotal=' + ( parseInt( awnings48 * gAllPrice['Awning48'] ) ) + '&';
	thetext	+= 'doorawning60Qty=' + ( awnings60 ) + '&';
	thetext	+= 'doorawning60CalculatedTotal=' + ( parseInt( awnings60 * gAllPrice['Awning60'] ) ) + '&';
	
	
	// Steel Doors
	if ( steeldoors36 > 0 )
	{
		thetext	+= 'steeldoors36=1&';
	}
	if ( steeldoors36T > 0 )
	{
		thetext	+= 'steeldoors36T=1&';
	}

	// FrenchDoors
	if ( frenchdoors48 > 0 )
	{
		thetext	+= 'frenchdoors48=1&';
	}
	if ( frenchdoors60 > 0 )
	{
		thetext	+= 'frenchdoors60=1&';
	}
	if ( frenchdoors48T > 0 )
	{
		thetext	+= 'frenchdoors48T=1&';
	}
	if ( frenchdoors60T > 0 )
	{
		thetext	+= 'frenchdoors60T=1&';
	}

	// OwnDoors
	if ( owndoors36 > 0 )
	{
		thetext	+= 'owndoors36=' + owndoors36 + '&';
		var owndoors36total = parseInt( owndoors36 * gAllPrice['ProvideOwn36Door'] );
		thetext	+= 'owndoors36CalculatedTotal=' + owndoors36total + '&';
	}
	if ( owndoors48 > 0  )
	{
		thetext	+= 'owndoors48=' + owndoors48 + '&';
		var owndoors48total = parseInt( owndoors48 * gAllPrice['ProvideOwn48Door'] );
		thetext	+= 'owndoors48CalculatedTotal=' + owndoors48total + '&';
	}
	if ( owndoors60 > 0  )
	{
		thetext	+= 'owndoors60=' + owndoors60 + '&';
		var owndoors60total = parseInt( owndoors60 * gAllPrice['ProvideOwn60Door'] );
		thetext	+= 'owndoors60CalculatedTotal=' + owndoors60total + '&';
	}
	if ( owndoors36T > 0 )
	{
		thetext	+= 'owndoors36T=' + owndoors36 + '&';
		var owndoors36total = parseInt( owndoors36T * gAllPrice['ProvideOwn36Door'] );
		thetext	+= 'owndoors36TCalculatedTotal=' + owndoors36Ttotal + '&';
	}
	if ( owndoors48T > 0  )
	{
		thetext	+= 'owndoors48T=' + owndoors48T + '&';
		var owndoors48Ttotal = parseInt( owndoors48T * gAllPrice['ProvideOwn48Door'] );
		thetext	+= 'owndoors48TCalculatedTotal=' + owndoors48Ttotal + '&';
	}
	if ( owndoors60T > 0  )
	{
		thetext	+= 'owndoors60T=' + owndoors60T + '&';
		var owndoors60Ttotal = parseInt( owndoors60T * gAllPrice['ProvideOwn60Door'] );
		thetext	+= 'owndoors60TCalculatedTotal=' + owndoors60Ttotal + '&';
	}
	

	thetext	+= 'steeldoors36CalculatedTotal=' + parseInt( steeldoors36 * gAllPrice['SteelDoor36'] ) + '&';
	thetext	+= 'steeldoors36Qty=' + steeldoors36 + '&';
	thetext	+= 'steeldoors36TCalculatedTotal=' + parseInt( steeldoors36T * gAllPrice['SteelDoor36_10Wall'] ) + '&';
	thetext	+= 'steeldoors36TQty=' + steeldoors36T + '&';
	thetext	+= 'frenchdoors48CalculatedTotal=' + parseInt( frenchdoors48 * gAllPrice['FrenchDoor48'] ) + '&';
	thetext	+= 'frenchdoors48Qty=' + frenchdoors48 + '&';
	thetext	+= 'frenchdoors60CalculatedTotal=' + parseInt( frenchdoors60 * gAllPrice['FrenchDoor60'] ) + '&';
	thetext	+= 'frenchdoors60Qty=' + frenchdoors60 + '&';
	thetext	+= 'frenchdoors48TCalculatedTotal=' + parseInt( frenchdoors48T * gAllPrice['FrenchDoor48_10Wall'] ) + '&';
	thetext	+= 'frenchdoors48QTty=' + frenchdoors48T + '&';
	thetext	+= 'frenchdoors60TCalculatedTotal=' + parseInt( frenchdoors60T * gAllPrice['FrenchDoor60_10Wall'] ) + '&';
	thetext	+= 'frenchdoors60TQty=' + frenchdoors60T + '&';

	return thetext;
}


// Resets the select menus to their default option if the dividing line is selected

function resetMenu ( dd, selectMenu ) { 
 if (selectMenu == "00" ) {
	dd.options[0].selected = true;
 }
return false;
}

// ---------------------------------- Format Prices ----------------------------------
	
function FormatPrice( price )
{
	price = String( price );
	var RgX	= /^(.* )?([-+\u00A3\u20AC]?\d+)(\d{3}\b)/;

	return ( price == ( price = price.replace( RgX, "$1$2,$3" )) ? price : FormatPrice( price ));
}
	
	
function WritePrice( id, price )
{
	try
	{
	  	document.getElementById( id ).innerHTML = FormatPrice( parseFloat(price) );
  	}
  	catch(e) {}
}


// ---------------------------------- Show/Hide --------------------------------------

// Show or hide the table rows containing the door options as needed for 16, 20, 24, 30' and 30' Tall Wall yurts

function displayRow1() // custom option select menu 1
{ 
	diplayRow1_8(1);
} 

function displayRow2() // custom option select menu 2
{ 
	diplayRow1_8(2);
} 

function displayRow3() // custom option select menu 3
{ 
	diplayRow1_8(3);
} 

function displayRow4() // custom option select menu 4
{ 
	diplayRow1_8(4);
} 

function displayRow5() // custom option select menu 5
{ 
	diplayRow1_8(5);
} 

function displayRow6() // custom option select menu 6
{ 
	diplayRow1_8(6);
} 

function displayRow7() // custom option select menu 7
{ 
	diplayRow1_8(7);
} 

function displayRow8() // custom option select menu 8
{ 
	diplayRow1_8(8);
} 

function diplayRow1_8(row_no)
{
    var loc=document.price_quote; 
    var c=loc['customPanel'+row_no].options[loc['customPanel'+row_no].selectedIndex].value; 
    if (c==''+gAllPrice['SteelDoor36']) { document.getElementById('optionRow'+row_no).style.display=""; 
    } 
	else if (c==''+gAllPrice['FrenchDoor48']) { document.getElementById('optionRow'+row_no).style.display=""; 
    } 
	else if (c==''+gAllPrice['ProvideOwn36Door']) { document.getElementById('optionRow'+row_no).style.display=""; 
    } 
	else if (c==''+gAllPrice['ProvideOwn48Door']) { document.getElementById('optionRow'+row_no).style.display=""; 
    } 
	else if (c==''+gAllPrice['SteelDoor36_10Wall']) { document.getElementById('optionRow'+row_no).style.display=""; 
    } 
	else if (c==''+gAllPrice['FrenchDoor60']) { document.getElementById('optionRow'+row_no).style.display=""; 
    } 
	else if (c==''+gAllPrice['ProvideOwn60Door']) { document.getElementById('optionRow'+row_no).style.display="";
	}
    else { document.getElementById('optionRow'+row_no).style.display="none"; 
    } 
}

// Popup window - Display Summary
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function myPOP(thef)
{	
	var thetext	= UpdateTotal();
	
// Open window with printable form
	MM_openBrWindow('quote_calculator/print.php?'+thetext,'printable','menubar=yes,scrollbars=yes,resizable=yes,width=650,height=700');
	return true;	
}