/* emoticons.js */
var xmlhttp
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	  try {
	  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
	 } catch (e) {
	  try {
	    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	  } catch (E) {
	   xmlhttp=false
	  }
	 }
	@else
	 xmlhttp=false
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	 try {
	  xmlhttp = new XMLHttpRequest();
	 } catch (e) {
	  xmlhttp=false
	 }
	}
	function myXMLHttpRequest() {
	  var xmlhttplocal;
	  try {
	    xmlhttplocal= new ActiveXObject("Msxml2.XMLHTTP")
	 } catch (e) {
	  try {
	    xmlhttplocal= new ActiveXObject("Microsoft.XMLHTTP")
	  } catch (E) {
	    xmlhttplocal=false;
	  }
	 }

	if (!xmlhttplocal && typeof XMLHttpRequest!='undefined') {
	 try {
	  var xmlhttplocal = new XMLHttpRequest();
	 } catch (e) {
	  var xmlhttplocal=false;
	  alert('couldn\'t create xmlhttp object');
	 }
	}
	return(xmlhttplocal);
}


function getEmoticons(text){
    if(text != ''){
	var url = "/ajax/emoticons.php?text=" + text;
	//alert(url);
	xmlhttp.open("GET", url);
	xmlhttp.onreadystatechange = getEmoticonsResponse;
	xmlhttp.send(null);
    }
}

function getEmoticonsResponse() {
    if(xmlhttp.readyState == 4) {
        commentParsed = xmlhttp.responseText;
        $('#captchaDialogBody').replaceWith(commentParsed);
        //$dialog.html('<div style="margin-left: 10%; margin-right: 10%;"><div style="text-align:left">To post your review:<br><br><div style="font-size: .9em; font-style: italic;" id="captchaDialogBody">'+commentParsed+'</div><br><br>Plese enter the code:</div><div style="float:left; margin-right: 10px;"><img id="captchaCode" src="captcha.php?uuid='+uuid+'" class="captcha" width="115" height="45" /></div><div style="float:left; text-align:left;"><br><input type="text" name="captchaUserInputCode" id="captchaUserInputCode_'+uuid+'" autocomplete="off" /></div></div>');
    }
}

