//----------------------------------------------------------------------- // Copyright (C) Ektron Inc. All rights reserved. //----------------------------------------------------------------------- // ajax.js // Ektron Ajax Framework. // Resource for Search, Poll, Listsummary, Collection, Metadatalist function IAjax(){ } IAjax.ValidateKey=function(item,control){ if (item.keyCode==13){ __LoadSearchResult(IAjax.getArguements(),'control='+control+'&__ecmcurrentpage=1'); return false; } } IAjax.DisplayError=function(message, context) { alert('An unhandled exception has occurred:\n' + message); } IAjax.DisplayResult=function(result, context) { this.QueryString=function(key){ var value = null; for (var i=0;i= 0) { var argname = unescape(pairs[i].substring(0,pos)); var value = unescape(pairs[i].substring(pos+1)); this.QueryString.keys[this.QueryString.keys.length] = argname; this.QueryString.values[this.QueryString.values.length] = value; } } }; this.ParseQueryString(context); document.getElementById(this.QueryString("control")).innerHTML=result; try{ if(document.getElementById("__EkAjaxHidden$"+this.QueryString("control"))!=null){ document.getElementById("__EkAjaxHidden$"+this.QueryString("control")).value=result; if(IAjax.IsIE()){ window.location.replace((window.location.href).replace(window.location.hash,"")+"#"+this.QueryString("control")) IAjax.CacheHtml(this.QueryString("control")); } } }catch(e){} } IAjax.getArguements=function(){ return(IAjax.serializeForm()); } IAjax.serializeForm = function() { var element = document.forms[0].elements; var len = element.length; var query_string = ""; this.AddFormField = function(name,value) { if (query_string.length>0) { query_string += "&"; } query_string += encodeURIComponent(name) + "=" + encodeURIComponent(value); }; for (var i=0; i=0) { this.AddFormField(item.name,item.options[item.selectedIndex].value); } break; case 'select-multiple': for (var j=0; j -1) && (!(ua.indexOf('opera') > -1))); } IAjax.addLoadEvent=function (func) { var _currentloadevent = window.onload; if (typeof window.onload != 'function') { window.onload = func; }else{ window.onload = function() { if (_currentloadevent) { _currentloadevent(); } func(); } } }; IAjax.addLoadEvent(IAjax.ResetValueOnBackButton);