<!--

var setting_string1 = defaultSettings;
var setting_string2 = defaultSettings2;
var setting_string3 = defaultSettings3;
var old_colors1 = new Array;
var old_colors2 = new Array;
var old_colors3 = new Array;
var color_array1 = new Array;
var color_array2 = new Array;
var color_array3 = new Array;
var default_index = 0;
var product_index1;
var product_index2;
var product_index3;
var color_index1;
var color_index2;
var color_index3;
var quoin_index;
var wallcap_index;
var windowmolding_index;
var windowsill_index;
var quoin_color;
var wallcap_color;
var windowmolding_color;
var windowsill_color;
var pattern_text_default = "Please choose a stone product in order to fill in this area.";
var pattern_text1 = "";
var pattern_text2 = "";
var pattern_text3 = "";
var lath_type_value = 0;
var sealer_type_value = 0;
var args = new Array;

// Example:
// onMouseOver="toolTip('tool tip text here')";
// onMouseOut="toolTip()";
// -or-
// onMouseOver="toolTip('more good stuff', '#FFFF00', 'orange')";
// onMouseOut="toolTip()"; 
/*
MOVE this to the <body>:
<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
<script language="JavaScript"><!--
initToolTips(); //--></script>
*/
var product_tooltip = "All the boxes and fields that you enter information into will disappear and leave your specific information, ready to be printed, once you hit Submit.";
var product_tooltip2 = "If using more than one Stone Product, make sure to fill in percentages for each one used.";
var the_timeout;
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = 0;
offsetY = 20;
var toolTipSTYLE="";
function initToolTips()
{
  if(ns4||ns6||ie4)
  {
    if(ns4) toolTipSTYLE = document.toolTipLayer;
    else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;
    else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;
    if(ns4) document.captureEvents(Event.MOUSEMOVE);
    else
    {
      toolTipSTYLE.visibility = "visible";
      toolTipSTYLE.display = "none";
    }
    document.onmousemove = moveToMouseLoc;
  }
}
function toolTip(msg, fg, bg)
{
  if(toolTip.arguments.length < 1) // hide
  {
    if(ns4) toolTipSTYLE.visibility = "hidden";
    else toolTipSTYLE.display = "none";
  }
  else // show
  {
    if(!fg) fg = "#777777";
    if(!bg) bg = "#FFFFFF";
    var content =
    '<table border="0" cellspacing="0" cellpadding="1" bgcolor="' + fg + '"><td>' +
    '<table border="0" cellspacing="0" cellpadding="1" bgcolor="' + bg + 
    '"><td align="center"><font face="arial" color="' + fg +
    '" size="-1">&nbsp\;' + msg +
    '&nbsp\;</font></td></table></td></table>';
    if(ns4)
    {
      toolTipSTYLE.document.write(content);
      toolTipSTYLE.document.close();
      toolTipSTYLE.visibility = "visible";
    }
    if(ns6)
    {
      document.getElementById("toolTipLayer").innerHTML = content;
      toolTipSTYLE.display='block'
    }
    if(ie4)
    {
      document.all("toolTipLayer").innerHTML=content;
      toolTipSTYLE.display='block'
    }
  }
}
function moveToMouseLoc(e)
{
  if(ns4||ns6)
  {
    x = e.pageX;
    y = e.pageY;
  }
  else
  {
    x = event.x + document.body.scrollLeft;
    y = event.y + document.body.scrollTop;
  }
  toolTipSTYLE.left = x + offsetX;
  toolTipSTYLE.top = y + offsetY;
  return true;
}

function makeArray(n)
{
  this.length = n;
  for ( i=0;i<n;i++ ) { this[i]=0; }
  return this;
}

