//initialize XMLHttpRequest Object function initialize(display) { try { // Firefox, Opera 8.0+, Safari request=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { request=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { request=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { //keep it silent for now :) //alert("Your browser does not support AJAX!"); request=false; } } } request.onreadystatechange=function() { handleStateChange(display); } } //handle state changes within the XMLHttpObject function handleStateChange(display) { if(request.readyState<4) { if(display) { display.innerHTML='Loading...'; } } if(request.readyState==4) { if(display) { display.innerHTML=request.responseText; } } } //actually request something function AJAXRequest(url,disp) { //does not need to be neccesarly initalized everytime it is used, but improves consistency initialize(disp); request.open('GET',url,'true'); request.send(null); } function AJAXRequestPOST(url,disp,data) { //does not need to be neccesarly initalized everytime it is used, but improves consistency initialize(disp); request.open('POST',url,'true'); request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); request.setRequestHeader("Content-length", data.length); request.setRequestHeader("Connection", "close"); request.send(data); } //change global display variable (IDTag) function changeDisplay(disp) { display = document.getElementById(disp); } function formToData(target) { var data = ''; for(i = 0; i < target.elements.length ; i++) { data += target.elements[i].name+'='+target.elements[i].value+'&' } return data.substring(0,data.length-1); } function gup( name ) { name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return ""; else return results[1]; } function CommentSubmit(target,id,day,kid,dozid,type) { var data = formToData(target); AJAXRequestPOST('display.php?mod=moduleinfo&id='+id+'&day='+day+'&kid='+kid+'&dozid='+dozid+'&type='+type,document.getElementById('moduleDisplay'),data); } var tmp; var display = 'moduleDisplay'; initialize(); var tmp1; function high(elem) { tmp=elem.style.backgroundColor; tmp1=elem.style.color; elem.style.backgroundColor='#CC3C44'; elem.firstChild.style.color='#FFFFFF'; } function down(elem) { elem.style.backgroundColor=tmp; elem.firstChild.style.color=tmp1; } function hide() { var elem = document.getElementById(display); if(elem) { elem.style.visibility = 'hidden'; elem.style.display = 'none'; } } function show() { var elem = document.getElementById(display); if(elem) { elem.style.visibility = 'visible'; elem.style.display = 'block'; } }