// JavaScript Document // get querystring information from browser -- via Querystring.js var q = new Querystring(); var vid = q.get("vid"); var mySort = q.get("sort"); var mySearch = ""; if (q.get("q") != null) {mySearch = q.get("q");} var myPage = q.get("page"); var myCmd = q.get("cmd"); var myAction = q.get("action"); var myCategory = q.get("cat"); var returnURL = q.get("returnURL"); // global variable for plugin script page var pluginURL = "http://www.ensemblevideo.com/plugin/v2/index.asp"; var pluginPath = "http://www.ensemblevideo.com/plugin/v2"; // eliminate null page value if (myPage == null) {myPage = 1} /* Response handler. Will inject a new div * element into the body and insert the data * which it assumes is text into the div. */ function myXjrResponseHandler(data) { var myDiv = document.getElementById("vidShow") myDiv.innerHTML = data ; } // functions to return the proper request url function displayLogin(web_id, categories, showcase) { return pluginURL + "?webid=" + web_id + "&cmd=login&returnURL=" + returnURL + "&categories=" + categories + "&showcase=" + showcase; } function searchVideos(web_id, categories) { return pluginURL + "?webid=" + web_id + "&q=" + mySearch + "&sort=" + mySort + "&page=" + myPage + "&cmd=search&categories=" + categories; } function searchVideoCategory(web_id, categories) { return pluginURL + "?webid=" + web_id + "&q=" + mySearch + "&sort=" + mySort + "&page=" + myPage + "&cat=" + myCategory + "&categories=" + categories; } function getVideoCategory(web_id, categories) { return pluginURL + "?webid=" + web_id + "&cat=" + myCategory + "&sort=" + mySort + "&page=" + myPage + "&categories=" + categories; } function getMainPage(web_id, categories, showcase, orientation) { var url; if (categories == 'true') { url = pluginURL + "?webid=" + web_id + "&categories=true&orientation=" + orientation; if (showcase == 'true') { url = pluginURL + "?webid=" + web_id + "&categories=true&showcase=true&orientation=" + orientation; } } else { url = searchVideos(web_id, categories); } return url; } function getVideoInfo(web_id, categories) { return pluginURL + "?webid=" + web_id + "&vid=" + vid + "&categories=" + categories; } //function to determine which request url to use function fetch(web_id, categories, showcase, orientation) { var url; url = getMainPage(web_id, categories, showcase, orientation); if (vid != null) { url = getVideoInfo(web_id, categories); } if (myCategory != null) { url = getVideoCategory(web_id, categories); if (mySearch != null) { url = searchVideoCategory(web_id, categories); } } if (myCmd == 'search') { url = searchVideos(web_id, categories); } if (myCmd == 'login') { url = displayLogin(web_id, categories, showcase); } xjr.get(url); } // show loader graphic when request has not completed function showLoader() { var myDiv = document.getElementById("vidShow"); myDiv.style.width = '100%'; myDiv.innerHTML = '