	/* ADVANCE COMMENT BOX - BY MODULES2BUY.COM */
    var emoticon_status = 0;
	comment_changed = 0;
	
    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('comment_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('comment_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('comment_body');
		//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;
	}

