function SummaryDescription(){this.mContainer=null;this.mPanel=null;this.mHeader=null;this.mContent=null;this.mPointer=null;this.mClose=null;this.mContext=null;this.mCurrentElement=null;this.mHidden=true;this.mAnimate=true;this.mFunctionRequestContent;this.MAX_FIELD_VALUES=4;this.MAX_VALUE_LENGTH=70;this.MAX_SEGMENT_LENGTH=15;this.NO_CONTENT="No Information Available.";this.CLASSNAME="summaryDescriptionContainer";this.CLASSNAME_RIGHT_POINTER="rightPointer";this.CLASSNAME_LEFT_POINTER="leftPointer";this.HEADER_TEXT="&nbsp;Media Summary";this.init=function(){this.mPanel=$(document.createElement("div"));this.mHeader=$(document.createElement("h1"));this.mContent=$(document.createElement("table"));this.mContent.body=$(document.createElement("tbody"));this.mPointer=$(document.createElement("div"));this.mPanel.style.position="absolute";this.mPanel.style.display="none";this.mPanel.appendChild(this.mHeader);this.mContent.appendChild(this.mContent.body);this.mPanel.appendChild(this.mContent);this.mPanel.appendChild(this.mPointer);this.mContainer.appendChild(this.mPanel);this.mHeader.update(this.HEADER_TEXT);this.mPanel.addClassName(this.CLASSNAME);if(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/iPad/i)){this.mClose=$(document.createElement("span"));this.mHeader.appendChild(this.mClose);this.mClose.update("x");this.mClose.addClassName("close");this.mClose.onclick=function(){this.parentNode.parentNode.hide()};this.mClose.style.cssFloat="right";this.mClose.style.marginRight="5px"}this.mPointer.style.position="absolute";this.mPointer.style.left="0px";this.mPointer.style.top="0px";this.hide();this.initalizeListeners()};this.initalizeListeners=function(){var B=this.mContext.select("a img");var D=this;for(var A=0;A<B.length;A++){var C=B[A];C.summaryDescription=this;if(!navigator.userAgent.match(/iPhone/i)&&!navigator.userAgent.match(/iPod/i)){C.onmouseover=function(E){D.show();D.update(jshGetSourceElement(E))}}C.title="";C.alt="";if(C.up()){C.up().title=""}}};this.render=function(A,B){if(A&&B){this.mContext=B;this.mContainer=A;this.init()}};this.show=function(){this.mHidden=false;this.mPanel.show();if(this.mAnimate==true){ElementEffects.fadeElement(this.mPanel,1,55,0.25,null)}};this.hide=function(){this.mHidden=true;if(this.mAnimate==true){var B=this;var A=function(){B.mPanel.hide()};ElementEffects.fadeElement(this.mPanel,0,55,0.25,A)}else{this.mPanel.hide()}};this.update=function(A){if(A){this.mCurrentElement=$(A);this.clearContent();this.requestContent(this.mCurrentElement);this.position(this.mCurrentElement)}};this.position=function(C){var D=C.cumulativeOffset();this.mPointer.className=this.CLASSNAME_LEFT_POINTER;var A=[];A[0]=D[0]+C.getWidth();A[1]=D[1]+Math.round(C.getHeight()/4);var B=jshGetWindowSize();if((A[0]+this.mPanel.getWidth())>=B[0]){this.mPointer.className=this.CLASSNAME_RIGHT_POINTER;A[0]=D[0]-this.mPanel.getWidth()}this.mPanel.style.left=A[0]+"px";this.mPanel.style.top=A[1]+"px"};this.requestContent=function(A){if(A&&this.mFunctionRequestContent){this.mFunctionRequestContent(A)}};this.clearContent=function(){this.mContent.body.update("")};this.updateContent=function(C,L){this.clearContent();if(C&&L){var D=0;var K;var B;var F;var G;var I;for(var H in L){if(L[H]&&(D<this.MAX_FIELD_VALUES)){K=document.createElement("tr");B=document.createElement("td");B.width="30%";B.height="1";B.style.textAlign="right";B.align="right";B.vAlign="top";F=document.createElement("td");F.width="70%";F.height="1";F.vAlign="top";G=$(document.createElement("span"));B.appendChild(G);G.update(H+":");F=$(F);I=L[H].truncate(this.MAX_VALUE_LENGTH,"&#133;");F.update(jshForceSpaces(I,this.MAX_SEGMENT_LENGTH));K.appendChild(B);K.appendChild(F);this.mContent.body.appendChild(K)}}if(checkIpad()||checkIphone()){K=document.createElement("tr");B=document.createElement("td");B.width="30%";B.height="1";B.style.textAlign="right";B.align="right";B.vAlign="top";F=document.createElement("td");F.width="70%";F.height="1";F.vAlign="top";G=$(document.createElement("span"));B.appendChild(G);G.update("");var E=document.createElement("a");E.href=C.parentNode.href;E.update("Zoom In / View Larger");F=$(F);F.appendChild(E);K.appendChild(B);K.appendChild(F);this.mContent.body.appendChild(K)}}else{var K=document.createElement("tr");var B=document.createElement("td");B.appendChild($(document.createElement("span")).update(this.NO_CONTENT));B.vAlign="top";K.appendChild(B);this.mContent.body.appendChild(K)}var A=document.createElement("td");A.height="99";A.colSpan="2";var J=document.createElement("tr");J.appendChild(A);this.mContent.body.appendChild(J);this.show()};this.setRequestContentFunction=function(A){this.mFunctionRequestContent=A};this.setAnimate=function(A){this.mAnimate=A}};
