﻿function emailAnswer(email, title)
{
	document.getElementById('email').value = email;
	document.getElementById('post').value = title;
	document.getElementById('contactForm').style.display = "";
}
function hideContact()
{
	document.getElementById('email').value = "";
	document.getElementById('post').value = "";
	document.getElementById('message').value = "";
	document.getElementById('contactForm').style.display = "none";
}
function sendEmail()
{
	AjaxRequest.post(
	 {
	   'parameters':{'email': document.getElementById('email').value, 'post': document.getElementById('post').value, 'message': document.getElementById('message').value, 'from': document.getElementById('from').value, 'replyEmail': document.getElementById('replyEmail').value },
	   'url':"http://www.sinlesslinks.com/ajax.php?action=emailFAQAnswer",
	   'onSuccess':sendEmailCallback
	 } );
}
function sendEmailCallback(data)
{
	alert(data.responseText);
	if(data.responseText == "Email Sent Successfully")
		hideContact();
}
function deleteQuestion(id)
{
	document.getElementById('question'+id).style.display = "none";
	document.getElementById('questionLinks'+id).style.display = "none";
	AjaxRequest.get(
   		 {
   		   'url':"http://www.sinlesslinks.com/ajax.php?action=deleteQuestion&id="+id
   		   ,'onSuccess':function(req){ 
				;
		   }
   		 } );
}

document.getElementById('faqSearchSubmit').onclick = function() {
	var str = document.getElementById('faqSearchTextBox').value;
	str = str.replace(/ /g, "+");
	window.location = "http://www.sinlesslinks.com/FAQ/search/"+str+"/";
}
document.getElementById('faqSearchForm').onsubmit = function()
{
	document.getElementById('faqSearchSubmit').onclick();
	return false;
}