function getCode(type, container, keywords){
	$.getJSON( "index.php?sales&getcode&" + id + "&" + type, function( data ) {
		$('#'+container).html(data).each(function(i, e) {hljs.highlightBlock(e)});
	});
}

$(function () {

	$('#url_code').each(function(i, e) {hljs.highlightBlock(e)});

	getCode($('#js_select').val(), 'js_code', '');
	$('#js_select').change(function() {
		getCode($('#js_select').val(), 'js_code', '');
	});

	getCode($('#php_select').val(), 'php_code', '');
	$('#php_select').change(function() {
		getCode($('#php_select').val(), 'php_code', '');
	});

});