/**
 * @author volodya
 */
$(document).ready(function(){
	$("a[href=http://mirohost.net/service/]").remove();
	
	
	$(".result").each(function(){
		var s =$(this).attr('url');
		var i=s.length-1;
		var j=0;
		var ss=' ';
		while(s.charAt(i)!='/'){
		 	ss += s.charAt(i);
		 	i--;//asas/XXX
		}
		var pp='';
		i--;
		while(s.charAt(i)!='/'){
		 	pp += s.charAt(i);
		 	i--;//xxx/121
		}
		var p='';
		for(var i=pp.length-1;i>=0;i--){
			p+=pp.charAt(i); //if painters.
		}
		//alert(p);
		var s='';
		for(var i=ss.length-1;i>0;i--){
			s+=ss.charAt(i); //id painters.
		}

		$(this).attr({
			"id":"p"+s
		});
		
		 if (p == 'painters') {
		 	$.post("http://"+top.location.host+"/mods/req.php", {
				'painters':1,
		 		'id': s
		 	}, function(data){
		 		eval('var t=' + data);
		 		for (var i = 0; i < t.length; i++) {
		 			$("#p"+t[i].auth_id).append('<img class="img" src="http://' + top.location.host + '/auction/' + t[i].pic + '" style="margin:5px" height="80px" border="1"/>');
		 		}
				
				
		 	});
		 }else if (p == 'pic_show') {
		 	$.post("http://"+top.location.host+"/mods/req.php", {
				'pic':1,
		 		'id': s
		 	}, function(data){
		 		eval('var t=' + data);
		 		for (var i = 0; i < t.length; i++) {
		 			$("#p"+t[i].id).append('<img class="img" src="http://' + top.location.host + '/auction/' + t[i].pic + '" style="margin:5px" height="80px" border="1"/>');
		 		}
				
				
		 	});
		 }else{
		$("li[u="+$(this).attr('url')+"]").remove();
		 }
		
	})
})
