/**
 * addcompanyuser Info Module JS Files
 * @author Pathfinder Solutions India
 * @link http://www.pathfindersolutions.biz
 * @version 1.0
 * @package justmeans
 * @subpackage manageuser
 */


function fnClearContent()
{
	document.getElementById('id_txtName').value = "Name?";
	document.getElementById('id_txtEmail').value = "Email?";
	document.getElementById('id_txtPhone').value = "Phone?";
	document.getElementById('id_txtQuestion').value = "Question or Request?";
	
	document.getElementById('id_txtName').className = "text grayUnableTxt";
	document.getElementById('id_txtEmail').className = "text grayUnableTxt";
	document.getElementById('id_txtPhone').className = "text grayUnableTxt";
	document.getElementById('id_txtQuestion').className = "grayUnableTxt";
	
	try
	{
		document.getElementById('id_subscSuccess').style.display = "none";
	}
	catch(e)
	{}
}


function fnSetUnsetvalue(strElemtnId)
{
	if(strElemtnId.value == "Name?" || strElemtnId.value == "Email?" || strElemtnId.value == "Phone?" || strElemtnId.value == "Question or Request?")
	{
		if(strElemtnId.value == "Question or Request?")
		{
			strElemtnId.className = "grayTxt";
		}
		else
		{
			strElemtnId.className = "text grayTxt";
		}
		strElemtnId.value = "";
		
	}
}

function fnSetDefaultvalue(strElemtnId,strDefaultVal)
{
	/*if(strElemtnId.value == "Name?" || strElemtnId.value == "Email?" || strElemtnId.value == "Phone?" || strElemtnId.value == "Question or Request?")
	{
		strElemtnId.value = "";
	}*/
	
	if(strElemtnId.value == "")
	{
		strElemtnId.value = strDefaultVal;
		if(strDefaultVal == "Question or Request?")
		{
			strElemtnId.className = "grayUnableTxt";
		}
		else
		{
			strElemtnId.className = "text grayUnableTxt";
		}
	}
}



function fnShowFreeTrialForm()
{ 
	document.getElementById('id_FreeTrial').style.display = "";
	document.getElementById('id_Captcha').style.display = "none";
}

function fnViewCaptcha()
{
	document.getElementById("id_captcha_image").src = "images/ajax-loader-bar.gif";
	ajaxObjects[102] = new sack();
	ajaxObjects[102].requestFile = sitename+"/index.php?action=getregistred&mode=ajax&ajax_action=viewlogincaptcha";
	ajaxObjects[102].onCompletion = function(){
													document.getElementById("id_captcha_image").src = ajaxObjects[102].response;
											  };
	ajaxObjects[102].runAJAX();
}

function fnValidateData()
{
	if(document.getElementById('id_FreeTrial').style.display == "")
	{
		errordiv = 'id_ErrorMsg'; 
		return fnValidateForm("frmFreeTrial");
	}
}	
	
function fnValidateCaptcha()
{ 
	document.getElementById("id_CaptchaLoader").style.display = "";
	document.getElementById("id_captchbtn").style.display = "none";
	
	strCaptchaText = document.getElementById("id_CaptchaText").value;
	
	ajaxObjects[102] = new sack();
	ajaxObjects[102].PostParam = "&freetrialcaptcha="+strCaptchaText;
	ajaxObjects[102].requestFile = securedsitename+"/index.php?action=getregistred&mode=ajax&ajax_action=validatecaptcha";
	ajaxObjects[102].onCompletion = function(){
												 if(ajaxObjects[102].response=="")
												 {
													document.frmFreeTrial.submit();
												 }
												 else
												 {
													  document.getElementById("id_CaptchaLoader").style.display = "none";
													  document.getElementById("id_captchbtn").style.display = "";
												 }
											  };
	 ajaxObjects[102].runAJAX();
}

