
function submitWebsite( )
{
	var objFV = new FormValidator("frmWebsite");

	if (!objFV.validate("txtTitle", "B", "Please enter the Site Name."))
		return false;
		
	if (!objFV.validate("txtUrl", "B", "Please enter the Site Url."))
		return false;
		
	if (!objFV.validate("txtName", "B", "Please enter Your Name."))
		return false;
		
	if (!objFV.validate("txtEmail", "B,E", "Please enter Your Email Address."))
		return false;
		
	if (!objFV.validate("txtInfo", "B", "Please enter the Additional Info."))
		return false;
		
	$('Processing').show( );
	$('BtnSubmitSite').disable( );

	var sUrl    = "ajax/awards/submit-website.php"; 
	var sParams = $('frmWebsite').serialize( );
	
	new Ajax.Request(sUrl, { method:'post', parameters:sParams, onFailure:_showError, onSuccess:_submitWebsite });
}

function _submitWebsite(sResponse)
{
	if (sResponse.status == 200 && sResponse.statusText == "OK")
	{
		var sParams = sResponse.responseText.split('|-|');
		
		if (sParams[0] == "OK")		
			$('Website').innerHTML = sParams[1];
			
		else
			_showError(sParams[1]);
			
		$('Processing').hide( );
		$('BtnSubmitSite').enable( );
	}
	
	else
		_showError( );
}

function submitBlog( )
{
	var objFV = new FormValidator("frmBlog");
	
	if (!objFV.validate("txtTitle", "B", "Please enter the Blog Name."))
		return false;
		
	if (!objFV.validate("txtUrl", "B", "Please enter the Blog Url."))
		return false;
		
	if (!objFV.validate("txtName", "B", "Please enter Your Name."))
		return false;
		
	if (!objFV.validate("txtEmail", "B,E", "Please enter Your Email Address."))
		return false;
		
	if (!objFV.validate("txtInfo", "B", "Please enter the Additional Info."))
		return false;
		
	$('Processing').show( );
	$('BtnSubmitBlog').disable( );
	
	var sUrl    = "ajax/awards/submit-blog.php"; 
	var sParams = $('frmBlog').serialize( );
	
	new Ajax.Request(sUrl, { method:'post', parameters:sParams, onFailure:_showError, onSuccess:_submitBlog }); 
}

function _submitBlog(sResponse)
{
	if (sResponse.status == 200 && sResponse.statusText == "OK")
	{
		var sParams = sResponse.responseText.split('|-|');
		
		if (sParams[0] == "OK")		
			$('Blog').innerHTML = sParams[1];
			
		else
			_showError(sParams[1]);
			
		$('Processing').hide( );
		$('BtnSubmitBlog').enable( );
	}
	
	else
		_showError( );
}