dojo.addOnLoad(function(){var langDrop=dojo.query("div.langDropAbs");if(langDrop.length>0){langDrop.connect("onmouseenter",function(e){dojo.addClass(e.currentTarget,"langDropAbsHovered");});langDrop.connect("onmouseleave",function(e){dojo.removeClass(e.currentTarget,"langDropAbsHovered");});langDrop.connect("onclick",function(e){if(!dojo.hasClass(e.currentTarget,"langDropAbsHovered")){dojo.addClass(e.currentTarget,"langDropAbsHovered");}else{dojo.removeClass(e.currentTarget,"langDropAbsHovered");}});}});function openPopUpWindow(url,w,h){window.open(url,"","width="+w+", height="+h+", left=150, top=100,border=0, scrollbars=yes, resizable=yes");}function openWindow(url){window.open(url,"","width=500, height=400, left=150, top=100,border=0, scrollbars=yes, resizable=yes");}function Menu(url){window.open(url,"menu","height=350,width= 470,directories=no,location=no,menubar=no,resizable=no,status=no,toolbar=no,history=no,scrollbars=yes");}function getNextSibling(startNode){nextNode=startNode.nextSibling;while(nextNode!=null&&nextNode.nodeType!="1"){nextNode=nextNode.nextSibling;}return nextNode;}function getPreviousSibling(startNode){prevNode=startNode.previousSibling;while(prevNode!=null&&prevNode.nodeType!="1"){prevNode=prevNode.previousSibling;}return prevNode;}ulm_round_corner_size_main=2;ulm_round_corner_size_sub=2;function im_round_corners(tb,ms,isget,inner){var size=window["ulm_round_corner_size_"+ms];var pos=0;var wv="";if(!inner){wv+='\u003Cdiv class="imroundcorner" imrctype="'+tb+'" imrcgroup="'+ms+'"\u003E';}if(tb=="top"){wv+=im_rcs(size,1," imtopspace");for(var i=size-1;i>=0;i--){wv+=im_rcs(i);}}else{for(var i=0;i<size;i++){wv+=im_rcs(i);}wv+=im_rcs(size,1,"");}if(!inner){wv+="\u003C/div\u003E";}if(isget){return wv;}else{document.write(wv);}}function im_rcs(pos,is_cap,topclass){if(is_cap){return'\u003Cdiv class="imrbcolor imrc imbrc'+topclass+'" style="margin-left:'+pos+"px;margin-right:"+pos+'px;"\u003E\u003C/div\u003E';}else{return'\u003Cdiv class="imrbcolor imrcolor imrc" style="vertical-align:top;margin-left:'+pos+"px;margin-right:"+pos+'px;"\u003E\u003C/div\u003E';}}function toggleMore(truncCharCount,elementId,moreLinkName,lessLinkName){var elem=document.getElementById(elementId);if(!document.getElementById("moreLink")){if(document.getElementById("lessLink")){elem.removeChild(document.getElementById("lessLink"));}var len1=0;var secPart=document.createElement("span");var limitReached=new Boolean(false);move=new Array();for(var i=0;i<elem.childNodes.length;i++){var part=elem.childNodes[i];var len=textVal(part);if(len1+len>truncCharCount){if(part.nodeType==3&&limitReached==false&&part.nodeValue.lastIndexOf(". ",truncCharCount-len1)!=-1){var text=part.nodeValue;var lastIndex=text.lastIndexOf(". ",truncCharCount-len1);var textPart1=text.substring(0,lastIndex+2);var textPart2=text.substring(lastIndex+2);part.nodeValue=textPart1;textNode1=document.createTextNode(textPart1);textNode2=document.createTextNode(textPart2);move[move.length]=textNode2;}else{move[move.length]=part;}limitReached=new Boolean(true);}len1+=len;}for(var i=0;i<move.length;i++){secPart.appendChild(move[i]);}if(len1>truncCharCount){secPart.style.color="red";secPart.style.display="none";secPart.id="detailDesc";var moreLink=document.createElement("a");if(typeof lessLinkName!="undefined"){moreLink.href="javascript:toggleMore("+truncCharCount+", '"+elementId+"', '"+moreLinkName+"', '"+lessLinkName+"')";}else{moreLink.href="javascript:toggleMore(0, '"+elementId+"')";}moreLink.innerHTML=moreLinkName;moreLink.id="moreLink";elem.appendChild(moreLink);elem.parentNode.insertBefore(secPart,elem.nextSibling);}}else{var secPart=document.getElementById("detailDesc");elem.removeChild(document.getElementById("moreLink"));for(var i=0;i<secPart.childNodes.length;i++){var part=secPart.childNodes[i];elem.appendChild(part.cloneNode(true));}elem.parentNode.removeChild(document.getElementById("detailDesc"));if(typeof lessLinkName!="undefined"){var lessLink=document.createElement("a");lessLink.href="javascript:toggleMore("+truncCharCount+", '"+elementId+"','"+moreLinkName+"','"+lessLinkName+"')";lessLink.innerHTML=lessLinkName;lessLink.id="lessLink";elem.appendChild(document.createTextNode(" "));elem.appendChild(lessLink);}}}function textVal(elem){if(elem.nodeType==1&&elem.hasChildNodes()){var count=0;for(var i=0;i<elem.childNodes.length;i++){var x=elem.childNodes[i];count+=textVal(x);}return count;}else{if(elem.nodeType==3){return elem.data.length;}else{return 0;}}}var djCal;var djCalPattern={datePattern:"yyyy-MM-dd",selector:"date"};dojo.addOnLoad(function(){dojo.query("input.djCal").forEach(function(n,i){var l=dojo.place('<a href="#" class="djCalLink"><img src="/www/images/icons/date16.png" alt="..."></a>',n,"after");if(l){dojo.connect(l,"onclick","showDjCal");}});});function showDjCal(e){e.preventDefault();dojo.require("dijit.dijit");dojo.require("dijit.Calendar");dojo.require("dojo.date.locale");if(!djCal){var cont=dojo.create("div",{"class":"djCalContainer",style:{position:"absolute"}},dojo.body(),"last");var repl=dojo.create("div",{},cont,"first");var locale=dojoConfig.locale;if(dojo.attr(e.currentTarget.previousSibling,"lang")){locale=dojo.attr(e.currentTarget.previousSibling,"lang");}djCal=new dijit.Calendar({onValueSelected:function(date){console.log("onValueSelected");console.log(date);if(this.ref&&typeof date==="object"){this.ref.value=dojo.date.locale.format(date,djCalPattern);if(this.ref.onchange){this.ref.onchange();}}this.hide();},lang:locale,onBlur:function(){this.hide();},hide:function(){dojo.style(this.domNode.parentNode,"display","none");},show:function(){dojo.style(this.domNode.parentNode,"display","block");this.domNode.focus();}},repl);dojo.connect(djCal,"_setValueAttr",djCal,"onValueSelected");}var node=djCal.domNode.parentNode;var textf=e.currentTarget.previousSibling;var locale=dojoConfig.locale;if(dojo.attr(textf,"lang")){locale=dojo.attr(textf,"lang");}dojo.style(node,"top",(dojo.coords(e.currentTarget,true).y-5)+"px");dojo.style(node,"left",dojo.coords(e.currentTarget,true).x+"px");djCal.attr("lang",locale);djCal.attr("ref",textf);djCal.attr("value",(textf&&dojo.date.locale.parse(textf.value,djCalPattern))?dojo.date.locale.parse(textf.value,djCalPattern):new Date());djCal.show();djCal.focus();}var ratingHelpDialog;function connectRatingHelpLinks(boxTitle){dojo.query(".ratingHelpLink a").forEach(function(elem,index,all){dojo.connect(elem,"onclick",null,function(e){dojo.require("dijit.Dialog");e.preventDefault();if(!ratingHelpDialog){ratingHelpDialog=new dijit.Dialog({id:"ratingHelpDialog",title:boxTitle,preventCache:false,href:elem.href,style:"width:460px;"});}else{ratingHelpDialog.attr("href",elem.href);ratingHelpDialog.refresh();}ratingHelpDialog.show();});});}function connectWipeToggler(linkId,containerId,onToggleOn,onToggleOff){dojo.require("dojo.fx");dojo.connect(dojo.byId(linkId),"onclick",function(e){e.preventDefault();if(dojo.byId(containerId)&&dojo.style(containerId,"display")=="none"){dojo.fx.wipeIn({node:dojo.byId(containerId)}).play();var imgs=dojo.query("#"+linkId+" img");if(imgs.length>0){dojo.attr(imgs[0],"src","/www/images/icons/lessup10.png");}dojo.query("#"+linkId+" span.icoMoreDown10").removeClass("icoMoreDown10").addClass("icoLessUp10");if(typeof onToggleOn=="function"){onToggleOn.call(dojo.byId(linkId),e);}}else{if(dojo.byId(containerId)){dojo.fx.wipeOut({node:dojo.byId(containerId)}).play();var imgs=dojo.query("#"+linkId+" img");if(imgs.length>0){dojo.attr(imgs[0],"src","/www/images/icons/moredown10.png");}dojo.query("#"+linkId+" span.icoLessUp10").removeClass("icoLessUp10").addClass("icoMoreDown10");if(typeof onToggleOff=="function"){onToggleOff.call(dojo.byId(linkId),e);}}}});}function connectDialog(options){dojo.addOnLoad(function(){var query=options.query;if(typeof query=="undefined"){query="#"+options.id;}dojo.query(query).connect("onclick",function(e){e.preventDefault();dojo.require("dijit.Dialog");if(typeof options.href=="undefined"&&e.currentTarget&&e.currentTarget.href){options.href=e.currentTarget.href;}if(typeof options.width=="undefined"){options.width=300;}if(!dlg){dlg=new dijit.Dialog({content:""});}if(typeof options.content=="undefined"&&typeof options.href=="string"){dlg.attr("href",options.href);dlg.refresh();}else{dlg.attr("content",options.content);}dlg.attr("style","width:"+options.width+"px");dlg.attr("title",options.title);dlg.show();if(typeof options.onShow=="function"){options.onShow.call(dlg);}});});}var dlg;function recommendSubmit(e){console.debug("In recommendSubmit "+e.target);e.preventDefault();e.stopPropagation();var diag=this;dojo.xhrPost({form:dojo.byId("recommendForm"),handleAs:"text",load:function(data){diag.attr("content",data);emailRecommendationCount++;dojo.query(".emailRecommendationCount").forEach(function(node,index,arr){node.innerHTML=emailRecommendationCount;});dojo.connect(dojo.byId("recommendForm"),"onsubmit",diag,function(e){recommendSubmit.call(this,e);});},error:function(error){diag.attr("content",error);dojo.connect(dojo.byId("recommendForm"),"onsubmit",diag,function(e){recommendSubmit.call(this,e);});}});}function registerSocialRecommend(dataId,socialSource){dojo.xhrGet({url:"/SummaryBySocialLike.do?action=rateSummaryBySocialLike&dataId="+dataId+"&socialSource="+socialSource,handleAs:"json",preventCache:true});}function addToBookshelf(e,myurl,fallbackUrl){e.preventDefault();dojo.xhrGet({url:myurl,handleAs:"json",preventCache:true,load:function(data){dojo.query("a.addToBookshelf").addClass("hidden");dojo.query("a.onBookshelf").removeClass("hidden");},error:function(error){dojo.doc.location.assign(fallbackUrl);}});}function removeFromBookshelf(e,myurl,fallbackUrl){e.preventDefault();dojo.xhrGet({url:myurl,handleAs:"json",preventCache:true,load:function(data){dojo.query("a.addToBookshelf").removeClass("hidden");dojo.query("a.onBookshelf").addClass("hidden");},error:function(error){dojo.doc.location.assign(fallbackUrl);}});}function userReviewSubmit(e){console.debug("In userReviewSubmit "+e.target);e.preventDefault();e.stopPropagation();var diag=this;dojo.xhrPost({form:dojo.byId("userReviewForm"),handleAs:"text",load:function(data){diag.attr("content",data);dojo.connect(dojo.byId("userReviewForm"),"onsubmit",diag,function(e){userReviewSubmit.call(this,e);});},error:function(error){diag.attr("content",error);dojo.connect(dojo.byId("userReviewForm"),"onsubmit",diag,function(e){userReviewSubmit.call(this,e);});}});}function registerSummaryTooltip(){dojo.addOnLoad(function(){dojo.require("dojoga.SummaryTooltip");tooltipcache=new Object();mouseoverelement=null;dojo.query(".summaryImageLink[id^=dataId]").connect("onmouseleave",function(evt){if(mouseoverelement===evt.target){mouseoverelement=null;}});dojo.query(".summaryImageLink[id^=dataId]").connect("onmouseenter",function(evt){var node=evt.target;mouseoverelement=node;var rel=dojo.attr(node,"id");var tooltip=dijit.byId("tooltip_"+rel);if(!tooltip){tooltip=new dojoga.SummaryTooltip({id:"tooltip_"+rel,connectId:[dojo.attr(evt.target,"id")]});dojo.xhrGet({url:"/ShowAbstractPreview.do?action=jsonSummaryPopup\u0026dataId="+rel.substring(7),handleAs:"json",load:function(data){tooltip.label=createTooltipLabel(data);tooltipcache[rel]=tooltip;if(mouseoverelement===evt.target){tooltip._onHover(evt);}},error:function(error){console.error("Error: ",error);}});}});});}function createTooltipLabel(data){var buffer="<b>"+data.mainTitle+"</b><br><hr>";if(data.recommendation){buffer+='<p class="ballonText">'+data.recommendation+"</p>";}if(data.learnTopics&&data.learnTopics.length>0){dojo.forEach(data.learnTopics,function(entry,index,array){if(index==0){buffer+='<b class="balloonText">'+entry+"</b><ul>";}else{buffer+='<li class="balloonText">'+entry+"</li>";}if(index==array.length-1){buffer+="</ul>";}});}if(data.ratingOverall>0){buffer+='<table cellpadding="0" cellspacing="0" ><tr><td class="balloonText" colspan="4"><b>'+data.stringRating+"</b></td></tr>";buffer+='<tr><td class="balloonText">'+data.stringOverall+'</td><td><img src="/www/images/invis.gif" width="10" height="1"></td><td class="balloonText"><img src="/www/images/rating'+data.ratingOverall+'.gif" alt="'+data.ratingOverall+'"></td><td class="balloonText">&nbsp;&nbsp;('+data.ratingOverall+")</td></tr>";if(data.ratingApplicability>0){buffer+='<tr><td class="balloonText">'+data.stringApplicability+'</td><td><img src="/www/images/invis.gif" width="10" height="1"></td><td class="balloonText"><img src="/www/images/rating'+data.ratingApplicability+'.gif" alt="'+data.ratingApplicability+'"></td><td class="balloonText">&nbsp;&nbsp;('+data.ratingApplicability+")</td></tr>";}if(data.ratingImportance>0){buffer+='<tr><td class="balloonText">'+data.stringImportance+'</td><td><img src="/www/images/invis.gif" width="10" height="1"></td><td class="balloonText"><img src="/www/images/rating'+data.ratingImportance+'.gif" alt="'+data.ratingImportance+'"></td><td class="balloonText">&nbsp;&nbsp;('+data.ratingImportance+")</td></tr>";}if(data.ratingInnovation>0){buffer+='<tr><td class="balloonText">'+data.stringInnovation+'</td><td><img src="/www/images/invis.gif" width="10" height="1"></td><td class="balloonText"><img src="/www/images/rating'+data.ratingInnovation+'.gif" alt="'+data.ratingInnovation+'"></td><td class="balloonText">&nbsp;&nbsp;('+data.ratingInnovation+")</td></tr>";}if(data.ratingStyle>0){buffer+='<tr><td class="balloonText">'+data.stringStyle+'</td><td><img src="/www/images/invis.gif" width="10" height="1"></td><td class="balloonText"><img src="/www/images/rating'+data.ratingStyle+'.gif" alt="'+data.ratingStyle+'"></td><td class="balloonText">&nbsp;&nbsp;('+data.ratingStyle+")</td></tr>";}buffer+="</table>";}return buffer;}function openInfoBox(divId,anchorId){dojo.require("dojoga.InfoBox");var customW=dojo.style(divId,"width");var infoBox=dijit.byId(divId);if(!infoBox){infoBox=new dojoga.InfoBox({id:divId},divId);}infoBox.open(dojo.byId(anchorId));if(customW){dojo.query(".soria .dojogaInfoBoxContainer").style("width",customW+"px");console.log(dojo.query(".soria .dojogaInfoBoxContainer").length);}}function checkMsgBar(url){dojo.addOnLoad(function(){dojo.require("dojoga.MsgBar");dojo.xhrGet({url:url,handleAs:"json",load:function(data){if(data&&data.message){var msgBar=new dojoga.MsgBar({msgBarHistoryId:data.msgBarHistoryId,message:data.message});}},error:function(error){console.error("Error: ",error);}});});}function jsTimezone(){dojo.require("dojo.date.locale");dojo.query(".jsTimezone").forEach(function(n,i){var cTime=dojo.query(".jsDate",n)[0];var cDate=dojo.query(".nonJsDate",n)[0];if(cTime&&cDate){var millis=cTime.firstChild.nodeValue;var myTime=new Date(millis*1);cDate.innerHTML=dojo.date.locale.format(myTime,{formatLength:"medium"});}});}var docViewer;function getDocViewer(){if(docViewer){return docViewer;}else{if(window.FlexPaperViewer){return window.FlexPaperViewer;}else{if(document.FlexPaperViewer){return document.FlexPaperViewer;}else{return null;}}}}function onExternalLinkClicked(link){window.location.href=link;}function onProgress(loadedBytes,totalBytes){}function onDocumentLoading(){}function onDocumentLoaded(totalPages){dojo.style(dojo.byId("flashContainer"),"width",(dojo.window.getBox().w-280)+"px");dojo.style(dojo.byId("socialBar"),"width",(dojo.window.getBox().w-200)+"px");dojo.style(dojo.byId("flashContainer"),"height",(dojo.window.getBox().h-30)+"px");dojo.style("container","height",(dojo.window.getBox().h-400)+"px");dojo.style("sidebar","height",(dojo.window.getBox().h-400)+"px");if(dojo.window.getBox().w<=1024){getDocViewer().setZoom(1.16);}dojo.connect(window,"onresize",function(e){dojo.style(dojo.byId("flashContainer"),"width",(dojo.window.getBox().w-280)+"px");dojo.style(dojo.byId("socialBar"),"width",(dojo.window.getBox().w-200)+"px");dojo.style(dojo.byId("flashContainer"),"height",(dojo.window.getBox().h-30)+"px");dojo.style("container","height",(dojo.window.getBox().h-400)+"px");dojo.style("sidebar","height",(dojo.window.getBox().h-400)+"px");if(dojo.window.getBox().w<=1024){getDocViewer().fitWidth();}});}function onDocumentLoadedError(errMessage){alert(errMessage);}
