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;
		document.getElementById('contactUsDiv').grow({duration:1, direction:'bottom-left'})
	}
	else
	{
		fbOpen = false;
		document.getElementById('contactUsDiv').shrink({duration:1, direction:'bottom-left'})
	}
}

function goFeedback()
{
	fb.requestFile = "/feedback.asp?name="+encodeURI(document.getElementById('name').value)+"&phone="+encodeURI(document.getElementById('phone').value)+"&email="+encodeURI(document.getElementById('email').value)+"&need="+encodeURI(document.getElementById('need').value)+"&comment="+encodeURI(document.getElementById('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)
		{
			document.getElementById('name').style.backgroundColor = "#F5A9A9";
			document.getElementById('name').value = ""
		}
		else
		{
			document.getElementById('name').style.backgroundColor = "white";
		}
		if (fb.response.indexOf(",phone")>-1)
		{
			document.getElementById('phone').style.backgroundColor = "#F5A9A9";
			document.getElementById('phone').value = ""
		}
		else
		{
			document.getElementById('phone').style.backgroundColor = "white";
		}
		if (fb.response.indexOf(",email")>-1)
		{
			document.getElementById('email').style.backgroundColor = "#F5A9A9";
			document.getElementById('email').value = ""
		}
		else
		{
			document.getElementById('email').style.backgroundColor = "white";
		}
		if (fb.response.indexOf(",need")>-1)
		{
			document.getElementById('need').style.backgroundColor = "#F5A9A9";
		}
		else
		{
			document.getElementById('need').style.backgroundColor = "white";
		}
	}
	else
	{
		//toggleFeedback();
		document.getElementById('name').value = "";
		document.getElementById('phone').value = "";
		document.getElementById('email').value = "";
		document.getElementById('need').value = "";
		document.getElementById('contactMiddle').innerHTML = "";
		document.getElementById('contactBottom').innerHTML = "&nbsp;";
		document.getElementById('contactBottom').style.height = "30px";
		document.getElementById('contactMiddle').style.height = "160px";
		document.getElementById('contactMiddle').morph('height:164px; height:0px;');
		document.getElementById('contactBottom').style.paddingTop = "2px";
		document.getElementById('contactBottom').style.paddingLeft = "40px";


		document.getElementById('contactBottom').innerHTML = "<span id='contactThanks' style='display:none;color:black;letter-spacing:3px;font-weight:bold;font-size:14px;position:relative;top:0px;'>THANK YOU</span>";
		document.getElementById('contactMiddle').morph('height:60px; height:10px;');
		document.getElementById('contactTop').morph('height:60px; height:30px;');
				//document.getElementById('contactBottom').morph('height:60px; height:4px;');
		setTimeout('document.getElementById(\'contactThanks\').appear({from: 0.0, to: 1.0, duration: 1.0 });',1000)

	}
	//pageTracker._trackPageview("/feedback.asp" );
}

