function Staff_Testimonials() { this.loaded = 0; this.queryitems = []; this.auto = 0; } function staff_testimonials_initialize() { with (this) { if (Site.loaded == 1) { loaded = 1; root = "http://www.gmf.ca/"; CompileQuery(); } else { window.setTimeout('Testimonials.Initialize()',10); } } } function staff_testimonials_compilequery() { var fields; with (this) { if (loaded == 1) { fields = document.body.getElementsByTagName("INPUT"); for (i = 0; i < fields.length; i++) { if (fields[i].id != "" && fields[i].name != "") { if (fields[i].id.search(/s-/gi) != -1) { queryitems[fields[i].id] = new Array(fields[i].name,fields[i].value); } } } if (queryitems['s-auto']) { auto = queryitems['s-auto'][1]; auto = (auto == "1" || auto == "-1" ? auto : "-1"); } } } } function staff_testimonials_addtoquery(item,value,s) { with (this) { if (loaded == 1) { if (item) { if (item.id.search(/s-/gi) != -1) { item.value = value; CompileQuery(); if (s == 1 && auto == "1") { SubmitQuery(); } } } } } } function staff_testimonials_submitquery() { var session_url = ""; var query = (session_url == "" ? 'http://www.gmf.ca/z/testimonials/?x=1&' : session_url); with (this) { if (loaded == 1) { for (i in queryitems) { if (queryitems[i][1] != "") { query += queryitems[i][0]+"="+queryitems[i][1]+"&"; } } query = query.substr(0,query.length-1); location.href = query; } } } function staff_testimonials_keypress(e) { var evt = e || window.event; var key = evt.which || evt.keyCode; with (this) { if (key == 13) { SubmitQuery(); } } } function staff_testimonials_profile_options(item) { var list = new Array("approve","remove"); var opt; with (this) { if (loaded == 1) { if ($(item+'_item')) { opt = ($(item+'_item').style.visibility == "visible" ? new Array("hidden","none") : new Array("visible","inline")); for (i = 0; i < list.length; i++) { if ($(list[i]+'_item')) { $(list[i]+'_item').style.visibility = "hidden"; $(list[i]+'_item').style.display = "none"; } } $(item+'_item').style.visibility = opt[0]; $(item+'_item').style.display = opt[1]; } } } } Staff_Testimonials.prototype.Initialize = staff_testimonials_initialize; Staff_Testimonials.prototype.CompileQuery = staff_testimonials_compilequery; Staff_Testimonials.prototype.AddToQuery = staff_testimonials_addtoquery; Staff_Testimonials.prototype.SubmitQuery = staff_testimonials_submitquery; Staff_Testimonials.prototype.KeyPress = staff_testimonials_keypress; Staff_Testimonials.prototype.ProfileOptions = staff_testimonials_profile_options; var Testimonials = new Staff_Testimonials(); Testimonials.Initialize();