var top; var stack = Array(); var maxzi=0; var top; function initstack(){ var divs=document.getElementsByTagName('div'); for(d in divs){ if(divs[d] && divs[d].getAttribute && divs[d].getAttribute('class')=='spost'){ var zi=divs[d].style.zIndex; if(zi>maxzi)maxzi=zi; var id=divs[d].getAttribute('id').substr(5); stack[id]=zi; } } } function raise(id){ initstack(); maxzi++; stack[id]=maxzi; top=document.getElementById('spost'+id); top.style.zIndex=maxzi; } var e; var ox=false; var oy=false; function begindrag(id,evt){ raise(id); e=evt; ox=-evt.screenX+top.offsetLeft; oy=-evt.screenY+top.offsetTop; document.getElementsByTagName('body')[0].setAttribute('onmousemove','drag(event)'); // top.style.left=e.X; } function drag(evt){ if(ox && oy){ top.style.left=(evt.screenX+ox)+'px'; top.style.top=(evt.screenY+oy)+'px'; } } function enddrag(evt){ if(ox && oy){ top.style.left=evt.screenX+ox; top.style.top=evt.screenY+oy; } document.getElementsByTagName('body')[0].removeAttribute('onmousemove'); ox=false; oy=false; } function kill(id){ var k=document.getElementById('spost'+id); k.parentNode.removeChild(k); } function killall(){ var divs=document.getElementsByTagName('div'); if(divs){ for(d in divs){ if(divs[d] && divs[d].getAttribute && divs[d].getAttribute("class")=="spost"){ divs[d].parentNode.removeChild(divs[d]); killall(); } } } } var storew=false; var storeh=false; var storet=false; var storel=false; function minimax(id){ var k=document.getElementById('spost'+id); if(!storew && !storeh){ storew=k.style.width; storeh=k.style.height; storet=k.style.top; storel=k.style.left; k.style.width='100%'; k.style.height='100%'; k.style.top='0'; k.style.left='0'; }else{ k.style.width=storew; k.style.height=storeh; k.style.top=storet; k.style.left=storel; storew=false; storeh=false; storet=false; storel=false; } } function createXMLHTTP(){ /* I stole this from somebody a long time ago. Sorry, somebody. */ /*@cc_on @*/ /*@if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @end @*/ if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); } } var xmlhttp=false; var newid; function pop(id){ newid=id; var z=document.getElementById('spost'+id); if(z){ raise(id); return false; } if (!xmlhttp) createXMLHTTP(); if (!xmlhttp){ alert('Darn.'); return false; } var url = 'http://1.0iloveyou.com/wp-content/themes/splat-10/splat.php?id='+id+'&ix='+(++maxzi); xmlhttp.open("GET", url, true); xmlhttp.onreadystatechange = function(){ xstate = xmlhttp.readyState; if (xstate == 4 && xmlhttp.status == 200){ handleServerText(xmlhttp.responseText); return true; } return false; } xmlhttp.send(""); return false; } function handleServerText(txt){ var nn=document.createElement('div'); nn.innerHTML=txt; var nd=nn.getElementsByTagName('div')[0]; document.getElementsByTagName('body')[0].appendChild(nd); raise(newid); }