jQuery.extend({
    csv: function(delim, quote, linedelim) {
        delim = typeof delim == "string" ? new RegExp( "[" + (delim || ","   ) + "]" ) : typeof delim == "undefined" ? ","    : delim;
        quote = typeof quote == "string" ? new RegExp("^[" + (quote || '"'   ) + "]" ) : typeof quote == "undefined" ? '"'    : quote;
        lined = typeof lined == "string" ? new RegExp( "[" + (lined || "\n") + "]+") : typeof lined == "undefined" ? "\n" : lined;

        function splitline (v) {
            // Split the line using the delimitor
            var arr  = v.split(delim),
                out = [], q;
            for (var i=0, l=arr.length; i<l; i++) {
                if (q = arr[i].match(quote)) {
                    for (j=i; j<l; j++) {
                        if (arr[j].charAt(arr[j].length-1) == q[0]) { break; }
                    }
                    var s = arr.slice(i,j+1).join(delim);
                    out.push(s.substr(1,s.length-2));
                    i = j;
                }
                else { out.push(arr[i]); }
            }

            return out;
        }

        return function(text) {
            var lines = text.split(lined);
            for (var i=0, l=lines.length; i<l; i++) {
                lines[i] = splitline(lines[i]);
            }
            return lines;
        };
    }
});

function loadCSVFile(csvUrl)
{
csvUrl = "/wp/wp-content/themes/wordzine/proxy.php";

 $('#loading').fadeIn(); 
 $('.tableContent').find("tr:gt(0)").remove();
 $.get(csvUrl, function(data) { 
	var ary = $.csv() (data); 
	console.log(ary);
	$.each(ary, function() {
		var row = String(this).split(",");
		if (row[0] != "")
			$('.tableContent').append('<tr><td align="left">' + row[0] + '</td><td align="center">' + row[1] + '</td><td align="right">' + row[2] + '</td></tr>');
	});
	$('.tableContent tr:odd').css('background-color', '#ffc');
	});
 $('#loading').fadeOut();	
}