function loadRecentComments(url)
{
	new Ajax.Request( url , {method:'get', parameters:'', asynchronous:true, onSuccess:updateRecentComments });
  	return status;
}

function updateRecentComments(req)
{
	var html= req.responseText;
	$('RecentCommentsAjax').innerHTML=html;
	new Effect.Appear('RecentCommentsAjax');
}

function loadComments(url)
{
	new Ajax.Request(url, {method:'get', parameters:'', asynchronous:true, onSuccess:updateComments});
	return false;
}

function updateComments(req)
{
	var html= req.responseText;
	$('CommentsAjax').innerHTML=html;
}

function loadPopular(url)
{
	new Ajax.Request( url , {method:'get', parameters:'', asynchronous:true, onSuccess:updatePopular });
  	return false;
}

function updatePopular(req)
{
	var html= req.responseText;
	$('MostPopularAjax').innerHTML=html;
	new Effect.Appear('MostPopularAjax');
}

function loadRelated(url)
{
	new Ajax.Request( url , {method:'get', parameters:'', asynchronous:true, onSuccess:updateRelated });
	return false;
}

function updateRelated(req)
{
	var html= req.responseText;
	$('RelatedArticlesAjax').innerHTML = html;
	new Effect.Appear('RelatedArticlesAjax');
}
 
function loadToday(url)
{
	new Ajax.Request( url , {method:'get', parameters:'', asynchronous:true, onSuccess:updateToday });
	return false;
}

function updateToday(req)
{
	var html= req.responseText;
	$('TodayArticlesAjax').innerHTML=html;
	new Effect.Appear('TodayArticlesAjax');
}

function submitFeedbackForm( theform )
{
	var params = Form.serialize( theform );
	new Ajax.Request( '/php/turing/feedback.php' , { method:'post', postBody:params , asynchronous:true, onSuccess:updateFeedbackForm });
	return false;
}

function updateFeedbackForm( req )
{
	var elemtest=req.responseXML.getElementsByTagName('success');
 	if (elemtest.length > 0) 
 	{
		Effect.Appear('feedbackBlock_thanks');
 		Effect.Fade('feedbackBlock_form');
 	}else{
		Effect.Appear('feedbackBlock_error');
 	}
 	
}

function submitEmailForm( theform )
{
	var params = Form.serialize( theform );
	new Ajax.Request( '/php/turing/emailarticle.php' , { method:'post', postBody:params , asynchronous:true, onSuccess:updateEmailForm });
	return false;
}

function updateEmailForm( req )
{	
	var elemtest=req.responseXML.getElementsByTagName('success');
 	if (elemtest.length > 0 ) 
 	{
		Effect.Appear('emailResponseBlock');
		Effect.Fade('emailBlock');
 	}else{
		Effect.Appear('emailBlock_error');
 	}
	
	return false;
}

function submitRating(theform)
{
	var params = Form.serialize( theform );
	new Ajax.Request( '/php/rating/rate.php' , {method:'post', postBody:params , asynchronous:true, onSuccess:updateRating });
	return false;
}

function updateRating(req)
{
	var html= req.responseText;
	$('ajaxRatingResult').innerHTML=html;
	new Effect.Fade('ajaxRating');
	new Effect.Appear('articleRatingblock');
}

function loadStarRating(url)
{
	new Ajax.Request( url , {method:'get', parameters:'', asynchronous:true, onSuccess:updateStarRating });
	return false;
}

function updateStarRating(req)
{
	var html= req.responseText;
	$('starrating').innerHTML=html;
	new Effect.Fade('ajaxRating');
	new Effect.Appear('articleRatingblock');
}

function PostStarRating(rating,article,site,lang)
{
	var params= 'rate='.concat(rating);
	params = params.concat('&site=').concat(site).concat('&lang=').concat(lang).concat('&id=').concat(article);
	new Ajax.Request( '/php/rating/postrating.php' , {method:'post', postBody:params , asynchronous:true, onSuccess:updateStarRatingPost });
	return false;
}

function updateStarRatingPost(req)
{
	var html= req.responseText;
	$('starrating').innerHTML=html;
	new Effect.Appear('starrating');
}

function loadThumbRating(url)
{
	new Ajax.Request( url , {method:'get', parameters:'', asynchronous:true, onSuccess:updateThumbRating });
	return false;
}

function updateThumbRating(req)
{
	var html= req.responseText;
	$('thumbrating').innerHTML=html;
/* 	new Effect.Fade('ajaxRating'); */
/* 	new Effect.Appear('articleRatingblock'); */
}

function PostThumb(rating,article,site,lang)
{
	var params= 'rate='.concat(rating);
	params = params.concat('&site=').concat(site).concat('&lang=').concat(lang).concat('&id=').concat(article);
	new Ajax.Request( '/php/rating/thumbrate.php' , {method:'post', postBody:params , asynchronous:true, onSuccess:updateThumbRating });
	return false;
}

function loadKeywords(url)
{
  	new Ajax.Request( url , {method:'get' , parameters:'', asynchronous:true, onSuccess:updateKeywords} );
  	return false;
}

function updateKeywords(req)
{
	var html= req.responseText;
	$('KeywordsAjax').innerHTML = html;
	new Effect.Appear('KeywordsAjax');
}

