/*
 * Original Wordpress Plugins Code from:
 * Package-Name: Plurk For Wordpress
 * By http://a.ndri.info thanks to dadan@doeljoni.co.cc
 *
 *
 * Plurk and Kaskus and Mario/Luigi/Yoshi Emoticons for Jquery
 * 2010, by http://dwaan.com email me at me (at) dwaan.com
 *
 *
 * How to use it? Just write something like this on your script
 *
 * $(document).ready(function(){
 *   $("#commentsAnchor").emoticons ({
 *     url:"http://dwaan.com/assets/js/plurk/"
 *   });
 * });
 *
 */
 
jQuery.fn.emoticons = function() { 
	
	var emoticons = {
		'joyful.gif ':/:-\)\)/gi,
		'smile.gif ':/:-\)/gi,
		'grin.gif ':/:D/gi,
		'grin.gif ':/:-D/gi,
		'laugh.gif ':/\(LOL\)/gi,
		'laugh.gif ':/\(lol\)/gi,
		'tongue.gif ':/:-P/gi,
		'tongue.gif ':/:-p/gi,
		'tongue.gif ':/:p/gi,
		'tongue.gif ':/:P/gi,
		'w00t.gif ':/\(woot\)/gi,
		'wink.gif ':/;-\)/gi,
		'surprised.gif ':/:-o/gi,
		'surprised.gif ':/:-O/gi,
		'angry_002.gif ':/X-\(/gi,
		'angry_002.gif ':/x-\(/gi,
		'sad.gif ':/:-\(/gi,
		'sad.gif ':/;-\(/gi,
		'sick.gif ':/:-&amp;/gi,
		'angry.gif ':/\(angry\)/gi,
		'annoyed.gif ':/\(annoyed\)/gi,
		'bye.gif ':/\(bye\)/gi,
		'cool.gif ':/B-\)/gi,
		'cool.gif':/8\)/gi,
		'cozy.gif ':/\(cozy\)/gi,
		'fever.gif  ':/\(sick\)/gi,
		'tired.gif ':/\(:/gi,
		'fingerscrossed.gif ':/\(goodluck\)/gi,
		'gril_toungue.png ':/\(griltongue\)/gi,
		'like_food.gif ':/\(mmm\)/gi,
		'hungry.gif ':/\(hungry\)/gi,
		'listening_music.gif ':/\(music\)/gi,
		'tears.gif ':/\(tears\)/gi,
		'tongue_002.gif ':/\(tongue\)/gi,
		'unsure_002.gif ':/\(unsure\)/gi,
		'wave.gif ':/\(highfive\)/gi,
		'dance.gif ':/\(dance\)/gi,
		'doh.gif ':/\(doh\)/gi,
		'broken_heart.gif ':/\(brokenheart\)/gi,
		'drinking.gif ':/\(drinking\)/gi,
		'girl_kiss.gif ':/\(girlkiss\)/gi,
		'lol.gif ':/\(rofl\)/gi,
		'money.gif ':/\(money\)/gi,
		'rock_n_roll.gif ':/\(rock\)/gi,
		'not_talking.gif ':/\(nottalking\)/gi,
		'party.gif ':/\(party\)/gi,
		'sleeping.gif ':/\(sleeping\)/gi,
		'thinking.gif ':/\(thinking\)/gi,
		'bring_it_on.gif ':/\(bringit\)/gi,
		'worship.gif ':/\(worship\)/gi,
		'applause.gif ':/\(applause\)/gi,
		'nerd.gif ':/8-\)/gi,
		'gym.gif ':/\(gym\)/gi,
		'heart.gif ':/\(heart\)/gi,
		'devil.gif ':/\(devil\)/gi,
		'lmao.gif ':/\(lmao\)/gi,
		'banana_cool.gif ':/\(banana_cool\)/gi,
		'banana_rock.gif ':/\(banana_rock\)/gi,
		'evil_grin.gif ':/\(evil_grin\)/gi,
		'headspin.gif ':/\(headspin\)/gi,
		'heart_beat.gif ':/\(heart_beat\)/gi,
		'ninja.gif ':/\(ninja\)/gi,
		'haha.gif ':/\(haha\)/gi,
		'evilsmirk.gif ':/\(evilsmirk\)/gi,
		'big_eyed.gif ':/\(bigeyes\)/gi,
		'dance_moves.gif ':/\(funkydance\)/gi,
		'idiot.gif ':/\(idiot\)/gi,
		'lonely.gif ':/\(lonely\)/gi,
		'scenic.gif ':/\(scenic\)/gi,
		'silly_couple.gif ':/\(hassle\)/gi,
		'startled.gif ':/\(panic\)/gi,
		'unsure.gif ':/\(okok\)/gi,
		'yupi.gif ':/\(yahoo\)/gi,
		'blush.gif ':/\(blush\)/gi,
		'eyeroll.gif ':/\(eyeroll\)/gi,
		'cry.gif ':/\(cry\)/gi,
		'muhaha.gif ':/\(muhaha\)/gi,
		'taser.gif ':/\(taser\)/gi,
		'banana_ninja.gif ':/\(banana_ninja\)/gi,
		'beer.gif ':/\(beer\)/gi,
		'coffee.gif ':/\(coffee\)/gi,
		'fish_hit.gif ':/\(fish_hit\)/gi,
		'muscle.gif ':/\(muscle\)/gi,
		'smileydance.gif ':/\(smileydance\)/gi,
		'fireworks.gif ':/\(fireworks\)/gi,
		'sundul.gif ':/\(sundul\)/gi,
		'mrenges.gif ':/\(nyengir\)/gi,
		'pertamax.gif ':/\(pertamax\)/gi,
		'cendol.gif':/\(cendol\)/gi,
		'Mario.png':/\(mario\)/gi,
		'Luigi.gif':/\(luigi\)/gi,
		'Yoshi.gif':/\(yoshi\)/gi,
		'wii.jpg':/\(wii\)/gi,
		'dsi.jpg':/\(dsi\)/gi,
		'nintendo.jpg':/\(nintendo\)/gi
	};
	var u = {
		url:"change/your/path/here/or/there/when/you/call/me/"
	};
	
	var o = $(this[0]);
	var s = arguments[0];
	
	if(s) $.extend(u, s);
	
	$.each(emoticons, function(key, value) {
		o.each(function () {
			$(this).html(
				$(this).html().replace(value, '<img src="'+u.url+key+'" width="" height="" />')
			);
		});
	});
};
