// Checks to see if stripe is used...
function checkStripe(stripValue) {
	if(stripValue == 'true' || stripValue == true) {
		$('striped').show();
		if(document.myform && document.myform.fabstripe) document.myform.fabstripe.value = 'true';

		$('strdirv').disabled = $('strdirh').disabled = false;

		if(typeof(reloadingForm) == 'undefined' || !reloadingForm) {
			if(document.myform.width.value > 52) alert('Since your cushion is more than 52" wide, there may be one or more seams visible in the cushion fabric if you choose Vertical (front to back) as your stripe direction. Please take this into consideration when choosing a stripe direction.');
				else alert('You have selected a fabric with a stripe. Please choose Vertical (front to back) or Horizontal (side to side) as your stripe direction.');
		}
	} else {
		if(document.myform && document.myform.fabstripe) document.myform.fabstripe.value = 'false';

		$('strdirv').disabled = $('strdirh').disabled = true;

		$('striped').hide();
	}
}

// JavaScript Document
function swapcolor()
{
	e=document.getElementById('colordrop1');
	y=e.selectedIndex;
	z=e.options[y].value;
	document.cpic.src="http://www.umbrellasource.com/images/sm/"+z+".jpg";
	document.myform.color.value=z;
}

function pageswap()
{
	e=document.getElementById('t1');
	y=e.selectedIndex;
	z=e.options[y].value;
	if(z=="nonrec") location.href="custom-shaped-cushions.php";
	else if(z=="chaircon" || z=="chaise" || z=="steamer") document.getElementById('midtxt').style.visibility='visible';
	else document.getElementById('midtxt').style.visibility='hidden';
}

function pageswap2()
{
	e=document.getElementById('t1');
	y=e.selectedIndex;
	z=e.options[y].value;
	if(z=="nonrec") location.href="custom-shaped-cushions.php";
	else location.href="quote.php?type="+z;
}

function verify()
{
	x=document.myform;
	z=true;
	/*if(x.name.value=="")
	{
		alert("Please enter your name");
		x.name.focus();
		z=false;
	}
	else */ if(x.email.value=="")
	{
		alert("Please enter your email address");
		x.email.focus();
		z=false;
	}
	else if(x.zip.value=="")
	{
		alert("Please enter your zip code");
		x.zip.focus();
		z=false;
	}
/*	else if(x.length.value=="")
	{
		alert("Please enter the length of your cushion");
		x.length.focus();
		z=false;
	}
	else if(x.width.value=="")
	{
		alert("Please enter the width of your cushion");
		x.width.focus();
		z=false;
	} */
	return z;
}

function scolor(cval)
{
sc=window.open("clg.php?c="+cval, "cwin", "toolbar=no, scrollbars=yes, status=no, height=625, width=375");
if (window.focus) { sc.focus() }
}