$(function(){

$("input:radio[@name=for]").change(function() {
		
		var checkedvalue = $(this).val();
		
	    switch(checkedvalue)
	    {
	    	case 'songs':
	    		$("#inputString").unautocomplete();
		    	$("#inputString").autocomplete('js/lib-autocomplete/mysearch.php', {
		    		width: 237,
		    		scrollHeight: 220,
		    		autoFill: false,
		    		delay: 0,
		    		max: 6,
		    		multiple: false,
		    		cacheLength: 1,
		    		matchContains: true		
		    	});
		    	//$('#inputString').flushCache();
		    break;

	    	case 'albums':
	    		$("#inputString").unautocomplete();	    		    	
		    	$("#inputString").autocomplete('js/lib-autocomplete/albums.php', {
		    		width: 237,
		    		scrollHeight: 220,
		    		autoFill: false,
		    		delay: 0,
		    		max: 6,
		    		multiple: false,
		    		cacheLength: 1,
		    		matchContains: true		
		    	});
		    	//$('#inputString').flushCache();
		    break;

	    	case 'clips':
	    		$("#inputString").unautocomplete();	    		    	
		    	$("#inputString").autocomplete('js/lib-autocomplete/clips.php', {
		    		width: 237,
		    		scrollHeight: 220,
		    		autoFill: false,
		    		delay: 0,
		    		max: 6,
		    		multiple: false,
		    		cacheLength: 1,
		    		matchContains: true		
		    	});
		    	//$('#inputString').flushCache();
		    break;

	    	case 'lyrics':
	    		$("#inputString").unautocomplete();	    		    	
		    	$("#inputString").autocomplete('js/lib-autocomplete/lyrics.php', {
		    		width: 237,
		    		scrollHeight: 220,
		    		autoFill: false,
		    		delay: 0,
		    		max: 6,
		    		multiple: false,
		    		cacheLength: 1,
		    		matchContains: true		
		    	});
		    	//$('#inputString').flushCache();
		    break;	
	    }
});

});