	$("#footer").empty();
	var maxLen = 7;
	$.get('http://obzor.hi-tech.com.ua/wp-content/themes/hi-tech.com.ua/js/proxy.php',function(data){
	   var infLength = $(data).find('item').length -1;
		var chosen = new Array();
			do{
	  			var newVal = Math.floor(Math.random()*infLength);
				if($.inArray(newVal,chosen) < 0)
						chosen.push(newVal);
	  		} while(chosen.length < maxLen);
				
	var htm = "";						 
	$.each(chosen,function(key,value){
		var item = $(data).find('item').eq(value);
		var image =item.find('image').text();
		var url = item.find('url').text();
		url += "obzor/";
		var name = item.find('name').text();
		var description = item.find('description').text().substr(0,70)+"...";
		description = description.replace(/quot;/, "'").replace(/ndash;/, "-").replace(/nbsp;/, " ").replace(/rsquo;rsquo;/, '"');
 		var price = item.find('price').text();
				
		htm += '<div class="infoMain hproduct"><div class="infoImage"><a href="';
		htm += url;
		htm += '" target="_blank"><img width="80px" src="';
		htm += image;
		htm += '" alt="';
		htm += name;
		htm += '" class="photo"/></a><a class="a" href="';
		htm += url;
		htm += '" target="_blank">Подробнее</a></div><div class="infoTxt"><h2 class="fn"><a href="';
		htm += url;
		htm += '" target="_blank" title="';
		htm += name;
		htm += '" class="url">';
		htm += name;
		htm += '</a></h2><p class="description">';
		htm += description;
		htm += '</p><span class="price">';
		htm += price;
		htm += ' </span></div></div>';
		
		});
		
	$('div#footer').css({'overflow':'hidden','height':'160px','padding-left':'10px'}).html(htm);
		$('div#footer div.infoMain')
	.css({'float':'left','width':'220px','height':'120px','margin':'5px',
	'border-color':'#b1b1b1','border-style':'solid','border-width':'1px'});
});

