function createRequestObject() {
var tmpXmlHttpObject;
//depending on what the browser supports, use the right way to create the XMLHttpRequest object
if (window.XMLHttpRequest) {
// Mozilla, Safari would use this method ...
tmpXmlHttpObject = new XMLHttpRequest();
} else if (window.ActiveXObject) {
// IE would use this method ...
tmpXmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
}
return tmpXmlHttpObject;
}
//call the above function to create the XMLHttpRequest object
var http = createRequestObject();
function getRadioValue(radioObject) {
var value = null
for (var i=0; i<radioObject.length; i++) {
if (radioObject[i].checked) {
value = radioObject[i].value;
break ;
}
}
return value
}
function makeGetRequestByName(name) {
// Checking if at least one period button is selected. Or not.
//var video = getRadioValue(document.pollForm.Video);
//var video = VFAPlayer.currentVideoPlaying.title; //currentVideo.title;
//make a connection to the server ... specifying that you intend to make a GET request
//to the server. Specifiy the page name and the URL parameters to send
http.open('get', '/processors/pollajaxhelper.jsp?charset=UTF-8&cmd=tally&pagenumber=0&pollid=TBSGeneral!WFC2009&results=TBSGeneral!WFC2009.results.html&submitsubmit=Submit&vwf_ShowAndHide_HiddenQuestions=&vwf_showquestion=&Video=' + name );
//assign a handler for the response
http.onreadystatechange = processResponse;
//actually send the request to the server
http.send(null);
} 
function makeGetRequest() {
// C§hecking if at least one period button is selected. Or not.
//var video = getRadioValue(document.pollForm.Video);
var video = VFAPlayer.currentVideoPlaying.title; //currentVideo.title;
//make a connection to the server ... specifying that you intend to make a GET request
//to the server. Specifiy the page name and the URL parameters to send
http.open('get', '/processors/pollajaxhelper.jsp?charset=UTF-8&cmd=tally&pagenumber=0&pollid=TBSGeneral!WFC2009&results=TBSGeneral!WFC2009.results.html&submitsubmit=Submit&vwf_ShowAndHide_HiddenQuestions=&vwf_showquestion=&Video=' + video );
//assign a handler for the response
http.onreadystatechange = processResponse;
//actually send the request to the server
http.send(null);
}
function processResponse() {
//check if the response has been received from the server
if(http.readyState == 4){
//read and assign the response from the server
var response = http.responseText;
//do additional parsing of the response, if needed
//alert('this worked');
}
}