function displayDate()
{
  var this_month = new makeArray(12);
  this_month[0]  = "January";
  this_month[1]  = "February";
  this_month[2]  = "March";
  this_month[3]  = "April";
  this_month[4]  = "May";
  this_month[5]  = "June";
  this_month[6]  = "July";
  this_month[7]  = "August";
  this_month[8]  = "September";
  this_month[9]  = "October";
  this_month[10] = "November";
  this_month[11] = "December";
  var today = new Date();
  var day   = today.getDate();
  var month = today.getMonth();
  var year  = today.getYear();
  if ( year< 1900 ) { year += 1900; }
  return(this_month[month]+" "+day+", "+year);
}

function expandField(current_field, index_offset, objectId) {
  var ns6=document.getElementById && !document.all ? 1 : 0;
  var myObject = ns6 ? current_field.nextSibling.nextSibling.style : '';
  if (objectId != null) {
    myObject = document.getElementById(objectId).style;
  }
  var folding_area = ns6 ? myObject : document.all[current_field.sourceIndex+index_offset].style;
  if (folding_area.display == "none") {
    folding_area.display = "";
  } else {
    folding_area.display = "none";
  }
}

function expandDependentField(dependent_name, offset_index) {
  var ns6=document.getElementById && !document.all ? 1 : 0;
  var ns6_test = eval("document.getElementById('" + dependent_name + "_span').style.display");
  var other_test = ns6 ? "" : eval("document.all[document.csilongform." + dependent_name + ".sourceIndex-" + offset_index + "].style.display");
  var test_value = ns6 ? ns6_test == 'none' : other_test == 'none';
  var folding_area = ns6 ? document.getElementById('percent_span').style : document.all[document.csilongform.percent1.sourceIndex-1].style;
  if (ns6) { document.csilongform.percent1.disabled = false }
  if (test_value) {
    if (folding_area.display == "none") {
      folding_area.display = "";
    } else { 
	  if (!ns6) { folding_area.display = "none"; }
    }
  }
}

function turnVisible(field_name, on_or_off)
{
  field_name.style.visibility = on_or_off;
}

