function changeClass(oldid, newclass) { window.document.getElementById(oldid).className=newclass; } function initXmlHttp() { var xmlHttp=null; try { xmlHttp=new XMLHttpRequest(); } catch (e) { try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } function fdb_loadData($query, $target) { var xmlHttp = initXmlHttp(); xmlHttp.open('POST', '/modules/family/family.php', true); xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlHttp.send($query); xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { if($target == 'return') { return xmlHttp.responseText; } else { window.document.getElementById($target).innerHTML = xmlHttp.responseText; } } } } function fdb_buildIQuery($form, $function, $return) { $querystring = $function; for($i = 0; $i < window.document.getElementById($form).length; $i++) { switch(window.document.getElementById($form)[$i].type) { case 'radio': if(window.document.getElementById($form)[$i].checked == true) { $querystring = $querystring + '&' + window.document.getElementById($form)[$i].name + '=' + escape(window.document.getElementById($form)[$i].value); } break; case 'select-one': var sel = window.document.getElementById($form)[$i]; for(i=0; i< sel.options.length; i++) { if (sel.options[i].selected == true) { $querystring = $querystring + '&' + sel.name + '=' + escape(sel.options[i].value); } } break; case 'text': $querystring = $querystring + '&' + window.document.getElementById($form)[$i].name + '=' + escape(window.document.getElementById($form)[$i].value); break; case 'textarea': $querystring = $querystring + '&' + escape(window.document.getElementById($form)[$i].name) + '=' + escape(window.document.getElementById($form)[$i].value); break; case 'password': $querystring = $querystring + '&' + escape(window.document.getElementById($form)[$i].name) + '=' + escape(window.document.getElementById($form)[$i].value); break; case 'hidden': if(window.document.getElementById($form)[$i].name != '') { $querystring = $querystring + '&' + escape(window.document.getElementById($form)[$i].name) + '=' + escape(window.document.getElementById($form)[$i].value); } break; case 'checkbox': $querystring = $querystring + '&' + window.document.getElementById($form)[$i].name + '=' + ((window.document.getElementById($form)[$i].checked) ? '1' : '0'); break; } } fdb_loadData($querystring, $return); } AIM = { frame : function(c) { var n = 'f' + Math.floor(Math.random() * 99999); var d = document.createElement('div'); d.innerHTML = ''; document.body.appendChild(d); var i = document.getElementById(n); if (c && typeof(c.onComplete) == 'function') { i.onComplete = c.onComplete; } return n; }, form : function(f, name) { f.setAttribute('target', name); }, submit : function(f, c) { AIM.form(f, AIM.frame(c)); if (c && typeof(c.onStart) == 'function') { return c.onStart(); }else{ return true; } }, loaded : function(id) { var i = document.getElementById(id); if (i.contentDocument) { var d = i.contentDocument; }else if (i.contentWindow){ var d = i.contentWindow.document; } else { var d = window.frames[id].document; } if (d.location.href == "about:blank") { return; } if (typeof(i.onComplete) == 'function') { i.onComplete(d.body.innerHTML); } } } function imageHelper(response) { window.document.getElementById('imagecontainer').innerHTML = response; }