/** 
 * OnChange event of Results Per Page
 */
function changeNumPerPage(url, limitFormField) {
	loadPickVideoDoc(url + "&limit=" + limitFormField.value);
}	

/** 
 * HTTP Request call to load page behind the scenes
 */
function loadPickVideoDoc(url) {
    if (window.XMLHttpRequest) {
        // for native XMLHttpRequest object
        req = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        // for IE/Windows ActiveX version
        req = new ActiveXObject("Microsoft.XMLHTTP");
    }
    if (req != null) {
        req.onreadystatechange = processPickVideoChange;
        req.open("POST", url, true);
        req.send(null);
    }
    
    var urlArray = url.split('?');
    if (urlArray.length > 1) {
	    sendMediaroomEvent(this,'pickvideo?' + urlArray[1]);
	}
}

/** 
 * Handle the HTTP Request response
 */
function processPickVideoChange() {
    // if req shows "loaded"
    if (req.readyState == 4) {
        // if req "OK"
        if (req.status == 200) {
            if(document.getElementById){	    
			   document.getElementById("pickVideo").innerHTML = req.responseText; 
			} else if(document.all) {       
			   document.all[divName].innerHTML = req.responseText; 
			}
         } else {
            if(document.getElementById){	    
			   document.getElementById("pickVideo").innerHTML = "There was a technical error retrieving the data.  Please try again later."; 
			} else if(document.all) {       
			   document.all[divName].innerHTML = "There was a technical error retrieving the data.  Please try again later."; 
			}
         }
    }
}