
function choiceA(newColor){
	var stuff = document.getElementById('Croom');
	stuff.innerHTML = '<img src="/images/diningstyle/' + newColor + '.jpg" alt="Your Favorite Dining Style">';
	stuff = document.getElementById('Cdescr');
	stuff.innerHTML = Cdesc[newColor];
	stuff = document.getElementById('slideshow');
	return true;
}

function nextSlide(dirctn)
{
	var current = null;
	var voteButn = document.getElementsByName('vote');
	for(var i = 0; i < voteButn.length; i++)
	{
		if( voteButn[i].checked == true)
		{
			current = i;	
		}
	}
	
	if(current != null)
	{
		if(dirctn == 'up')
		{
			if(current == (voteButn.length - 1))
			{
				voteButn[0].checked = true;
				voteButn[current].checked = false;
				choiceA(voteButn[0].value);
			} else
			{
				voteButn[(current+1)].checked = true;
				voteButn[current].checked = false;
				current++;
				choiceA(voteButn[current].value);
			}
		}else
		{
			if(current == (0))
			{
				voteButn[(voteButn.length - 1)].checked = true;
				voteButn[current].checked = false;
				choiceA(voteButn[(voteButn.length - 1)].value);
			} else
			{
				voteButn[current-1].checked = true;
				voteButn[current].checked = false;
				current--;
				choiceA(voteButn[current].value);
			}
	
		}
	}
}

function TestDataCheck()
{
	var cCheck = new Array('name','iphone','address','city','state','zip','country');
	var errorCount = 0;
	function mailtest(field) 
	{
		
		var x=document.getElementById('c' + field);
		var y=document.getElementById(field);
		y.style.color = 'black';
		
		 var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
		 var regex = new RegExp(emailReg);

 		if (!(regex.test(x.value)))
		{ 
			y.style.color = 'red';
			return false;
		}
		return true;
	  }
	  
	  function checkField(field)
	{


		var x=document.getElementById('c' + field);
		var y=document.getElementById(field);
		var cString = x.value;

		if(cString == "")
		{

				y.style.color = 'red';
				return false;
		} else
			{
					y.style.color = 'black';
					return true;
			}
	return true;

	}	// end of checkField
	var cLoop = cCheck.length;
	var i;
	 for(i=0; i< cLoop; i++)
	{
		if(checkField(cCheck[i]) == false)
		{
			errorCount++;	
		} 
	}
	
	if(mailtest('email') == false)
	{
		errorCount++;	
	}
	if(errorCount > 0 )
	{
		alert("Please complete the indicated fields before submitting.");
		return false;
	} else	return true;
	  
	return false;
}
var tColor = new Array(6);

	tColor['coastal']
	tColor['modern']
	tColor['european']
	tColor['british']
	tColor['traditional']
	tColor['french']
	tColor['oldworld']


var Cdesc = new Array(6);
Cdesc['coastal'] = ("<span class=\"ttitle\">Coastal:</span> Bring the feel of the coast to your table with crisp whites and soft, painted blues. This casual display summons the scent of sea air and makes every meal feel like a special getaway.");

Cdesc['modern'] = ("<span class=\"ttitle\">Modern:</span> Set this table with sophistication and nouveau cuisine! From intimate dinners to posh social gatherings, this setting provides undeniable style and comfort.");

Cdesc['european'] = ("<span class=\"ttitle\">European Charm:</span> Relaxed European charm is served up in this combination of graceful design, distressed ivory and black painted finishes. Break bread and enjoy quality time with family and friends.");

Cdesc['british'] = ("<span class=\"ttitle\">British Colonial:</span> It takes an exotic meal to match the tales of travel told around this table. Inspired by British Colonial style, this relaxed setting is the perfect place to experience culinary adventures without ever leaving home.");

Cdesc['traditional'] = ("<span class=\"ttitle\">Traditional:</span> Time-honored traditions are meant to be celebrated at this table. Proudly serve your favorite recipes passed down from generations and delight in the history evoked by this setting's elegant curves, intricately carved details and rich finish.");

Cdesc['french'] = ("<span class=\"ttitle\">French:</span> The French are not only masters of cuisine, but the inspiration for this charming, delicately carved display. Savor the special ingredients in this collection, including French walnut, patinaed finishes, delicate inlays and marble accents.");

Cdesc['oldworld'] = ("<span class=\"ttitle\">Old World:</span> Rich and rustic, this setting calls for a hearty meal and a vintage wine. Satisfy your appetite for Old World charm with hand-rubbed, distressed wood finishes, sumptuous leather and elegant detail." );