var zmaclicked = false;
var nmaclicked = false;
var pmaclicked = false;
var cmtclicked = false;
var fbOpen = false;
var fb = new sack();

function toggleFeedback()
{
	if(fbOpen == false)
	{
		fbOpen = true;
		$('contactUsDiv').grow({duration:1, direction:'bottom-left'})
	}
	else
	{
		fbOpen = false;
		$('contactUsDiv').shrink({duration:1, direction:'bottom-left'})
	}
}

function goFeedback()
{
	fb.requestFile = "/feedback.asp?name="+encodeURI($('name').value)+"&phone="+encodeURI($('phone').value)+"&company="+encodeURI($('company').value)+"&email="+encodeURI($('email').value)+"&need="+encodeURI($('need').value)+"&comment="+encodeURI($('comment').value);
	//alert(fb.requestFile)
	fb.onCompletion = fbComplete;
	fb.runAJAX();
}

function fbComplete()
{
	//alert(fb.response);
	if(fb.response != 'success')
	{
		if (fb.response.indexOf(",name")>-1)
		{
			$('name').style.backgroundColor = "#f8e83a";
			$('name').value = "Name"
		}
		else
		{
			$('name').style.backgroundColor = "white";
		}
		if (fb.response.indexOf(",company")>-1)
		{
			$('company').style.backgroundColor = "#f8e83a";
			$('company').value = "Company"
		}
		else
		{
			$('company').style.backgroundColor = "white";
		}
		if (fb.response.indexOf(",phone")>-1)
		{
			$('phone').style.backgroundColor = "#f8e83a";
			$('phone').value = "Phone"
		}
		else
		{
			$('phone').style.backgroundColor = "white";
		}
		if (fb.response.indexOf(",email")>-1)
		{
			$('email').style.backgroundColor = "#f8e83a";
			$('email').value = "Email"
		}
		else
		{
			$('email').style.backgroundColor = "white";
		}
		if (fb.response.indexOf(",need")>-1)
		{
			$('need').style.backgroundColor = "#f8e83a";
		}
		else
		{
			$('need').style.backgroundColor = "white";
		}
	}
	else
	{
		//toggleFeedback();
		$('name').value = "";
		$('phone').value = "";
		$('email').value = "";
		$('need').value = "";
		$('contactMiddle').innerHTML = "";
		$('contactBottom').innerHTML = "&nbsp;";
		$('contactBottom').style.height = "50px";
		$('contactMiddle').style.height = "160px";
		$('contactMiddle').morph('height:164px; height:0px;');
		$('contactBottom').style.paddingTop = "2px";
		$('contactBottom').style.paddingLeft = "6px";
		$('contactBottom').innerHTML = "<div id='contactThanks' style='text-align:left;width:100%;display:none;color:#666666;font-weight:normal;font-size:10px;line-height:10px;position:relative;top:0px;'>Thank you. We have received your information, and will contact you regarding your requested document.</div>";
		//$('contactTop').morph('height:60px; height:30px;');
		//$('contactBottom').morph('height:60px; height:4px;');
		setTimeout('$(\'contactThanks\').appear({from: 0.0, to: .5, duration: .5 });',50)

	}
	//pageTracker._trackPageview("/feedback.asp" );
}

