(function($){
	jQuery('html').themeshortcode({
		id							: 'addlist',
		title 						: 'Webhosty List',			
		image						: 'iconbutton.png',
		showWindow					: true,	
		fields						: [ {type : 'textarea', name : 'Point With Square[]', id: 'list'},{type : 'select', name : 'List', id : 'icon' , option : ['unorder','arrow']}]
	}, 
	function(ed, url, options) 
	{
		var icon = jQuery('#'+options.pluginprefix + 'icon').val();
				
			var list = jQuery('#'+options.pluginprefix + 'list').val(); 
			list = list.match(/[^[\]]+(?=])/g);
			
			if(icon=='unorder')
			{
			var html = '<ul class="webhosty_ul">';
	         }
			 if(icon=='order')
			{
			var html = '<ol class="list-i">';  
	         }
			if(icon=='arrow') 
			{ 
			var html = '<ul class="list_check">';
	         }
			 
			for(var i =0;i<list.length;i++){ 
				html += '<li>'+list[i]+'</li>';
			}
			if(icon=='unorder')
			{
			html += '</ul>';
	         } 
			 if(icon=='arrow')
			{
			html += '</ul>';
	         } 
			  
		
		ed.execCommand('mceInsertContent', false, html);
	});
})(jQuery);