   function xss_ajax(url) {    var email = '';    if (document.getElementById('addRatingAddARatingCreateForm:email') != null) {       email = escape(document.getElementById('addRatingAddARatingCreateForm:email').value);    }    url = url + '&name=' + escape(document.getElementById('name').value);    url = url + '&review=' + escape(document.getElementById('addRatingAddARatingCreateForm:review').value);    url = url + '&rating=' + escape(document.getElementById('addRatingAddARatingCreateForm:myRating').value);    url = url + '&email=' + email;    url = url + '&namePer=' + escape(document.getElementById('addRatingAddARatingCreateForm:myNamePermission').value);    url = url + '&commPer=' + escape(document.getElementById('addRatingAddARatingCreateForm:myCommentsPermission').value);     var script_id = null;    var script = document.createElement('script');    script.setAttribute('type', 'text/javascript');    script.setAttribute('src', url);    script.setAttribute('id', 'script_id');    script_id = document.getElementById('script_id');    if (script_id) {      document.getElementsByTagName('head')[0].removeChild(script_id);    }    document.getElementsByTagName('head')[0].appendChild(script);  }  function submitAndDisplay() {   if (verify()) {    xss_ajax('http://www.dentalratingsnetwork.com/myofficeratings/submitratingform?id=VU5lAOULNRACBe1');  } else { 	alert('Errors on page');  }  }  function callback(txt) {  		document.getElementById("drn_div").innerHTML = txt; }  var array_size = 5;  function getRandomNumber() { 	return Math.floor(Math.random()*array_size);  }  var image_array = new Array(array_size);  image_array[0] = 'teeth';  image_array[1] = 'dentist';  image_array[2] = 'brush';  image_array[3] = 'smile';  image_array[4] = 'floss';  var image_name = image_array[getRandomNumber()];  function verify() {   problemFound = false;   if ((document.getElementById('addRatingAddARatingCreateForm:myRating').value == null) ||       (document.getElementById('addRatingAddARatingCreateForm:myRating').value == '')) {     setWarningVisible('myRatingMessage', true);     problemFound = true;  } else {     setVisible('myRatingMessage', false);   }   if ((document.getElementById('addRatingAddARatingCreateForm:myNamePermission').value == null) ||       (document.getElementById('addRatingAddARatingCreateForm:myNamePermission').value == '')) {     setWarningVisible('myNamePermissionMessage', true);     problemFound = true;  } else {     setVisible('myNamePermissionMessage', false);   }   if ((document.getElementById('addRatingAddARatingCreateForm:myCommentsPermission').value == null) ||       (document.getElementById('addRatingAddARatingCreateForm:myCommentsPermission').value == '')) {     setWarningVisible('myCommentsPermissionMessage', true);     problemFound = true;  } else {     setVisible('myCommentsPermissionMessage', false);   }   if ((document.getElementById('addRatingAddARatingCreateForm:review').value == null) ||       (document.getElementById('addRatingAddARatingCreateForm:review').value == '')) {     setWarningVisible('myCommentsMessage', true);     problemFound = true;  } else {     setVisible('myCommentsMessage', false);   }   if (document.getElementById('addRatingAddARatingCreateForm:myVerifyText').value != image_name) { 	 image_name = image_array[getRandomNumber()]; 	 document.getElementById('addRatingAddARatingCreateForm:myVerifyImage').src= "http://www.dentalratingsnetwork.com/images/formverify/" + image_name + ".jpg";     setWarningVisible('myVerifyMessage', true);     problemFound = true;  } else {     setVisible('myVerifyMessage', false);   }   if (problemFound) {    return false;   }   return true; }  function changeStars(starNum, commit) {   if (starNum == 1) {     document.getElementById('addRatingAddARatingCreateForm:star1').src='http://www.dentalratingsnetwork.com/images/singleyellowstar.png';     document.getElementById('addRatingAddARatingCreateForm:star2').src='http://www.dentalratingsnetwork.com/images/singlewhitestar.png';     document.getElementById('addRatingAddARatingCreateForm:star3').src='http://www.dentalratingsnetwork.com/images/singlewhitestar.png';     document.getElementById('addRatingAddARatingCreateForm:star4').src='http://www.dentalratingsnetwork.com/images/singlewhitestar.png';     document.getElementById('addRatingAddARatingCreateForm:star5').src='http://www.dentalratingsnetwork.com/images/singlewhitestar.png';     if (commit) {       document.getElementById('addRatingAddARatingCreateForm:myRating').value='1';     }   }   if (starNum == 2) {     document.getElementById('addRatingAddARatingCreateForm:star1').src='http://www.dentalratingsnetwork.com/images/singleyellowstar.png';     document.getElementById('addRatingAddARatingCreateForm:star2').src='http://www.dentalratingsnetwork.com/images/singleyellowstar.png';     document.getElementById('addRatingAddARatingCreateForm:star3').src='http://www.dentalratingsnetwork.com/images/singlewhitestar.png';     document.getElementById('addRatingAddARatingCreateForm:star4').src='http://www.dentalratingsnetwork.com/images/singlewhitestar.png';     document.getElementById('addRatingAddARatingCreateForm:star5').src='http://www.dentalratingsnetwork.com/images/singlewhitestar.png';     if (commit) {      document.getElementById('addRatingAddARatingCreateForm:myRating').value='2';     }   }   if (starNum == 3) {     document.getElementById('addRatingAddARatingCreateForm:star1').src='http://www.dentalratingsnetwork.com/images/singleyellowstar.png';     document.getElementById('addRatingAddARatingCreateForm:star2').src='http://www.dentalratingsnetwork.com/images/singleyellowstar.png';     document.getElementById('addRatingAddARatingCreateForm:star3').src='http://www.dentalratingsnetwork.com/images/singleyellowstar.png';     document.getElementById('addRatingAddARatingCreateForm:star4').src='http://www.dentalratingsnetwork.com/images/singlewhitestar.png';     document.getElementById('addRatingAddARatingCreateForm:star5').src='http://www.dentalratingsnetwork.com/images/singlewhitestar.png';     if (commit) {      document.getElementById('addRatingAddARatingCreateForm:myRating').value='3';     }   }   if (starNum == 4) {     document.getElementById('addRatingAddARatingCreateForm:star1').src='http://www.dentalratingsnetwork.com/images/singleyellowstar.png';     document.getElementById('addRatingAddARatingCreateForm:star2').src='http://www.dentalratingsnetwork.com/images/singleyellowstar.png';     document.getElementById('addRatingAddARatingCreateForm:star3').src='http://www.dentalratingsnetwork.com/images/singleyellowstar.png';     document.getElementById('addRatingAddARatingCreateForm:star4').src='http://www.dentalratingsnetwork.com/images/singleyellowstar.png';     document.getElementById('addRatingAddARatingCreateForm:star5').src='http://www.dentalratingsnetwork.com/images/singlewhitestar.png';     if (commit) {      document.getElementById('addRatingAddARatingCreateForm:myRating').value='4';     }   }   if (starNum == 5) {     document.getElementById('addRatingAddARatingCreateForm:star1').src='http://www.dentalratingsnetwork.com/images/singleyellowstar.png';     document.getElementById('addRatingAddARatingCreateForm:star2').src='http://www.dentalratingsnetwork.com/images/singleyellowstar.png';     document.getElementById('addRatingAddARatingCreateForm:star3').src='http://www.dentalratingsnetwork.com/images/singleyellowstar.png';     document.getElementById('addRatingAddARatingCreateForm:star4').src='http://www.dentalratingsnetwork.com/images/singleyellowstar.png';     document.getElementById('addRatingAddARatingCreateForm:star5').src='http://www.dentalratingsnetwork.com/images/singleyellowstar.png';     if (commit) {      document.getElementById('addRatingAddARatingCreateForm:myRating').value='5';     }   }  }  function setPermission(permissionType, val) {   if (permissionType == 'name') {    document.getElementById('addRatingAddARatingCreateForm:myNamePermission').value=val;   }   if (permissionType == 'comments') {    document.getElementById('addRatingAddARatingCreateForm:myCommentsPermission').value=val;   }  }    /* -----------------------------------------------  Floating layer - v.1  (c) 2006 www.haan.net  contact: jeroen@haan.net  ------------------------------------------------ */  function setVisible(obj, yesno) {   obj = document.getElementById(obj);   if (yesno) {    obj.style.visibility = 'visible';    obj.style.display = 'block';   } else {    obj.style.visibility = 'hidden';    obj.style.display = 'none';   }  }  function setWarningVisible(obj, yesno) {   setVisible(obj, yesno);   obj = document.getElementById(obj);   obj.style.color = 'red';  }  var style = "";if(typeof(drn_ratings_font_family) != "undefined"){ if (drn_ratings_font_family != '') {   style = style + "font-family: " + drn_ratings_font_family + ";";}}if(typeof(drn_ratings_font_size) != "undefined"){ if (drn_ratings_font_size != '') {   style = style + "font-size: " + drn_ratings_font_size + ";";}}document.write("<form id=\"addRatingAddARatingCreateForm\"> <input type=\"hidden\" id=\"addRatingAddARatingCreateForm:myRating\" name=\"addRatingAddARatingCreateForm:myRating\"> <input type=\"hidden\" id=\"addRatingAddARatingCreateForm:myNamePermission\" name=\"addRatingAddARatingCreateForm:myNamePermission\"> <input type=\"hidden\" id=\"addRatingAddARatingCreateForm:myCommentsPermission\" name=\"addRatingAddARatingCreateForm:myCommentsPermission\"> <div border=\"1\" id=\"drn_div\" style=\"" + style + "\"> <table style=\"" + style + "\"><tr><th>Rating:</th><td><span style=\"padding: 0 5px 0 0; font-size: 10px;\">POOR</span><img id=\"addRatingAddARatingCreateForm:star1\" src=\"http://www.dentalratingsnetwork.com/images/singlewhitestar.png\" onmouseover=\"changeStars(1, false);\" onclick=\"changeStars(1, true);\" style=\"border:none;\"><img id=\"addRatingAddARatingCreateForm:star2\" src=\"http://www.dentalratingsnetwork.com/images/singlewhitestar.png\" onmouseover=\"changeStars(2, false);\" onclick=\"changeStars(2, true);\" style=\"border:none;\"><img id=\"addRatingAddARatingCreateForm:star3\" src=\"http://www.dentalratingsnetwork.com/images/singlewhitestar.png\" onmouseover=\"changeStars(3, false);\" onclick=\"changeStars(3, true);\" style=\"border:none;\"><img id=\"addRatingAddARatingCreateForm:star4\" src=\"http://www.dentalratingsnetwork.com/images/singlewhitestar.png\" onmouseover=\"changeStars(4, false);\" onclick=\"changeStars(4, true);\" style=\"border:none;\"><img id=\"addRatingAddARatingCreateForm:star5\" src=\"http://www.dentalratingsnetwork.com/images/singlewhitestar.png\" onmouseover=\"changeStars(5, false);\" onclick=\"changeStars(5, true);\" style=\"border:none;\"><span style=\"padding: 0 5px 0 0; font-size: 10px;\">EXCELLENT</span><br/><span style=\"padding: 0 0 0 0;\">(Mouse over and click on a star to select your rating. This is required)</span><div class=\"errorMessage\" id=\"myRatingMessage\" style=\"display: none; visibility: hidden;\">Please rate this office.</div></td></tr><tr><th valign=\"top\">Comments:</th><td>Please write a comment that explains the Rating you selected above. If you give your permission, we may post your comments on Idlewild Family Dentistry's website and on public review sites such as <a href=\"http://www.rateadentist.com\">www.rateadentist.com</a>, so please DO NOT include any personal or medical information in your comments.<p/><textarea cols=\"40\" rows=\"5\" id=\"addRatingAddARatingCreateForm:review\"></textarea>   <div class=\"errorMessage\" id=\"myCommentsMessage\" style=\"display: none; visibility: hidden;\">Please enter a comment.</div></td></tr><tr><td></td><td>   <input type=\"radio\" name=\"addRatingAddARatingCreateForm:myCommentsPermissionRadio\" value=\"true\" onclick=\"setPermission('comments',this.value);\">&#160;I give my permission for these comments to be published online.<br/>    <input type=\"radio\" name=\"addRatingAddARatingCreateForm:myCommentsPermissionRadio\" value=\"false\" onclick=\"setPermission('comments',this.value);\">&#160;DO NOT publish these comments - they are private, to my dentist's office only.    <div class=\"errorMessage\" id=\"myCommentsPermissionMessage\" style=\"display: none; visibility: hidden;\">Please either grant or deny permission to use your comments.</div></td></tr> <tr><th nowrap>Your Email:</th><td><input type=\"text\" id=\"addRatingAddARatingCreateForm:email\"></td></tr><tr><th nowrap valign=\"top\">Your Name:</th><td><input type=\"text\" id=\"name\"><br/>(This is how your name will appear online, if you give us permission to display it. Leave blank for \"Anonymous\")</td></tr><tr><td></td><td>   <input type=\"radio\" name=\"addRatingAddARatingCreateForm:myNamePermissionRadio\" value=\"true\" onclick=\"setPermission('name',this.value);\">&#160;I give my permission for my name / initials to be published online with my comments.<br/>    <input type=\"radio\" name=\"addRatingAddARatingCreateForm:myNamePermissionRadio\" value=\"false\" onclick=\"setPermission('name',this.value);\">&#160;DO NOT publish my name or initials - only my dentist's office may see them.    <div class=\"errorMessage\" id=\"myNamePermissionMessage\" style=\"display: none; visibility: hidden;\">Please either grant or deny permission to use your name.</div></td></tr> <tr><td></td><td>Authentication:<br/><div style=\"border: 1px solid #000000; width:400px; height: 100px; padding: 5px;\"> <img id=\"addRatingAddARatingCreateForm:myVerifyImage\" style=\"float: left; border: 1px solid #AAAAAA;\" />  <div style=\"padding: 5px 5px 5px 215px;\">  Please enter the characters in the image on the left in the box below.   <br/>  <br/>  <input type=\"text\" id=\"addRatingAddARatingCreateForm:myVerifyText\"/> </div></div>   <div class=\"errorMessage\" id=\"myVerifyMessage\" style=\"display: none; visibility: hidden;\">Please enter the word in the image above.</div></td></tr> <tr><td colspan=\"2\"> <input type=\"button\" value=\"Submit\" onclick=\"submitAndDisplay();\"> </td></tr></table></div></form> <script> currentval = document.getElementById('addRatingAddARatingCreateForm:myRating').value;  changeStars(currentval, true);  document.getElementById('addRatingAddARatingCreateForm:myVerifyImage').src= \"http://www.dentalratingsnetwork.com/images/formverify/\" + image_name + \".jpg\"; </script> ");