		var basepath="";
		
		function fillstars(scoreElement, score){
			for(i=1;i<=10;i++){
			    document.getElementById("star"+scoreElement+i).src=basepath+"/images/star_off.png";
			}
			for(i=1;i<=parseInt(score);i++){
			    document.getElementById("star"+scoreElement+i).src=basepath+"/images/star_on.png";
			}
			document.getElementById(scoreElement).value=score;
		}

		function removestars(scoreElement){
			for(i=1;i<=10;i++){
			    document.getElementById("star"+scoreElement+i).src=basepath+"/images/star_off.png";
			}
			if(getValue(scoreElement)!=0){
				for(i=1;i<=parseInt(getValue(scoreElement));i++){
				    document.getElementById("star"+scoreElement+i).src=basepath+"/images/star_on.png";
				}
			}
		}

		function showstars(scoreElement, score){
			for(i=1;i<=10;i++){
			    document.getElementById("star"+scoreElement+i).src=basepath+"/images/star_off.png";
			}
			for(i=1;i<=parseInt(score);i++){
			    document.getElementById("star"+scoreElement+i).src=basepath+"/images/star_on.png";
			}
		}

		function fillclass(scoreElement, score){
			for(i=1;i<=5;i++){
			    document.getElementById("star"+scoreElement+i).src=basepath+"/images/star_off.png";
			}
			for(i=1;i<=parseInt(score);i++){
			    document.getElementById("star"+scoreElement+i).src=basepath+"/images/star_on.png";
			}
			document.getElementById(scoreElement).value=score;
		}

		function showclass(scoreElement, score){
			for(i=1;i<=5;i++){
			    document.getElementById("star"+scoreElement+i).src=basepath+"/images/star_off.png";
			}
			for(i=1;i<=parseInt(score);i++){
			    document.getElementById("star"+scoreElement+i).src=basepath+"/images/star_on.png";
			}
		}

		function removeclass(scoreElement){
			for(i=1;i<=5;i++){
			    document.getElementById("star"+scoreElement+i).src=basepath+"/images/star_off.png";
			}
			if(getValue(scoreElement)!=0){
				for(i=1;i<=parseInt(getValue(scoreElement));i++){
				    document.getElementById("star"+scoreElement+i).src=basepath+"/images/star_on.png";
				}
			}
		}
		
		function chkReview(){
			  if(getValue("Name")==""){
			    alert("Please fill in your name");
			    document.getElementById("Name").blur();
			    document.getElementById("Name").focus();
			    return false;
			  }
			  if(!chkEmail(getValue("Email"))){
			    document.getElementById("Email").blur();
			    document.getElementById("Email").focus();
			    return false;
			  }
			  if(getValue("Comment")=="" || CountWords(getValue("Comment"))<5){
			    alert("Please give a review of at least 20 words.");
			    document.getElementById("Comment").blur();
			    document.getElementById("Comment").focus();
			    return false;
			  }
			  if(getValue("Captcha")==""){
			    alert("Please type in the code from the image.");
			    document.getElementById("Captcha").blur();
			    document.getElementById("Captcha").focus();
			    return false;
			  }
			  if(getValue("Rooms")=="0" || getValue("Service")=="0" || getValue("Style")=="0" || getValue("Food")=="0" || getValue("Friendly")=="0" || getValue("Price")=="0" || getValue("Overall")=="0"){
			    alert("Please complete your review");
			    return false;
			  }
			  return true;
		}
		
		function getValue(elemName) {
		  var myType = document.getElementById(elemName).type;
		  if (myType == 'checkbox') {
			if (document.getElementById(elemName).checked) {
				return "1";
			} else {
				return "0";
			}
		  }
		  if (myType == 'password' || myType == 'text' || myType == 'hidden' || myType == 'textarea') {
			return(document.getElementById(elemName).value);
		  }
		  if (myType == 'select-one') {
			return document.getElementById(elemName).options[document.getElementById(elemName).selectedIndex].value;
		  }	
		  return(document.getElementById(elemName).value);
		}

		function chkEmail(a) {
		  var supported = 0;
		  var result=true;
		  if (window.RegExp) {
		    var tempStr = "a";
		    var tempReg = new RegExp(tempStr);
		    if (tempReg.test(tempStr)) supported = 1;
		  }
		  if (!supported)
		    result=(a.indexOf(".") > 2) && (str.indexOf("@") > 0);
		    if(!result){
			alert("Your e-mail address is not correct.");
			return false;
		    }
		  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
		  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
		  result=(!r1.test(a) && r2.test(a));
		  if(!result){
			alert("Your e-mail address is not correct.");
			return false;
		  }
		  return true;
		}

		function CountWords (text) {
			var fullStr = text + " ";
			var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi;
			var left_trimmedStr = fullStr.replace(initial_whitespace_rExp, "");
			var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi;
			var cleanedStr = left_trimmedStr.replace(non_alphanumerics_rExp, " ");
			var splitString = cleanedStr.split(" ");
			var word_count = splitString.length -1;
			if (fullStr.length <2) {
			word_count = 0;
			}
			return word_count;
		}

		function chkTellaFriend(){
			  if(getValue("tellText")==""){
			    alert("Please fill in a comment.");
			    document.getElementById("tellText").blur();
			    document.getElementById("tellText").focus();
			    return false;
			  }
			  if(getValue("tellName")==""){
			    alert("Please fill in your name");
			    document.getElementById("tellName").blur();
			    document.getElementById("tellName").focus();
			    return false;
			  }
			  if(!chkEmail(getValue("tellEmail"))){
			    document.getElementById("tellEmail").blur();
			    document.getElementById("tellEmail").focus();
			    return false;
			  }
			  return true;
		}

		function bookmark()
		{
			  if(document.all) {
			    window.external.AddFavorite('http://www.letsigo.com/','Letsigo.com');
			  }
			  else {
			    alert("Your browser does not support this function!");
			  }
		}