	var email_message = "* Required";
	var name_message  = "* Required";
	function backInBlack(ob){
		ob.style.color = "#000000";
		ob.value = "";
	}

function submitProductQuoteForm(){
	//alert("here");
/*	if($('productQuoteForm').onsubmit()){
		$('productQuoteForm').submit();
	}*/

	if(checkProductQuoteNameAndEmail()){
		var productFormValues = $('productQuoteForm').serialize();
		var tmpUrl = "/?fuseaction=quote.sendProductQuote&"+productFormValues;
		//alert(tmpUrl);
		new Ajax.Updater('formFormDiv', tmpUrl, {method: 'post', insertion: Insertion.Bottom, budgetAjax: false});
	}
}

Ajax.Responders.register(
{
	onCreate : function(a_request)
	{
		if (Ajax.activeRequestCount >= 1)
		{
			//alert(a_request.my_custom_var);
			if (a_request.options.budgetAjax)
			{
				Element.show('systemWorking');
			}
			else 
			{
				$('theRequestSubmit').style.cursor='wait';
				Element.show('systemWorking2');
				$('theRequestSubmit').style.background='url(images/productlayout/submiting.png)';
				$('theRequestSubmit').onclick = function(){
		       		}
			}
		}
	},
	onComplete : function(a_request)
	{
		if (Ajax.activeRequestCount == 0)
		{
			if (a_request.options.budgetAjax)
			{
				Element.hide('systemWorking');
			}
			else 
			{
				$('theRequestSubmit').style.cursor='default';
				Element.hide('systemWorking2');
				$('theRequestSubmit').style.background='url(images/productlayout/submitted.png)';
			}
		}
	}
});
function checkProductQuoteNameAndEmail(){

	var name_form  = $("qqname");
	var email_form = $("qqemail");
	name_form.onfocus = function(){
		backInBlack(this);
	}
	email_form.onfocus = function(){
		backInBlack(this);
	}
	var strEmail = document.getElementById("qqemail").value;
	var strName = document.getElementById("qqname").value;
	var echk = true;
	var emailFilter = /^.+@.+\..{2,3}$/;
	var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/;

	if (strName == "" || strName == name_message){
		name_form.style.color = "#ff0033";
		name_form.value = name_message;
		echk = false;
	}
	if (strName.match(illegalChars)){
		name_form.style.color = "#ff0033";
		name_form.value = name_message;
		echk = false;
	}
	if (strEmail == "" || strEmail == email_message){
		email_form.style.color = "#ff0033";
		email_form.value = email_message;
		echk = false;
	}
	if (!emailFilter.test(strEmail))
	{
		email_form.style.color = "#ff0033";
		email_form.value = email_message;
		echk = false;
	}
	if (strEmail.match(illegalChars))
	{
		email_form.style.color = "#ff0033";
		email_form.value = email_message;
		echk = false;
	}

	return echk;
}
function fillReferrer(){
	document.getElementById("productReferrer").value = encodeURIComponent(location.href);
	//alert(location.href);
}



function taText(){
	if(document.getElementById('qqaddinfo').value == "i.e. customization questions, due date, multiple quantities, etc"){
		document.getElementById('qqaddinfo').value = "";
	}
	else if (document.getElementById('qqaddinfo').value == ""){
		document.getElementById('qqaddinfo').value = "i.e. customization questions, due date, multiple quantities, etc";
	}
}
