var xmlhttp; if(window.ActiveXObject) { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if(window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest; } function doWat() { if(window.innerWidth && window.innerHeight) { //ff var x = parseInt((window.innerWidth/2)-330); var y = parseInt((window.innerHeight/2)-230); var winX = "100%"; var winY = parseInt(window.innerHeight)+(window.scrollMaxY); } else { //ie var x = parseInt((document.documentElement.clientWidth/2)-330); var y = parseInt((document.documentElement.clientHeight/2)-230); var winX = parseInt(document.documentElement.clientWidth)+"px"; var winY = document.body.parentNode.scrollHeight; } var obj = document.getElementById('hide_this_page'); obj.setAttribute("style", "width: "+winX+"; height: "+winY+"px"); obj.style.zIndex = "100"; obj.innerHTML = "
\"\"

\n\n
\n
\n
"; window.onscroll = function() { if(window.scrollY) { document.getElementById('wat_box').style.top = y+window.scrollY+"px"; } else { document.getElementById('wat_box').style.top = y+document.body.parentNode.scrollTop+"px"; } } xmlhttp.open("POST", "/qwerty/wat/ajax_wat.php", true); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttp.onreadystatechange = function() { /*if(xmlhttp.readyState == 1) { document.getElementById('wat_get_stuff').innerHTML = "

"+loadingwe+"

"; } else */if(xmlhttp.readyState == 4) { document.getElementById('wat_get_stuff').innerHTML = xmlhttp.responseText; } } xmlhttp.send(null); } function sendWat(main) { if(main == "main") { var params = "thetopic="+document.getElementById('wat_post_message').value; var check = document.getElementById('wat_post_message'); } else { var params = "reply_to="+document.getElementById('wat_reply_to_'+main).value+"&reply_message="+document.getElementById('wat_textarea_'+main).value+"&reply_to_name="+document.getElementById('wat_reply_to_name_'+main).value; var check = document.getElementById('wat_textarea_'+main); } if(check.value == "") { check.style.background = "red"; check.focus(); check.onkeyup = function() { check.style.background = ""; } return; } xmlhttp.open("POST", "/qwerty/wat/ajax_wat.php", true); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4) { document.getElementById('wat_get_stuff').innerHTML = xmlhttp.responseText; if(main == "main") { document.getElementById('wat_post_message').value = ""; } } } xmlhttp.send(params); } function hideReplyBox(id, a) { document.getElementById('wat_show_this_textarea_'+id).style.display = "none"; a.setAttribute("onclick", "showReplyBox("+id+", this);"); } function showReplyBox(id, a) { document.getElementById('wat_show_this_textarea_'+id).style.display = ""; document.getElementById('wat_textarea_'+id).focus(); a.setAttribute("onclick", "hideReplyBox("+id+", this);"); }