var NDCore=new function(){this.GetElementsByClassName=function(baseElement,className,tagHint){if(baseElement.getElementsByClassName){return baseElement.getElementsByClassName(className);}if(!tagHint){tagHint="*";}var tagArray=baseElement.getElementsByTagName(tagHint);var matchArray=new Array();var tagIndex=0;var matchIndex=0;while(tagIndex<tagArray.length){if(NDWShared.HasClass(tagArray[tagIndex],className)){matchArray[matchIndex]=tagArray[tagIndex];matchIndex++;}tagIndex++;}return matchArray;};this.SetToAbsolutePosition=function(element,x,y,width,height){if(x!=undefined&&element.offsetLeft!=x){element.style.left=x+"px";}if(y!=undefined&&element.offsetTop!=y){element.style.top=y+"px";}if(width!=undefined&&element.offsetWidth!=width){if(!this.pxRegex.test(element.style.width)){element.style.width=width+"px";if(element.offsetWidth!=width){var adjustment=width-element.offsetWidth;element.style.width=(width+adjustment)+"px";}}else{var styleWidth=RegExp.$1;var adjustment=styleWidth-element.offsetWidth;element.style.width=(width+adjustment)+"px";}}if(height!=undefined&&element.offsetHeight!=height){if(!this.pxRegex.test(element.style.height)){element.style.height=height+"px";if(element.offsetHeight!=height){var adjustment=height-element.offsetHeight;element.style.height=(height+adjustment)+"px";}}else{var styleHeight=RegExp.$1;var adjustment=styleHeight-element.offsetHeight;element.style.height=(height+adjustment)+"px";}}};this.GetFullOffsets=function(element){var result={offsetTop:element.offsetTop,offsetLeft:element.offsetLeft};element=element.offsetParent;while(element!=undefined&&element.nodeName!="BODY"){result.offsetTop+=element.offsetTop;result.offsetLeft+=element.offsetLeft;element=element.offsetParent;}return result;};this.pxRegex=/^([0-9]+)px$/i;};var NDContentPage=new function(){this.Start=function(){this.toolTipHolder=document.createElement("div");this.toolTipHolder.className="NDSampleOutput";this.toolTipHolder.style.display="none";this.toolTipHolder.style.position="fixed";this.toolTipHolder.style.zIndex=20;document.body.appendChild(this.toolTipHolder);this.OnToolTipsLoaded(NDSampleOutputToolTips);};this.OnToolTipsLoaded=function(toolTips){this.toolTips=toolTips;if(this.showingToolTip!=undefined&&this.toolTips[this.showingToolTip]!=undefined){this.ShowToolTip();}};this.OnLinkMouseOver=function(event,toolTipID){var domLink=event.target||event.srcElement;if(this.showingToolTip!=toolTipID){this.ResetToolTip();this.showingToolTip=toolTipID;this.domLinkShowingToolTip=domLink;if(this.toolTips==undefined){}else if(this.toolTips[toolTipID]!=undefined){this.toolTipTimeout=setTimeout(function(){clearTimeout(this.toolTipTimeout);this.toolTipTimeout=undefined;NDContentPage.ShowToolTip();},350);}}};this.OnLinkMouseOut=function(event){var domLink=event.target||event.srcElement;if(this.domLinkShowingToolTip==domLink){this.ResetToolTip();}};this.ShowToolTip=function(){this.toolTipHolder.innerHTML=this.toolTips[this.showingToolTip];this.toolTipHolder.style.visibility="hidden";this.toolTipHolder.style.display="block";NDCore.SetToAbsolutePosition(this.toolTipHolder,0,undefined,undefined,undefined);var scrollParent=document.body;if(scrollParent.scrollTop==0){scrollParent=scrollParent.parentNode;}var linkOffsets=NDCore.GetFullOffsets(this.domLinkShowingToolTip);var x=linkOffsets.offsetLeft;var y=linkOffsets.offsetTop+this.domLinkShowingToolTip.offsetHeight-scrollParent.scrollTop+5;var newWidth=undefined;if(x+this.toolTipHolder.offsetWidth+2>document.body.offsetWidth){x=document.body.offsetWidth-this.toolTipHolder.offsetWidth-2;if(x<2){x=2;newWidth=document.body.offsetWidth-4;}}NDCore.SetToAbsolutePosition(this.toolTipHolder,x,y,newWidth,undefined);if(y+this.toolTipHolder.offsetHeight+2>scrollParent.clientHeight){var newY=linkOffsets.offsetTop-this.toolTipHolder.offsetHeight-scrollParent.scrollTop-5;if(newY>=0){NDCore.SetToAbsolutePosition(this.toolTipHolder,undefined,newY,undefined,undefined);}}this.toolTipHolder.style.visibility="visible";};this.ResetToolTip=function(){if(this.showingToolTip!=undefined){this.toolTipHolder.style.display="none";this.toolTipHolder.style.width=null;this.lastToolTip=this.showingToolTip;this.showingToolTip=undefined;}if(this.toolTipTimeout!=undefined){clearTimeout(this.toolTipTimeout);this.toolTipTimeout=undefined;}};};