function showForm(div)
{

var div2Change = document.getElementById(div).style
if (div2Change.height == "15px")
	{
	if (div =="viraldiv")
		{
		var vIframe = (document.getElementById("viralframe").style)
		div2Change.height = "360px"
		vIframe.height = "360px"
		
		}
	else div2Change.height = "auto"
	}
else
	{
	div2Change.height = "15px";
	}
}




function checkForm (form)
{
var errorID = form+"error"
var errorHead = (document.getElementById (errorID))

var form2Ck= (document.getElementById(form));
var error=0;
for (i=0; i<form2Ck.length; i++)
	{
	//var resetTxt = (document.getElementById(form2Ck[i].name).style);
	//resetTxt.color = "black";
	
	if (form2Ck[i].value=="")
		{
		if (form2Ck.required_fields.value.indexOf(form2Ck[i].name)>-1)
			{
			var errorTxt = (document.getElementById(form2Ck[i].name).style)
			errorTxt.color = "red"
			error++
			}
		
			
		}	
	}
if (error == 0)
	{
	if (form == "viral")
		{
		document.viral.submit();
		}
	else if (form == "form")
		{
		document.form.submit();
		}
	}
else
	{
	errorHead.innerHTML =("Please Fillin in all required fields");
	errorHead.style.font = "normal 900 12px Verdana, Arial, sans-serif";
	errorHead.style.color = "red";
	
	}


}
	





var contact = new Array ();
var sign = new Array ();
var join = new Array ();

function buildArray (img,title,help)
{
this.imgSrc = img;
this.subTitle = title;
this.helpText = help;
return this;
}

function formAssets ()
{
var ct = 0;
contact[ct] = new buildArray ("images/h_contact.gif","Contact Us","<p style='margin:0;'><span  class='subsection' >Questions or Comments?</span><br/>We're always interested in what you have to say and would love to answer any questions you may have.  If you would like us to respond to your comments or questions we'll need either your phone number or email address.  We will never share or sell your personal information with 3rd parties.  We will only use this information with your permission. For more details see our <a href='priv.html'>Privacy Policy</a>.</p>"); 
ct = 0;
sign[ct] = new buildArray ("images/h_signup.gif","Sign-Up","<p style='margin:0;'><span  class='subsection' >Why Sign-up?</span><br/>Periodically we'll have promotions, after hour events or a new product that is so cool we think you'll want to hear about.  This is above and beyond early notice of our once yearly sale.  We promise whatever we send you will be entertaining and that we will never share or sell your personal information with 3rd parties.  We will only use this information with your permission. For more details see our <a href='priv.html'>Privacy Policy</a>.</p> ");
ct = 0;

join[ct] = new buildArray ("images/h_joinus.gif","Join Us","<p style='margin:0;'><span  class='subsection' >Why Join? </span><br/>Because we have some great ideas, events and products that we'd like to share.  This is above and beyond early notice of our once yearly sale.  We promise whatever we send you will be entertaining and that we will never share or sell your personal information with 3rd parties.  We will only use this information with your permission. For more details see our <a href='priv.html'>Privacy Policy</a>.</p>");
ct = 0;
}
 
function customizeForm()
{
	
var headImg = (document.getElementById('head'));
var helpTxt = (document.getElementById('helptext'));
var subNavTxt = (document.getElementById('subnavtext'));
if (thisURl == "sign")
	{
	headImg.src = sign[0].imgSrc;
	helpTxt.innerHTML = sign[0].helpText
	subNavTxt.innerHTML = sign[0].subTitle
	document.contact.optin.checked="checked";
	document.contact.subject.value = "Cantu Sign-Up Form"
	}
else if (thisURl == "join")
	{
	headImg.src = join[0].imgSrc;
	helpTxt.innerHTML = join[0].helpText
	subNavTxt.innerHTML = join[0].subTitle
	document.contact.optin.checked="checked";
	document.contact.subject.value = "Cantu Join Us Form"
	}
else if (thisURl == "update")
	{
	//headImg.src = join[0].imgSrc;
	//helpTxt.innerHTML = join[0].helpText
	//subNavTxt.innerHTML = join[0].subTitle
	//document.contact.optin.checked="checked";
	document.contact.subject.value = "Cantu Company Update Form"
	document.contact.redirect.value = "http://www.cantubathrooms.com/thankyou.html?update"
	}
else
	{
	headImg.src = contact[0].imgSrc;
	helpTxt.innerHTML = contact[0].helpText
	subNavTxt.innerHTML = contact[0].subTitle
	document.contact.subject.value = "Cantu Contact us Form"

	}
}

function setValue(div,formname)
{
var currValue = document.getElementById(formname).value
var currName = document.getElementById(formname).name;
var div2Change= (document.getElementById(div));
	var what2Add = ("");
	 if (formname == 'Country')
	 {
	 	 what2Add += ("<p class='formlabel'>"+formname+":&nbsp;<br/>");
	 }
if (currName == 'Other')
	{
	what2Add += ("<input type='text' name='"+formname+"' id='"+formname+"' size='30' title='"+formname+"?' value='Other?' class='textfield' style='margin:-3px 0 0 5px; color:red;'/>");
	}
else if (currValue == 'other')
	{
	what2Add += ("<input type='text' name='"+formname+"' id='"+formname+"' size='15' title='Your "+formname+"?' class='textfield' value='Your "+formname+"?' style='color:red;' />");
	}

else if (formname == 'Country')
	{
	what2Add += ("<input type='text' name='"+formname+"' id='"+formname+"' size='15' title='Your "+formname+"' class='textfield' value=' "+currValue+"'  />");
	}
div2Change.innerHTML = what2Add;
}

function button(action, item)
{
var butt2Change = (document.getElementById(item).style);
var txt = (item+"txt")
var txt2Change = (document.getElementById(txt).style);
if (action == 'on')
	{
	butt2Change.borderBottom = ("1px solid #fcfcfc");
	butt2Change.borderRight = ("1px solid #fcfcfc");
	butt2Change.borderTop = ("1px solid #c0c0c0");
	butt2Change.borderLeft = ("1px solid #c0c0c0");
	txt2Change.color = ("#CE952C");
	txt2Change.margin = ("-1px 0 0 -1px");
	}
else
	{
	butt2Change.borderTop = ("1px solid #fcfcfc");
	butt2Change.borderLeft = ("1px solid #fcfcfc");
	butt2Change.borderBottom = ("1px solid #c0c0c0");
	butt2Change.borderRight = ("1px solid #c0c0c0");
	txt2Change.color = ("#085B9F");
	txt2Change.margin = 0;
	}

}

