function Cnet() {
    this.id      = '21658011594875983181003652215448';
    this.url     = 'http://api.cnet.com/restApi/v1.0/';
	this.urlFull = '';
	this.name    = '';
	this.type    = 'techProductSearch'; // softwareProductSearch
    this.q       = null;
    this.query   = null;
    this.src1    = null;
    this.src2    = null;
    this.params  = '';
    this.limit   = 10; // less than 100, default 10

    this.exec=function(){
        targ   = this.params.split(";"); 
        params = new Array();
		empty  = true;
        for (i=0;i<targ.length;i++){ 
            params[i] = $(targ[i]).val();
			if (params[i] != '') {
				empty = false;
			}
        }
		if (empty) {
			$(this.src1).html('0');
			return true;
		}
		
        this.img    = $('li#pl-'+this.name+' img.icon');
        this.imgsrc = $('li#pl-'+this.name+' img.icon').attr('src');		
        this.img.attr('src','/public/images/preloading.gif');
		        
		this.queryFull = $.vsprintf(this.query, params);
		this.queryFull = this.queryFull.replace('"" OR ','');
		this.queryFull = this.queryFull.replace(' OR ""','');
		this.queryFull = encodeURIComponent(this.queryFull);
		
        this.urlFull   = this.url + this.type + '?viewType=json&iod=none&start=0&partKey='+this.id+'&results='+this.limit+'&query='+ this.queryFull + '&callback=?';
		
        var plugin = this;
        
        $.ajax({
            // AJAX-specified URL
           url: plugin.urlFull,
           dataType : "jsonp",
           // Handle the success event
           success: function (data) {
				var ul = document.createElement("ul");
				switch (plugin.type) {
				    default:
				        if (parseInt(data.CNETResponse.TechProducts['@numFound']) > 0)
				        $.each(data.CNETResponse.TechProducts.TechProduct,
        					function(i, val) {
        						var li = document.createElement("li");
        						var inner = '';
        						inner += '<a href="'+val.ReviewURL.$+'" title="'+val.Name.$+'" target="_blank" class="img"><img src="'+val.ImageURL[0]['$']+'" width="'+val.ImageURL[0]['@width']+'" alt="'+val.Name.$+'"/></a>';
        						inner += '<span><b>'+val.EditorsRating.$+'/'+val.EditorsRating["@outOf"]+'</b>&nbsp;'+val.Name.$+'<br/><small>'+val.Specs.$+'</small></span>';  
        						li.innerHTML = inner;      		
        						ul.appendChild(li);
        					}
        				);
				        break;
				}
				/*
				
				{"@id":"32595956",
				 "@xlink:href":"http:\/\/api.cnet.com\/restApi\/v1.0\/techProduct?productId=32595956&iod=none&partKey=21658011594875983181003652215448",
				 "Name":{"$":"Apple iPod Touch (16GB)"},
				 "ImageURL":[
    				 {"@width":"60","$":"http:\/\/i.i.com.com\/cnwk.1d\/sc\/32595956-2-60-0.gif"},
    				 {"@width":"120","$":"http:\/\/i.i.com.com\/cnwk.1d\/sc\/32595956-2-120-0.gif"}],
				 "PriceURL":{"$":"http:\/\/shopper.cnet.com\/portable-video-players-pvps\/apple-ipod-touch-16gb\/4014-6499_9-32595956.html?tag=api&subj=sh"},
				 "ReviewURL":{"$":"http:\/\/reviews.cnet.com\/portable-video-players-pvps\/apple-ipod-touch-16gb\/4505-6499_7-32595956.html?tag=api&subj=re"},
				 "Manufacturer":{"@id":"272829","Name":{"$":"Apple Inc."}},
				 "SKU":{"$":"MA627LL\/B"},
				 "PublishDate":{"$":"2007-09-05 10:53:29.0"},
				 "Specs":{"$":"Portable media center, 2.4 in x 0.3 in x 4.3 in,  3.5 in, USB 2.0, AAC, Protected AAC, MP3, MP3 VBR, Audible 2, Audible 3, Audible 4, Apple Lossless, WAV, AIFF, MPEG-4, 4.2 oz"},
				 "EditorsChoice":{"$":"false"},
				 "EditorsRating":{"@outOf":"10","$":"8,7"},
				 "PreferredNode":{"@id":"6499"},
				 "Category":{"@id":"6499","@xlink:href":"http:\/\/api.cnet.com\/restApi\/v1.0\/category?categoryId=6499&partKey=21658011594875983181003652215448"}
				 }
				*/
				link = '<a href="http://reviews.cnet.com/4244-5_7-0.html?query='+plugin.queryFull+'&tag=srch&target='+plugin.queryFull+'" title="View All Results (in new window)" target="_blank">'+data.CNETResponse.TechProducts['@numFound']+'</a>';
				$(plugin.src1).html(link);
				$(plugin.src2).html(ul);
				plugin.img.attr('src',plugin.imgsrc);
			}
        });
    };

}