//	Function to refresh the datas
jQuery(document).ready(function(){
	jQuery('div.xml_container').each(function(){
		var object = jQuery(this);
		window.setTimeout(function(){refresh(object);}, object.children('input.xml_delay').val());
	});	
});


function refresh(object)
{
	if ( object.children('input.xml_url').size() )
	{
		jQuery.get('modules/mod_aixml/includes/aixml_ajax.php?url=' + escape(object.children('input.xml_url').val()) + '&delay=' + object.children('input.xml_delay').val() +
		'&width=' + object.children('input.xml_width').val() + '&height=' + object.children('input.xml_height').val() + '&picturesWidth=' + object.children('input.xml_picturesWidth').val() +
		'&picturesHeight=' + object.children('input.xml_picturesHeight').val() + '&category=' + object.children('input.xml_category').val() + '&articles=' + object.children('input.xml_articles').val() +
		'&merchants=' + object.children('input.xml_merchants').val() + '&display=' + object.children('input.xml_display').val() + '&title=' + object.children('input.xml_title').val().replace('#', '') +
		'&price=' + object.children('input.xml_price').val().replace('#', '') + '&frame=' + object.children('input.xml_frame').val().replace('#', '') + '&link=' + object.children('input.xml_link').val().replace('#', ''), function(data) 
		{
			object.html(data);
			window.setTimeout(function(){refresh(object);}, object.children('input.xml_delay').val());
		});
	}
}

