function setDiv(){selectDiv.style.visibility="hidden";selectDiv.style.border="1px";selectDiv.style.zIndex=-1;selectDiv.style.backgroundColor="#CAE1FF";selectDiv.style.position="absolute"}function attachDiv(){document.getElementById("container").appendChild(selectDiv)}function clearMultipleSelection(){clearSelect();clearSelectionDiv();clearSelectionValue(false)}function clearSingleSelection(){clearSelect()}function clearSelection(){if(isMultipleSelection()){clearMultipleSelection()}else{clearSingleSelection()}}function clearSelect(){endSelect="0"}function clearSelectionDiv(){selectDiv.style.visibility="hidden";selectDiv.style.width=0;selectDiv.style.height=0;left=0;top=0;oWidth=0;oHeight=0}function clearSelectionValue(a){if(a){selectionValue="Null";document.getElementById("workspace:query").value=""}else{if(selectionValue.charAt(selectionValue.length-1)!="~"){selectionValue="Null"}}}function startSelection(a,b){if(!isSelect&&b.button<2){clearSelection()}if(b.button<2){isSelect=true;left=a.offsetLeft;top=a.offsetTop;oWidth=a.offsetWidth;oHeight=a.offsetHeight;clearSelect();startSelect=a.id}isScrolling=false}function endSelection(a){isScrolling=true;if(isSelect){isSelect=false;if(a.id==startSelect){clearMultipleSelection()}else{endSelect=a.id;setSelection(calcDimension())}}}function calcDimension(){var b=new Array(4);var c=startSelect.split("_");var a=endSelect.split("_");b[0]=parseInt(c[0]);b[1]=parseInt(c[1]);b[2]=parseInt(a[0]);b[3]=parseInt(a[1]);if(startSelect.length>0){if(b[0]>b[2]){b[0]=b[2];b[2]=c[0]}if(b[1]>b[3]){b[1]=b[3];b[3]=c[1]}}startSelect=b[0]+"_"+b[1];endSelect=b[2]+"_"+b[3];return b}function modDivDimension(a){if(isSelect){selectDiv.style.visibility="visible";if(a.offsetLeft<left){selectDiv.style.left=a.offsetLeft+"px";selectDiv.style.width=left+oWidth-a.offsetLeft+"px"}else{selectDiv.style.left=left+"px";selectDiv.style.width=a.offsetLeft+a.offsetWidth-left+"px"}if((a.offsetTop)<top){selectDiv.style.top=a.offsetTop+"px";selectDiv.style.height=top+oHeight-a.offsetTop+"px"}else{selectDiv.style.top=top+"px";selectDiv.style.height=a.offsetTop+oHeight-top+"px"}}}function isMultipleSelection(){if(endSelect=="0"){return false}else{return true}}function getEventPos(a){var b=new Array();b[0]=a.clientX||0;b[1]=a.clientY||0;return b}function scrollRight(){document.getElementById("container").scrollLeft=document.getElementById("container").scrollLeft+30}function scrollLeft(){document.getElementById("container").scrollLeft=document.getElementById("container").scrollLeft-30}function scrollDown(){document.getElementById("container").scrollTop=document.getElementById("container").scrollTop+30}function scrollUp(){document.getElementById("container").scrollTop=document.getElementById("container").scrollTop-30}function endScroll(){if(isScrolling){clearInterval(scrollController);isScrolling=false}}function startScroll(b){if(isScrolling){endScroll()}var a=new Array();if(isSelect&&!isScrolling){a=getEventPos(b);if(a[0]>(document.getElementById("container").offsetWidth+document.getElementById("workspace:appScreen").offsetLeft-20)){scrollController=setInterval("scrollRight()",300);isScrolling=true}else{if(a[0]<document.getElementById("container").offsetLeft+10){scrollController=setInterval("scrollLeft()",300);isScrolling=true}else{if(a[1]>(document.getElementById("container").offsetHeight+(document.getElementById("workspace:top").offsetHeight-document.body.scrollTop))){scrollController=setInterval("scrollDown()",300);isScrolling=true}else{if(a[1]<(document.getElementById("container").offsetTop)+5){scrollController=setInterval("scrollUp()",300);isScrolling=true}}}}}}function setSelection(d){var a="";var b=stripHTML(document.getElementById(startSelect).childNodes[0].innerHTML),c=stripHTML(document.getElementById(endSelect).childNodes[0].innerHTML);if(isMultipleSelection()&&/\S/.test(b)&&/\S/.test(c)){a=getSelectionValues(false);if(selectionValue=="Null"){selectionValue=a+"~ ~"}else{selectionValue+=a;initSend()}}}function getSelectionValues(b){var c="";var d=calcDimension();for(var e=d[1];e<=d[3];e++){for(var a=d[0];a<=d[2];a++){c+=stripHTML((document.getElementById(a+"-"+e)).innerHTML);if(b){(document.getElementById(a+"-"+e)).innerHTML=""}if(a<d[2]){c+=","}}if(e<d[3]){c+="|"}}return c};