var boxHoverEvent;var boxHoverTimeout;function switchTab(boxName,tabNum,numTabs){for(var i=0;i<numTabs;i++){if(i==tabNum)
document.getElementById(boxName+i).style.display='block';else
document.getElementById(boxName+i).style.display='none';}}
function BoxPopup(event,title,content,width){var divName="divBoxPopup";var target,newTarget;var boxWidth="36em";var boxX,boxY;var divWidth,divHeight;var boxStyle="red";var boxLeft=false;var boxOffsetX=12,boxOffsetY=12;var winH,winW;if(width){boxWidth=width;}
if(window.innerWidth)
{winW=window.innerWidth;winH=window.innerHeight;}
else
{winW=document.body.offsetWidth;winH=document.body.offsetHeight;}
if(!event){boxX=winW/2+170;boxY=300;}
else if(event.pageX)
{boxX=event.pageX;boxY=event.pageY;}
else
{var root=document.documentElement||document.body;boxX=event.clientX+root.scrollLeft;boxY=event.clientY+root.scrollTop;}
if(!event){boxLeft=false;}
else if(boxX<winW/2){boxLeft=true;}
else{boxLeft=false;}
if(!document.getElementById(divName)){newTarget=document.createElement("div");newTarget.id=divName;document.body.appendChild(newTarget);}
target=document.getElementById(divName);target.style.position="absolute";target.style.width=boxWidth;target.innerHTML="\
                <div class=\"box-container\">\
                    <div id=\"divBoxPopUpTitle\" name=\"divBoxPopUpTitle\" class=\"box-back-"+boxStyle+"\" "+(boxLeft?"style=\"padding-left:0.4em\"":"")+">\
                        <div style=\"float:"+(boxLeft?"left":"right")+"; margin-top: 0.2em; margin-right: 0.2em\">\
                            <div class=\"box-button-close\" onclick=\"javascript:BoxClose()\">&nbsp;</div>\
                        </div>\
                        "+title+"\
                    </div>\
                    <div id=\"divBoxPopUpContent\" name=\"divBoxPopUpContent\" class=\"box-content-padding\">\
                        "+content+"\
                    </div>\
                </div>\
                ";divWidth=target.offsetWidth||target.width||300;divHeight=target.offsetHeight||target.height||200;target.style.visibility="visible";if(boxLeft){target.style.top=(boxY-boxOffsetY)+"px";target.style.left=(boxX-boxOffsetX)+"px";}
else{target.style.top=(boxY-boxOffsetY)+"px";target.style.left=(boxX+boxOffsetX-divWidth)+"px";}}
function copyByEnum(object){var copyObject=new Object();for(var property in object){copyObject[property]=object[property];}
return copyObject;}
function BoxWaitHover(event,title,content,width){this.boxHoverEvent=copyByEnum(event);this.boxHoverTimeout=setTimeout("BoxHover(null, '"+title+"','"+content+"', '"+width+"')",750);}
function BoxHover(event,title,content,width){var divName="divBoxHover";var target,newTarget;var boxWidth="36em";var boxX,boxY;var divWidth,divHeight;var boxStyle="red";var boxLeft=false;var boxOffsetX=-30,boxOffsetY=48;var winH,winW;if(event){this.boxHoverEvent=event;}
if(width){if(width.length>0&&width!="undefined"){boxWidth=width;}}
if(window.innerWidth)
{winW=window.innerWidth;winH=window.innerHeight;}
else
{winW=document.body.offsetWidth;winH=document.body.offsetHeight;}
if(!this.boxHoverEvent){boxX=winW/2+170;boxY=300;}
else if(this.boxHoverEvent.pageX)
{boxX=this.boxHoverEvent.pageX;boxY=this.boxHoverEvent.pageY;}
else
{var root=document.documentElement||document.body;boxX=this.boxHoverEvent.clientX+root.scrollLeft;boxY=this.boxHoverEvent.clientY+root.scrollTop;}
if(!this.boxHoverEvent){boxLeft=false;}
else if(boxX<winW/2){boxLeft=true;}
else{boxLeft=false;}
if(!document.getElementById(divName)){newTarget=document.createElement("div");newTarget.id=divName;document.body.appendChild(newTarget);}
target=document.getElementById(divName);target.style.position="absolute";target.style.width=boxWidth;target.innerHTML="\
        <table class=\"box-rounded\" cellspacing=\"0\" cellpadding=\"0\">\
         <tr>\
          <td></td>\
          <td class=\"box-rounded-corner-top-left\"></td>\
          <td class=\"box-rounded-corner-top-center\"></td>\
          <td class=\"box-rounded-corner-top-right\"></td>\
         </tr>\
         <tr>\
          <td></td>\
          <td class=\"box-rounded-title\"></td>\
          <td class=\"box-rounded-title\">\
           "+title+"\
          </td>\
          <td class=\"box-rounded-title\"></td>\
         </tr>\
         <tr>\
          <td class=\"box-arrow-left\"></td>\
          <td class=\"box-rounded-corner-middle-left\"></td>\
          <td class=\"box-rounded-content\">\
          "+content+"\
          </td>\
          <td class=\"box-rounded-corner-middle-right\"></td>\
         </tr>\
         <tr>\
          <td></td>\
          <td class=\"box-rounded-corner-bottom-left\"></td>\
          <td class=\"box-rounded-corner-bottom-center\"></td>\
          <td class=\"box-rounded-corner-bottom-right\"></td>\
         </tr>\
        </table>\
        ";divWidth=target.offsetWidth||target.width||300;divHeight=target.offsetHeight||target.height||200;target.style.visibility="visible";if(boxLeft){target.style.top=(boxY-boxOffsetY)+"px";target.style.left=(boxX-boxOffsetX)+"px";}
else{target.style.top=(boxY-boxOffsetY)+"px";target.style.left=(boxX+boxOffsetX-divWidth)+"px";}}
function BoxClose(){document.getElementById("divBoxPopup").style.visibility="hidden";}
function BoxUnhover(){if(this.boxHoverTimeout){clearTimeout(this.boxHoverTimeout);}
if(document.getElementById("divBoxHover")){document.getElementById("divBoxHover").style.visibility="hidden";}}
function BoxUpdate(newContent,newTitle){var divNameTitle="divBoxPopUpTitle";var divNameContent="divBoxPopUpContent";if(document.getElementById(divNameContent)){if(newContent){document.getElementById(divNameContent).innerHTML=newContent;}}
if(document.getElementById(divNameTitle)){if(newTitle){document.getElementById(divNameTitle).innerHTML=newTitle;}}}