activeIcon = ""; window.onload = function(){ var elemSpan = document.createElement("span"); elemSpan.id = "spanOutput"; elemSpan.className = "spanTextDropdown"; document.body.appendChild(elemSpan); } function openBrowser2(mypage, myname, w, h){ var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl; win = window.open(mypage, myname, winprops); } function SendData(mylist,textid) { golos_textid =textid; var url = "textrate_new.asp"; var myrate = mylist.options[mylist.selectedIndex].value; var strParams = 'textid='+textid+'&rate='+myrate ; var loader1=new net.ContentLoader(url,ShowAnswer,ErrText,"POST",strParams); } function ShowAnswer (){ data=this.req.responseText; if (data=='Done'){ textic = "Ваш голос учтен!" } else { textic = "Вы оценивали это произведение!" } document.all["golos"+golos_textid].innerHTML = textic; document.all["golos"+golos_textid].style.cssText = "padding-left: 20px;padding-bottom: 5px;"; } function ErrText() { alert ("Error!!!"); } function SendForLinks(textid,linktypeid){ golos_textid =textid; activeIcon = document.all["icon"+textid + "_" + linktypeid]; var url = "show_textlinks.asp"; var strParams = 'textid='+textid+'&linktypeid='+linktypeid ; document.getElementById("spanOutput").innerHTML = ""; SetElementPosition(activeIcon); var loader1=new net.ContentLoader(url,ShowLinks,ErrText,"POST",strParams); } function BadLink(textlinkid){ //alert (textlinkid); badlink_textid =textlinkid; var url = "bad_links.asp"; var strParams = 'textlinkid='+badlink_textid; var loader2=new net.ContentLoader(url,ShowBadLinks,ErrText,"POST",strParams); } function ShowBadLinks (){ data=this.req.responseText; if (data=='Done'){ textic = "Принято!"; } document.all["badlink"+badlink_textid].innerHTML = textic; } function ShowLinks (){ data=this.req.responseText; document.getElementById("spanOutput").innerHTML = data; } function SetElementPosition(theTextBoxInt){ var selectedPosX = 0; var selectedPosY = 0; var theElement = theTextBoxInt; if (!theElement) return; var box = theElement.getBoundingClientRect(); console.log(box); var theElemHeight = theElement.offsetHeight; //while(theElement != null){ //selectedPosX += theElement.offsetLeft; selectedPosX = box.left; //selectedPosY += theElement.offsetTop; selectedPosY = box.top; //theElement = theElement.offsetParent; //} console.log(selectedPosX); console.log(selectedPosY); xPosElement = document.getElementById("spanOutput"); xPosElement.style.left = selectedPosX-20; //if(theTextBoxInt.obj.matchTextBoxWidth) //xPosElement.style.width = theElemWidth; xPosElement.style.top = selectedPosY + theElemHeight+10; xPosElement.style.display = "block"; }