// JavaScript Document


		var xmlHttp = false;
		try {
		  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			  try {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			  } 
			  catch (e2) {
				xmlHttp = false;
			  }
		}
		
		if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
		  xmlHttp = new XMLHttpRequest();
		}
		
function RateArticle(Rating, ArticleID) {
	//alert("Rating:" + Rating + " ArticleID:" + ArticleID);
	var url = "AJAXRateArticle.asp"
	xmlHttp.open("POST",url, true);
	xmlHttp.onreadystatechange = UpdateRating;
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlHttp.send("ArticleID=" + escape(ArticleID) + "&Rating=" + escape(Rating));
	
}

function UpdateRating() {
  if (xmlHttp.readyState == 4) {
		   if (xmlHttp.status == 200) {
		            var response = xmlHttp.responseText.split("|");	
					var perc = response[3]/5.00
					//alert(perc*125)
					if (response[0] > 1 ) {
						ends = "s";
					}
						else {
						ends = "";
					}
					document.getElementById("current-rating").className = "already-rated";
					document.getElementById("rating-div").innerHTML = "<ul class='star-rating'><li class='already-rated' style='width:"+ perc*125 +"px;' title='My Rating: "+response[3]+"/5'></li></ul>"
					document.getElementById("rating-stats").innerHTML ="<strong>"+response[2]+"/5</strong>&nbsp;("+response[0]+" vote"+ends+")"

		   }
			else {
			alert("status is " + xmlHttp.status + "Error: " + xmlHttp.responseText);
			return false; 
			}
     }
}
		
function EmailStart() {
				var url = "AJAXEmailFriend.asp"
				xmlHttp.open("POST",url, true);
				xmlHttp.onreadystatechange = ShowAJAXStart;
				xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				xmlHttp.send("");
				document.getElementById("baraction").className = "baraction";
				document.getElementById("EmailFriendLink").className = "EmailFriendLink";
				document.getElementById("CommentLink").className = "";
				document.getElementById("baraction").innerHTML = "<img src='../images/golf_news/loading.gif' alt='Loading' width='74' height='20' border='0' align='absmiddle' />"
}

function CommentStart() {
				var url = "AJAXCommentStart.asp"
				xmlHttp.open("POST",url, true);
				xmlHttp.onreadystatechange = function(){ShowAJAXStart();}
				xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				xmlHttp.send("");
				
				document.getElementById("baraction").className = "baraction";
				document.getElementById("CommentLink").className = "EmailFriendLink";
				//document.getElementById("EmailFriendLink").className = "";
				document.getElementById("baraction").innerHTML = "<img src='../images/golf_news/loading.gif' alt='Loading' width='74' height='20' border='0' align='absmiddle' />"
}

function ShowAJAXStart() {

	  if (xmlHttp.readyState == 4) {
		   if (xmlHttp.status == 200) {
		   var response = xmlHttp.responseText 
		   document.getElementById("baraction").innerHTML = response
		   }
			else {
			alert("status is " + xmlHttp.status + "Error: " + xmlHttp.responseText);
			return false; 
			}
     }
}

function CancelAJAX() {
document.getElementById("baraction").innerHTML = ""; 
document.getElementById("baraction").className = "cancelaction";
//document.getElementById("EmailFriendLink").className = "";
document.getElementById("CommentLink").className = "";

}

function AddCommentBottom() {
	document.location=('#Top');
	var gocom = CommentStart();
	
	//alert ("Please enter your info");
}


function AddCommentPress() {
                  
				if (document.getElementById("txtComment").value == "") {
				alert("Please make sure that your comment is not blank.");
				document.getElementById("txtComment").focus();
				return false;
				}
				if (document.getElementById("txtName").value == "") {
					alert("Please make sure that your Name is not blank. If you do not wish to display a name please put /'Anonymous/'");
					document.getElementById("txtName").focus();
					return false;
				}
				var articleid = document.getElementById("articleid").value
				var url2 = "AJAXSaveComment.asp"
				xmlHttp.open("POST",url2, true);
				
				xmlHttp.onreadystatechange = function(){CommentRefresh();}
				xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				xmlHttp.send("ArticleId=" + escape(articleid) +"&comment=" + escape(document.getElementById("txtComment").value) + "&Name=" + escape(document.getElementById("txtName").value) + "&WebPage=" + escape(document.getElementById("txtWebPage").value));

}

function CommentRefresh() {

	  if (xmlHttp.readyState == 4) {
		   if (xmlHttp.status == 200||xmlHttp.status == 0) {
				   var response = xmlHttp.responseText.split("|");
						if(response[0] == "True"||response[0] == "") {
						alert("This article requires comments to be approved first. Your comment has been sent to the article contributor for approval. Thank you for your comments.");	
						}
						window.location.reload();
		   }
			else {
			alert("status is " + xmlHttp.status + "Error: " + xmlHttp.responseText);
			return false; 
			}
     }
}

<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->

<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->








