//update rating
function rating_update(id, section, rating)
	{
		var element_id  = 'rating'
		var script_link = '/scripts/ajax.php?script=rating_update&id='+id+'&section='+section+'&rating='+rating

		//show 'loading'
		document.getElementById(element_id).innerHTML = '<div class="element"><img src="/templates/default/images/loading.gif" class="icon" /> Please wait ...</div>';
				
		//call php script
		call_ajax('get', element_id, script_link);
	}
	
//change page 'comments'
function show_comment(id, section, page)
	{
		var element_id  = 'box_comment_list'
		var script_link = '/scripts/ajax.php?script=show_comment&id='+id+'&section='+section+'&page='+page

		//show 'loading'
		document.getElementById(element_id).innerHTML = '<div style="padding: 10px 0px 10px 10px;"><img src="/templates/default/images/loading.gif" class="loading" /> Por Favor Espere, lista de comentarios cargando...</div>';
		
		//call php script
		call_ajax('get', element_id, script_link);
	}

//post comment	
function post_comment(section, id, name) 
	{
		var element_id   = 'review'
		var script_link  = '/scripts/ajax.php?script=post_comment&id='+ id +'&section='+ section+'&name='+ name
		var parameters   = '';
		
		parameters += 'c_title=' + encodeURIComponent( document.getElementById('c_title').value ) + '&'
		parameters += 'c_content=' + encodeURIComponent( document.getElementById('c_content').value ) + '&'
		parameters += 'c_score=' + encodeURIComponent( document.getElementById('c_score').value ) + '&'
		parameters += 'c_name=' + encodeURIComponent( document.getElementById('c_name').value ) + '&'
		parameters += 'c_email=' + encodeURIComponent( document.getElementById('c_email').value ) + '&'		
		parameters += 'verify_string=' + encodeURIComponent( document.getElementById('verify_string').value ) + '&'		
		
		//call php script
		call_ajax('post', element_id, script_link, parameters);
		
		//reload comment list
		show_comment(id, section, 1);
	}
	
//update subcategory select
function updatePath()
	{
		var element_id  = 'path'
		var section     = document.getElementById('section').value
		var script_link = '/scripts/ajax.php?script=updatePath&section=' + section

		//show 'loading'
		document.getElementById(element_id).innerHTML = '<div style="padding: 10px 0px 10px 10px;"><img src="/templates/default/images/loading.gif" class="loading" /> Por Favor Espere, lista de Subcategorías cargando...</div>';
		
		//call php script
		call_ajax('get', element_id, script_link);
	}