');
var jQuery;
if (window.jQuery === undefined || window.jQuery.fn.jquery !== "3.1.0") {
var script_tag = document.createElement("script");
script_tag.setAttribute("type","text/javascript");
script_tag.setAttribute("src",
"https://code.jquery.com/jquery-3.1.0.min.js");
if (script_tag.readyState) {
script_tag.onreadystatechange = function () { // For old versions of IE
if (this.readyState == "complete" || this.readyState == "loaded") {
scriptLoadHandler();
}
};
} else { // Other browsers
script_tag.onload = scriptLoadHandler;
}
// Try to find the head, otherwise default to the documentElement
(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag);
} else {
// The jQuery version on the window is the one we want to use
jQuery = window.jQuery;
main();
}
function scriptLoadHandler() {
jQuery = window.jQuery.noConflict(true);
main();
}
function main() {
jQuery(document).ready(function($) {
jQuery("#youragendasembed").append('
Show:
');
jQuery("#youragendasembed").append('
Search for agenda items.
');
$("input[type=text]").on("keydown", function(e) {
if (e.which == 13) {
e.preventDefault();
youragendas_search();
}
});
});
}
function youragendas_search() {
var value = jQuery("#youragendas_searchval").val();
if ( value.length == 0 ) {
alert("Please enter a search string.");
return;
}
jQuery("#youragendas_searchresult").html("Searching...");
jQuery.ajax({
type: "post",
async: true,
url: "https://youragendas.com/vam/json/agendasearch/mesaaz",
data: { q:value, callback:"callback" },
dataType: "jsonp",
jsonpCallback: "callback"
}).done(function( r ) {
if ( r.err ) {
jQuery("#youragendas_searchresult").html(r.msg);
} else {
jQuery("#youragendas_searchresult").html(r.data);
}
});
}
function youragendas_pickshow(sel) {
var value = sel.value;
if ( !value.length ) {
jQuery("#youragendas_year").html("");
} else {
jQuery("#youragendas_year").html("Loading...");
}
jQuery("#youragendas_date").html("");
jQuery("#youragendas_actions").html("");
if ( !value.length ) return;
jQuery.ajax({
type: "post",
async: true,
url: "https://youragendas.com/vam/json/showyears/mesaaz",
data: { title:value, callback:"callback" },
dataType: "jsonp",
jsonpCallback: "callback"
}).done(function( r ) {
if ( r.err ) {
jQuery("#youragendas_year").html(r.msg);
} else {
jQuery("#youragendas_year").html('Year: ');
jQuery.each(r.data, function( index, years ) {
jQuery("#youragendas_yearpicker").append("");
});
}
});
}
function youragendas_pickyear(sel) {
var values = sel.value.split("|");
var year = values[0];
var show = values[1];
if ( values.length == 1 ) {
jQuery("#youragendas_date").html("");
} else {
jQuery("#youragendas_date").html("Loading...");
}
jQuery("#youragendas_actions").html("");
if ( values.length == 1 ) return;
jQuery.ajax({
type: "post",
async: true,
url: "https://youragendas.com/vam/json/showdates/mesaaz",
data: { title:show, year:year, callback:"callback" },
dataType: "jsonp",
jsonpCallback: "callback"
}).done(function( r ) {
if ( r.err ) {
jQuery("#youragendas_date").html(r.msg);
} else {
jQuery("#youragendas_date").html('Date: ');
jQuery.each(r.data, function( index, dates ) {
jQuery("#youragendas_datepicker").append("");
});
}
});
}
function youragendas_pickdate(sel) {
var value = sel.value;
if ( !value.length ) {
jQuery("#youragendas_actions").html("");
} else {
jQuery("#youragendas_actions").html("Loading...");
}
if ( !value.length ) return;
jQuery.ajax({
type: "post",
async: true,
url: "https://youragendas.com/vam/json/showactions/mesaaz",
data: { showid:value, callback:"callback" },
dataType: "jsonp",
jsonpCallback: "callback"
}).done(function( r ) {
if ( r.err ) {
jQuery("#youragendas_actions").html(r.msg);
} else {
jQuery("#youragendas_actions").html("");
jQuery.each(r.data, function( index, action ) {
jQuery("#youragendas_actions").append(action);
});
}
});
}
function youragendas_viewvideo(showid) {
window.open("https://youragendas.com/vam/shows/show/"+showid, "yawin","left=20,top=20,width=640,height=768,toolbar=0,resizable=1,status=0,menubar=0");
}