function simplePreload()
{ 
  args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for (var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

function changePics( offset_num, loop_num )
{
  var ns4 = document.layers ? 1 : 0;
  var text_box_name;
  var image_name;
  var broken_image = new Array;
  var product_name;
  // Begin Loop
  for (loop=1; loop<=6; loop++) {
  // Name Image and Text Boxes
    text_box_name = eval ("top.image_frame.document.image_form.text_" + loop);
    image_name = eval ("top.image_frame.document.image_" + loop);
	if (offset_num > 0 && loop<=loop_num) {
	  broken_image = args[offset_num+loop-3].split(".");
	  product_name = broken_image[loop-1];
	  image_name.src = document.imageArray[offset_num+loop-3].src;
	   // Get Stones
	  if (offset_num <= 48 && !ns4) {
	    text_box_name.style.visibility = "visible";
	    text_box_name.value = document.csilongform.product.options[(offset_num-1)].text + " - " + product_color[offset_num+loop-3];
	  } 
	  // Get Quoins
	    if (offset_num == 66) {
	      text_box_name.style.visibility = "visible";
		  text_box_name.value = document.csilongform.quoinselect.options[loop].text + " - " + product_color[loop+22];
		}
		// Get Wall Caps
	  if (offset_num == 68) {
		    text_box_name.style.visibility = "visible";
		    text_box_name.value = document.csilongform.wallcapselect.options[loop].text + " - " + product_color[loop+26];
		  } 
		  // Get Window Mouldings
	  if (offset_num == 71) {
			  text_box_name.style.visibility = "visible";
		      text_box_name.value = document.csilongform.windowmoldingselect.options[loop].text + " - " + product_color[loop+32];
			}
			// Get Window Sills
	  if (offset_num == 72) {
			    text_box_name.style.visibility = "visible";
		        text_box_name.value = document.csilongform.windowmoldingselect.options[loop].text + " - " + product_color[loop+35];
			  }
	}
  }
}

function showImage()
{
  var product_name = FORM_DATA.product;
  for (loop=1; loop<4; loop++) {
    if (loop>1) { product_name = eval("FORM_DATA.product" + loop); }
	if (product_name.charAt(0) != "-" && (loop==1 || (loop==2 && FORM_DATA.second_product) || (loop==3 && FORM_DATA.third_product))) {
      while (product_name.indexOf(' ') > -1) {
        product_name = product_name.substring(0,product_name.indexOf(' ')) + '' + product_name.substring(product_name.indexOf(' ') + 1);
	    // Take out each ' ' in data string.
      }
      product_name = "images/" + product_name.toLowerCase() + ".jpg";
      document.writeln('<tr><td width="570" colspan="5">&nbsp;<br><div align="center"><img src="' + product_name + '"></div></td></tr>');
	}
  }
}

function convertProductName( cnum, name_to_change )
{
  var temp_carray = eval ( "color_array" + cnum );
  var temp_cselect = eval ( "document.csilongform.color" + cnum );
  var temp_custom = eval ( "document.csilongform.customcolor" + cnum );
  var temp_percent = eval ( "document.csilongform.percent" + cnum );
  if (name_to_change != "- Select Product -") {
  	temp_cselect.disabled = false;
	temp_percent.disabled = false;
    while (name_to_change.indexOf(' ') > -1) {
      name_to_change = name_to_change.substring(0,name_to_change.indexOf(' ')) + '_' + name_to_change.substring(name_to_change.indexOf(' ') + 1);
      // Replace each ' ' in data string with a '_'.
    }
  } else {
    if (name_to_change == "- Select Product -") {
      temp_percent.disabled = true;
      if (cnum == 1) { temp_percent.value = "100";
	  } else { temp_percent.value = "0"; }
  	  temp_cselect.disabled = true;
	  temp_custom.disabled = true;
	  temp_custom.value = "";
      name_to_change = "Select_Product";
	} else {
      temp_percent.disabled = true;
      if (cnum == 1) { temp_percent.value = "100";
	  } else { temp_percent.value = "0"; }
  	  temp_cselect.disabled = true;
	  temp_custom.disabled = true;
	  temp_custom.value = "";
      name_to_change = "To_Be_Selected";
	}
  }
  temp_carray = eval(name_to_change);
  return ( temp_carray );
}

function convertName( product_field, extension )
{
  var numExpression = /\d/;
  var dashExpression = /-/;
  var name_to_change = product_field;
  while (name_to_change.indexOf(' ') > -1) {
    if (numExpression.test(name_to_change.charAt(0))) { name_to_change = "a" + name_to_change;
	} else {
	  if (dashExpression.test(name_to_change.charAt(0))) {
	    name_to_change = eval("Select" + extension);
	    return ( name_to_change );
	  }
	}
    name_to_change = name_to_change.substring(0,name_to_change.indexOf(' ')) + '_' + name_to_change.substring(name_to_change.indexOf(' ') + 1);
    // Replace each ' ' in data string with a '_'.
  }
  name_to_change = eval(name_to_change + extension);
  return ( name_to_change );
}

function changeAccColor(accessory_name, accessory_color, extension, color_index)
{
  if (accessory_name.selectedIndex == -1) { return false; }
  var full_accessory_name = convertName(accessory_name.options[accessory_name.selectedIndex].text, extension);
  accessory_color.options.length = full_accessory_name.length;
  changeColors(full_accessory_name, color_index, accessory_color);
}

function changeColors( selected_product, select_index, color_select )
{
  color_select.options.length = selected_product.length;
  for (loop=0; loop < selected_product.length; loop++) { color_select.options[loop].text = selected_product[loop]; }
  color_select.selectedIndex = select_index;
}

function customField(test_value, field_value, text_box_name, text_box_value)
{
  if ( field_value == test_value-1 )
  {
    text_box_name.disabled = false;
    text_box_name.value = text_box_value;
  } else {
    text_box_name.disabled = true;
    text_box_name.value = "";
  }
}

function changePatternText(product_field)
{
  document.csilongform.pattern.disabled = false;
  if (product_field == document.csilongform.product) { pattern_text1 = convertName ( product_field.options[product_field.selectedIndex].text, '_pattern' );
  } else {
	if (product_field == document.csilongform.product2) { pattern_text2 = unescape("%0D%0A%0D%0A") + "<br>" + convertName ( product_field.options[product_field.selectedIndex].text, '_pattern' );
	} else {
	  if (product_field == document.csilongform.product3) { pattern_text3 = unescape("%0D%0A%0D%0A") + "<br>" + convertName ( product_field.options[product_field.selectedIndex].text, '_pattern' ); }
	}
  }
  var full_pattern_text = pattern_text1 + pattern_text2 + pattern_text3;
  if (full_pattern_text.length > 25) { document.csilongform.pattern.value = full_pattern_text;
  } else {
    document.csilongform.pattern.value = "";
	document.csilongform.pattern.disabled = true;
  }
}

function writePatternText()
{
  pattern_text1 = convertName ( FORM_DATA.product, '_pattern' );
  if (FORM_DATA.second_product) { pattern_text2 = "<br>" + unescape("%0D%0A%0D%0A") + convertName ( FORM_DATA.product2, '_pattern' ); }
  if (FORM_DATA.third_product) { pattern_text3 = "<br>" + unescape("%0D%0A%0D%0A") + convertName ( FORM_DATA.product3, '_pattern' ); }
  document.writeln(pattern_text1 + pattern_text2 + pattern_text3);
}

function checkTheBox()
{
  var args = checkTheBox.arguments;
  for ( loop=0; loop<args.length; loop++ ) {
    var full_name = eval("document.csilongform." + args[loop]);
    full_name.checked = true;
  }
}

function enableTheBox()
{
  var args = enableTheBox.arguments;
  for ( loop=0; loop<args.length-1; loop++ ) {
    var full_name = eval("document.csilongform." + args[loop+1]);
    if (args[0]) { full_name.disabled = false;
    } else { full_name.disabled = true; }
  }
}

function checkPercents()
{
  var temp1 = eval(document.csilongform.percent1.value);
  var temp2 = eval(document.csilongform.percent2.value);
  var temp3 = eval(document.csilongform.percent3.value);
  var total_percent = temp1 + temp2 + temp3;
  if (total_percent!=100) {
    alert("Please make sure your values add up to 100% for all products combined.");
	document.csilongform.percent1.value = "100";
	document.csilongform.percent2.value = "0";
	document.csilongform.percent3.value = "0";
	return false;
  } else { return true; }
}

function initOnRefresh( product_select1, product_select2, product_select3 )
{
    if (document.cookie) {
        var the_cookie = document.cookie;
        var broken_cookie = the_cookie.split("=");
        var the_values = unescape(broken_cookie[1]);
	    product_index1 = the_values.substring(0,the_values.indexOf("~"));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        color_index1 = the_values.substring(0,the_values.indexOf("~"));
        the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        document.csilongform.customcolor1.value = customTextToForm(the_values.substring(0,the_values.indexOf("~")));
        the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        document.csilongform.percent1.value = customTextToForm(the_values.substring(0,the_values.indexOf("~")));
        the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
	    product_index2 = the_values.substring(0,the_values.indexOf("~"));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        color_index2 = the_values.substring(0,the_values.indexOf("~"));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        document.csilongform.customcolor2.value = customTextToForm(the_values.substring(0,the_values.indexOf("~")));
        the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        document.csilongform.percent2.value = customTextToForm(the_values.substring(0,the_values.indexOf("~")));
        the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
	    product_index3 = the_values.substring(0,the_values.indexOf("~"));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        color_index3 = the_values.substring(0,the_values.indexOf("~"));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        document.csilongform.customcolor3.value = customTextToForm(the_values.substring(0,the_values.indexOf("~")));
        the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        document.csilongform.percent3.value = customTextToForm(the_values.substring(0,the_values.indexOf("~")));
        the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        quoin_index = the_values.substring(0,the_values.indexOf("~"));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        quoin_color = the_values.substring(0,the_values.indexOf("~"));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        document.csilongform.quoin_custom_color.value = customTextToForm(the_values.substring(0,the_values.indexOf("~")));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        wallcap_index = the_values.substring(0,the_values.indexOf("~"));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        wallcap_color = the_values.substring(0,the_values.indexOf("~"));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        document.csilongform.wallcap_custom_color.value = customTextToForm(the_values.substring(0,the_values.indexOf("~")));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        document.csilongform.keystone_color.value = customTextToForm(the_values.substring(0,the_values.indexOf("~")));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        windowmolding_index = the_values.substring(0,the_values.indexOf("~"));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        windowmolding_color = the_values.substring(0,the_values.indexOf("~"));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        document.csilongform.windowmolding_custom_color.value = customTextToForm(the_values.substring(0,the_values.indexOf("~")));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        windowsill_index = the_values.substring(0,the_values.indexOf("~"));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        windowsill_color = the_values.substring(0,the_values.indexOf("~"));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        document.csilongform.windowsill_custom_color.value = customTextToForm(the_values.substring(0,the_values.indexOf("~")));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
	    lath_type_value = the_values.substring(0,the_values.indexOf("~"));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
        sealer_type_value = the_values.substring(0,the_values.indexOf("~"));
	    the_values = the_values.substring(the_values.indexOf("~")+1,the_values.length);
	    var temp_pselect = new Array;
	    var temp_pindex;
	    var temp_cselect = new Array;
	    var temp_cindex;
	    var temp_carray = new Array;
	    var temp_custom = new Array;
	    var temp_percent;
	    for (var loop=1; loop<4; loop++) {
	      temp_percent = eval("document.csilongform.percent" + loop);
	      temp_pselect = eval("product_select" + loop);
		  temp_pindex = eval("product_index" + loop);
		  temp_cselect = eval("document.csilongform.color" + loop);
		  temp_cindex = eval("color_index" + loop);
		  temp_custom = eval("document.csilongform.customcolor" + loop);
		  if ( temp_pindex != 0 ) {
		    temp_pselect.selectedIndex = temp_pindex;
		    temp_carray = convertProductName ( loop, temp_pselect.options[temp_pindex].text );
		    changePatternText(temp_pselect);
			if (loop==2) {
			  document.csilongform.second_product.checked = true;
			} else {
			  if (loop==3) {
			    document.csilongform.third_product.checked = true;
			  }
			}
		    if ( temp_cindex != 0 ) {
		      changeColors ( temp_carray, temp_cindex, temp_cselect );
		      if ( temp_cselect.options[temp_cindex].text != "Custom" ) { temp_custom.value = "";
			  } else { temp_custom.disabled = false; }
		    } else { changeColors ( temp_carray, default_index, temp_cselect ); }
		  } else {
		    temp_percent.disabled = true;
		    if (loop==1) { temp_percent.value = "100";
		    } else { temp_percent.value = "0" ; }
		    temp_cselect.disabled = true;
		    temp_custom.disabled = true;
		    temp_custom.value = "";
		  }
	    }
		if (quoin_index > 0) {
		  checkTheBox('accessories','quoins');
		  enableTheBox(true,'quoinselect','quoin_color');
		  document.csilongform.quoinselect.selectedIndex = quoin_index;
		  changeAccColor(document.csilongform.quoinselect, document.csilongform.quoin_color, '_quoin', quoin_color);
		  if (document.csilongform.quoin_color.options[quoin_color].text != "Custom") { document.csilongform.quoin_custom_color.value = "";
		  } else { document.csilongform.quoin_custom_color.disabled = false; }
		}
		if (wallcap_index > 0) {
		  checkTheBox('accessories','wallcaps');
		  enableTheBox(true,'wallcapselect','wallcap_color','wallcapsize');
		  document.csilongform.wallcapselect.selectedIndex = wallcap_index;
		  changeAccColor(document.csilongform.wallcapselect, document.csilongform.wallcap_color, '_wallcap', wallcap_color);
		  if (document.csilongform.wallcap_color.options[wallcap_color].text != "Custom") { document.csilongform.wallcap_custom_color.value = "";
		  } else { document.csilongform.wallcap_custom_color.disabled = false; }
		}
		if (document.csilongform.keystone_color.value != "") { checkTheBox('accessories','keystones'); }
		if (windowmolding_index > 0) {
		  checkTheBox('accessories','windowmoldings');
		  enableTheBox(true,'windowmoldingselect','windowmolding_color');
		  document.csilongform.windowmoldingselect.selectedIndex = windowmolding_index;
		  changeAccColor(document.csilongform.windowmoldingselect, document.csilongform.windowmolding_color, '_molding', windowmolding_color);
		  if (document.csilongform.windowmolding_color.options[windowmolding_color].text != "Custom") { document.csilongform.windowmolding_custom_color.value = "";
		  } else { document.csilongform.windowmolding_custom_color.disabled = false; }
		}
		if (windowsill_index > 0) {
		  checkTheBox('accessories','windowsills');
		  enableTheBox(true,'windowsillselect','windowsill_color');
		  document.csilongform.windowsillselect.selectedIndex = windowsill_index;
		  changeAccColor(document.csilongform.windowsillselect, document.csilongform.windowsill_color, '_molding', windowsill_color);
		  if (document.csilongform.windowsill_color.options[windowsill_color].text != "Custom") { document.csilongform.windowsill_custom_color.value = "";
		  } else { document.csilongform.windowsill_custom_color.disabled = false; }
		}
		if (document.csilongform.pattern.value != pattern_text_default) { document.csilongform.pattern.disabled = false; }
		if (document.csilongform.panel_size.selectedIndex == document.csilongform.panel_size.length-1) { document.csilongform.custom_panel_size.disabled = false; }
		if (document.csilongform.wall_size.selectedIndex == document.csilongform.wall_size.length-1) { document.csilongform.custom_wall_size.disabled = false; }
		enableTheBox(lath_type_value, 'lath_type_text');
		enableTheBox(sealer_type_value, 'sealer_type_text');
		enableTheBox(document.csilongform.section_8.checked, 'rs_custom_text1');
		enableTheBox(document.csilongform.section_9.checked, 'rs_custom_text2');
		enableTheBox(document.csilongform.qa_custom.checked, 'qa_custom_text');
		enableTheBox(document.csilongform.mm_custom.checked, 'mm_custom_text');
		enableTheBox(document.csilongform.ssv_custom.checked, 'ssv_custom_text');
		enableTheBox(document.csilongform.bw_custom.checked, 'bw_custom_text');
		enableTheBox(document.csilongform.submittals_2.checked, 'sample', 'panel_size');
		enableTheBox(document.csilongform.submittals_6.checked, 'submittal_custom_text');
		enableTheBox(document.csilongform.sample_wall.checked, 'wall_size');
		enableTheBox(document.csilongform.quoins.checked, 'quoinselect', 'quoin_color');
		enableTheBox(document.csilongform.wallcaps.checked, 'wallcapselect', 'wallcap_color', 'wallcapsize');
		enableTheBox(document.csilongform.keystones.checked, 'keystone_color');
		enableTheBox(document.csilongform.windowmoldings.checked, 'windowmoldingselect', 'windowmolding_color');
		enableTheBox(document.csilongform.windowsills.checked, 'windowsillselect', 'windowsill_color');
	}
}

function convertCheckToNum(check_value)
{
  var check_num = check_value ? 1 : 0;
  return check_num;
}

function convertNumToCheck(check_num)
{
  var check_value = check_num ? true : false;
  return check_value;
}

function customTextToCookie(text_to_convert)
{
  text_to_return = text_to_convert == "" ? "_" : text_to_convert;
  return text_to_return;
}

function customTextToForm(text_to_convert)
{
  text_to_return = text_to_convert == "_" ? "" : text_to_convert;
  return text_to_return;
}

function writeCookie()
{
  var the_cookie = "";
  var the_date = new Date("December 31, 2003");
  var the_cookie_date = the_date.toGMTString();
  var path = "/csi";
  var domain = ".coronado.com";
  var secure = " ";
  the_cookie = sealer_type_value + "~";
  the_cookie = lath_type_value + "~" + the_cookie;
  the_cookie = customTextToCookie(document.csilongform.windowsill_custom_color.value) + "~" + the_cookie;
  the_cookie = document.csilongform.windowsill_color.selectedIndex + "~" + the_cookie;
  the_cookie = document.csilongform.windowsillselect.selectedIndex + "~" + the_cookie;
  the_cookie = customTextToCookie(document.csilongform.windowmolding_custom_color.value) + "~" + the_cookie;
  the_cookie = document.csilongform.windowmolding_color.selectedIndex + "~" + the_cookie;
  the_cookie = document.csilongform.windowmoldingselect.selectedIndex + "~" + the_cookie;
  the_cookie = customTextToCookie(document.csilongform.keystone_color.value) + "~" + the_cookie;
  the_cookie = customTextToCookie(document.csilongform.wallcap_custom_color.value) + "~" + the_cookie;
  the_cookie = document.csilongform.wallcap_color.selectedIndex + "~" + the_cookie;
  the_cookie = document.csilongform.wallcapselect.selectedIndex + "~" + the_cookie;
  the_cookie = customTextToCookie(document.csilongform.quoin_custom_color.value) + "~" + the_cookie;
  the_cookie = document.csilongform.quoin_color.selectedIndex + "~" + the_cookie;
  the_cookie = document.csilongform.quoinselect.selectedIndex + "~" + the_cookie;
  the_cookie = customTextToCookie(document.csilongform.customcolor3.value) + "~" + the_cookie;
  the_cookie = customTextToCookie(document.csilongform.percent3.value) + "~" + the_cookie;
  the_cookie = document.csilongform.color3.selectedIndex + "~" + the_cookie;
  the_cookie = document.csilongform.product3.selectedIndex + "~" + the_cookie;
  the_cookie = customTextToCookie(document.csilongform.customcolor2.value) + "~" + the_cookie;
  the_cookie = customTextToCookie(document.csilongform.percent2.value) + "~" + the_cookie;
  the_cookie = document.csilongform.color2.selectedIndex + "~" + the_cookie;
  the_cookie = document.csilongform.product2.selectedIndex + "~" + the_cookie;
  the_cookie = customTextToCookie(document.csilongform.customcolor1.value) + "~" + the_cookie;
  the_cookie = customTextToCookie(document.csilongform.percent1.value) + "~" + the_cookie;
  the_cookie = document.csilongform.color1.selectedIndex + "~" + the_cookie;
  the_cookie = document.csilongform.product.selectedIndex + "~" + the_cookie;
  document.cookie = "csicookie=" + escape(the_cookie) + "; EXPIRES=" + the_cookie_date + "; PATH=" + path + "; DOMAIN=" + domain + secure;
  document.csilongform.pattern.disabled = true;
}
function drystacked(drySelect)
{
	if(drySelect == 1){
		document.csilongform.mortarjoint.disabled = true;
	} else {
		document.csilongform.mortarjoint.disabled = false;
	}
}

// -->