	jQuery.noConflict();
    jQuery(document).ready(function() {
		jQuery("a.hpMainBar").mouseover(function(){
			var clickedItem = jQuery(this);
			jQuery("td.navfont").css('background-color', '#8DC442');
			clickedItem.parent().css('background-color', '#58B331');
		});
		var previus = jQuery("a#Latesta");
		jQuery("a.atab").click(function() {
			var clicked = jQuery(this);
			if (previus != null)
			{
				previus.parent().removeAttr("class");
			}
			previus = clicked;
			clicked.parent().attr("class","select");
			//jQuery("td.ajaxtab").css('background', 'transparent url(/images/sprite.png) no-repeat scroll left 0');
			//clicked.parent().css('background', 'transparent url(/images/sprite.png) no-repeat scroll left -23px');
			//jQuery("td.ajaxtab").css('background-color', '#CCC');
			//clicked.parent().css('background-color', '#736F6E');
			obj = document.getElementById('hpoverlay');
//			alert(obj.tagName);
//			jQuery.ajax({
//				type: 'post'
//				, async: true
//				, url: "./json/process.php?type=" + clicked.attr("title")
//				, success: function(data) {
//					jQuery("#hpoverlay").html(data);
//					jQuery("#hpoverlay").removeAttr("class");
//				  }
//				, error: function(data, status, err) {
//					alert('Failed connection to server');
//				  }
//				, complete: function() {
//
//				  }
//			});
			jQuery.getJSON("./json/process.php?type=" + clicked.attr("title"),
				function(data){
					jQuery.each(data.products, function(i,product){
						jQuery("#hpurl" + i).attr("href","./product/" + product.title.replace(/ /g,'-'));
						if (product.image != "")
						{
							jQuery("#hpimg" + i).attr("src","http://eco3p.com/gallery/thumb155/" + product.image);
						}
						else
						{
							jQuery("#hpimg" + i).attr("src","./images/no_image.gif" + product.image);
						}
						jQuery("#hpusername" + i).attr("href",product.username);
						jQuery("#hpusername" + i).html(product.username);
						jQuery("#hpprice" + i).html(product.price);
						jQuery("#hpname" + i).html(product.title.substring(0,35) + "...");
						jQuery("#attributes" + i).html("");
						//attributes
						if (product.attributes != "")
						{
							var myattributes = product.attributes.split(',');
							//for (var singleAttr in myattributes)
							//{
							jQuery.each(myattributes, function(index,value){
								jQuery.getJSON("./json/getAttributes.php?attribute=" + value,
									function(data1){
										try{
											jQuery("#attributes" + i).html(jQuery("#attributes" + i).html() + "<a  onMouseover=\"ddrivetip('" + data1.description +"')\"; onMouseout=\"hideddrivetip()\" ><img src=\"images/" + data1.image + "\" border=\"0\" width=\"23\" height=\"23\"></a>  ");
										}catch(ex){
											
										}
									});
								});
							//}
						}
					});
					jQuery("#hpoverlay").removeAttr("class");
				});
				jQuery("#hpoverlay").attr("class","hpoverlay");
				return false;
			});
        });
