
	$(document).ready(function(){
				$('a[@class^="id_"]').each(function(el) {
									$(this).click(  function ajaxSend (ext,id_){ 
													if (arguments[1]==undefined) {
															var ext = $(this).html();
															if(ext.substr(ext.length-3)=="zip") ext="zip";
															else if (ext.substr(ext.length-6)=="pkg.gz") ext="pkg.gz";
															else if (ext.substr(ext.length-6)=="tar.gz") ext="tar.gz";
															var id_= $(this).attr("class").substr($(this).attr("class").indexOf("_")+1);
													}		
												$.ajax({
													   			type: "POST",
													   			url: "ajax/counter.php",	
													   			dataType:"html",
													   			data: "id="+id_+"&ext="+ext,		
																  success: function(data){
													   			},
																  error: function(req, err, obj) { 
																            if ((req.status == 0) ) { 																               
																                ajaxSend(ext,id_); 
																            } else { 
																                alert ("Error in Ajax call: " + err + " - " + req.status); 
																 						}
																  }
							 						}); 	
									 });
					 });
					 $('a[@id^="demo_"]').each(function(el) {
													 		$(this).click( function() {
													 			var nom_theme=$(this).attr("id").substr($(this).attr("id").indexOf("demo_")+5);
													 				window.location.href='http://www.7themes.com/dotclear/index.php?theme='+nom_theme;
													 				return false;
													 		});
					});
													
						
		
	});
