var g_OSE=null;var g_OSE_DServers=null;var _MA=null;function SetDivContentHeight()
{var htMin=GetStyleValue_Integer(DiscussionContentDiv.currentStyle.WMMinHeight);var ht=(document.body.clientHeight+document.body.scrollTop)-(GetStyleValue_Integer(DiscussionDiv.style.top)+SCROLLBARHEIGHT);if(ht>htMin)
DiscussionContentDiv.style.height= ht;else
DiscussionContentDiv.style.height= htMin;}function _d()
{if(_aA==null)
return;var enm=new Enumerator(ViewDiv.all.tags("table"));var str=new String();var _DA=0;for(;!enm.atEnd();enm.moveNext())
{str=enm.item().id;if(_G(str.substr(0,7),"Replies"))
{var obj=new Object();obj.id=str.substr(7,str.length);obj.state=document.all.item(str).style.display;var _TB=new String();_TB="Arrow"+obj.id;_TB=document.all.item(_TB).src;obj.file =_TB;_aA[_DA++]=obj;}}}function _s()
{if(_aA==null)
return;var _DA=0;for(;_DA<_aA.length;_DA++)
{var strID=new String();strID="Replies"+_aA[_DA].id;if(document.all.item(strID))
{document.all.item(strID).style.display=_aA[_DA].state;var _TB=new String();_TB="Arrow"+_aA[_DA].id;document.all.item(_TB).src=_aA[_DA].file;}}}function _b()
{try
{var d=g_OSE_DServers.Add(g_szDiscussionServerURL ,g_szDiscussionServerURL);d.SetAsDefault();_MA=g_OSE.OpenDiscussions(location.href);}catch (e)
{return 0;}return 1;}function CreateDiscussionServerObjects()
{try
{g_OSE=new ActiveXObject("OSE.Global");g_OSE_DServers=new ActiveXObject("OSE.DiscussionServers");}catch(e)
{ViewDiv.innerHTML="<br><CENTER><SPAN class=DiscussErrorText>"+g_szDiscussionActiveXDownloadFailed+"</SPAN></CENTER>";return;}if(g_OSE!=null&&g_OSE_DServers!=null)
{if(_b())
RefreshDiscussions();else
ViewDiv.innerHTML="<br><CENTER><SPAN class=DiscussErrorText>"+g_szDiscussionConnectionFailed+"</SPAN></CENTER>";}}function AddNewTopic()
{MediaPlayer_Pause();try
{var nTime=GetPresentationTime();var szPos=_BA(nTime);for(i=1;i<=_MA.Count;i++)
{if(_G(_MA(i).Bookmark,szPos))
{alert(_MA(i).Bookmark+" "+g_szDiscussionTopicExists);MediaPlayer_PlayPause();return;}}var arg=new Array();arg[0]=szPos;arg[1]="AddTopic";arg[2]="";arg[3]="";var text=showModalDialog("AdEdDlg.htm",arg,"status:no;dialogHeight=345px;dialogWidth=450px;resizable=yes;help=no;");if(text!=null)
{_MA.Add(text[0],nTime.toString(),szPos);_MA(_MA.Count).Discussions.Add(text[1],text[2],"1");CreateDiscussionServerObjects();}}catch (e)
{alert(e.description);}MediaPlayer_Play();}function Reply (level)
{MediaPlayer_Pause();try
{var obj=_e(level,"Reply");var arg=new Array();arg[0]=_MA(obj.top).Bookmark;arg[1]="Reply";arg[2]=_MA(obj.top).Discussions(obj.bottom).Subject;arg[3]=_MA(obj.top).Discussions(obj.bottom).Text;arg[4]=_MA(obj.top).Subject;var text=showModalDialog("AdEdDlg.htm",arg,"status:no;dialogHeight=345px;dialogWidth=450px;resizable=yes;help=no;");if(text!=null)
{if(obj.numBottom!=_MA(obj.top).Discussions.Count)
{for(i=1;i<=_MA(obj.top).Discussions.Count;i++)
{num=parseInt(_MA(obj.top).Discussions(i).Bookmark);if(num>obj.numBottom)
{num+=1;_MA(obj.top).Discussions(i).AutoCommit=0;_MA(obj.top).Discussions(i).Bookmark=num.toString();_MA(obj.top).Discussions(i).Commit();}}}obj.numBottom+=1;_MA(obj.top).Discussions.Add(text[1],text[2],obj.numBottom.toString());CreateDiscussionServerObjects();}}catch(e)
{alert(e.description);}MediaPlayer_Play();}function Edit (level)
{MediaPlayer_Pause();try
{var obj=_e(level,"Edit");var arg=new Array();arg[0]=_MA(obj.top).Bookmark;arg[1]="Edit";arg[2]=_MA(obj.top).Discussions(obj.bottom).Subject;arg[3]=_MA(obj.top).Discussions(obj.bottom).Text;arg[4]=_MA(obj.top).Subject;var text=showModalDialog("AdEdDlg.htm",arg,"status:no;dialogHeight=345px;dialogWidth=450px;resizable=yes;help=no;");if(text!=null)
{_MA(obj.top).Discussions(obj.bottom).AutoCommit=0;_MA(obj.top).Discussions(obj.bottom).Subject=text[1];_MA(obj.top).Discussions(obj.bottom).Text=text[2];_MA(obj.top).Discussions(obj.bottom).Commit();CreateDiscussionServerObjects();}}catch(e)
{alert(e.description);}MediaPlayer_Play();}function Delete (level)
{MediaPlayer_Pause();try
{var obj=_e(level,"Delete");var _QB=g_szDiscussionConfirmDeleteDiscussion;if(_MA(obj.top).Discussions.Count==1)
_QB=g_szDiscussionConfirmDeleteTopic;if(confirm(_QB))
{_MA(obj.top).Discussions(obj.bottom).Delete();for(i=1;i<=_MA(obj.top).Discussions.Count;i++)
{var num=parseInt(_MA(obj.top).Discussions(i).Bookmark);if(num>obj.numBottom)
{num-=1;_MA(obj.top).Discussions(i).AutoCommit=0;_MA(obj.top).Discussions(i).Bookmark=num.toString();_MA(obj.top).Discussions(i).Commit();}}if(_MA(obj.top).Discussions.Count==0)
_MA(obj.top).Delete();CreateDiscussionServerObjects();}}catch(e)
{alert(e.description);}MediaPlayer_Play();}function RefreshDiscussions()
{if(g_OSE!=null&&g_OSE_DServers!=null&&_MA!=null)
{_d();var rgTop=new Array(_MA.Count);for(i=0;i<rgTop.length;i++)
rgTop[i]=_MA(i+1);rgTop.sort(SortByField("Bookmark"));var view="";var level ="";view+="<TABLE><TR>";view+="<TD class=DiscussAddRefreshTopic onclick=AddNewTopic() onmouseover=\"this.style.cursor=\'hand\'\">"+g_szDiscussionAddNewTopic+"</TD>";view+="<TD class=DiscussAddRefreshTopic onclick=CreateDiscussionServerObjects() onmouseover=\"this.style.cursor=\'hand\'\">"+g_szDiscussionRefreshTopics+"</TD>";view+="</TR></TABLE>";for(i=0;i<rgTop.length;i++)
{view+="";view+="<TABLE cellpadding=0 cellspacing=0 width=100% ID=Topic"+(rgTop[i].Text)+" class=DiscussTopic style=\"border-collapse:collapse\"><TR>";view+= "<TD>&nbsp;<IMG ID=Arrow"+i+" align=middle onclick=ExpandCollapse("+i+") style=\"cursor:hand\" src=\""+g_InitialCSSDirectory+"/PArrow.gif\">&nbsp;</td>";view+= "<TD width=75% onclick=SetTopic(\"Topic"+rgTop[i].Text+"\") title=\""+g_szDiscussionTopicTooltip+"\" align=left>"+rgTop[i].Subject+"</TD>";view+= "<TD width=25% onclick=SetTopic(\"Topic"+rgTop[i].Text+"\") title=\""+g_szDiscussionTopicTooltip+"\" align=right style=\"padding-right:10px\">"+_BA(rgTop[i].Text)+"&#32;<IMG src=\""+g_InitialCSSDirectory+"/Clock.gif\" "+rgTop[i].Bookmark+"</TD>";view+="</TR></TABLE>";var rgBottom=new Array();for(k=1;k<=rgTop[i].Discussions.Count;k++)
{rgBottom[rgTop[i].Discussions(k).Bookmark-1]=rgTop[i].Discussions(k);}if(rgBottom.length!=rgTop[i].Discussions.Count)
alert ("Bottom array #"+i+" has "+rgBottom.length+"  element(s) instead of "+rgTop[i].Discussions.Count);view+="<TABLE ID=Replies"+i+" width=100% style=\"border-collapse:collapse;display:none;\">";for(j=1;j<=rgBottom.length;j++)
{level=rgTop[i].Bookmark+"/"+rgBottom[j-1].Bookmark;_IA=0;if(j>1)
{_UB=rgBottom[j-1].Subject;_VB=rgBottom[j-2].Subject;_IA=_G(_UB,_VB);}if(!_IA)
view+="<TR><TD colspan=5 class=DiscussSubject>"+g_szDiscussionSubject+": <B>"+rgBottom[j-1].Subject+"</B></TD></TR>";view+="<TR><TD class=DiscussAuthor width=35%>"+rgBottom[j-1].Author+"</TD>";view+="<TD class=DiscussReplyEditDelete width=10% align=center>";view+="<SPAN ID=Reply"+level+" onclick=Reply(this.id) onmouseover=\"this.style.cursor=\'hand\'\">"+g_szDiscussionReply+"</SPAN></TD>";view+="<TD class=DiscussReplyEditDelete width=10% align=center>";view+="<SPAN ID=Edit" +level+" onclick=Edit(this.id) onmouseover=\"this.style.cursor=\'hand\'\">"+g_szDiscussionEdit+"</SPAN></TD>";view+="<TD class=DiscussReplyEditDelete width=10% align=center>";view+="<SPAN ID=Delete"+level+" onclick=Delete(this.id) onmouseover=\"this.style.cursor=\'hand\'\">"+g_szDiscussionDelete+"</SPAN></TD>";var dtUTC=new Date(rgBottom[j-1].TimeStamp);var dtLcl=new Date(Date.UTC(dtUTC.getYear(),dtUTC.getMonth(),dtUTC.getDate(),dtUTC.getHours(),dtUTC.getMinutes(),dtUTC.getSeconds(),dtUTC.getMilliseconds()));view+="<TD class=DiscussTimeStamp width=35% align=right>"+dtLcl.toString()+"</TD></TR>";view+="<TR><TD colspan=5 class=DiscussText>"+rgBottom[j-1].Text+"</TD></TR>";}view+="</TABLE>";view+="<BR>";}ViewDiv.innerHTML=view;_s();}else
{ViewDiv.innerHTML="<CENTER><SPAN class=DiscussErrorText>"+g_szDiscussionConnectionFailed +"</SPAN></CENTER>";return;}}function _e(level,action)
{var obj=new Object();var str=new String(level);var index=str.search("/");var strTop=str.substring(action.length,index);var numBottom=parseInt(str.substr(index+1,str.length));var l=1;while(l<=_MA.Count)
{if(_G(_MA(l).Bookmark,strTop))
break;l++;}var s=1;while(s<=_MA(l).Discussions.Count)
{if(parseInt(_MA(l).Discussions(s).Bookmark)==numBottom)
break;s++;}obj.top=l;obj.bottom=s;obj.numBottom=numBottom;return obj;}function SetTopic(refTime)
{var str=new String(refTime);str=str.substr(5,str.length);var _IB=null,i,_lA=_WA.length;_IB=_WA[0];for(i=1;i<_lA;i++)
{if(_WA[i].fTime>parseFloat(str))
{break;}_IB=_WA[i];}_r(_IB.nID,1);MediaPlayer_SetCurrentLocation(_IB.GetMediaFileEntry(),parseFloat(str));}function _G (str1,str2)
{var str1=new String(str1);var str2=new String(str2);if(str1.length!=str2.length)
return 0;c=0;while(str1.charAt(c)==str2.charAt(c)&&c<str1.length)
c++;return (c==str1.length);}function SortByField(field)
{function FieldSort(v1,v2)
{if(v1[field]>v2[field])
return 1;else if(v1[field]<v2[field])
return -1;else
return 0;}return FieldSort;}function MyRec (name,index)
{this.name=name;this.index=index;}function _j()
{return "index: "+this.index+" name: "+this.name;}MyRec.prototype.toString=_j;function ExpandCollapse(a)
{var strReplies=new String();strReplies="Replies"+a.toString();var strArrow=new String();strArrow="Arrow"+a.toString();var str=new String(document.all.item(strArrow).src);if(str.toLowerCase().indexOf("parrow.gif")!=-1)
document.all.item(strArrow).src =g_InitialCSSDirectory+"/Marrow.gif";else
document.all.item(strArrow).src =g_InitialCSSDirectory+"/Parrow.gif";if(document.all.item(strReplies).style.display=="")
document.all.item(strReplies).style.display="none";else
document.all.item(strReplies).style.display="";}function ShowDiscussionsPara_onclick()
{if(ShowDiscussionsPara.innerText==g_szDiscussionShowDiscussions)
{ShowDiscussionsPara.innerText=g_szDiscussionHideDiscussions;ViewDiv.style.visibility="visible";CreateDiscussionServerObjects();}else
{ShowDiscussionsPara.innerText=g_szDiscussionShowDiscussions;ViewDiv.style.visibility="hidden";}}function DiscussionHR_OnMouseDown()
{DiscussionHR.setCapture();g_bTrackingY=DiscussionDiv.style.pixelTop-event.clientY;}function DiscussionHR_OnMouseUp()
{g_bTrackingY=-1;DiscussionHR.releaseCapture();}function DiscussionHR_OnMouseMove()
{var nBottomBorder=GetStyleValue_Integer(DiscussionDiv.currentStyle.paddingBottom);var nTopBorder=GetStyleValue_Integer(DiscussionGripImage.currentStyle.height);var nContent=GetStyleValue_Integer(DiscussionContentDiv.currentStyle.WMMinHeight);var nMinMoveHeight=(document.body.clientHeight+document.body.scrollTop)-(nBottomBorder+nTopBorder+nContent);var nCurrPos=event.clientY+document.body.scrollTop;if(g_bTrackingY!=-1)
{if((event.clientY+document.body.scrollTop)> g_nMinimumDicussionTop&&nCurrPos<nMinMoveHeight)
DiscussionDiv.style.top=event.clientY+document.body.scrollTop;else if((event.clientY+document.body.scrollTop)< g_nMinimumDicussionTop)
DiscussionDiv.style.top=g_nMinimumDicussionTop;SetDivContentHeight();SetDynamicDivDimensions();}}function DiscussionToggle()
{if(DiscussionDiv.style.display=="none")
{DiscussionDiv.style.display="inline";var _gA=document.body.clientHeight-180;if(_gA>g_nMinimumDicussionTop)
{DiscussionDiv.style.top=_gA;}else
{DiscussionDiv.style.top=g_nMinimumDicussionTop;}if(ClientCaps & Browser_SupportsFilterEffects)
DiscussionDiv.filters.item(0).Apply();DiscussionDiv.style.visibility="visible";OSEObjectsDiv.style.visibility="visible";ViewDiv.style.visibility="visible";if(ClientCaps & Browser_SupportsFilterEffects)
DiscussionDiv.filters.item(0).Play();SetDivContentHeight();SetDynamicDivDimensions();CreateDiscussionServerObjects();}else
{DiscussionDiv.runtimeStyle.removeAttribute("height",0);DiscussionDiv.style.visibility="hidden";OSEObjectsDiv.style.visibility="hidden";ViewDiv.style.visibility="hidden";DiscussionDiv.style.display="none";}}