	/* ADVANCE COMMENT BOX - BY MODULES2BUY.COM */
    var emoticon_status = 0;
	comment_changed = 0;
	function getXhr(){
	 var xhr = null;
        
        if (window.XMLHttpRequest) {
                xhr = new XMLHttpRequest();
        } else if (window.createRequest) {
                xhr = window.createRequest();
        } else if (window.ActiveXObject) {
                try {
                        xhr = new ActiveXObject('Msxml2.XMLHTTP');
                } catch (e) {
                        try {
                                xhr = new ActiveXObject('Microsoft.XMLHTTP');
                        } catch (e) {}
                }
        }
        
        return xhr;

}
	function change2Edit(display,commentid,music_id)
	{
	
		var musicComment = document.getElementById('music_comments');
		//var editComDiv = document.getElementById('comment_'+display);
		var entryLine 	 = document.getElementById('entry_line_comment_'+display);
		//alert(display);
		var img = document.getElementById('img_edit_'+display);
		var divContent = document.getElementById('profile_comment_body_'+display);
		var html = divContent.innerHTML;
		
		html = reverse_emoticon_yahoo(html);
		//alert(html);
		var formhtml = '<div class="border_emoticon">  ';      
           formhtml+=' <div class="above_emoticon"> ';
           formhtml+='     <div class="fl"> ';
           formhtml+='        <img src="./images/smilies/smiley1.gif" class="icon"  onclick="show_div_emoticon2('+display+')"  border="0" /> ';
           formhtml+='     </div> ';
           formhtml+='     <div class="fl" style="padding-top:3px"> ';
           formhtml+='         <a href="javascript:void(0)" onclick="insert_code_edit2(\'[b]\',\'[/b]\','+display+')"><b>B</b></a> ';
           formhtml+='         <a href="javascript:void(0)" onclick="insert_code_edit2(\'[i]\',\'[/i]\','+display+')"><i>I</i></a> ';
           formhtml+='         <a href="javascript:void(0)" onclick="insert_code_edit2(\'[u]\',\'[/u]\','+display+')"><u>U</u></a> ';
           formhtml+='     </div>    ';
                   
           formhtml+=' </div> ';
           formhtml+='     <div id="div_emoticon_'+display+'" style="display:none" align="left"> ';
           formhtml+='         <script language="javascript"> smile_emoticon2('+display+')</script> ';
           formhtml+='     </div> ';
           formhtml+='     <textarea name=\'comments_body\' id=\'comments_body_'+display+'\' rows=\'3\' cols="84" style=\'color: #000; \' class="textarea_comment">'+html+'</textarea>';
           formhtml+='</div>';
		//divContent.innerHTML = '<textarea id="text_edit_comment_'+display+'">'+html+'</textarea>';
		divContent.innerHTML = formhtml;
		img.src ='./images/save_comment.png';
		img.onclick= new Function("save2Edit('" + display + "','"+commentid+"','"+music_id+"')");
	}
	function reverse_emoticon_yahoo(comment_body)
	{
		comment_body = comment_body.replace(/<br>/g, "\r\n");
		
		//comment_body = comment_body.replace(/'/g, "'");
		//Added for Advance Comment Box - Modules2Buy.Com
		comment_body = comment_body.replace(/<i>/g,"[i]");
		comment_body = comment_body.replace(/<\/i>/g,"[/i]");
		comment_body = comment_body.replace(/<b>/g,"[b]");
		comment_body = comment_body.replace(/<\/b>/g,"[/b]");
		comment_body = comment_body.replace(/<u>/g,"[u]");
		comment_body = comment_body.replace(/<\/u>/g,"[/u]"); 
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/20.gif" alt="crying">/g,":((");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/21.gif" alt="laughing">/g,":))");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/19.gif" alt="devil">/g,"&gt;:)");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/23.gif" alt="raised eyebrows">/g,"/:)");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/100.gif" alt="on the phone">/g,":)]");
			
			
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/2.gif" alt="sad">/g,":(");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/5.gif" alt="batting eyelashes">/g,";;)");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/48.gif" alt="cowboy">/g,"&lt;):)");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/3.gif" alt="winking">/g,";)");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/6.gif" alt="big hug">/g,"&gt;:D&lt;");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/4.gif" alt="big grin">/g,":D");
			
			
			
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/7.gif" alt="confused">/g,":-/");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/8.gif" alt="love struck">/g,":x");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/9.gif" alt="blushing">/g,":&quot;&gt;");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/47.gif" alt="phbbbbt">/g,"&gt;:P");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/10.gif" alt="tongue">/g,":P");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/11.gif" alt="kiss">/g,":-*");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/12.gif" alt="broken heart">/g,"=((");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/13.gif" alt="surprise">/g,":-O");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/102.gif" alt="at wits' end">/g,"~X(");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/14.gif" alt="angry">/g,"X(");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/15.gif" alt="smug">/g,":&gt;");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/16.gif" alt="cool">/g,"B-)");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/18.gif" alt="whew!">/g,"#:-S");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/42.gif" alt="nail biting">/g,":-SS");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/17.gif" alt="worried">/g,":-S");
			

		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/37.gif" alt="yawn">/g,"(:|");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/22.gif" alt="straight face">/g,":|");
			
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/24.gif" alt="rolling on the floor">/g,"=))");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/25.gif" alt="angel">/g,"O:-)");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/26.gif" alt="nerd">/g,":-B");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/27.gif" alt="talk to the hand">/g,"=;");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/101.gif" alt="call me">/g,":-c");
			
			
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/103.gif" alt="wave">/g,":-h");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/104.gif" alt="time out">/g,":-t");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/105.gif" alt="day dreaming">/g,"8-&gt;");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/28.gif" alt="sleepy">/g,"I-)");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/29.gif" alt="rolling eyes">/g,"8-|");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/30.gif" alt="loser">/g,"L-)");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/31.gif" alt="sick">/g,":-&amp;");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/32.gif" alt="don't tell anyone">/g,":-$");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/33.gif" alt="no talking">/g,"[-(");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/34.gif" alt="clown">/g,":O)");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/35.gif" alt="silly">/g,"8-}");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/36.gif" alt="party">/g,"&lt;:-P");
			
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/38.gif" alt="drooling">/g,"=P~");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/39.gif" alt="thinking">/g,":-?");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/40.gif" alt="d'oh">/g,"#-o");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/41.gif" alt="applause">/g,"=D&gt;");
			
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/43.gif" alt="hypnotized">/g,"@-)");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/44.gif" alt="liar">/g,":^o");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/45.gif" alt="waiting">/g,":-w");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/46.gif" alt="sigh">/g,":-&lt;");
			
			
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/109.gif" alt="I don't want to see">/g,"X_X");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/110.gif" alt="hurry up!">/g,":!!");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/111.gif" alt="rock on!">/g,"\\m/");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/112.gif" alt="thumbs down">/g,":-q");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/113.gif" alt="thumbs up">/g,":-bd");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/114.gif" alt="it wasn't me">/g,"^#(^");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/pirate_2.gif" alt="pirate\*">/g,":ar!");
		comment_body = comment_body.replace(/<img src=".\/images\/smiles_yahoo\/1.gif" alt="happy">/g,":)");
		return comment_body;
	}
	function replace_emoticon_yahoo(comment_body)
	{
		comment_body = comment_body.replace(/\r\n/g, "<br>");
		comment_body = comment_body.replace(/\n/g, "<br>");
		//comment_body = comment_body.replace(/'/g, "'");
		//Added for Advance Comment Box - Modules2Buy.Com
		//alert('gsdg');
		comment_body = comment_body.replace(/\[i\]/g,"<\i>");
		comment_body = comment_body.replace(/\[\/i\]/g,"</i>");
		comment_body = comment_body.replace(/\[b\]/g,"<b>");
		comment_body = comment_body.replace(/\[\/b\]/g,"</b>");
		comment_body = comment_body.replace(/\[u\]/g,"<u>");
		comment_body = comment_body.replace(/\[\/u\]/g,"</u>"); 
		comment_body = comment_body.replace(/:\(\(/g,'<img src="./images/smiles_yahoo/20.gif" alt="crying">');
		comment_body = comment_body.replace(/:\)\)/g,'<img src="./images/smiles_yahoo/21.gif" alt="laughing">');
		comment_body = comment_body.replace(/>:\)/g,'<img src="./images/smiles_yahoo/19.gif" alt="devil">');
		comment_body = comment_body.replace(/\/\:\)/g,'<img src="./images/smiles_yahoo/23.gif" alt="raised eyebrows">');
		comment_body = comment_body.replace(/\:\)\]/g,'<img src="./images/smiles_yahoo/100.gif" alt="on the phone">');
						
		comment_body = comment_body.replace(/\:\(/g,'<img src="./images/smiles_yahoo/2.gif" alt="sad">');
		comment_body = comment_body.replace(/\;\;\)/g,'<img src="./images/smiles_yahoo/5.gif" alt="batting eyelashes">');
		comment_body = comment_body.replace(/<\):\)/g,'<img src="./images/smiles_yahoo/48.gif" alt="cowboy">');
		comment_body = comment_body.replace(/\;\)/g,'<img src="./images/smiles_yahoo/3.gif" alt="winking">');
		comment_body = comment_body.replace(/>:D</g,'<img src="./images/smiles_yahoo/6.gif" alt="big hug">');
		comment_body = comment_body.replace(/:D/g,'<img src="./images/smiles_yahoo/4.gif" alt="big grin">');
						
		comment_body = comment_body.replace(/\:\-\//g,'<img src="./images/smiles_yahoo/7.gif" alt="confused">');
		comment_body = comment_body.replace(/:x/g,'<img src="./images/smiles_yahoo/8.gif" alt="love struck">');
		comment_body = comment_body.replace(/\:&quot;\&gt;/g,'<img src="./images/smiles_yahoo/9.gif" alt="blushing">');
		
		
		
		
		comment_body = comment_body.replace(/>:P/g,'<img src="./images/smiles_yahoo/47.gif" alt="phbbbbt">');
		comment_body = comment_body.replace(/:P/g,'<img src="./images/smiles_yahoo/10.gif" alt="tongue">');
		comment_body = comment_body.replace(/\:\-\*/g,'<img src="./images/smiles_yahoo/11.gif" alt="kiss">');
		comment_body = comment_body.replace(/=\(\(/g,'<img src="./images/smiles_yahoo/12.gif" alt="broken heart">');
		comment_body = comment_body.replace(/:-O/g,'<img src="./images/smiles_yahoo/13.gif" alt="surprise">');
		comment_body = comment_body.replace(/\~X\(/g,'<img src="./images/smiles_yahoo/102.gif" alt="at wits&#039 end">');
		comment_body = comment_body.replace(/\X\(/g,'<img src="./images/smiles_yahoo/14.gif" alt="angry">');
		comment_body = comment_body.replace(/:>/g,'<img src="./images/smiles_yahoo/15.gif" alt="smug">');
		comment_body = comment_body.replace(/B-\)/g,'<img src="./images/smiles_yahoo/16.gif" alt="cool">');
		comment_body = comment_body.replace(/\#:-S/g,'<img src="./images/smiles_yahoo/18.gif" alt="whew!">');
		comment_body = comment_body.replace(/\:\-SS/g,'<img src="./images/smiles_yahoo/42.gif" alt="nail biting">');
		comment_body = comment_body.replace(/\:\-S/g,'<img src="./images/smiles_yahoo/17.gif" alt="worried">');
			

		comment_body = comment_body.replace(/\(\:\|/g,'<img src="./images/smiles_yahoo/37.gif" alt="yawn">');
		comment_body = comment_body.replace(/\:\|/g,'<img src="./images/smiles_yahoo/22.gif" alt="straight face">');
			
		comment_body = comment_body.replace(/\=\)\)/g,'<img src="./images/smiles_yahoo/24.gif" alt="rolling on the floor">');
		comment_body = comment_body.replace(/\O\:\-\)/g,'<img src="./images/smiles_yahoo/25.gif" alt="angel">');
		comment_body = comment_body.replace(/:-B/g,'<img src="./images/smiles_yahoo/26.gif" alt="nerd">');
		comment_body = comment_body.replace(/\=\;/g,'<img src="./images/smiles_yahoo/27.gif" alt="talk to the hand">');
		comment_body = comment_body.replace(/:-c/g,'<img src="./images/smiles_yahoo/101.gif" alt="call me">');
			
		//-----------------	
		comment_body = comment_body.replace(/:-h/g,'<img src="./images/smiles_yahoo/103.gif" alt="wave">');
		comment_body = comment_body.replace(/:-t/g,'<img src="./images/smiles_yahoo/104.gif" alt="time out">');
		comment_body = comment_body.replace(/8->/g,'<img src="./images/smiles_yahoo/105.gif" alt="day dreaming">');
		comment_body = comment_body.replace(/\I\-\)/g,'<img src="./images/smiles_yahoo/28.gif" alt="sleepy">');
		comment_body = comment_body.replace(/8-\|/g,'<img src="./images/smiles_yahoo/29.gif" alt="rolling eyes">');
		comment_body = comment_body.replace(/\L\-\)/g,'<img src="./images/smiles_yahoo/30.gif" alt="loser">');
		comment_body = comment_body.replace(/:-&/g,'<img src="./images/smiles_yahoo/31.gif" alt="sick">');
		comment_body = comment_body.replace(/\:-\$/g,'<img src="./images/smiles_yahoo/32.gif" alt="don&#039t tell anyone">');
		comment_body = comment_body.replace(/\[-\(/g,'<img src="./images/smiles_yahoo/33.gif" alt="no talking">');
		comment_body = comment_body.replace(/\:O\)/g,'<img src="./images/smiles_yahoo/34.gif" alt="clown">');
		comment_body = comment_body.replace(/8-}/g,'<img src="./images/smiles_yahoo/35.gif" alt="silly">');
		comment_body = comment_body.replace(/<:-P/g,'<img src="./images/smiles_yahoo/36.gif" alt="party">');
			
		comment_body = comment_body.replace(/\=\P\~/g,'<img src="./images/smiles_yahoo/38.gif" alt="drooling">');
		comment_body = comment_body.replace(/\:\-\?/g,'<img src="./images/smiles_yahoo/39.gif" alt="thinking">');
		comment_body = comment_body.replace(/\#\-\o/g,'<img src="./images/smiles_yahoo/40.gif" alt="d&#039oh">');
		comment_body = comment_body.replace(/\=\D&gt;/g,'<img src="./images/smiles_yahoo/41.gif" alt="applause">');
			
		comment_body = comment_body.replace(/\@\-\)/g,'<img src="./images/smiles_yahoo/43.gif" alt="hypnotized">');
		comment_body = comment_body.replace(/\:\^\o/g,'<img src="./images/smiles_yahoo/44.gif" alt="liar">');
		comment_body = comment_body.replace(/:-w/g,'<img src="./images/smiles_yahoo/45.gif" alt="waiting">');
		comment_body = comment_body.replace(/:-</g,'<img src="./images/smiles_yahoo/46.gif" alt="sigh">');
			
			
		comment_body = comment_body.replace(/X_X/g,'<img src="./images/smiles_yahoo/109.gif" alt="I don&#039t want to see">');
		comment_body = comment_body.replace(/\:\!\!/g,'<img src="./images/smiles_yahoo/110.gif" alt="hurry up!">');
		comment_body = comment_body.replace(/\\m\//g,'<img src="./images/smiles_yahoo/111.gif" alt="rock on!">');
		comment_body = comment_body.replace(/\:\-\q/g,'<img src="./images/smiles_yahoo/112.gif" alt="thumbs down">');
		comment_body = comment_body.replace(/:-bd/g,'<img src="./images/smiles_yahoo/113.gif" alt="thumbs up">');
		comment_body = comment_body.replace(/\^\#\(\^/g,'<img src="./images/smiles_yahoo/114.gif" alt="it wasn&#039t me">');
		comment_body = comment_body.replace(/\:ar\!/g,'<img src="./images/smiles_yahoo/pirate_2.gif" alt="pirate*">');
		comment_body = comment_body.replace(/\:\)/g,'<img src="./images/smiles_yahoo/1.gif" alt="happy">');
		
		
		return comment_body;
	}
	function save2Edit(display,commentid,music_id)
	{
		//alert(display,commentid);
		var img = document.getElementById('img_edit_'+display);
		var content = document.getElementById('comments_body_'+display);
		var divContent = document.getElementById('profile_comment_body_'+display);
		var xhr = getXhr();
		xhr.onreadystatechange = function()
		{
			if(xhr.readyState == 4 && xhr.status == 200)
			{
				try //Internet Explorer
				{
					xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
					xmlDoc.async="false";
					xmlDoc.loadXML(xhr.responseText);
				}
				catch(e)
				{
					try //Firefox, Mozilla, Opera, etc.
					{
					  parser=new DOMParser();
					  xmlDoc=parser.parseFromString(xhr.responseText,"text/xml");
					
					}
					catch(e) {alert(e.message)}
				}
				//alert(xhr.responseText);
				if ( xhr.responseText !='FAIL')
				{
					divContent.innerHTML = replace_emoticon_yahoo(content.value);
					img.src= './images/edit_comment.png';
					img.onclick= new Function("change2Edit('" + display + "','"+commentid+"','"+music_id+"')");
				}
				else
				{
					alert('Error occurs when update this comment');
				}
			}
		}
	    var timestamp = Number(new Date());
		var url = "m2bmusic_player.php";
		var params = "task=update_comment&comment_id="+commentid+"&time="+timestamp+"&comment_body="+encodeURIComponent(content.value)+"&music_id="+music_id;
		xhr.open("POST",url+"?"+params,true);
		xhr.send(params);
		
	}
	function insert_code_2(myValue,display){
		//alert(1);
		myField = document.getElementById('comments_body_'+display);
		//removeText(myField );
		myField.focus();
        comment_changed = 1;
		if (document.selection) {
			myField.focus();
			sel = document.selection.createRange();
			sel.text = myValue;
		}
		//Mozilla/firefox/Netscape 7+ support
		else if (myField.selectionStart || myField.selectionStart == '0') {
			var startPos = myField.selectionStart;
			var endPos = myField.selectionEnd;
			myField.value = myField.value.substring(0, startPos)+ myValue+ myField.value.substring(endPos, myField.value.length);
			myField.setSelectionRange(endPos+myValue.length, endPos+myValue.length);
		} 
		else {
			myField.value += myValue;
		}

	}
	function smile_emoticon2(display){
		html = "";
		html +=	'<img src="./images/smiles_yahoo/1.gif" alt="happy" onclick="insert_code_2(\':) \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/2.gif" alt="sad" onclick="insert_code_2(\':( \'),'+display+'">';
		html +='<img src="./images/smiles_yahoo/3.gif" alt="winking" onclick="insert_code_2(\';) \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/4.gif" alt="big grin" onclick="insert_code_2(\':D \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/5.gif" alt="batting eyelashes" onclick="insert_code_2(\';;) \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/6.gif" alt="big hug" onclick="insert_code_2(\'>:D< \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/7.gif" alt="confused" onclick="insert_code_2(\':-/ \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/8.gif" alt="love struck" onclick="insert_code_2(\':x \','+display+')">';
		//html +=	'<img src="./images/smiles_yahoo/9.gif" alt="blushing" onclick="insert_code_2(\':\"\> \','+display+')">'; 
		html +=	'<img src="./images/smiles_yahoo/10.gif" alt="tongue" onclick="insert_code_2(\':P \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/11.gif" alt="kiss" onclick="insert_code_2(\':-* \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/12.gif" alt="broken heart" onclick="insert_code_2(\'=(( \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/13.gif" alt="surprise" onclick="insert_code_2(\':-O \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/14.gif" alt="angry" onclick="insert_code_2(\'X( \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/15.gif" alt="smug" onclick="insert_code_2(\':> \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/16.gif" alt="cool" onclick="insert_code_2(\'B-) \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/17.gif" alt="worried" onclick="insert_code_2(\':-S \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/18.gif" alt="whew!" onclick="insert_code_2(\'#:-S \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/19.gif" alt="devil" onclick="insert_code_2(\'>:) \','+display+')">';  
		html +=	'<img src="./images/smiles_yahoo/20.gif" alt="crying" onclick="insert_code_2(\':(( \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/21.gif" alt="laughing" onclick="insert_code_2(\':)) \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/22.gif" alt="straight face" onclick="insert_code_2(\':| \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/23.gif" alt="raised eyebrows" onclick="insert_code_2(\'/:) \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/24.gif" alt="rolling on the floor" onclick="insert_code_2(\'=)) \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/25.gif" alt="angel" onclick="insert_code_2(\'O:-) \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/26.gif" alt="nerd" onclick="insert_code_2(\':-B \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/27.gif" alt="talk to the hand" onclick="insert_code_2(\'=; \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/28.gif" alt="sleepy" onclick="insert_code_2(\'I-) \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/29.gif" alt="rolling eyes" onclick="insert_code_2(\'8-| \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/30.gif" alt="loser" onclick="insert_code_2(\'L-) \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/31.gif" alt="sick" onclick="insert_code_2(\':-&amp; \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/32.gif" alt="don&#039t tell anyone" onclick="insert_code_2(\':-$ \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/33.gif" alt="no talking" onclick="insert_code_2(\'[-( \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/34.gif" alt="clown" onclick="insert_code_2(\':O) \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/35.gif" alt="silly" onclick="insert_code_2(\'8-} \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/36.gif" alt="party" onclick="insert_code_2(\'<:-P \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/37.gif" alt="yawn" onclick="insert_code_2(\'(:| \','+display+')">';			
		html +=	'<img src="./images/smiles_yahoo/38.gif" alt="drooling" onclick="insert_code_2(\'=P~ \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/39.gif" alt="thinking" onclick="insert_code_2(\':-? \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/40.gif" alt="d&#039oh" onclick="insert_code_2(\'#-o \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/41.gif" alt="applause" onclick="insert_code_2(\'=D> \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/42.gif" alt="nail biting" onclick="insert_code_2(\':-SS \','+display+')">';	
		html +=	'<img src="./images/smiles_yahoo/43.gif" alt="hypnotized" onclick="insert_code_2(\'@-) \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/44.gif" alt="liar" onclick="insert_code_2(\':^o \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/45.gif" alt="waiting" onclick="insert_code_2(\':-w \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/46.gif" alt="sigh" onclick="insert_code_2(\':-< \','+display+')">';	
		html +=	'<img src="./images/smiles_yahoo/47.gif" alt="phbbbbt" onclick="insert_code_2(\'>:P \','+display+')">';	
		html +=	'<img src="./images/smiles_yahoo/48.gif" alt="cowboy" onclick="insert_code_2(\'<):) \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/100.gif" alt="on the phone" onclick="insert_code_2(\':)] \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/101.gif" alt="call me" onclick="insert_code_2(\':-c \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/102.gif" alt="at wits&#039 end" onclick="insert_code_2(\'~X( \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/103.gif" alt="wave" onclick="insert_code_2(\':-h \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/104.gif" alt="time out" onclick="insert_code_2(\':-t \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/105.gif" alt="day dreaming" onclick="insert_code_2(\'8-> \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/109.gif" alt="I don&#039t want to see" onclick="insert_code_2(\'X_X \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/110.gif" alt="hurry up!" onclick="insert_code_2(\':!! \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/111.gif" alt="rock on!" onclick="insert_code_2(\'\\\\m/ \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/112.gif" alt="thumbs down" onclick="insert_code_2(\':-q \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/113.gif" alt="thumbs up" onclick="insert_code_2(\':-bd \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/114.gif" alt="it wasn&#039t me" onclick="insert_code_2(\'^#(^ \','+display+')">';
		html +=	'<img src="./images/smiles_yahoo/pirate_2.gif" alt="pirate*" onclick="insert_code_2(\':ar! \','+display+')">';
		return html;
	}
	function insert_code_edit2(myValue1,myValue2,display)
    {        
        var myField = document.getElementById('comments_body_'+display);
        
        if (document.selection) {
            theSelection = document.selection.createRange().text;
            if (theSelection) 
            {
                document.selection.createRange().text = myValue1 + theSelection + myValue2;
                myField.focus();
                theSelection = '';
            }
            eval(v+"++;");            
        }
        else
        {
            start_sel = myField.selectionStart;
            end_sel = myField.selectionEnd;
            if((myField.value).substring(start_sel, end_sel) != '')
            {
                myField.value = (myField.value).substring(0, start_sel) + myValue1 + (myField.value).substring(start_sel, end_sel) + myValue2 + (myField.value).substring(end_sel, myField.textLength);
                myField.selectionStart = start_sel;
                myField.selectionEnd = end_sel + (myValue1.length + myValue2.length);
                return;
            }
            else{
                myField.value += myValue1 + myValue2;
            }
        }
    }
	function delete_comment(commentdisplay,commentid)
	{
		//alert('display'+commentdisplay+'com_id'+commentid);
		var xhr = getXhr();
		var musicComment = document.getElementById('music_comments');
		var deleteComDiv = document.getElementById(commentdisplay);
		var entryLine 	 = document.getElementById('entry_line_'+commentdisplay);
		xhr.onreadystatechange = function()
		{
			if(xhr.readyState == 4 && xhr.status == 200)
			{
				try //Internet Explorer
				{
					xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
					xmlDoc.async="false";
					xmlDoc.loadXML(xhr.responseText);
				}
				catch(e)
				{
					try //Firefox, Mozilla, Opera, etc.
					{
					  parser=new DOMParser();
					  xmlDoc=parser.parseFromString(xhr.responseText,"text/xml");
					
					}
					catch(e) {alert(e.message)}
				}
				//alert(xhr.responseText);
				if ( xhr.responseText =='OK')
				{
					musicComment.removeChild(deleteComDiv);
					musicComment.removeChild(entryLine);
				}
				else
				{
					alert('Error occurs when delete this comment');
				}
			}
		}
	    var timestamp = Number(new Date());
		var url = "m2bmusic_player.php";
		var params = "task=delete_comment&comment_id="+commentid+"&time="+timestamp;

		xhr.open("POST",url+"?"+params,true);
		xhr.send(params);
	
	}
	function show_div_emoticon2(display){
        if(emoticon_status){
			var nameEmo = 'div_emoticon_'+display;
            document.getElementById(nameEmo).style.display="none";			
            emoticon_status=0;
        }
        else
		{
			//removeText(document.getElementById('comment_body'));
			//var smile_str  = smile_emoticon();
            document.getElementById('div_emoticon_'+display).style.display="block";
			document.getElementById('div_emoticon_'+display).innerHTML = smile_emoticon2(display);
            emoticon_status=1;
        }
    }
    function show_div_emoticon(){
        if(emoticon_status){
            document.getElementById('div_emoticon').style.display="none";			
            emoticon_status=0;
        }
        else
		{
			//removeText(document.getElementById('comment_body'));
			//var smile_str  = smile_emoticon();
            document.getElementById('div_emoticon').style.display="block";
			document.getElementById('div_emoticon').innerHTML = smile_emoticon();
            emoticon_status=1;
        }
    }
    
    function insert_code2(myValue1,myValue2)
    {        
        var myField = document.getElementById('comments_body');
        
        if (document.selection) {
            theSelection = document.selection.createRange().text;
            if (theSelection) 
            {
                document.selection.createRange().text = myValue1 + theSelection + myValue2;
                myField.focus();
                theSelection = '';
            }
            eval(v+"++;");            
        }
        else
        {
            start_sel = myField.selectionStart;
            end_sel = myField.selectionEnd;
            if((myField.value).substring(start_sel, end_sel) != '')
            {
                myField.value = (myField.value).substring(0, start_sel) + myValue1 + (myField.value).substring(start_sel, end_sel) + myValue2 + (myField.value).substring(end_sel, myField.textLength);
                myField.selectionStart = start_sel;
                myField.selectionEnd = end_sel + (myValue1.length + myValue2.length);
                return;
            }
            else{
                myField.value += myValue1 + myValue2;
            }
        }
    }

    function set_quote_comment(text){
        myField = document.getElementById('comments_body');
        myField.value ="";
        removeText(myField );
        myField.value=text;
    }
	
	function removeText(commentBody) {
	  if(comment_changed == 0) {
		commentBody.value='';
		commentBody.style.color='#000000';
		comment_changed = 1;
	  }
	}
	
	function insert_code(myValue){
		
		myField = document.getElementById('comments_body');
		myField.focus();
		//removeText(myField );
        comment_changed = 1;
		if (document.selection) {
			myField.focus();
			sel = document.selection.createRange();
			sel.text = myValue;
		}
		//Mozilla/firefox/Netscape 7+ support
		else if (myField.selectionStart || myField.selectionStart == '0') {
			var startPos = myField.selectionStart;
			var endPos = myField.selectionEnd;
			myField.value = myField.value.substring(0, startPos)+ myValue+ myField.value.substring(endPos, myField.value.length);
			myField.setSelectionRange(endPos+myValue.length, endPos+myValue.length);
		} 
		else {
			myField.value += myValue;
		}

	}
	
	function smile_emoticon(){
		html = "";
		html +=	'<img src="./images/smiles_yahoo/1.gif" alt="happy" onclick="insert_code(\':) \')">';
		html +=	'<img src="./images/smiles_yahoo/2.gif" alt="sad" onclick="insert_code(\':( \')">';
		html +='<img src="./images/smiles_yahoo/3.gif" alt="winking" onclick="insert_code(\';) \')">';
		html +=	'<img src="./images/smiles_yahoo/4.gif" alt="big grin" onclick="insert_code(\':D \')">';
		html +=	'<img src="./images/smiles_yahoo/5.gif" alt="batting eyelashes" onclick="insert_code(\';;) \')">';
		html +=	'<img src="./images/smiles_yahoo/6.gif" alt="big hug" onclick="insert_code(\'>:D< \')">';
		html +=	'<img src="./images/smiles_yahoo/7.gif" alt="confused" onclick="insert_code(\':-/ \')">';
		html +=	'<img src="./images/smiles_yahoo/8.gif" alt="love struck" onclick="insert_code(\':x \')">';
		//html +=	'<img src="./images/smiles_yahoo/9.gif" alt="blushing" onclick="insert_code(\':\"\> \')">'; 
		html +=	'<img src="./images/smiles_yahoo/10.gif" alt="tongue" onclick="insert_code(\':P \')">';
		html +=	'<img src="./images/smiles_yahoo/11.gif" alt="kiss" onclick="insert_code(\':-* \')">';
		html +=	'<img src="./images/smiles_yahoo/12.gif" alt="broken heart" onclick="insert_code(\'=(( \')">';
		html +=	'<img src="./images/smiles_yahoo/13.gif" alt="surprise" onclick="insert_code(\':-O \')">';
		html +=	'<img src="./images/smiles_yahoo/14.gif" alt="angry" onclick="insert_code(\'X( \')">';
		html +=	'<img src="./images/smiles_yahoo/15.gif" alt="smug" onclick="insert_code(\':> \')">';
		html +=	'<img src="./images/smiles_yahoo/16.gif" alt="cool" onclick="insert_code(\'B-) \')">';
		html +=	'<img src="./images/smiles_yahoo/17.gif" alt="worried" onclick="insert_code(\':-S \')">';
		html +=	'<img src="./images/smiles_yahoo/18.gif" alt="whew!" onclick="insert_code(\'#:-S \')">';
		html +=	'<img src="./images/smiles_yahoo/19.gif" alt="devil" onclick="insert_code(\'>:) \')">';  
		html +=	'<img src="./images/smiles_yahoo/20.gif" alt="crying" onclick="insert_code(\':(( \')">';
		html +=	'<img src="./images/smiles_yahoo/21.gif" alt="laughing" onclick="insert_code(\':)) \')">';
		html +=	'<img src="./images/smiles_yahoo/22.gif" alt="straight face" onclick="insert_code(\':| \')">';
		html +=	'<img src="./images/smiles_yahoo/23.gif" alt="raised eyebrows" onclick="insert_code(\'/:) \')">';
		html +=	'<img src="./images/smiles_yahoo/24.gif" alt="rolling on the floor" onclick="insert_code(\'=)) \')">';
		html +=	'<img src="./images/smiles_yahoo/25.gif" alt="angel" onclick="insert_code(\'O:-) \')">';
		html +=	'<img src="./images/smiles_yahoo/26.gif" alt="nerd" onclick="insert_code(\':-B \')">';
		html +=	'<img src="./images/smiles_yahoo/27.gif" alt="talk to the hand" onclick="insert_code(\'=; \')">';
		html +=	'<img src="./images/smiles_yahoo/28.gif" alt="sleepy" onclick="insert_code(\'I-) \')">';
		html +=	'<img src="./images/smiles_yahoo/29.gif" alt="rolling eyes" onclick="insert_code(\'8-| \')">';
		html +=	'<img src="./images/smiles_yahoo/30.gif" alt="loser" onclick="insert_code(\'L-) \')">';
		html +=	'<img src="./images/smiles_yahoo/31.gif" alt="sick" onclick="insert_code(\':-&amp; \')">';
		html +=	'<img src="./images/smiles_yahoo/32.gif" alt="don&#039t tell anyone" onclick="insert_code(\':-$ \')">';
		html +=	'<img src="./images/smiles_yahoo/33.gif" alt="no talking" onclick="insert_code(\'[-( \')">';
		html +=	'<img src="./images/smiles_yahoo/34.gif" alt="clown" onclick="insert_code(\':O) \')">';
		html +=	'<img src="./images/smiles_yahoo/35.gif" alt="silly" onclick="insert_code(\'8-} \')">';
		html +=	'<img src="./images/smiles_yahoo/36.gif" alt="party" onclick="insert_code(\'<:-P \')">';
		html +=	'<img src="./images/smiles_yahoo/37.gif" alt="yawn" onclick="insert_code(\'(:| \')">';			
		html +=	'<img src="./images/smiles_yahoo/38.gif" alt="drooling" onclick="insert_code(\'=P~ \')">';
		html +=	'<img src="./images/smiles_yahoo/39.gif" alt="thinking" onclick="insert_code(\':-? \')">';
		html +=	'<img src="./images/smiles_yahoo/40.gif" alt="d&#039oh" onclick="insert_code(\'#-o \')">';
		html +=	'<img src="./images/smiles_yahoo/41.gif" alt="applause" onclick="insert_code(\'=D> \')">';
		html +=	'<img src="./images/smiles_yahoo/42.gif" alt="nail biting" onclick="insert_code(\':-SS \')">';	
		html +=	'<img src="./images/smiles_yahoo/43.gif" alt="hypnotized" onclick="insert_code(\'@-) \')">';
		html +=	'<img src="./images/smiles_yahoo/44.gif" alt="liar" onclick="insert_code(\':^o \')">';
		html +=	'<img src="./images/smiles_yahoo/45.gif" alt="waiting" onclick="insert_code(\':-w \')">';
		html +=	'<img src="./images/smiles_yahoo/46.gif" alt="sigh" onclick="insert_code(\':-< \')">';	
		html +=	'<img src="./images/smiles_yahoo/47.gif" alt="phbbbbt" onclick="insert_code(\'>:P \')">';	
		html +=	'<img src="./images/smiles_yahoo/48.gif" alt="cowboy" onclick="insert_code(\'<):) \')">';
		html +=	'<img src="./images/smiles_yahoo/100.gif" alt="on the phone" onclick="insert_code(\':)] \')">';
		html +=	'<img src="./images/smiles_yahoo/101.gif" alt="call me" onclick="insert_code(\':-c \')">';
		html +=	'<img src="./images/smiles_yahoo/102.gif" alt="at wits&#039 end" onclick="insert_code(\'~X( \')">';
		html +=	'<img src="./images/smiles_yahoo/103.gif" alt="wave" onclick="insert_code(\':-h \')">';
		html +=	'<img src="./images/smiles_yahoo/104.gif" alt="time out" onclick="insert_code(\':-t \')">';
		html +=	'<img src="./images/smiles_yahoo/105.gif" alt="day dreaming" onclick="insert_code(\'8-> \')">';
		html +=	'<img src="./images/smiles_yahoo/109.gif" alt="I don&#039t want to see" onclick="insert_code(\'X_X \')">';
		html +=	'<img src="./images/smiles_yahoo/110.gif" alt="hurry up!" onclick="insert_code(\':!! \')">';
		html +=	'<img src="./images/smiles_yahoo/111.gif" alt="rock on!" onclick="insert_code(\'\\\\m/ \')">';
		html +=	'<img src="./images/smiles_yahoo/112.gif" alt="thumbs down" onclick="insert_code(\':-q \')">';
		html +=	'<img src="./images/smiles_yahoo/113.gif" alt="thumbs up" onclick="insert_code(\':-bd \')">';
		html +=	'<img src="./images/smiles_yahoo/114.gif" alt="it wasn&#039t me" onclick="insert_code(\'^#(^ \')">';
		html +=	'<img src="./images/smiles_yahoo/pirate_2.gif" alt="pirate*" onclick="insert_code(\':ar! \')">';
		return html;
	}

