var TrimPath;(function(){if(TrimPath==null)TrimPath=new Object();if(TrimPath.evalEx==null)TrimPath.evalEx=function(src){return eval(src);};var UNDEFINED;if(Array.prototype.pop==null)Array.prototype.pop=function(){if(this.length===0){return UNDEFINED;};return this[--this.length];};if(Array.prototype.push==null)Array.prototype.push=function(){for(var i=0;i<arguments.length;++i){this[this.length]=arguments[i];};return this.length;};TrimPath.parseTemplate=function(tmplContent,optTmplName,optEtc){if(optEtc==null)optEtc=TrimPath.parseTemplate_etc;var funcSrc=parse(tmplContent,optTmplName,optEtc);var func=TrimPath.evalEx(funcSrc,optTmplName,1);if(func!=null)return new optEtc.Template(optTmplName,tmplContent,funcSrc,func,optEtc);return null;};try{String.prototype.process=function(context,optFlags){var template=TrimPath.parseTemplate(this,null);if(template!=null)return template.process(context,optFlags);return this;}}catch(e){};TrimPath.parseTemplate_etc={};TrimPath.parseTemplate_etc.statementTag="forelse|for|if|elseif|else|var|macro";TrimPath.parseTemplate_etc.statementDef={"if":{delta:1,prefix:"if (",suffix:") {",paramMin:1},"else":{delta:0,prefix:"} else {"},"elseif":{delta:0,prefix:"} else if (",suffix:") {",paramDefault:"true"},"/if":{delta:-1,prefix:"}"},"for":{delta:1,paramMin:3,prefixFunc:function(stmtParts,state,tmplName,etc){if(stmtParts[2]!="in")throw new etc.ParseError(tmplName,state.line,"bad for loop statement: "+stmtParts.join(' '));var iterVar=stmtParts[1];var listVar="__LIST__"+iterVar;return["var ",listVar," = ",stmtParts[3],";","var __LENGTH_STACK__;","if (typeof(__LENGTH_STACK__) == 'undefined' || !__LENGTH_STACK__.length) __LENGTH_STACK__ = new Array();","__LENGTH_STACK__[__LENGTH_STACK__.length] = 0;","if ((",listVar,") != null) { ","var ",iterVar,"_ct = 0;",listVar,".each(function(",iterVar,") { ","__LENGTH_STACK__[__LENGTH_STACK__.length - 1]++;"].join("");}},"forelse":{delta:0,prefix:"} } if (__LENGTH_STACK__[__LENGTH_STACK__.length - 1] == 0) { if (",suffix:") {",paramDefault:"true"},"/for":{delta:-1,prefix:"}); }; delete __LENGTH_STACK__[__LENGTH_STACK__.length - 1];"},"var":{delta:0,prefix:"var ",suffix:";"},"macro":{delta:1,prefixFunc:function(stmtParts,state,tmplName,etc){var macroName=stmtParts[1].split('(')[0];return["var ",macroName," = function",stmtParts.slice(1).join(' ').substring(macroName.length),"{ var _OUT_arr = []; var _OUT = { write: function(m) { if (m) _OUT_arr.push(m); } }; "].join('');}},"/macro":{delta:-1,prefix:" return _OUT_arr.join(''); };"}};TrimPath.parseTemplate_etc.modifierDef={"eat":function(v){return"";},"escape":function(s){return String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");},"capitalize":function(s){return String(s).toUpperCase();},"default":function(s,d){return s!=null?s:d;}};TrimPath.parseTemplate_etc.modifierDef.h=TrimPath.parseTemplate_etc.modifierDef.escape;TrimPath.parseTemplate_etc.Template=function(tmplName,tmplContent,funcSrc,func,etc){this.process=function(context,flags){if(context==null)context={};if(context._MODIFIERS==null)context._MODIFIERS={};if(context.defined==null)context.defined=function(str){return(context[str]!=undefined);};for(var k in etc.modifierDef){if(context._MODIFIERS[k]==null)context._MODIFIERS[k]=etc.modifierDef[k];};if(flags==null)flags={};var resultArr=[];var resultOut={write:function(m){resultArr.push(m);}};try{func(resultOut,context,flags);}catch(e){if(flags.throwExceptions==true)throw e;var result=new String(resultArr.join("")+"[ERROR: "+e.toString()+(e.message?'; '+e.message:'')+"]");result["exception"]=e;return result;};return resultArr.join("");};this.name=tmplName;this.source=tmplContent;this.sourceFunc=funcSrc;this.toString=function(){return"TrimPath.Template ["+tmplName+"]";}};TrimPath.parseTemplate_etc.ParseError=function(name,line,message){this.name=name;this.line=line;this.message=message;};TrimPath.parseTemplate_etc.ParseError.prototype.toString=function(){return("TrimPath template ParseError in "+this.name+": line "+this.line+", "+this.message);};var parse=function(body,tmplName,etc){body=cleanWhiteSpace(body);var funcText=["var TrimPath_Template_TEMP = function(_OUT, _CONTEXT, _FLAGS) { with (_CONTEXT) {"];var state={stack:[],line:1};var endStmtPrev=-1;while(endStmtPrev+1<body.length){var begStmt=endStmtPrev;begStmt=body.indexOf("{",begStmt+1);while(begStmt>=0){var endStmt=body.indexOf('}',begStmt+1);var stmt=body.substring(begStmt,endStmt);var blockrx=stmt.match(/^\{(cdata|minify|eval)/);if(blockrx){var blockType=blockrx[1];var blockMarkerBeg=begStmt+blockType.length+1;var blockMarkerEnd=body.indexOf('}',blockMarkerBeg);if(blockMarkerEnd>=0){var blockMarker;if(blockMarkerEnd-blockMarkerBeg<=0){blockMarker="{/"+blockType+"}";}else{blockMarker=body.substring(blockMarkerBeg+1,blockMarkerEnd);};var blockEnd=body.indexOf(blockMarker,blockMarkerEnd+1);if(blockEnd>=0){emitSectionText(body.substring(endStmtPrev+1,begStmt),funcText);var blockText=body.substring(blockMarkerEnd+1,blockEnd);if(blockType=='cdata'){emitText(blockText,funcText);}else if(blockType=='minify'){emitText(scrubWhiteSpace(blockText),funcText);}else if(blockType=='eval'){if(blockText!=null&&blockText.length>0)funcText.push('_OUT.write( (function() { '+blockText+' })() );');};begStmt=endStmtPrev=blockEnd+blockMarker.length-1;}}}else if(body.charAt(begStmt-1)!='$'&&body.charAt(begStmt-1)!='\\'){var offset=(body.charAt(begStmt+1)=='/'?2:1);if(body.substring(begStmt+offset,begStmt+10+offset).search(TrimPath.parseTemplate_etc.statementTag)==0)break;};begStmt=body.indexOf("{",begStmt+1);};if(begStmt<0)break;var endStmt=body.indexOf("}",begStmt+1);if(endStmt<0)break;emitSectionText(body.substring(endStmtPrev+1,begStmt),funcText);emitStatement(body.substring(begStmt,endStmt+1),state,funcText,tmplName,etc);endStmtPrev=endStmt;};emitSectionText(body.substring(endStmtPrev+1),funcText);if(state.stack.length!=0)throw new etc.ParseError(tmplName,state.line,"unclosed, unmatched statement(s): "+state.stack.join(","));funcText.push("}}; TrimPath_Template_TEMP");return funcText.join("");};var emitStatement=function(stmtStr,state,funcText,tmplName,etc){var parts=stmtStr.slice(1,-1).split(' ');var stmt=etc.statementDef[parts[0]];if(stmt==null){emitSectionText(stmtStr,funcText);return;};if(stmt.delta<0){if(state.stack.length<=0)throw new etc.ParseError(tmplName,state.line,"close tag does not match any previous statement: "+stmtStr);state.stack.pop();};if(stmt.delta>0)state.stack.push(stmtStr);if(stmt.paramMin!=null&&stmt.paramMin>=parts.length)throw new etc.ParseError(tmplName,state.line,"statement needs more parameters: "+stmtStr);if(stmt.prefixFunc!=null)funcText.push(stmt.prefixFunc(parts,state,tmplName,etc));else funcText.push(stmt.prefix);if(stmt.suffix!=null){if(parts.length<=1){if(stmt.paramDefault!=null)funcText.push(stmt.paramDefault);}else{for(var i=1;i<parts.length;i++){if(i>1)funcText.push(' ');funcText.push(parts[i]);}};funcText.push(stmt.suffix);}};var emitSectionText=function(text,funcText){if(text.length<=0)return;var nlPrefix=0;var nlSuffix=text.length-1;while(nlPrefix<text.length&&(text.charAt(nlPrefix)=='\n'))nlPrefix++;while(nlSuffix>=0&&(text.charAt(nlSuffix)==' '||text.charAt(nlSuffix)=='\t'))nlSuffix--;if(nlSuffix<nlPrefix)nlSuffix=nlPrefix;if(nlPrefix>0){funcText.push('if (_FLAGS.keepWhitespace == true) _OUT.write("');var s=text.substring(0,nlPrefix).replace('\n','\\n');if(s.charAt(s.length-1)=='\n')s=s.substring(0,s.length-1);funcText.push(s);funcText.push('");');};var lines=text.substring(nlPrefix,nlSuffix+1).split('\n');for(var i=0;i<lines.length;i++){emitSectionTextLine(lines[i],funcText);if(i<lines.length-1)funcText.push('_OUT.write("\\n");\n');};if(nlSuffix+1<text.length){funcText.push('if (_FLAGS.keepWhitespace == true) _OUT.write("');var s=text.substring(nlSuffix+1).replace('\n','\\n');if(s.charAt(s.length-1)=='\n')s=s.substring(0,s.length-1);funcText.push(s);funcText.push('");');}};var emitSectionTextLine=function(line,funcText){var endMarkPrev='}';var endExprPrev=-1;while(endExprPrev+endMarkPrev.length<line.length){var begMark="${",endMark="}";var begExpr=line.indexOf(begMark,endExprPrev+endMarkPrev.length);if(begExpr<0)break;if(line.charAt(begExpr+2)=='%'){begMark="${%";endMark="%}";};var endExpr=line.indexOf(endMark,begExpr+begMark.length);if(endExpr<0)break;emitText(line.substring(endExprPrev+endMarkPrev.length,begExpr),funcText);var exprArr=line.substring(begExpr+begMark.length,endExpr).replace(/\|\|/g,"#@@#").split('|');for(var k in exprArr){if(exprArr[k].replace)exprArr[k]=exprArr[k].replace(/#@@#/g,'||');};funcText.push('_OUT.write(');emitExpression(exprArr,exprArr.length-1,funcText);funcText.push(');');endExprPrev=endExpr;endMarkPrev=endMark;};emitText(line.substring(endExprPrev+endMarkPrev.length),funcText);};var emitText=function(text,funcText){if(text==null||text.length<=0)return;text=text.replace(/\\/g,'\\\\');text=text.replace(/\n/g,'\\n');text=text.replace(/"/g,'\\"');funcText.push('_OUT.write("');funcText.push(text);funcText.push('");');};var emitExpression=function(exprArr,index,funcText){var expr=exprArr[index];if(index<=0){funcText.push(expr);return;};var parts=expr.split(':');funcText.push('_MODIFIERS["');funcText.push(parts[0]);funcText.push('"](');emitExpression(exprArr,index-1,funcText);if(parts.length>1){funcText.push(',');funcText.push(parts[1]);};funcText.push(')');};var cleanWhiteSpace=function(result){result=result.replace(/\t/g,"    ");result=result.replace(/\r\n/g,"\n");result=result.replace(/\r/g,"\n");result=result.replace(/^(\s*\S*(\s+\S+)*)\s*$/,'$1');return result;};var scrubWhiteSpace=function(result){result=result.replace(/^\s+/g,"");result=result.replace(/\s+$/g,"");result=result.replace(/\s+/g," ");result=result.replace(/^(\s*\S*(\s+\S+)*)\s*$/,'$1');return result;};TrimPath.parseDOMTemplate=function(elementId,optDocument,optEtc){if(optDocument==null)optDocument=document;var element=optDocument.getElementById(elementId);var content=element.value;if(content==null)content=element.innerHTML;content=content.replace(/&lt;/g,"<").replace(/&gt;/g,">");return TrimPath.parseTemplate(content,elementId,optEtc);};TrimPath.processDOMTemplate=function(elementId,context,optFlags,optDocument,optEtc){return TrimPath.parseDOMTemplate(elementId,optDocument,optEtc).process(context,optFlags);}})();var HTTP={};HTTP._factories=[function(){return new XMLHttpRequest();},function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");}];HTTP._factory=null;HTTP._requestList=new Array();window.addEvent('unload',function(){if(HTTP._requestList!=null){HTTP.cleanUpRequests();}});HTTP.createRequest=function(){var request=null;if(HTTP._factory==null){for(var i=0;i<HTTP._factories.length;i++){try{var factory=HTTP._factories[i];request=factory();if(request!=null&&request!=undefined){HTTP._factory=factory;break;}}catch(e){}}}else{request=HTTP._factory();};if(request!=null){if(HTTP._requestList!=null){HTTP._requestList.push(request);};return(request);}else{return(null);}};HTTP.cleanUpRequests=function(){for(var i=0;i<HTTP._requestList.length;i++){try{HTTP._requestList[i].onreadystatechange=null;cleanUp(HTTP._requestList[i]);}catch(e){return;}}};HTTP.getXml=function(url,callback,errorCallback){var request=HTTP.createRequest();request.onreadystatechange=function(){try{if(request.readyState==4){if((request.status==200||request.status==0)){if(request.responseXml==undefined||request.responseXml==null){callback(XML.CreateDocument(request.responseText),request.responseText);}else{callback(request.responseXML,request.responseText);};request=null;}else if(request.status==304){callback(XML.CreateDocument("<notModified></notModified>"),"<notModified></notModified>");}else{if(errorCallback!=null)errorCallback(request.status);}}}catch(e){if(errorCallback!=null)errorCallback(e);}};try{request.onerror=function(){if(errorCallback!=null)errorCallback();};}catch(e){};request.open("GET",url,true);request.setRequestHeader('If-Modified-Since','Mon, 26 Jul 1997 05:00:00 GMT');var f=request.send(null);};HTTP.getText=function(url,callback){var request=HTTP.createRequest();request.onreadystatechange=function(){if(request.readyState==4&&request.status==200){if(callback!=null)callback(request.responseText);request=null;}};request.open("GET",url,true);request.setRequestHeader('If-Modified-Since','Mon, 26 Jul 1997 05:00:00 GMT');request.send(null);};HTTP.post=function(url,strPostInfo,callback,errorHandler){var request=HTTP.createRequest();request.onreadystatechange=function(){if(request.readyState==4){if(request.status==200){callback(request.responseText);request=null;}else{if(errorHandler)errorHandler(request.status,request.statusText);else callback(null);request=null;}}};request.open("POST",url);request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");request.send(strPostInfo);};HTTP.postAsXml=function(url,strPostInfo,callback,errorHandler){var request=HTTP.createRequest();request.onreadystatechange=function(){if(request.readyState==4){if(request.status==200){callback(request.responseText);request=null;}else{if(errorHandler)errorHandler(request.status,request.statusText);else callback(null);request=null;}}};request.open("POST",url);request.setRequestHeader("Content-Type","text/xml");request.send(strPostInfo);};HTTP.postXmlSynchronous=function(url,strPostInfo){var request=HTTP.createRequest();request.open("POST",url,false);request.setRequestHeader("Content-Type","text/xml");request.send(strPostInfo);return request.responseText;};HTTP.postSynchronous=function(url,strPostInfo){var request=HTTP.createRequest();request.open("POST",url,false);request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");request.send(strPostInfo);return request.responseText;};var XML={};XML.CreateDocument=function(strXml){try{return(new DOMParser()).parseFromString(strXml,"text/xml");}catch(e){};try{var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.loadXML(strXml);return xmlDoc;}catch(e){}};XML.MakeSureDocumentIsNormalized=function(xmlDoc){if(window.gecko){if((xmlDoc!=null)&&(xmlDoc.hasBeenNormalized!=true)){xmlDoc.hasBeenNormalized=true;xmlDoc.normalize();}}};XML.GetElementsByTagNameOneLevel=function(xmlElem,strValue){XML.MakeSureDocumentIsNormalized(xmlElem);if(xmlElem["childNodes"]!=null){var results=new Array();var j=0;var childCount=xmlElem.childNodes.length;for(var i=0;i<childCount;++i){var child=xmlElem.childNodes[i];if(child.nodeName==strValue){results[j++]=child;}};return results;};return null;};XML.GetElementByTagNameOneLevel=function(xmlElem,strValue){XML.MakeSureDocumentIsNormalized(xmlElem);if(xmlElem["childNodes"]!=null){var childCount=xmlElem.childNodes.length;for(var i=0;i<childCount;++i){var child=xmlElem.childNodes[i];if(child.nodeName==strValue){return child;}}};return null;};XML.FindAndFillValueOneLevel=function(xmlElem,strValue){XML.MakeSureDocumentIsNormalized(xmlElem);try{if(strValue==null){tmp=xmlElem;}else{var tmp=null;for(var i=0;i<xmlElem.childNodes.length;i++){if(xmlElem.childNodes[i].nodeName==strValue){tmp=xmlElem.childNodes[i];break;}}};if(tmp!=null){var result="";for(var i=0;i<tmp.childNodes.length;i++){if(tmp.childNodes[i].nodeType==3){result+=tmp.childNodes[i].nodeValue;}};return result;}}catch(e){};return"";};XML.FindAndFillValue=function(xmlElem,strValue,unescapeText){XML.MakeSureDocumentIsNormalized(xmlElem);try{if(strValue==null){tmp=xmlElem;}else{var tmp=XML.GetFirstElementByTagName(xmlElem,strValue);};if(tmp!=null){var result="";for(var i=0;i<tmp.childNodes.length;i++){if((tmp.childNodes[i].nodeType==3)||(tmp.childNodes[i].nodeType==4)){result+=tmp.childNodes[i].nodeValue;}};if(unescapeText==true){return unescape(result);};return result;}}catch(e){};return"";};XML.SetNodeValue=function(xmlElem,strValue){var tmp2=xmlElem.childNodes[0];tmp2.nodeValue=strValue;};XML.FindAndFillValueInt=function(xmlElem,strValue){XML.MakeSureDocumentIsNormalized(xmlElem);try{var strRes=XML.FindAndFillValue(xmlElem,strValue);if(strRes.length>0)return parseInt(strRes,10);}catch(e){};return-1;};XML.FindAndFillValueFloat=function(xmlElem,strValue){XML.MakeSureDocumentIsNormalized(xmlElem);try{var strRes=XML.FindAndFillValue(xmlElem,strValue);if(strRes.length>0)return parseFloat(strRes);}catch(e){};return-1.0;};XML.FindAndFillValueBool=function(xmlElem,strValue){XML.MakeSureDocumentIsNormalized(xmlElem);try{var strRes=XML.FindAndFillValue(xmlElem,strValue);if(strRes=="true")return true;if(strRes=="false")return false;}catch(e){};return null;};XML.HasElementByTagName=function(xmlElem,strValue){XML.MakeSureDocumentIsNormalized(xmlElem);try{var tmp=XML.GetFirstElementByTagName(xmlElem,strValue);if(tmp!=null)return true;}catch(e){};return false;};XML.GetAttributeFromTag=function(xmlElem,strTagName,strAttributeName,defaultValue){XML.MakeSureDocumentIsNormalized(xmlElem);try{var tmp=XML.GetFirstElementByTagName(xmlElem,strTagName);if(tmp!=null){var tmp2=tmp.getAttribute(strAttributeName);if(tmp2!=null){return tmp2;}}}catch(e){};if(defaultValue==null){defaultValue="";};return defaultValue;};XML.GetFirstElementByTagName=function(xmlElem,strTagName){XML.MakeSureDocumentIsNormalized(xmlElem);try{var elemList=XML.GetElementsByTagName(xmlElem,strTagName);if(elemList!=null)return elemList[0];}catch(e){};return null;};XML.GetFirstElementByTagNameOneLevel=function(xmlElem,strTagName){XML.MakeSureDocumentIsNormalized(xmlElem);try{var elemList=XML.GetElementsByTagName(xmlElem,strTagName);if(elemList!=null){for(var i=0;i<elemList.length;i++){if(elemList[i].parentNode==xmlElem){return elemList[i];}}}}catch(e){};return null;};XML.GetElementsByTagName=function(xmlElem,strTagName){XML.MakeSureDocumentIsNormalized(xmlElem);try{var elemList=xmlElem.getElementsByTagName(strTagName);if(elemList!=null&&elemList.length>0)return elemList;}catch(e){};return null;};XML.Serialize=function(node){if(typeof XMLSerializer!="undefined")return(new XMLSerializer()).serializeToString(node);else if(node.xml)return node.xml;else alert("XML.Serialize is not supported or can't serialize "+node);};XML.StripCDataFromText=function(strCDataText){var idxStart=strCDataText.indexOf("<![CDATA[")+9;var idxEnd=strCDataText.indexOf("]]>");return strCDataText.substring(idxStart,idxEnd);};XML.CreateCDataNode=function(xmlDoc,strText){return xmlDoc.createCDATASection(strText.replace(/]]>/g,"..."));};XML._escapesBadCharacters=null;XML.CreateTextNode=function(xmlDoc,strText){if(XML._escapesBadCharacters==null){var xmlDoc=XML.CreateDocument("<x></x>");var yElem=xmlDoc.createElement("y");yElem.appendChild(xmlDoc.createTextNode("<"));xmlDoc.documentElement.appendChild(yElem);XML._escapesBadCharacters=(XML.Serialize(xmlDoc).indexOf("<x><y>&lt;</y></x>")>-1);};if(!XML._escapesBadCharacters){strText=XML.RemoveBadXMLCharacters(strText);};return xmlDoc.createTextNode(strText);};XML.RemoveBadXMLCharacters=function(strText){strText=strText.replace(/&/g,"&amp;");strText=strText.replace(/</g,"&lt;");strText=strText.replace(/>/g,"&gt;");return strText;};var DOM={};DOM.ClearChildren=function(xmlElem){if(xmlElem==null||xmlElem==false)return;while(xmlElem.hasChildNodes()){var fc=xmlElem.firstChild;xmlElem.removeChild(fc);}};DOM.RemoveFromDOM=function(xmlElem){if(xmlElem==null||xmlElem==false)return;var parent=xmlElem.parentNode;parent.removeChild(xmlElem);};DOM.SetVisible=function(domElem,bVisible,widthHeightStyle){domElem.style.visibility=bVisible?"visible":"hidden";if(widthHeightStyle!=undefined){domElem.style.width=widthHeightStyle;domElem.style.height=widthHeightStyle;}};DOM.GetXml=function(url,funcCallback){var xmlIsland=DOM.GetXmlDataIsland();if(xmlIsland!=null)funcCallback(xmlIsland);else HTTP.getXml(url,funcCallback);};DOM.GetXmlDataIsland=function(strName){if($(strName)!=null){var value=$(strName).innerHTML;value=value.replace(/^\s+/,"").replace(/&nbsp;/g," ");if(navigator.userAgent.toLowerCase().indexOf("safari")!=-1){value=value.replace(/&/g,"&amp;");}else{value=value.replace(/&lt;/g,"<").replace(/&gt;/g,">")};value=value.replace(/QQltQQ/g,"&lt;").replace(/QQgtQQ/g,"&gt;").replace(/QQquotQQ/g,"&quot;");var result=XML.CreateDocument(value);return result;};try{if(strName==undefined)strName='embeddedXmlData';if(window[strName]){if(window[strName]!=undefined&&window[strName].length>0){var doc=XML.CreateDocument(window[strName]);window[strName]='';return doc;}}}catch(e){};return null;};DOM.ConvertAllLinksToOpenInNewWindow=function(parentNode){function openInNewWindow(){var newWindow=window.open(this.getAttribute('href'),'_blank');newWindow.focus();return false;};if(parentNode==null)parentNode=document;var links=$(parentNode).getElements('a');for(var i=0;i<links.length;i++){var link=$(links[i]);if(link.quantiaLink!=true&&link.onclick=='undefined')link.onclick=openInNewWindow;}};var DocumentUtils={};DocumentUtils.CreateALink=function(strLinkLocation,strInnerText,bNewWindow,windowArguments){var newElt=new Element('a');newElt.quantiaLink=true;newElt.href=strLinkLocation;if(bNewWindow)newElt.onclick=function(){var win=window.open(strLinkLocation,"_blank",windowArguments);win.focus();return false;};newElt.appendChild(document.createTextNode(strInnerText));return(newElt);};var hexcase=0;var b64pad="";var chrsz=16;function hex_md5(s){return binl2hex(core_md5(str2binl(s),s.length*chrsz));};function b64_md5(s){return binl2b64(core_md5(str2binl(s),s.length*chrsz));};function str_md5(s){return binl2str(core_md5(str2binl(s),s.length*chrsz));};function hex_hmac_md5(key,data){return binl2hex(core_hmac_md5(key,data));};function b64_hmac_md5(key,data){return binl2b64(core_hmac_md5(key,data));};function str_hmac_md5(key,data){return binl2str(core_hmac_md5(key,data));};function md5_vm_test(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72";};function core_md5(x,len){x[len>>5]|=0x80<<((len)%32);x[(((len+64)>>>9)<<4)+14]=len;var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;for(var i=0;i<x.length;i+=16){var olda=a;var oldb=b;var oldc=c;var oldd=d;a=md5_ff(a,b,c,d,x[i+0],7,-680876936);d=md5_ff(d,a,b,c,x[i+1],12,-389564586);c=md5_ff(c,d,a,b,x[i+2],17,606105819);b=md5_ff(b,c,d,a,x[i+3],22,-1044525330);a=md5_ff(a,b,c,d,x[i+4],7,-176418897);d=md5_ff(d,a,b,c,x[i+5],12,1200080426);c=md5_ff(c,d,a,b,x[i+6],17,-1473231341);b=md5_ff(b,c,d,a,x[i+7],22,-45705983);a=md5_ff(a,b,c,d,x[i+8],7,1770035416);d=md5_ff(d,a,b,c,x[i+9],12,-1958414417);c=md5_ff(c,d,a,b,x[i+10],17,-42063);b=md5_ff(b,c,d,a,x[i+11],22,-1990404162);a=md5_ff(a,b,c,d,x[i+12],7,1804603682);d=md5_ff(d,a,b,c,x[i+13],12,-40341101);c=md5_ff(c,d,a,b,x[i+14],17,-1502002290);b=md5_ff(b,c,d,a,x[i+15],22,1236535329);a=md5_gg(a,b,c,d,x[i+1],5,-165796510);d=md5_gg(d,a,b,c,x[i+6],9,-1069501632);c=md5_gg(c,d,a,b,x[i+11],14,643717713);b=md5_gg(b,c,d,a,x[i+0],20,-373897302);a=md5_gg(a,b,c,d,x[i+5],5,-701558691);d=md5_gg(d,a,b,c,x[i+10],9,38016083);c=md5_gg(c,d,a,b,x[i+15],14,-660478335);b=md5_gg(b,c,d,a,x[i+4],20,-405537848);a=md5_gg(a,b,c,d,x[i+9],5,568446438);d=md5_gg(d,a,b,c,x[i+14],9,-1019803690);c=md5_gg(c,d,a,b,x[i+3],14,-187363961);b=md5_gg(b,c,d,a,x[i+8],20,1163531501);a=md5_gg(a,b,c,d,x[i+13],5,-1444681467);d=md5_gg(d,a,b,c,x[i+2],9,-51403784);c=md5_gg(c,d,a,b,x[i+7],14,1735328473);b=md5_gg(b,c,d,a,x[i+12],20,-1926607734);a=md5_hh(a,b,c,d,x[i+5],4,-378558);d=md5_hh(d,a,b,c,x[i+8],11,-2022574463);c=md5_hh(c,d,a,b,x[i+11],16,1839030562);b=md5_hh(b,c,d,a,x[i+14],23,-35309556);a=md5_hh(a,b,c,d,x[i+1],4,-1530992060);d=md5_hh(d,a,b,c,x[i+4],11,1272893353);c=md5_hh(c,d,a,b,x[i+7],16,-155497632);b=md5_hh(b,c,d,a,x[i+10],23,-1094730640);a=md5_hh(a,b,c,d,x[i+13],4,681279174);d=md5_hh(d,a,b,c,x[i+0],11,-358537222);c=md5_hh(c,d,a,b,x[i+3],16,-722521979);b=md5_hh(b,c,d,a,x[i+6],23,76029189);a=md5_hh(a,b,c,d,x[i+9],4,-640364487);d=md5_hh(d,a,b,c,x[i+12],11,-421815835);c=md5_hh(c,d,a,b,x[i+15],16,530742520);b=md5_hh(b,c,d,a,x[i+2],23,-995338651);a=md5_ii(a,b,c,d,x[i+0],6,-198630844);d=md5_ii(d,a,b,c,x[i+7],10,1126891415);c=md5_ii(c,d,a,b,x[i+14],15,-1416354905);b=md5_ii(b,c,d,a,x[i+5],21,-57434055);a=md5_ii(a,b,c,d,x[i+12],6,1700485571);d=md5_ii(d,a,b,c,x[i+3],10,-1894986606);c=md5_ii(c,d,a,b,x[i+10],15,-1051523);b=md5_ii(b,c,d,a,x[i+1],21,-2054922799);a=md5_ii(a,b,c,d,x[i+8],6,1873313359);d=md5_ii(d,a,b,c,x[i+15],10,-30611744);c=md5_ii(c,d,a,b,x[i+6],15,-1560198380);b=md5_ii(b,c,d,a,x[i+13],21,1309151649);a=md5_ii(a,b,c,d,x[i+4],6,-145523070);d=md5_ii(d,a,b,c,x[i+11],10,-1120210379);c=md5_ii(c,d,a,b,x[i+2],15,718787259);b=md5_ii(b,c,d,a,x[i+9],21,-343485551);a=safe_add(a,olda);b=safe_add(b,oldb);c=safe_add(c,oldc);d=safe_add(d,oldd);};return Array(a,b,c,d);};function md5_cmn(q,a,b,x,s,t){return safe_add(bit_rol(safe_add(safe_add(a,q),safe_add(x,t)),s),b);};function md5_ff(a,b,c,d,x,s,t){return md5_cmn((b&c)|((~b)&d),a,b,x,s,t);};function md5_gg(a,b,c,d,x,s,t){return md5_cmn((b&d)|(c&(~d)),a,b,x,s,t);};function md5_hh(a,b,c,d,x,s,t){return md5_cmn(b^c^d,a,b,x,s,t);};function md5_ii(a,b,c,d,x,s,t){return md5_cmn(c^(b|(~d)),a,b,x,s,t);};function core_hmac_md5(key,data){var bkey=str2binl(key);if(bkey.length>16)bkey=core_md5(bkey,key.length*chrsz);var ipad=Array(16),opad=Array(16);for(var i=0;i<16;i++){ipad[i]=bkey[i]^0x36363636;opad[i]=bkey[i]^0x5C5C5C5C;};var hash=core_md5(ipad.concat(str2binl(data)),512+data.length*chrsz);return core_md5(opad.concat(hash),512+128);};function safe_add(x,y){var lsw=(x&0xFFFF)+(y&0xFFFF);var msw=(x>>16)+(y>>16)+(lsw>>16);return(msw<<16)|(lsw&0xFFFF);};function bit_rol(num,cnt){return(num<<cnt)|(num>>>(32-cnt));};function str2binl(str){var bin=Array();var mask=(1<<chrsz)-1;for(var i=0;i<str.length*chrsz;i+=chrsz)bin[i>>5]|=(str.charCodeAt(i/chrsz)&mask)<<(i%32);return bin;};function binl2str(bin){var str="";var mask=(1<<chrsz)-1;for(var i=0;i<bin.length*32;i+=chrsz)str+=String.fromCharCode((bin[i>>5]>>>(i%32))&mask);return str;};function binl2hex(binarray){var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef";var str="";for(var i=0;i<binarray.length*4;i++){str+=hex_tab.charAt((binarray[i>>2]>>((i%4)*8+4))&0xF)+hex_tab.charAt((binarray[i>>2]>>((i%4)*8))&0xF);};return str;};function binl2b64(binarray){var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var str="";for(var i=0;i<binarray.length*4;i+=3){var triplet=(((binarray[i>>2]>>8*(i%4))&0xFF)<<16)|(((binarray[i+1>>2]>>8*((i+1)%4))&0xFF)<<8)|((binarray[i+2>>2]>>8*((i+2)%4))&0xFF);for(var j=0;j<4;j++){if(i*8+j*6>binarray.length*32)str+=b64pad;else str+=tab.charAt((triplet>>6*(3-j))&0x3F);}};return str;};function SHA1(msg){function rotate_left(n,s){var t4=(n<<s)|(n>>>(32-s));return t4;};function lsb_hex(val){var str="";var i;var vh;var vl;for(i=0;i<=6;i+=2){vh=(val>>>(i*4+4))&0x0f;vl=(val>>>(i*4))&0x0f;str+=vh.toString(16)+vl.toString(16);};return str;};function cvt_hex(val){var str="";var i;var v;for(i=7;i>=0;i--){v=(val>>>(i*4))&0x0f;str+=v.toString(16);};return str;};var blockstart;var i,j;var W=new Array(80);var H0=0x67452301;var H1=0xEFCDAB89;var H2=0x98BADCFE;var H3=0x10325476;var H4=0xC3D2E1F0;var A,B,C,D,E;var temp;msg=Utf8.encode(msg);var msg_len=msg.length;var word_array=new Array();for(i=0;i<msg_len-3;i+=4){j=msg.charCodeAt(i)<<24|msg.charCodeAt(i+1)<<16|msg.charCodeAt(i+2)<<8|msg.charCodeAt(i+3);word_array.push(j);};switch(msg_len%4){case 0:i=0x080000000;break;case 1:i=msg.charCodeAt(msg_len-1)<<24|0x0800000;break;case 2:i=msg.charCodeAt(msg_len-2)<<24|msg.charCodeAt(msg_len-1)<<16|0x08000;break;case 3:i=msg.charCodeAt(msg_len-3)<<24|msg.charCodeAt(msg_len-2)<<16|msg.charCodeAt(msg_len-1)<<8|0x80;break;};word_array.push(i);while((word_array.length%16)!=14)word_array.push(0);word_array.push(msg_len>>>29);word_array.push((msg_len<<3)&0x0ffffffff);for(blockstart=0;blockstart<word_array.length;blockstart+=16){for(i=0;i<16;i++)W[i]=word_array[blockstart+i];for(i=16;i<=79;i++)W[i]=rotate_left(W[i-3]^W[i-8]^W[i-14]^W[i-16],1);A=H0;B=H1;C=H2;D=H3;E=H4;for(i=0;i<=19;i++){temp=(rotate_left(A,5)+((B&C)|(~B&D))+E+W[i]+0x5A827999)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;};for(i=20;i<=39;i++){temp=(rotate_left(A,5)+(B^C^D)+E+W[i]+0x6ED9EBA1)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;};for(i=40;i<=59;i++){temp=(rotate_left(A,5)+((B&C)|(B&D)|(C&D))+E+W[i]+0x8F1BBCDC)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;};for(i=60;i<=79;i++){temp=(rotate_left(A,5)+(B^C^D)+E+W[i]+0xCA62C1D6)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;};H0=(H0+A)&0x0ffffffff;H1=(H1+B)&0x0ffffffff;H2=(H2+C)&0x0ffffffff;H3=(H3+D)&0x0ffffffff;H4=(H4+E)&0x0ffffffff;};var temp=cvt_hex(H0)+cvt_hex(H1)+cvt_hex(H2)+cvt_hex(H3)+cvt_hex(H4);return temp.toLowerCase();};function UrlInfo(q){if(q.length>1)this.q=q.substring(1,q.length);else this.q=null;this.keyValuePairs=new Array();if(this.q){for(var i=0;i<this.q.split("&").length;i++){this.keyValuePairs[i]=this.q.split("&")[i];}};this.getKeyValuePairs=function(){return this.keyValuePairs;};this.getValue=function(s){for(var j=0;j<this.keyValuePairs.length;j++){if(this.keyValuePairs[j].split("=")[0]==s)return this.keyValuePairs[j].split("=")[1];};return false;};this.getParameters=function(){var a=new Array(this.getLength());for(var j=0;j<this.keyValuePairs.length;j++){a[j]=this.keyValuePairs[j].split("=")[0];};return a;};this.getLength=function(){return this.keyValuePairs.length;};};function reverse(str){var s="";var i=str.length;while(i>0){s+=str.substring(i-1,i);i--;};return s;};function jumbleDataformId(dataformId){return hex_md5(dataformId+"dataform!");};function jumbleDataformGroupId(dataformGroupId){return hex_md5(dataformGroupId+"dataformGroup!");};function formatForHtml(text){var newText=text.replace(/&/g,"&amp;");newText=newText.replace(/</g,"&lt;");newText=newText.replace(/>/g,"&gt;");newText=newText.replace(/\n/g,"<br/>");return(newText);};function queryString(key){var urlStuff=new UrlInfo(location.search);return unescape(urlStuff.getValue(key));};function instanceCallback(instance,method){return function(){return method.apply(instance,arguments);};};function getNamedObject(objName){if(window.document[objName]){return window.document[objName];};if(navigator.appName.indexOf("Microsoft Internet")==-1){if(document.embeds&&document.embeds[objName])return document.embeds[objName];}else{return document.getElementById(objName);}};function truncateString(aString,length,bKeepPartialWord){var truncatedString=aString;if(truncatedString.length>length){truncatedString=truncatedString.substr(0,length);if(bKeepPartialWord==false)truncatedString=truncatedString.substr(0,truncatedString.lastIndexOf(" "));truncatedString+='...';};return truncatedString;};function formatTo2Letters(input){input=input.toString();if(input.length==0)input="00";else if(input.length==1)input="0"+input;return input;};function parseDomain(){var strDomain=document.location.href.substring(document.location.href.indexOf("://")+3,document.location.href.length-1);var indexOfSlash=strDomain.indexOf("/");if(indexOfSlash>=0){strDomain=strDomain.substring(0,indexOfSlash);};return strDomain;};function addLinksToText(input){return input.replace(/(https?:\/\/[^\s\.\?\<]+([\.\?][^\s\.\?\<]+)+)/g,function(url){var trimmedUrl=url;if(trimmedUrl.length>53){};return"<a href=\""+url+"\" target=\"_blank\">"+trimmedUrl+"</a>";});};var ScreenDoor={};ScreenDoor.key="aywdbzgecjhfnkirpmusqxvt";ScreenDoor.To=function(i){var key=i+""+i;return ScreenDoor.FromDecimal(parseInt(key));};ScreenDoor.From=function(s){var s_as_i=ScreenDoor.ToDecimal(s);s=s_as_i+"";var length=s.length;if(length%2!=0){return null;};var firstHalf=s.substr(0,length/2);var secondHalf=s.substr(length/ 2, length /2);if(firstHalf!=secondHalf){return null;};return parseInt(firstHalf);};ScreenDoor.FromDecimal=function(i){var base=ScreenDoor.key.length;var result="";do{var remainder=i%base;result=ScreenDoor.key.substr(remainder,1)+result;i=Math.floor(i/base);}while(i>0)return result;};ScreenDoor.ToDecimal=function(s){var base=ScreenDoor.key.length;var result=0;for(var i=0;i<s.length;i++){result+=ScreenDoor.key.indexOf(s.substr(s.length-i-1,1))*Math.pow(base,i);};return result;};var DateUtils={};DateUtils._luMonths=new Array("","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");DateUtils.CurrentDateToString=function(){return DateUtils.DateToString(new Date());};DateUtils.DateToString=function(date){if(date==null)return"";var month=formatTo2Letters(date.getMonth()+1);var day=formatTo2Letters(date.getDate());var year=date.getFullYear();var min=formatTo2Letters(date.getMinutes());var hour=formatTo2Letters(date.getHours());var sec=formatTo2Letters(date.getSeconds());var retStr=""+month+"/"+day+"/"+year+" "+hour+":"+min+":"+sec;return retStr;};DateUtils.ToString3=function(dateObj){if(dateObj==null)return"";var month=dateObj.getMonth()+1;month=formatTo2Letters(month);var date=dateObj.getDate();date=formatTo2Letters(date);var year=""+dateObj.getFullYear();year=year.substring(2);return""+month+"/"+date+"/"+year;};DateUtils.ToAbbreviatedDate=function(dateObj){if(dateObj==null)return"";var month=DateUtils._luMonths[dateObj.getMonth()+1];var date=dateObj.getDate();if(locale=='ja'){return dateObj.getFullYear()+"\u5E74"+(dateObj.getMonth()+1)+"\u6708"+date+"\u65E5";};return month+" "+date+", "+dateObj.getFullYear();};DateUtils.ToNumberedDate=function(dateObj){if(dateObj==null)return"";var month=dateObj.getMonth()+1;var date=dateObj.getDate();var year=""+dateObj.getFullYear();year=year.substring(2);if(locale=='ja'){return dateObj.getFullYear()+"\u5E74"+month+"\u6708"+date+"\u65E5";};return""+month+"/"+date+"/"+year;};DateUtils.ToDateAndTime=function(dateObj){if(dateObj==null)return"";var strMonths=new Array("January","February","March","April","May","June","July","August","September","October","November","December");var year=""+dateObj.getFullYear();var month=strMonths[dateObj.getMonth()];var date=""+dateObj.getDate();if(locale=='ja'){return dateObj.getFullYear()+"\u5E74"+(dateObj.getMonth()+1)+"\u6708"+date+"\u65E5 "+DateUtils.ToHrsMinString(dateObj);};return month+" "+date+", "+year+" at "+DateUtils.ToHrsMinString(dateObj);};DateUtils.ToHrsMinString=function(dateObj){var hour=dateObj.getHours();var amPm="am";if(hour>11){hour=hour-12;amPm="pm";};if(hour==0)hour=12;var min=""+dateObj.getMinutes();if(parseInt(min,10)<10)min="0"+min;return hour+":"+min+amPm;};DateUtils.FromServerTime1=function(serverTime){var newDate=null;try{var pieces=serverTime.split(" ");var datepieces=pieces[0].split("/");var newdatestr=DateUtils._luMonths[parseInt(datepieces[0],10)]+" "+datepieces[1]+", "+datepieces[2]+" "+pieces[1];newDate=new Date(newdatestr);}catch(err){newDate=new Date();};return(newDate);};DateUtils.FromServerTime2=function(serverTime){var year=1901;var month=0;var day=1;var hours=0;var minutes=0;var seconds=0;var milliseconds=0;var dateNow=new Date();try{var pieces=serverTime.split(" ");if(pieces.length>0){if(pieces[0]!=undefined){var datepieces=pieces[0].split("/");if(datepieces.length==3){month=parseInt(datepieces[0],10)-1;day=parseInt(datepieces[1],10);year=parseInt(datepieces[2],10);if(year<100){year=2000+year;if(year>dateNow.getFullYear())year-=100;};if(pieces[1]!=undefined){var time=pieces[1].split(":");if(time.length>0)hours=time[0];if(time.length>1)minutes=time[1];if(time.length>2)seconds=time[2];}}}}}catch(e){};var newDate=new Date(year,month,day,hours,minutes,seconds,milliseconds);return newDate;};DateUtils.FromServerTime3=function(serverTime){if(serverTime==null)return null;var pieces=serverTime.split(" ");var datepieces=pieces[0].split("-");var time=pieces[1].split(":");var time2=time[2].split(".");var newDate=new Date(datepieces[0],parseInt(datepieces[1],10)-1,datepieces[2],time[0],time[1],time2[0],time2[1]);return newDate;};DateUtils.FromYear=function(strYear){var year=strYear;var month=0;var day=1;var hours=0;var minutes=0;var seconds=0;var milliseconds=0;var newDate=new Date(year,month,day,hours,minutes,seconds,milliseconds);return newDate;};DateUtils.IsEqual=function(date1,date2){if(date1==null&&date2==null)return true;if(date1==null||date2==null)return false;if(date1.getMonth()!=date2.getMonth())return false;if(date1.getDate()!=date2.getDate())return false;if(date1.getFullYear()!=date2.getFullYear())return false;if(date1.getMinutes()!=date2.getMinutes())return false;if(date1.getHours()!=date2.getHours())return false;if(date1.getSeconds()!=date2.getSeconds())return false;return true;};var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1)return data[i].identity;}else if(dataProp)return data[i].identity;}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1)return;return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();function sha1Hash(msg){var K=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6];msg+=String.fromCharCode(0x80);var l=Math.ceil(msg.length/4)+2;var N=Math.ceil(l/16);var M=new Array(N);for(var i=0;i<N;i++){M[i]=new Array(16);for(var j=0;j<16;j++){M[i][j]=(msg.charCodeAt(i*64+j*4)<<24)|(msg.charCodeAt(i*64+j*4+1)<<16)|(msg.charCodeAt(i*64+j*4+2)<<8)|(msg.charCodeAt(i*64+j*4+3));}};M[N-1][14]=((msg.length-1)*8)/Math.pow(2,32);M[N-1][14]=Math.floor(M[N-1][14]);M[N-1][15]=((msg.length-1)*8)&0xffffffff;var H0=0x67452301;var H1=0xefcdab89;var H2=0x98badcfe;var H3=0x10325476;var H4=0xc3d2e1f0;var W=new Array(80);var a,b,c,d,e;for(var i=0;i<N;i++){for(var t=0;t<16;t++)W[t]=M[i][t];for(var t=16;t<80;t++)W[t]=ROTL(W[t-3]^W[t-8]^W[t-14]^W[t-16],1);a=H0;b=H1;c=H2;d=H3;e=H4;for(var t=0;t<80;t++){var s=Math.floor(t/20);var T=(ROTL(a,5)+f(s,b,c,d)+e+K[s]+W[t])&0xffffffff;e=d;d=c;c=ROTL(b,30);b=a;a=T;};H0=(H0+a)&0xffffffff;H1=(H1+b)&0xffffffff;H2=(H2+c)&0xffffffff;H3=(H3+d)&0xffffffff;H4=(H4+e)&0xffffffff;};return H0.toHexStr()+H1.toHexStr()+H2.toHexStr()+H3.toHexStr()+H4.toHexStr();};function f(s,x,y,z){switch(s){case 0:return(x&y)^(~x&z);case 1:return x^y^z;case 2:return(x&y)^(x&z)^(y&z);case 3:return x^y^z;}};function ROTL(x,n){return(x<<n)|(x>>>(32-n));};Number.prototype.toHexStr=function(){var s="",v;for(var i=7;i>=0;i--){v=(this>>>(i*4))&0xf;s+=v.toString(16);};return s;};function StringBuilder(value){this.strings=new Array("");this.Append(value);};StringBuilder.prototype.Append=function(value){if(value){this.strings.push(value);}};StringBuilder.prototype.Clear=function(){this.strings.length=1;};StringBuilder.prototype.ToString=function(){return this.strings.join("");};function MessageList(){this._channels=new Array();this._orphanDataforms=new Array();};MessageList.prototype.GetChannels=function(){return this._channels;};MessageList.prototype.UpdateList=function(contents){this.ParseMessages(contents);};MessageList.prototype.UpdateChannel=function(contents){this.ParseMessages(contents)};MessageList.prototype.GetOrphanDataforms=function(){return this._orphanDataforms;};MessageList.prototype.ParseMessages=function(xmlDoc){var channelItems=XML.GetElementsByTagName(xmlDoc.documentElement,"ch");if(channelItems!=null){for(var i=0;i<channelItems.length;i++){this._channels.push(new Channel(channelItems[i]));}};var dataformsElement=XML.GetFirstElementByTagName(xmlDoc.documentElement,"dataforms");var dataformItems=XML.GetElementsByTagName(dataformsElement,"x");if(dataformItems!=null){for(var i=0;i<dataformItems.length;i++){if(dataformItems[i].parentNode==dataformsElement){var newDataformItem=new DataformItem(dataformItems[i]);var channel=this.FindChannel(dataformItems[i].getAttribute("chid"));if(channel!=null){channel.AddDataformItem(newDataformItem);}else{this._orphanDataforms.push(newDataformItem);}}}}};MessageList.prototype.FindChannel=function(channelId){for(var i=0;i<this._channels.length;i++){if(this._channels[i].GetId()==channelId){return this._channels[i];}}};function Channel(xmlElement){this._id=xmlElement.getAttribute("id");this._title=XML.FindAndFillValue(xmlElement,"title");this._canUserSubmit=(xmlElement.getAttribute("can_user_submit")=="true");this._showInSelector=(xmlElement.getAttribute("show_in_selector")=="true");this._banner=XML.FindAndFillValue(xmlElement,"banner");this._sidebar=XML.FindAndFillValue(xmlElement,"sidebar");this._selectionRule=XML.FindAndFillValue(xmlElement,"selRule");this._channelDisplays=new Array();var displayViews=XML.GetElementsByTagName(xmlElement,"display");if(displayViews!=null){for(var i=0;i<displayViews.length;i++){this._channelDisplays.push(new ChannelDisplay(displayViews[i],this));}};this._defaultView=this.GetView("default");this._dataformItems=new Array();};Channel.prototype.AddDataformItem=function(dataformItem){this._dataformItems.push(dataformItem);};Channel.prototype.GetDataformItems=function(){return this._dataformItems;};Channel.prototype.GetView=function(viewName){for(var i=0;i<this._channelDisplays.length;i++){if(this._channelDisplays[i].GetView()==viewName){return this._channelDisplays[i];}};return this._defaultView;};Channel.prototype.GetId=function(){return this._id;};Channel.prototype.GetTitle=function(){return this._title;};Channel.prototype.GetCanUserSubmit=function(){return this._canUserSubmit;};Channel.prototype.GetShowInSelector=function(){return this._showInSelector;};Channel.prototype.GetBanner=function(){return this._banner;};Channel.prototype.GetSidebar=function(){return this._sidebar;};Channel.prototype.GetSelectionRule=function(){return this._selectionRule;};function ChannelDisplay(xmlElement,channel){this._parameters=new Array();this._channel=channel;if(xmlElement!=null){this._view=xmlElement.getAttribute("view");this._renderer=xmlElement.getAttribute("renderer");for(var i=0;i<xmlElement.childNodes.length;i++){if(xmlElement.childNodes[i].nodeType==1){var key=xmlElement.childNodes[i].getAttribute("name");if((key==null)||(key=="")){key=xmlElement.childNodes[i].nodeName;};this._parameters[key]=XML.FindAndFillValue(xmlElement.childNodes[i]);}};for(var i=0;i<xmlElement.attributes.length;i++){if(xmlElement.attributes[i].nodeType==2){if((xmlElement.attributes[i].nodeName!="view")&&(xmlElement.attributes[i].nodeName!="renderer")){this._parameters[xmlElement.attributes[i].nodeName]=xmlElement.attributes[i].nodeValue;}}}}};ChannelDisplay.prototype.GetView=function(){return this._view;};ChannelDisplay.prototype.GetRenderer=function(){if((this._renderer==null)||(this._renderer=="")){if((this._channel!=null)&&(this._channel._defaultView!=null)&&(this._channel._defaultView!=this)){return this._channel._defaultView.GetRenderer();}};return this._renderer;};ChannelDisplay.prototype.GetParameter=function(parameterName,defaultValue){var result=this._parameters[parameterName];if(result==null){if((this._channel!=null)&&(this._channel._defaultView!=null)&&(this._channel._defaultView!=this)){return this._channel._defaultView.GetParameter(parameterName,defaultValue);};return defaultValue;};return result;};function DataformItem(xmlElement){if(xmlElement==null){return;};this._id=xmlElement.getAttribute("id");this._group=xmlElement.getAttribute("group");this._namespace=xmlElement.getAttribute("namespace");this._title=XML.FindAndFillValueOneLevel(xmlElement,"title");this._headline=XML.FindAndFillValueOneLevel(xmlElement,"headline");this._author=XML.FindAndFillValueOneLevel(xmlElement,"author");this._icon=XML.FindAndFillValueOneLevel(xmlElement,"thumbImage");this._leadingText=XML.FindAndFillValueOneLevel(xmlElement,"leadingText");this._summary=XML.FindAndFillValueOneLevel(xmlElement,"summary");if(this._summary==null||this._summary==''){this._summary=XML.FindAndFillValueOneLevel(xmlElement,"description");};if((this._icon=="")||(this._icon==null)){this._icon="ca_64x64.jpg";};var authors=XML.GetFirstElementByTagNameOneLevel(xmlElement,"authors");if(authors!=null){this._authors=new Array();var authorElements=XML.GetElementsByTagName(authors,"author");if(authorElements!=null){for(var i=0;i<authorElements.length;i++){this._authors[i]=new QIPAuthor(authorElements[i].getAttribute("userid"),XML.FindAndFillValue(authorElements[i],"name"),XML.FindAndFillValue(authorElements[i],"institution"),XML.FindAndFillValue(authorElements[i],"title"),XML.FindAndFillValue(authorElements[i],"prefix"),XML.FindAndFillValue(authorElements[i],"photo"));}}};this._editorsPickImage=XML.FindAndFillValueOneLevel(xmlElement,"edpick_image");this._slideSampleImage=XML.FindAndFillValueOneLevel(xmlElement,"slamp_image");this._previewImage=XML.FindAndFillValueOneLevel(xmlElement,"prev_image");this._hasBeenRead=(xmlElement.getAttribute("opened")=="true");this._numberOfComments=0;this._lastCommentDate=null;this._cmeCredits=0;this._cmeCategory=null;this._cmeCreditsAlreadyAwarded=false;this._qpoints=0;this._qpointsAlreadyAwarded=false;this._publishDate=XML.FindAndFillValueOneLevel(xmlElement,"publish_date");this._duration=XML.FindAndFillValueOneLevel(xmlElement,"duration");this._rating=XML.FindAndFillValueOneLevel(xmlElement,"rating");this._ratingCount=parseInt(XML.FindAndFillValueOneLevel(xmlElement,"ratingcount"));var commentInfoItem=XML.GetFirstElementByTagNameOneLevel(xmlElement,"comment_info");if(commentInfoItem!=null){this._numberOfComments=parseFloat(XML.FindAndFillValue(commentInfoItem,"count"));if(isNaN(this._numberOfComments)){this._numberOfComments=0;};var commentTime=XML.FindAndFillValue(commentInfoItem,"last_date");if(commentTime!=""){this._lastCommentDate=DateUtils.FromServerTime3(commentTime).getTime();}};var qPointItem=XML.GetFirstElementByTagNameOneLevel(xmlElement,"qpoint");if(qPointItem!=null){this._qpoints=parseFloat(qPointItem.getAttribute("value"));if(qPointItem.getAttribute("awarded")!=null&&qPointItem.getAttribute("awarded")>0){this._qpointsAlreadyAwarded=true;}};var cmeItem=XML.GetFirstElementByTagNameOneLevel(xmlElement,"cme");if(cmeItem!=null){this._cmeCredits=parseFloat(cmeItem.getAttribute("value"));this._cmeCategory=((cmeItem.getAttribute("cme_cat")=="Cat1")?1:2);if(cmeItem.getAttribute("awarded")!=null&&cmeItem.getAttribute("awarded")>0){this._cmeCreditsAlreadyAwarded=true;}};this._numReads=-1;var numReads=XML.GetFirstElementByTagNameOneLevel(xmlElement,"numReads");if(numReads!=null){this._numReads=parseInt(numReads.getAttribute("count"));};this._seriesMembers=new Array();var seriesElement=XML.GetFirstElementByTagNameOneLevel(xmlElement,"series");if(seriesElement!=null){var xElements=XML.GetElementsByTagName(seriesElement,"x");for(var i=0;i<xElements.length;i++){this._seriesMembers.push(new DataformItem(xElements[i]));};for(var i=0;i<this._seriesMembers.length;i++){this._seriesMembers[i]._authors=new Array();this._seriesMembers[i]._author="";}};var responseReportSummaryElement=XML.GetFirstElementByTagNameOneLevel(xmlElement,"responses");if(responseReportSummaryElement!=null){this._responseReportSummary=new ResponseReportSummary(responseReportSummaryElement);}};DataformItem.prototype.GetId=function(){return this._id;};DataformItem.prototype.GetGroup=function(){return this._group;};DataformItem.prototype.GetNamespace=function(){return this._namespace;};DataformItem.prototype.GetTitle=function(){return this._title;};DataformItem.prototype.GetLeadingText=function(){return this._leadingText;};DataformItem.prototype.GetLeadingTextOrTitle=function(){return this._leadingText||this._title;};DataformItem.prototype.GetHeadline=function(){return this._headline;};DataformItem.prototype.GetAuthor=function(){return this._author;};DataformItem.prototype.GetSummary=function(){return this._summary;};DataformItem.prototype.GetIcon=function(){return this._icon;};DataformItem.prototype.GetEditorsPickImage=function(){return this._editorsPickImage;};DataformItem.prototype.GetSlideSampleImage=function(){return this._slideSampleImage;};DataformItem.prototype.GetPreviewImage=function(){return this._previewImage;};DataformItem.prototype.GetRating=function(){return this._rating;};DataformItem.prototype.GetRatingCount=function(){return this._ratingCount;};DataformItem.prototype.GetNumberOfComments=function(){return this._numberOfComments;};DataformItem.prototype.GetLastCommentDate=function(){return this._lastCommentDate;};DataformItem.prototype.GetCmeCredits=function(){return this._cmeCredits;};DataformItem.prototype.GetCmeCreditCategory=function(){return this._cmeCategory;};DataformItem.prototype.GetQPoints=function(){return this._qpoints;};DataformItem.prototype.GetQPointsAlreadyAwarded=function(){return this._qpointsAlreadyAwarded;};DataformItem.prototype.GetCmeCreditsAlreadyAwarded=function(){return this._cmeCreditsAlreadyAwarded;};DataformItem.prototype.GetHasBeenRead=function(){return this._hasBeenRead;};DataformItem.prototype.GetPublishDate=function(){return this._publishDate;};DataformItem.prototype.GetNumberReads=function(){return this._numReads;};DataformItem.prototype.GetDuration=function(){return this._duration;};DataformItem.prototype.GetSeriesMembers=function(){return this._seriesMembers;};DataformItem.prototype.GetResponseReportSummary=function(){return this._responseReportSummary;};DataformItem.prototype.GetLibraryCardAuthor=function(){return this._author;};DataformItem.prototype.GetAuthorHtml=function(hideTitle,hideInstitution){if(this._authors==null){return this._author;};var result="";for(var i=0;i<this._authors.length;i++){result+="<div><span class='authorName'>"+this._authors[i]._authorName+"</span>";if((hideTitle!=true)&&(this._authors[i]._authorTitle)){result+=", "+this._authors[i]._authorTitle+"";};if((hideInstitution!=true)&&(this._authors[i]._authorInstitution)){result+=", "+this._authors[i]._authorInstitution+"";};result+="</div>";};return result;};DataformItem.prototype.GetAuthorWithPhotoHtml=function(hideTitle,hideInstitution){if(this._authors==null){return this._author;};var result="<div class='clearfix'>";for(var i=0;i<this._authors.length;i++){result+="<div class='clearfix authorWithPhoto'>";if(this._authors[i]._photo){result+="<div class='authorPhoto'><img src='"+QSettings.ContentKeyUrl(this._authors[i]._photo)+"' /></div>";};if(this._authors[i]._prefix){result+="<div class='authorPrefix'>"+this._authors[i]._prefix+"</div>";};if(this._authors[i]._authorId){result+="<div class='authorName'><a href='#' onclick='openProfilePublic(\""+this._authors[i]._authorId+"\"); return false;'>"+this._authors[i]._authorName+"</a></div>";}else{result+="<div class='authorName'>"+this._authors[i]._authorName+"</div>";};if((hideTitle!=true)&&(this._authors[i]._authorTitle)){result+="<span class='authorTitle'>"+this._authors[i]._authorTitle+"</span>";};if(this._authors[i]._authorTitle&&this._authors[i]._authorInstitution){result+=", ";};if((hideInstitution!=true)&&(this._authors[i]._authorInstitution)){result+="<span class='authorInstitution'>"+this._authors[i]._authorInstitution+"</span>";};result+="</div>";};result+="</div>";return result;};var responseResultsTemplates=new Array();var responseReportList=null;function loadResponseResults(xmlElement,questionManager){var errorsFound=false;var questionResponses=XML.GetElementsByTagName(xmlElement,"question");if(questionResponses!=null){for(var i=0;i<questionResponses.length;i++){if(!loadQuestionResults(questionResponses[i],questionManager)){errorsFound=true;}}};return!errorsFound;};function loadQuestionResults(xmlElement,questionManager){var question=questionManager.FindQuestion(xmlElement.getAttribute("id"));if(question!=null){question.SetNumberOfUniqueResponses(xmlElement.getAttribute("count"));var answerResponses=XML.GetElementsByTagName(xmlElement,"answer");if(answerResponses!=null){for(var i=0;i<answerResponses.length;i++){var answer=question.FindAnswer(answerResponses[i].getAttribute("id"));var count=parseInt(answerResponses[i].getAttribute("count"));if((count==0)||(isNaN(count))){count=1;};if(answer!=null){answer.SetNumberOfResponses(count);var freeformElements=XML.GetElementsByTagName(answerResponses[i],"freeform");if(freeformElements!=null){for(var j=0;j<freeformElements.length;j++){answer.AddFreeFormResponse(new FreeFormAnswerResponse(freeformElements[j],j%2==1));}};answer.SortFreeFormResponses();}else{var numUnique=question.GetNumberOfUniqueResponses();if(numUnique!=null){numUnique=numUnique-count;if(numUnique>0)question.SetNumberOfUniqueResponses(numUnique);}}}}}else{return false;};return true;};function showAnswerResponses(questionId,answerId){$('answerResponses'+questionId+'_'+answerId).removeClass('cHidden');$('showHideLabel'+questionId+'_'+answerId).innerHTML="hide";$('showHide'+questionId+'_'+answerId).onclick=function(){hideAnswerResponses(questionId,answerId);return false;};};function hideAnswerResponses(questionId,answerId){$('answerResponses'+questionId+'_'+answerId).addClass('cHidden');$('showHideLabel'+questionId+'_'+answerId).innerHTML="show";$('showHide'+questionId+'_'+answerId).onclick=function(){showAnswerResponses(questionId,answerId);return false;};};function getResponseTemplate(templateName){if(responseResultsTemplates[templateName]==null){responseResultsTemplates[templateName]=TrimPath.parseDOMTemplate(templateName);};return responseResultsTemplates[templateName];};function ResponseReportSummary(xmlElement){this.TotalOpens=parseInt(xmlElement.getAttribute('totalOpens'));this.UniqueVisitors=parseInt(xmlElement.getAttribute('uniqueOpeners'));this.UniqueResponders=parseInt(xmlElement.getAttribute('uniqueAnswerers'));this.UniqueCompletes=parseInt(xmlElement.getAttribute('uniqueCompleters'));if((xmlElement.getAttribute('availDts')!='')&&(xmlElement.getAttribute('availDts')!=null)){this.AvailableDate=DateUtils.FromServerTime2(xmlElement.getAttribute('availDts'));};if((xmlElement.getAttribute('dfCreation')!='')&&(xmlElement.getAttribute('dfCreation')!=null)){this.DataformCreationDate=DateUtils.FromServerTime2(xmlElement.getAttribute('dfCreation'));}};function FreeFormAnswerResponse(xmlElement,isOdd){this.count=parseInt(xmlElement.getAttribute("count"));if((isNaN(this.count))||(this.count==0)){this.count=1;};this.response=XML.FindAndFillValue(xmlElement);this.isOdd=isOdd;};function ResponseReportList(xmlElement){var reports=XML.GetElementsByTagName(xmlElement,"report");this.Reports=new Array();if(reports!=null){for(var i=0;i<reports.length;i++){this.Reports.push(new ResponseReportLink(reports[i]));}}};function ResponseReportLink(xmlElement){this.Id=xmlElement.getAttribute("id");this.Title=xmlElement.getAttribute("title");};var QSettings={};QSettings.BuildUrlCmd=function(strCmd){var url=QSettings._protocol+QSettings._domainFull+"/q-webclient?user="+LoginCredentials.Username+"&pass="+LoginCredentials.Password+"&cmd="+strCmd+"&cb="+(new Date()).getTime();return url;};QSettings.BuildUrlContent=function(strKey,bSameDomain,dontBustCache){if(!bSameDomain)bSameDomain=false;var domain="";if(bSameDomain==true)domain=QSettings._domainFull;else domain=QSettings._contentDomain;var url=QSettings._protocol+domain+"/q-qcp"+"/"+strKey;if((QSettings.BustCache==true)&&(dontBustCache!=true))url+="?bc="+QSettings.BustNum;return url;};QSettings.PostUrl=function(){return QSettings._protocol+QSettings._domainFull+"/q-http?cb="+(new Date()).getTime();};QSettings.BuildPageAddress=function(strName,args){var url="/"+strName;if(args!=undefined){url+="?"+args;};if(QSettings.BustCache==true){if(args==undefined)url+="?";else url+="&";url+="bc=1";};return url;};QSettings.BuildUrlPage=function(strName,args){return this.BuildPageAddress(strName+".jsp",args);};QSettings.BuildQSubmissionsPage=function(strCmd,chapterId,reqId){var url=QSettings._protocol+QSettings._domainFull+"/q-submissions?user="+LoginCredentials.Username+"&pass="+LoginCredentials.Password+"&cmd="+strCmd;if(chapterId!=null)url+="&chid="+chapterId;if(reqId!=null)url+="&reqid="+reqId;return url;};QSettings.SetQSubmissionsPage=function(strCmd,chapterId,reqId){var url=QSettings._protocol+QSettings._domainFull+"/q-submissions?user="+LoginCredentials.Username+"&pass="+LoginCredentials.Password+"&cmd=submit";return url;};QSettings.BuildFileUploadUrl=function(reqId,key){var url=QSettings._protocol+QSettings._contentDomain+"/q-submissions?user="+LoginCredentials.Username+"&pass="+LoginCredentials.Password+"&cmd=newFile&key="+key+"&reqid="+reqId+"&cb="+(new Date()).getTime();return url;};QSettings.BuildFileCancelUrl=function(reqId,key){var url=QSettings._protocol+QSettings._domainFull+"/q-submissions?user="+LoginCredentials.Username+"&pass="+LoginCredentials.Password+"&cmd=cancelFile&key="+key+"&reqid="+reqId+"&cb="+(new Date()).getTime();return url;};QSettings.BuildFileStatusUrl=function(reqId,key){var url=QSettings._protocol+QSettings._domainFull+"/q-submissions?user="+LoginCredentials.Username+"&pass="+LoginCredentials.Password+"&cmd=getFileStatus&key="+key+"&reqid="+reqId+"&cb="+(new Date()).getTime();return url;};QSettings.MessageListUrl=function(){return QSettings.BuildUrlCmd("gethome");};QSettings.ChannelListUrl=function(channelId){return QSettings.BuildUrlCmd("getchannel")+"&ch="+channelId;};QSettings.DataformXmlUrl=function(strDataformID,channelId){var url=QSettings.BuildUrlCmd("getdf")+"&df="+strDataformID;if(channelId!=null){url=url+"&ch="+channelId;};var u=queryString("u");if((u!=null)&&(u!="")){url+="&u="+u;};return url;};QSettings.GetCommentsXmlUrl=function(strDataformGroup){return QSettings.BuildUrlCmd("getcmnt")+"&dfg="+strDataformGroup;};QSettings.PostCommentsUrl=function(strDataformGroup,strDataformID){return QSettings.BuildUrlCmd("setcmnt")+"&dfg="+strDataformGroup+"&df="+strDataformID;};QSettings.PostCommentVote=function(id,voteType){return QSettings.BuildUrlCmd("vote")+"&id="+id+"&type="+voteType;};QSettings.GetUserProfileXmlUrl=function(uid){var url=QSettings.BuildUrlCmd("getprof");if(uid!=null)url+="&uid="+uid;return url;};QSettings.GetHospitalListUrl=function(strFilter){return QSettings.BuildUrlCmd("gethlist")+"&name="+strFilter;};QSettings.GetSchoolListUrl=function(strFilter){return QSettings.BuildUrlCmd("getslist")+"&name="+strFilter;};QSettings.GetSpecialtyListUrl=function(strFilter){return QSettings.BuildUrlCmd("getsplist")+"&name="+strFilter;};QSettings.GetReferAFriendURL=function(strDfId,strEmailAddress){return QSettings.BuildUrlCmd("refer")+"&dfid="+strDfId+"&t="+strEmailAddress;};QSettings.GetReferMyDataformURL=function(strDfId,strEmailAddress){return QSettings.BuildUrlCmd("refermydataform")+"&dfid="+strDfId+"&t="+strEmailAddress;};QSettings.GetPostsByUserXmlUrl=function(uid){return QSettings.BuildUrlCmd("getcdf")+"&uid="+uid;};QSettings.ContentKeyUrl=function(strKey,bSameDomain,dontBustCache){return QSettings.BuildUrlContent(strKey,bSameDomain,dontBustCache);};QSettings.BundledContentKeyUrl=function(strBundle,strKey,bSameDomain,dontBustCache){return QSettings.BuildUrlContent(strBundle+"/"+strKey,bSameDomain,dontBustCache);};QSettings.SetUserProfileXmlUrl=function(){return QSettings.PostUrl();};QSettings.GetQPointsXmlUrl=function(){return QSettings.BuildUrlCmd("getqphistory");};QSettings.GetCMEXmlUrl=function(){return QSettings.BuildUrlCmd("getcmehistory");};QSettings.SaveRecertificationDateUrl=function(dateObj){return QSettings.BuildUrlCmd("getcmehistory")+"&save=1"+"&dts="+DateUtils.ToString3(dateObj);};QSettings.GetPlayerUrl=function(strdfid,strChannel,ns){var args="";var dfid=ScreenDoor.To(parseInt(strdfid));if(strChannel!=undefined&&strChannel!=null)args+="&cid="+strChannel;if(queryString("ch")!="false"){args+="&back=channel";}else if(queryString("s")!="false"){args+="&back=search&s="+queryString("s");};if(args!=""){args=args.substring(1);};if(ns=="dataform:series"){return QSettings.BuildPageAddress("series/"+dfid,args);};return QSettings.BuildPageAddress("player/"+dfid,args);};QSettings.GetUserProfileUrl=function(){return QSettings.BuildUrlPage("profilemanager");};QSettings.GetCommentsUrl=function(strDfg,strDfId){return QSettings.BuildUrlPage("profile","dfid="+strDfId);};QSettings.GetPollResUrl=function(strDfg,strDfId){return QSettings.BuildUrlPage("profile","dfg="+strDfg);};QSettings.GetPublicProfileUrl=function(strUID){return QSettings.BuildUrlPage("profile","id="+strUID);};QSettings.GetCMEDiaryUrl=function(strUID){return QSettings.BuildUrlPage("CME");};QSettings.GetQPointsUrl=function(strUID){return QSettings.BuildUrlPage("QPoints");};QSettings.GetHomeUrl=function(extra){return QSettings.BuildPageAddress("home",extra);};QSettings.SetDomain=function(){document.domain=QSettings._domainBase;};QSettings.GetProtocol=function(){var u=window.location.href;var c=u.indexOf(":");if(c>-1){return u.substring(0,c)+"://";};return"http://";};QSettings.Application="WebClient";QSettings.Version="2.2.24.0";QSettings._protocol=QSettings.GetProtocol();QSettings._domainFull=parseDomain();QSettings._contentDomain=QSettings._domainFull;if(QSettings._contentDomain.indexOf("quantiamd.com")>=0)QSettings._contentDomain="myqcp.quantiamd.com";if(QSettings._contentDomain.indexOf("qa.quantiaco.com")>=0)QSettings._contentDomain="qa-qcp.quantiaco.com";if(QSettings._contentDomain.indexOf("qa2.quantiaco.com")>=0)QSettings._contentDomain="qa2-qcp.quantiaco.com";if(QSettings._contentDomain.indexOf("pagee520")>=0)QSettings._contentDomain="192.168.0.47";QSettings.BustCache=false;if(document.location.href.indexOf("&bc=")>0||document.location.href.indexOf("?bc=")>0){QSettings.BustCache=true;QSettings.BustNum=(new Date()).getTime();};var LoginCredentials={};LoginCredentials.Username="";LoginCredentials.Password="";LoginCredentials.LoginName="";LoginCredentials.DeviceID="";LoginCredentials.ServerName=top.location.host;LoginCredentials.UsingGuestAccount=false;LoginCredentials.AuthFailureMessage="";LoginCredentials.AuthCallback=null;LoginCredentials.LogoffOccuredEvent=null;LoginCredentials.LogoffMessage="";LoginCredentials.CheckForLogout=function(xmlDoc){try{var errors=XML.GetElementsByTagName(xmlDoc.documentElement,"error_string");if(errors!=null){LoginCredentials.LogoffMessage=errors[0].childNodes[0].nodeValue;LoginCredentials.DeleteCachedCredentials();document.location="index.html";return true;}}catch(e){};return false;};function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');var result=null;for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0){if(result!=null){var date=new Date();date.setTime(date.getTime()+(-1*24*60*60*1000));var expires="; expires="+date.toGMTString();document.cookie=name+"="+expires+"; path=/";};result=c.substring(nameEQ.length,c.length);}};return result;};function createCookie(name,value,days){var expires="";if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toGMTString();};if(LoginCredentials.ServerName!=null&&LoginCredentials.ServerName.indexOf("quantiamd.com")>-1){document.cookie=name+"="+value+expires+"; path=/;domain=quantiamd.com";}else if(LoginCredentials.ServerName!=null&&LoginCredentials.ServerName.indexOf("quantiamd.jp")>-1){document.cookie=name+"="+value+expires+"; path=/;domain=quantiamd.jp";}else if(LoginCredentials.ServerName!=null&&LoginCredentials.ServerName.indexOf("mdplus.jp")>-1){document.cookie=name+"="+value+expires+"; path=/;domain=mdplus.jp";}else{document.cookie=name+"="+value+expires+"; path=/;domain="+LoginCredentials.ServerName.replace(/secure\./,'');};if((value=="")&&(days<0)){document.cookie=name+"="+value+expires+"; path=/";}};LoginCredentials.LoadCachedCreds=function(redirectToHomeIfNotLoggedIn){var userCookie=readCookie("com.quantia.user");if(userCookie!=null){var subvals=userCookie.split("___");if(subvals.length>=2){LoginCredentials.Password=subvals[1];var cookieUserName=subvals[0];if(LoginCredentials.Username.toLowerCase()!=cookieUserName.toLowerCase()&&LoginCredentials.ForceablyDenied!=true){window.location.reload(true);return false;}}}else if(LoginCredentials.UsingGuestAccount!=true){window.location.reload(true);return false;};if((redirectToHomeIfNotLoggedIn)&&(LoginCredentials.UsingGuestAccount)){window.location.href="/";return false;};if(LoginCredentials.UsingGuestAccount){LoginCredentials.Password="webapp";};return true;};LoginCredentials.AttemptLogout=function(){if(this.Username!=""&&this.Password!=""){var xmlDocument=XML.CreateDocument("<logout></logout>");var element=xmlDocument.documentElement;element.setAttribute("id",this.Username);element.setAttribute("password",this.Password);element.setAttribute("devicetype","web");HTTP.post(QSettings.PostUrl(),XML.Serialize(xmlDocument),function(){},function(){});}};LoginCredentials.RefreshCookie=function(tstamp){var c=readCookie("com.quantia.user");if(c!=null){var cs=c.split("___");createCookie("com.quantia.user",cs[0]+"___"+cs[1]+"___"+cs[0]+"___"+tstamp,30);createCookie("com.quantia.proxy",cs[0],30);}};LoginCredentials.AttemptLogin=function(username,password,resultCallback){storeTimeZone();var xmlDocument=XML.CreateDocument("<get_login_pad></get_login_pad>");var authenticateElement=xmlDocument.documentElement;authenticateElement.setAttribute("id",username);HTTP.post(QSettings.PostUrl(),XML.Serialize(xmlDocument),function(results){var resultDocument=XML.CreateDocument(results);var elem=resultDocument.documentElement;var pad=elem.getAttribute("pad");var pepper=elem.getAttribute("pepper");var encryptedPwd;if(pepper!=''){encryptedPwd=SHA1(pepper+password);}else{encryptedPwd=password;};var xmlAuth=XML.CreateDocument("<authenticate></authenticate>");authenticateElement=xmlAuth.documentElement;authenticateElement.setAttribute("id",username);var hashed=hex_md5(pepper+encryptedPwd+pad);authenticateElement.setAttribute("password",hashed);if(pad!=null){authenticateElement.setAttribute("pad",pad);};authenticateElement.setAttribute("web","true");authenticateElement.setAttribute("deviceclass","web");authenticateElement.setAttribute("devicetype","web");var tempThis=this;HTTP.postAsXml(QSettings.PostUrl(),XML.Serialize(xmlAuth),function(results){var authResults=XML.CreateDocument(results);if(authResults.documentElement.getAttribute("type")=="success"){var token=password;var serverUsername=authResults.documentElement.getAttribute("user_name");var pls=authResults.documentElement.getAttribute("pls");var plt=authResults.documentElement.getAttribute("plt");var tstamp=authResults.documentElement.getAttribute("timestamp");if(tstamp==null)tstamp=new Date().getTime();if(pls!=null&&plt!=null)token=pls+"_"+plt;LoginCredentials.createLoginCookie(serverUsername,token,tstamp);resultCallback(true,null);}else{resultCallback(false,results);}},function(errorMessage){resultCallback(false,errorMessage);});},function(){alert(QSTR.errorLoginConnectionFailed);resultCallback(false,null);});};LoginCredentials.createLoginCookie=function(serverUsername,token,tstamp){if(tstamp==null)tstamp=new Date().getTime();createCookie("com.quantia.user",serverUsername+"___"+token+"___"+serverUsername+"___"+tstamp,30);};LoginCredentials.updatePassword=function(pwd){};LoginCredentials.DeleteCachedCredentials=function(){createCookie("com.quantia.user","",-1);createCookie("com.quantia.proxy","",-1);};var CMD_STRING='cmd';var CMD_MODIFY='modify';var CMD_REMOVE='remove';var CMD_ADD='add';var MAKE_FOR_ME_INSTITUTION_TITLE='MakeForMeInstitution';function UserProfile(){this.ResetData();};UserProfile.prototype.ResetData=function(){this.strFirstName="";this.strLastName="";this.strTitle="";this.strSuffix="";this.strDegree="";this.specialityList=new Array();this.strPassword="";this.strLoginEmail="";this.validationstatus="";this.strNpiNumber="";this.npistatus="";this.strFax="";this.makeForMe=false;this.makeForMeNotes="";this.currentAffiliations=new Array();this.additionalInfo=new AddtProfileInfo();this.strAddress1="";this.strAddress2="";this.strCity="";this.strState="";this.strZipCode="";this.strLicenseNum="";this.strLocale="";this.communities=new Array();};UserProfile.prototype.ParseXml=function(xmlDoc){var i=0;var docElem=xmlDoc.documentElement;this.ResetData();this.strFirstName=XML.FindAndFillValue(docElem,"first_name",false);this.strLastName=XML.FindAndFillValue(docElem,"last_name",false);this.strLocale=XML.FindAndFillValue(docElem,"locale",false);this.strTitle=XML.FindAndFillValue(docElem,"title",false);this.strSuffix=XML.FindAndFillValue(docElem,"suffix",false);this.strDegree=XML.FindAndFillValue(docElem,"degree",false);var specialties=XML.GetElementsByTagName(docElem,"specialty");if(specialties!=null)for(i=0;i<specialties.length;i++)this.specialityList.push(new Speciality(specialties[i]));this.strAddress1=XML.FindAndFillValue(docElem,"address",false);this.strAddress2=XML.FindAndFillValue(docElem,"address2",false);this.strCity=XML.FindAndFillValue(docElem,"city",false);this.strState=XML.FindAndFillValue(docElem,"state",false);this.strZipCode=XML.FindAndFillValue(docElem,"zip",false);this.strLicenseNum=XML.FindAndFillValue(xmlDoc,"license",false);this.strLoginEmail=XML.FindAndFillValue(xmlDoc,"email",false);this.strFax=XML.FindAndFillValue(xmlDoc,"fax",false);this.validationstatus=XML.FindAndFillValue(xmlDoc,"validationStatus",false);this.strNpiNumber=XML.FindAndFillValue(xmlDoc,"npi",false);this.npistatus=XML.FindAndFillValue(xmlDoc,"npistatus",false);var currInst=XML.GetElementsByTagName(docElem,"current_inst");if(currInst!=null)for(i=0;i<currInst.length;i++)this.currentAffiliations.push(new Institution(currInst[i]));var addt=XML.GetElementsByTagName(docElem,"addtlProfInfo");if(addt!=null)for(i=0;i<addt.length;i++)this.additionalInfo=new AddtProfileInfo(addt[i]);this.specialityList.sort(Speciality.SortCompare);var communities=XML.GetElementsByTagName(docElem,"community");if(communities!=null){for(i=0;i<communities.length;++i){var c=new Community(communities[i]);this.communities.push(c);}};this.communities.sort(function(c1,c2){return c1.name<c2.name?-1:c1.name==c2.name?0:1;});var strMakeForMe=XML.FindAndFillValue(xmlDoc,"editprof",false);if(strMakeForMe=='open')this.makeForMe=true;};UserProfile.prototype.AddSpeciality=function(strSpeciality){var tmp=new Speciality();tmp.SetData(null,strSpeciality);this.specialityList.push(tmp);};UserProfile.prototype.ResetInstitutions=function(){this.currentAffiliations=new Array();};UserProfile.prototype.AddInstitution=function(type,strName,dateStart,dateEnd,strDetails,isPublic,strDbId,strDegree){if(type=='current_inst'){var tmp=new Institution();tmp.SetData(strName,dateStart,dateEnd,strDetails,isPublic,strDbId);this.currentAffiliations.push(tmp);};return tmp;};UserProfile.prototype.GetDisplayName=function(){var str='';if(this.strLocale=='ja_JP'){if(this.strLastName.length>0)str+=this.strLastName;if(this.strFirstName.length>0)str+=this.strFirstName;str+=QSTR.sensei;}else{if(this.strFirstName.length>0)str+=' '+this.strFirstName;if(this.strLastName.length>0)str+=' '+this.strLastName;if(this.strSuffix.length>0)str+=' '+this.strSuffix;if(this.strDegree.length>0)str+=', '+this.strDegree;};return str;};UserProfile.prototype.GetDisplaySpecialties=function(){var str="";for(var i=0;i<this.specialityList.length;i++){if(i!=0)str=str+", ";str=str+this.specialityList[i].name;};return str;};UserProfile.prototype.GetDisplayAddress1=function(){return this.strAddress1;};UserProfile.prototype.GetDisplayAddress2=function(){return this.strAddress2;};UserProfile.prototype.GetDisplayCityState=function(){if(this.strState.length==0&&this.strZipCode.length==0)return this.strCity;if(this.strCity.length==0)return locale=='ja'?this.strZipCode+"\n"+this.strState:this.strState+' '+this.strZipCode;if(locale=='ja'){return this.strZipCode+"\n"+this.strState+" "+this.strCity;}else{return this.strCity+", "+this.strState+" "+this.strZipCode;}};UserProfile.prototype.GetSpeciality=function(number){if(this.specialityList.length>=number)return this.specialityList[number-1].name;return"";};UserProfile.prototype.Clone=function(){var i=0;var clone=new UserProfile();clone.strFirstName=this.strFirstName;clone.strLastName=this.strLastName;clone.strTitle=this.strTitle;clone.strPassword=this.strPassword;clone.strSuffix=this.strSuffix;clone.strDegree=this.strDegree;for(i=0;i<this.specialityList.length;i++)clone.specialityList.push(this.specialityList[i].Clone());clone.strAddress1=this.strAddress1;clone.strAddress2=this.strAddress2;clone.strCity=this.strCity;clone.strState=this.strState;clone.strZipCode=this.strZipCode;clone.strLicenseNum=this.strLicenseNum;clone.strLoginEmail=this.strLoginEmail;clone.strFax=this.strFax;clone.validationstatus=this.validationstatus;clone.strNpiNumber=this.strNpiNumber;clone.npistatus=this.npistatus;for(i=0;i<this.currentAffiliations.length;i++)clone.currentAffiliations.push(this.currentAffiliations[i].Clone());clone.additionalInfo=this.additionalInfo.Clone();clone.makeForMe=this.makeForMe;clone.makeForMeNotes=this.makeForMeNotes;return clone;};UserProfile.prototype.createCommunityDoc=function(xmlDoc){var communities=xmlDoc.createElement("communities");for(var i=0;i<this.communities.length;++i){if(this.communities[i].member){var c=this.communities[i];var cxml=xmlDoc.createElement("community");cxml.setAttribute("id",c.id);communities.appendChild(cxml);}};return communities;};UserProfile.prototype.SubmitDifferences=function(refProfile,funcCallback){var xmlDoc=XML.CreateDocument("<setprofile></setprofile>");var setProfile=xmlDoc.documentElement;setProfile.setAttribute("id",LoginCredentials.Username);setProfile.setAttribute("password",LoginCredentials.Password);var user_profile=xmlDoc.createElement("user_profile");xmlDoc.documentElement.appendChild(user_profile);var personal_info=xmlDoc.createElement("personal_info");user_profile.appendChild(personal_info);var extended_info=xmlDoc.createElement("extended_info");user_profile.appendChild(extended_info);this.CheckAndDiff1(personal_info,"first_name",this.strFirstName,refProfile.strFirstName);this.CheckAndDiff1(personal_info,"last_name",this.strLastName,refProfile.strLastName);this.CheckAndDiff1(personal_info,"title",this.strTitle,refProfile.strTitle);this.CheckAndDiff1(personal_info,"password",this.strPassword,refProfile.strPassword);this.CheckAndDiff1(personal_info,"suffix",this.strSuffix,refProfile.strSuffix);this.CheckAndDiff1(personal_info,"degree",this.strDegree,refProfile.strDegree);this.CheckAndDiff1(personal_info,"address",this.strAddress1,refProfile.strAddress1);this.CheckAndDiff1(personal_info,"address2",this.strAddress2,refProfile.strAddress2);this.CheckAndDiff1(personal_info,"city",this.strCity,refProfile.strCity);this.CheckAndDiff1(personal_info,"state",this.strState,refProfile.strState);this.CheckAndDiff1(personal_info,"zip",this.strZipCode,refProfile.strZipCode);this.CheckAndDiff1(personal_info,"email",this.strLoginEmail,refProfile.strLoginEmail);this.CheckAndDiff1(personal_info,"npi",this.strNpiNumber,refProfile.strNpiNumber);if(!LuhnCheck(this.strNpiNumber)){alert("The NPI number is not valid");return;};if((this.strNpiNumber!=refProfile.strNpiNumber)&&(refProfile.strNpiNumber!='-1')&&(refProfile.strNpiNumber!='')){if(this.validationstatus=='approved'){if(!confirm("Changing your NPI number will require the reverification of your account.\n"+"You will not be able to enter comments or post questions until your account is reverified.\n"+"Are you sure you want to change your NPI number?")){return;}}};var communities=refProfile.createCommunityDoc(xmlDoc);personal_info.appendChild(communities);if(this.makeForMe==true){var make_for_me=xmlDoc.createElement("editprof");make_for_me.appendChild(xmlDoc.createTextNode('open'));var notes=xmlDoc.createElement("notes");notes.appendChild(XML.CreateTextNode(xmlDoc,this.makeForMeNotes));personal_info.appendChild(make_for_me);personal_info.appendChild(notes);};this.CheckAndDiffSpecialities(personal_info,refProfile,extended_info);this.CheckAndDiffLists(extended_info,this.currentAffiliations,refProfile.currentAffiliations,"current_inst");this.CheckAndDiffAdditionalInfo(extended_info,refProfile.additionalInfo);this.CheckAndDiff1(personal_info,"email",this.strLoginEmail,refProfile.strLoginEmail);this.CheckAndDiff1(personal_info,"license",this.strLicenseNum,refProfile.strLicenseNum);if(personal_info.childNodes.length==0){user_profile.removeChild(personal_info);};if(extended_info.childNodes.length==0)user_profile.removeChild(extended_info);if(user_profile.childNodes.length>0){HTTP.post(QSettings.SetUserProfileXmlUrl(),XML.Serialize(xmlDoc),funcCallback);}else{funcCallback();}};function LuhnCheck(strNpiNumber){if(strNpiNumber=='')return true;if(strNpiNumber==-1)return true;var npiNumber="80840"+strNpiNumber;var len=npiNumber.length;if(len!=15)return false;var doubleThisDigit=false;var total=0;for(var i=len-1;i>=0;--i){var c=npiNumber.charCodeAt(i)-48;if((c<0)||(c>9)){return false;};if(doubleThisDigit){c=c+c;total=total+Math.floor(c/10)+(c%10);}else{total=total+c;};doubleThisDigit=!doubleThisDigit;};if(total%10==0){return true;};return false;};UserProfile.prototype.CheckAndDiff1=function(parentNode,strNode,newString,oldString){if(newString!=oldString){var childNode=parentNode.ownerDocument.createElement(strNode);childNode.appendChild(XML.CreateTextNode(parentNode.ownerDocument,newString));parentNode.appendChild(childNode);}};UserProfile.prototype.CheckAndDiffSpecialities=function(parentNode,clone,extended_info){var bModifications=false;var i;if(clone.specialityList.length>this.specialityList.length)bModifications=true;else{for(i=0;i<clone.specialityList.length;i++){if(this.specialityList[i].name!=clone.specialityList[i].name){bModifications=true;}};for(;i<this.specialityList.length;i++){if(this.specialityList[i].name.length!=0){bModifications=true;}};};if(bModifications){var specialtyNode=parentNode.ownerDocument.createElement('specialties');for(i=0;i<this.specialityList.length;i++){if(this.specialityList[i].name.length>0){var singleSpec=parentNode.ownerDocument.createElement('specialty');singleSpec.setAttribute('name',this.specialityList[i].name);specialtyNode.appendChild(singleSpec);}};parentNode.appendChild(specialtyNode);}};UserProfile.prototype.CheckAndDiffLists=function(parentNode,thisList,refList,tagName){var i=0;var j=0;var bFound=false;for(i=0;i<refList.length;i++){bFound=false;for(j=0;j<thisList.length;j++){if(refList[i].id==thisList[j].id){thisList[j].original=refList[i];bFound=true;}};if(bFound==false){this.AddExtendedInfoXmlNode(parentNode,tagName,refList[i].id,null,null,null,null,null,CMD_REMOVE);}};for(i=0;i<thisList.length;i++){if(thisList[i].id==null){this.AddExtendedInfoXmlNode(parentNode,tagName,thisList[i].id,thisList[i].strName,thisList[i].dateStart,thisList[i].dateEnd,thisList[i].GetDataString(),!thisList[i].bPublic,CMD_ADD);}else{if(thisList[i].IsEqual(thisList[i].original)==false){this.AddExtendedInfoXmlNode(parentNode,tagName,thisList[i].id,thisList[i].strName,thisList[i].dateStart,thisList[i].dateEnd,thisList[i].GetDataString(),!thisList[i].bPublic,CMD_MODIFY);};}}};UserProfile.prototype.CheckAndDiffAdditionalInfo=function(parentNode,cloneAInfo){var tagName="addtlProfInfo";if(this.additionalInfo.id==null){this.AddExtendedInfoXmlNode(parentNode,tagName,this.additionalInfo.id,this.additionalInfo.strName,this.additionalInfo.dateStart,this.additionalInfo.dateEnd,this.additionalInfo.GetDataString(),!this.additionalInfo.bPublic,CMD_ADD,true);}else{if(this.additionalInfo.IsEqual(cloneAInfo)==false){this.AddExtendedInfoXmlNode(parentNode,tagName,this.additionalInfo.id,this.additionalInfo.strName,this.additionalInfo.dateStart,this.additionalInfo.dateEnd,this.additionalInfo.GetDataString(),!this.additionalInfo.bPublic,CMD_MODIFY,true);};}};UserProfile.prototype.AddExtendedInfoXmlNode=function(parentNode,strTag,strId,strInstName,dateStart,dateEnd,strData,bprivate,cmdVal){var xmlDoc=parentNode.ownerDocument;var xmlElem=xmlDoc.createElement(strTag);xmlElem.setAttribute('cmd',cmdVal);if(strId!=null)xmlElem.setAttribute('id',strId);var institutionElem=xmlDoc.createElement('institution');xmlElem.appendChild(institutionElem);if(strInstName!=null)institutionElem.appendChild(XML.CreateTextNode(xmlDoc,strInstName));var activityElem=xmlDoc.createElement('activity');xmlElem.appendChild(activityElem);var start_dateElem=xmlDoc.createElement('start_date');xmlElem.appendChild(start_dateElem);if(dateStart!=null){start_dateElem.appendChild(xmlDoc.createTextNode(DateUtils.ToString3(dateStart)));};var end_dateElem=xmlDoc.createElement('end_date');xmlElem.appendChild(end_dateElem);if(dateEnd!=null)end_dateElem.appendChild(xmlDoc.createTextNode(DateUtils.ToString3(dateEnd)));var dataElem=xmlDoc.createElement('data');xmlElem.appendChild(dataElem);if(strData!=null){dataElem.appendChild(XML.CreateCDataNode(xmlDoc,strData));};var privateElem=xmlDoc.createElement('private');xmlElem.appendChild(privateElem);if(bprivate!=null)privateElem.appendChild(xmlDoc.createTextNode(""+bprivate));parentNode.appendChild(xmlElem);};UserProfile.EncloseInFakeCData=function(strText){var tmp=strText;tmp=tmp.replace(/]]>/g,"...");tmp=tmp.replace(/]}>/g,"...");tmp="<![CDATA["+tmp+"]}>";return tmp;};UserProfile.ConvertFakeToRealCData=function(strText){var tmp=strText;tmp=tmp.replace(/]}>/g,"]]>");return tmp;};function Institution(xmlElem){this.ResetData();if(xmlElem)this.ParseXml(xmlElem);};Institution.prototype.ResetData=function(){this.id=null;this.strName="";this.dateStart=null;this.dateEnd=null;this.bPublic=false;this.strDetails="";};Institution.prototype.SetData=function(name,start,end,details,isPublic,strDbId){this.id=strDbId;this.strName=name;this.dateStart=start;this.dateEnd=end;this.strDetails=details;this.bPublic=isPublic;};Institution.prototype.Clone=function(){var clone=new Institution();clone.id=this.id;clone.strName=this.strName;clone.dateStart=this.dateStart;clone.dateEnd=this.dateEnd;clone.strDetails=this.strDetails;clone.bPublic=this.bPublic;return clone;};Institution.prototype.ParseXml=function(xmlElem){this.id=xmlElem.getAttribute('id');this.strName=XML.FindAndFillValue(xmlElem,"institution",false);this.bPublic=!(XML.FindAndFillValueBool(xmlElem,"private"));var strStartDate=XML.FindAndFillValue(xmlElem,"start_date");if(strStartDate.length>0)this.dateStart=DateUtils.FromServerTime2(strStartDate);var strEndDate=XML.FindAndFillValue(xmlElem,"end_date");if(strEndDate.length>0)this.dateEnd=DateUtils.FromServerTime2(strEndDate);var dataStr=XML.FindAndFillValue(xmlElem,"data");dataStr=UserProfile.ConvertFakeToRealCData(dataStr);var dataDoc=XML.CreateDocument(dataStr);this.strDetails=XML.FindAndFillValue(dataDoc.documentElement,"details",false);};Institution.prototype.IsEqual=function(rhs){if(this.strName==rhs.strName&&DateUtils.IsEqual(this.dateStart,rhs.dateStart)&&DateUtils.IsEqual(this.dateEnd,rhs.dateEnd)&&this.strDetails==rhs.strDetails&&this.bPublic==rhs.bPublic){return true;};return false;};Institution.prototype.GetDataString=function(){var strRest="<x><details>"+UserProfile.EncloseInFakeCData(this.strDetails)+"</details></x>";return strRest;};function AddtProfileInfo(xmlElem){this.ResetData();if(xmlElem)this.ParseXml(xmlElem);};AddtProfileInfo.prototype.ResetData=function(){this.id=null;this.strName="";this.dateStart=null;this.dateEnd=null;this.bPublic=true;this.strXhtmlBody="";};AddtProfileInfo.prototype.SetData=function(body,isPublic,strDbId){this.strXhtmlBody=body;if(isPublic!=undefined)this.bPublic=isPublic;if(strDbId!=undefined)this.id=strDbId;};AddtProfileInfo.prototype.Clone=function(){var clone=new AddtProfileInfo();clone.id=this.id;clone.strXhtmlBody=this.strXhtmlBody;clone.bPublic=this.bPublic;return clone;};AddtProfileInfo.prototype.ParseXml=function(xmlElem){this.id=xmlElem.getAttribute('id');this.bPublic=!(XML.FindAndFillValueBool(xmlElem,"private"));try{this.strXhtmlBody=XML.FindAndFillValue(xmlElem,"data");}catch(e){};};AddtProfileInfo.prototype.IsEqual=function(rhs){if(this.strXhtmlBody==rhs.strXhtmlBody&&this.bPublic==rhs.bPublic){return true;};return false;};AddtProfileInfo.prototype.GetDataString=function(){return this.strXhtmlBody;};function Speciality(xmlElem){this.ResetData();if(xmlElem)this.ParseXml(xmlElem);};Speciality.prototype.ResetData=function(){this.id=null;this.name="";this.marked=false;this.arrayOrder=9999;};Speciality.prototype.SetData=function(strDbId,strSpec){this.id=strDbId;this.name=strSpec;};Speciality.prototype.Clone=function(){var clone=new Speciality();clone.id=this.id;clone.name=this.name;return clone;};Speciality.prototype.ParseXml=function(xmlElem){this.id=xmlElem.getAttribute('id');this.name=xmlElem.getAttribute('name');};Speciality.SortCompare=function(left,right){return left.arrayOrder-right.arrayOrder;};function Community(xmlElem){if(xmlElem!=null){this.id=xmlElem.getAttribute('id');this.name=xmlElem.getAttribute('name');this._communityType="public_community";if(xmlElem.getAttribute("type")!=null)this._communityType=(xmlElem.getAttribute('type'));this.member=false;if(xmlElem.getAttribute("member")!=null)this.member=(xmlElem.getAttribute('member').toLowerCase()=='true');this.group=xmlElem.getAttribute('group');}};Community.prototype.getId=function(){return this.id;};Community.prototype.getName=function(){return this.name;};Community.prototype.isPrivate=function(){return this._communityType=="private_community";};Community.prototype.communityType=function(){return this._communityType;};Community.prototype.isMember=function(){return this.member;};Community.prototype.getGroup=function(){return this.group;};var AccountInfo={};AccountInfo.Title="";AccountInfo.FirstName="";AccountInfo.LastName="";AccountInfo.FullName="";AccountInfo.Degree="";AccountInfo.Suffix="";AccountInfo.Locale="";AccountInfo.CreateNewJPAccount=function(onSuccess,onFailure,props,partnerCode,allowContact,createProfileForMe,dataformId,userId){var xmlDocument=XML.CreateDocument("<createUser></createUser>");var createUserElement=xmlDocument.documentElement;if(allowContact){createUserElement.setAttribute("contactOptIn","true");};for(prop in props){var name=prop;if(prop.substr(0,6)=='signUp'){name=prop.substr(6,1).toLowerCase()+prop.substr(7);};element=xmlDocument.createElement(name);var value=props[prop];if(value==null)value='';element.appendChild(XML.CreateTextNode(xmlDocument,value));createUserElement.appendChild(element);};var trackingid=readCookie("com.quantia.session");if(trackingid!=null){element=xmlDocument.createElement("trackingid");element.appendChild(XML.CreateTextNode(xmlDocument,trackingid));createUserElement.appendChild(element);};HTTP.postAsXml("/q-webclient/?cmd=createjpuser",XML.Serialize(xmlDocument),function(results){var resultDocument=XML.CreateDocument(results);if(resultDocument.documentElement.getAttribute("status")=="success"){onSuccess(XML.FindAndFillValue(resultDocument,"username"));}else{onFailure(XML.FindAndFillValue(resultDocument,"errorMessage"));}},function(errorMessage){onFailure(errorMessage);});};AccountInfo.JoinCommunity=function(communityId,callback){HTTP.getText("/q-webclient/?cmd=joincommunity&join=true&user="+LoginCredentials.Username+"&com="+communityId,callback);};AccountInfo.LeaveCommunity=function(communityId,callback){HTTP.getText("/q-webclient/?cmd=joincommunity&join=false&user="+LoginCredentials.Username+"&com="+communityId,callback);};AccountInfo.CreateNewAccount=function(onSuccess,onFailure,firstName,lastName,suffix,credentials,emailAddress,password,trusted,fax,zipCode,title,institution,locale,partnerCode,allowContact,createProfileForMe,dataformId,userId,communities,userEnteredRegId){var xmlDocument=XML.CreateDocument("<createUser></createUser>");var createUserElement=xmlDocument.documentElement;if(allowContact){createUserElement.setAttribute("contactOptIn","true");};if(createProfileForMe){createUserElement.setAttribute("createProfile","true");};var element;element=xmlDocument.createElement("firstName");element.appendChild(XML.CreateTextNode(xmlDocument,firstName));createUserElement.appendChild(element);element=xmlDocument.createElement("lastName");element.appendChild(XML.CreateTextNode(xmlDocument,lastName));createUserElement.appendChild(element);element=xmlDocument.createElement("suffix");element.appendChild(XML.CreateTextNode(xmlDocument,suffix));createUserElement.appendChild(element);element=xmlDocument.createElement("credentials");element.appendChild(XML.CreateTextNode(xmlDocument,credentials));createUserElement.appendChild(element);element=xmlDocument.createElement("email");element.appendChild(XML.CreateTextNode(xmlDocument,emailAddress));createUserElement.appendChild(element);element=xmlDocument.createElement("password");element.appendChild(XML.CreateTextNode(xmlDocument,password));createUserElement.appendChild(element);element=xmlDocument.createElement("trusteddomain");element.appendChild(XML.CreateTextNode(xmlDocument,trusted));createUserElement.appendChild(element);if((fax!=null)&&(fax!='')){element=xmlDocument.createElement("faxnumber");element.appendChild(XML.CreateTextNode(xmlDocument,fax));createUserElement.appendChild(element);};element=xmlDocument.createElement("officeZip");element.appendChild(XML.CreateTextNode(xmlDocument,zipCode));createUserElement.appendChild(element);element=xmlDocument.createElement("institution");element.appendChild(XML.CreateTextNode(xmlDocument,institution));createUserElement.appendChild(element);element=xmlDocument.createElement("title");element.appendChild(XML.CreateTextNode(xmlDocument,title));createUserElement.appendChild(element);if((locale!=null)&&(locale!="")){element=xmlDocument.createElement("locale");element.appendChild(XML.CreateTextNode(xmlDocument,locale));createUserElement.appendChild(element);};if((partnerCode!=null)&&(partnerCode!="")){element=xmlDocument.createElement("partner");element.appendChild(XML.CreateTextNode(xmlDocument,partnerCode));createUserElement.appendChild(element);};if((dataformId!=null)&&(dataformId!="")){element=xmlDocument.createElement("signupDFID");element.appendChild(XML.CreateTextNode(xmlDocument,dataformId));createUserElement.appendChild(element);};if((userId!=null)&&(userId!="")){element=xmlDocument.createElement("signupReferrer");element.appendChild(XML.CreateTextNode(xmlDocument,userId));createUserElement.appendChild(element);};if((communities!=null)&&(communities.length!=0)){element=xmlDocument.createElement("communities");communities.forEach(function(e){var communityElement=xmlDocument.createElement("community");communityElement.setAttribute("id",e);element.appendChild(communityElement);});createUserElement.appendChild(element);};var regid=readCookie("joinquantiamd");if(regid!=null){element=xmlDocument.createElement("regid");element.appendChild(XML.CreateTextNode(xmlDocument,regid));createUserElement.appendChild(element);}else if(userEnteredRegId!=null){element=xmlDocument.createElement("regid");element.appendChild(XML.CreateTextNode(xmlDocument,userEnteredRegId));createUserElement.appendChild(element);};var trackingid=readCookie("com.quantia.session");if(trackingid!=null){element=xmlDocument.createElement("trackingid");element.appendChild(XML.CreateTextNode(xmlDocument,trackingid));createUserElement.appendChild(element);};HTTP.postAsXml("/q-webclient/?cmd=createuser",XML.Serialize(xmlDocument),function(results){var resultDocument=XML.CreateDocument(results);if(resultDocument.documentElement.getAttribute("status")=="success"){onSuccess(XML.FindAndFillValue(resultDocument,"username"));}else{onFailure(XML.FindAndFillValue(resultDocument,"errorMessage"));}},function(errorMessage){onFailure(errorMessage);});};AccountInfo.LoadFromXml=function(authElem){if(authElem.getAttribute("code")!=null){createCookie("com.quantia.user","",-1);LoginCredentials.LoadCachedCreds();return;};var accountElem=XML.GetFirstElementByTagName(authElem,"account_info");AccountInfo.Title=XML.FindAndFillValue(accountElem,"title");AccountInfo.FirstName=XML.FindAndFillValue(accountElem,"first_name");AccountInfo.LastName=XML.FindAndFillValue(accountElem,"last_name");AccountInfo.Degree=XML.FindAndFillValue(accountElem,"degree");AccountInfo.Suffix=XML.FindAndFillValue(accountElem,"suffix");AccountInfo.Locale=XML.FindAndFillValue(accountElem,"locale");AccountInfo.FullName=AccountInfo.ReturnFullName(AccountInfo.Title,AccountInfo.FirstName,AccountInfo.LastName,AccountInfo.Degree,AccountInfo.Suffix,AccountInfo.Locale);};AccountInfo.ReturnFullName=function(strTitle,strFirstName,strLastName,strDegree,strSuffix,strLocale){var fullName="";if("ja_JP"==strLocale){if(strLastName!=null&&strLastName.length>0&&strLastName!="null"){fullName=fullName+strLastName;};if(strFirstName!=null&&strFirstName.length>0&&strFirstName!="null"){fullName=fullName+strFirstName;}}else{if(strFirstName!=null&&strFirstName.length>0&&strFirstName!="null"){if(fullName.length>0)fullName=fullName+" ";fullName=fullName+strFirstName;};if(strLastName!=null&&strLastName.length>0&&strLastName!="null"){if(fullName.length>0)fullName=fullName+" ";fullName=fullName+strLastName;};if(strSuffix!=null&&strSuffix.length>0&&strSuffix!="null"){if(fullName.length>0)fullName=fullName+" ";fullName=fullName+strSuffix;};if(strDegree!=null&&strDegree.length>0&&strDegree!="null"){if(fullName.length>0)fullName=fullName+", ";fullName=fullName+strDegree;}};return unescape(fullName);};function QIPAuthor(strAuthorId,strAuthorName,strAuthorInstitution,strAuthorTitle,strPrefix,strPhoto){this._authorId=strAuthorId;this._authorName=strAuthorName;this._authorInstitution=strAuthorInstitution;this._authorTitle=strAuthorTitle;this._prefix=strPrefix;this._photo=strPhoto;};var InputBoxes={};InputBoxes.createSingleLine=function(strId,size,strInitialText){var ib=new Element("input");if(strId!=null)ib.setProperty('id',strId);try{ib.setProperty('type','text');}catch(e){};if(size!=null)ib.setProperty('size',size);if(strInitialText!=null)InputBoxes.setText(ib,strInitialText);return ib;};InputBoxes.createMultiLine=function(strId,rows,columns,strInitialText){var ib=new Element("textarea");if(strId!=null)ib.setProperty('id',strId);try{ib.setProperty('type','text');}catch(e){};if(rows!=null)ib.setProperty('rows',rows);if(columns!=null)ib.setProperty('cols',columns);else ib.style.width='100%';if(strInitialText!=null)InputBoxes.setText(ib,strInitialText);return ib;};InputBoxes.isFckEditAvailable=function(){var browVer=navigator.appVersion;if(browVer.indexOf('Safari')!=-1)return false;return true;};InputBoxes.createFckEditBox=function(strId,strInitialXhtml,bUseShortToolbar){var divHolder=new Element('div');divHolder.setProperty('id',strId);divHolder.ibBuilder='createFckEditBox';var fck=new FCKeditor(strId);fck.BasePath="js/lib/fckeditor/";if(bUseShortToolbar!=undefined&&bUseShortToolbar==true)fck.ToolbarSet='QuantiaFCKShort';else fck.ToolbarSet='QuantiaFCK';divHolder.innerHTML=fck.CreateHtml();if(strInitialXhtml!=undefined&&strInitialXhtml!=null)InputBoxes.setText(divHolder,strInitialXhtml);return divHolder;};InputBoxes.createDropDownBox=function(strId,arrayOptions,initialText){initialText=''+initialText;var selectElt=new Element('select');selectElt.setProperty('id',strId);for(var i=0;i<arrayOptions.length;i++){var curr=arrayOptions[i];var optionElt=new Element('option');optionElt.setAttribute('value',curr);optionElt.innerHTML=curr;selectElt.appendChild(optionElt);if(curr==initialText)optionElt.selectedIndex=i;};InputBoxes.setText(selectElt,initialText);return selectElt;};InputBoxes.createRadioButton=function(strGoupName,strId,strValue,bChecked){try{var ansElt=document.createElement('<input type="radio" name="'+strGoupName+'" />');}catch(err){var ansElt=document.createElement('input');ansElt.setAttribute('type','radio');ansElt.setAttribute('name',strGoupName);};ansElt.type="radio";ansElt.checked=bChecked;if(strId!=null)ansElt.id=strId;if(strValue!=null)ansElt.value=strValue;return ansElt;};InputBoxes.setText=function(domElem,strText){strText=''+strText;var mooObj=$(domElem);var strTagName=mooObj.get("tag");if(strTagName=='input'||strTagName=='textarea'){mooObj.value=strText;}else if(strTagName=='select'){for(var a=0;a<mooObj.options.length;a++){if(mooObj.options[a].text==strText){mooObj.selectedIndex=a;break;};}}else if(strTagName=='div'){if(mooObj.ibBuilder=='createFckEditBox'){try{if(FCKeditorAPI!=undefined){var oEditor=FCKeditorAPI.GetInstance(mooObj.getAttribute('id'));if(oEditor!=undefined){oEditor.SetHTML(strText);return;}}}catch(e){};window.setTimeout(function(){InputBoxes.setText(domElem,strText);},500);};}};InputBoxes.getText=function(domElem){var mooObj=$(domElem);var strTagName=mooObj.get("tag");if(strTagName=='input'||strTagName=='textarea'){return mooObj.value;}else if(strTagName=='select'){return mooObj.options[mooObj.selectedIndex].text;}else if(strTagName=='div'){if(mooObj.ibBuilder=='createFckEditBox'){try{var oEditor=FCKeditorAPI.GetInstance(mooObj.getAttribute('id'));var str=oEditor.GetXHTML(true);if(str!=null&&typeof str=='string'){var test=str.length;return str;}}catch(e){};return"";};}};InputBoxes.createYearArray=function(includeBlank,startYear,endYear){var years=new Array();if(includeBlank)years.push('');for(var i=endYear;i>startYear;i--){years.push(''+i);};return years;};InputBoxes.plainTextToHtml=function(strText){var tmp=strText;tmp=tmp.replace(/\n/g,"<br/>");return tmp;};var windowScroller=null;function getScroller(){if(windowScroller==null){windowScroller=new Fx.Scroll(window,{wait:false,duration:500,transition:Fx.Transitions.Quad.easeInOut});};return windowScroller;};function goToNextUrl(addr){window.nextUrl=addr;document.location.href=addr;return false;};var windowScroller=null;function getScroller(){if(windowScroller==null){windowScroller=new Fx.Scroll(window,{wait:false,duration:500,transition:Fx.Transitions.Quad.easeInOut});};return windowScroller;};function scrollToHeight(element,height,effectDuration,onCompleteCallback){this.fx=new Fx.Tween(element,{property:'height',wait:false,duration:effectDuration,transition:Fx.Transitions.Sine.easeInOut,onComplete:onCompleteCallback});this.fx.start(height);};function fadeToOpacity(element,opacity,effectDuration,onCompleteCallback){this.fx=new Fx.Tween(element,{property:'opacity',wait:false,duration:effectDuration,transition:Fx.Transitions.Sine.easeInOut,onComplete:onCompleteCallback});this.fx.start(opacity);};var tempThis;function SmoothToggler(arg){this._bodyDiv=arg.bodyDiv;this._clickedOnElement=arg.clickedOnElement;this._toggleElement=arg.toggleElement;this._toggleChild=arg.toggleChild;this._elementToFocus=arg.elementToFocus;this._callOnOpen=arg.callOnOpen;this._callOnClose=arg.callOnClose;this._duration=arg.duration;this._neverScrollToTop=arg.neverScrollToTop;this._isVisible=("true"==arg.isVisible);this._isAnimating=false;};SmoothToggler.prototype.toggleVisibility=function(forceToTop){if(this._isAnimating){return;};this._isAnimating=true;if(this._isVisible){if(this._callOnClose!=null){this._callOnClose();};tempThis=this;fadeToOpacity($(tempThis._toggleElement),0,this._duration/2,function(){scrollToHeight($(tempThis._toggleElement),0,tempThis._duration/2,function(){tempThis._isVisible=false;tempThis._isAnimating=false;});});}else{if(this._callOnOpen!=null){this._callOnOpen();};$(this._toggleElement).setStyle('height','0px');$(this._toggleElement).setStyle('opacity','0');$(this._toggleElement).setStyle('overflow','hidden');$(this._toggleElement).removeClass('cHidden');var desiredHeight=$(this._toggleChild).getSize().y;$(this._bodyDiv).setStyle('height',$(this._bodyDiv).getSize().y+desiredHeight);if((forceToTop)||(Viewport.scrollY()+Viewport.windowHeight()<$(this._toggleElement).getTop()+100)){if(this._neverScrollToTop!=true){var desiredY=$(this._clickedOnElement).getTop();getScroller().start(0,desiredY);}};tempThis=this;scrollToHeight($(tempThis._toggleElement),desiredHeight,this._duration/2,function(){fadeToOpacity($(tempThis._toggleElement),1,tempThis._duration/2,function(){tempThis._isVisible=true;tempThis._isAnimating=false;if(Viewport.scrollY()+Viewport.windowHeight()<$(tempThis._toggleElement).getTop()+$(tempThis._toggleChild).getSize().y){var desiredY=$(tempThis._toggleElement).getTop()-(Viewport.windowHeight()-$(tempThis._toggleChild).getSize().y)+10;getScroller().start(0,desiredY);};if(tempThis._elementToFocus!=null){$(tempThis._elementToFocus).focus();}});});}};var PopupPreview={};PopupPreview.REQUEST_DELAY=1000;PopupPreview.Hover=function(dataformId,element){if(PopupPreview.dataformId!=dataformId){PopupPreview.Leave();PopupPreview.dataformId=dataformId;PopupPreview.element=element;PopupPreview.timerControl=setTimeout(function(){PopupPreview.PostRequest(dataformId);},PopupPreview.REQUEST_DELAY);}};PopupPreview.SetMouseLocation=function(x,y){PopupPreview.mouseX=x;PopupPreview.mouseY=y;};PopupPreview.PostRequest=function(dataformId){var alternateElement=PopupPreview.element.getAttribute('popupid');if(alternateElement!=null&&$(alternateElement)!=null){var text=$(alternateElement).innerHTML;PopupPreview.Callback(text,dataformId);}else if((PopupPreview.dataformId==dataformId)&&(parseInt(dataformId)>0)){pageName="/dataformPopup.jsp?dataformID="+dataformId;HTTP.getText(pageName,function(text){PopupPreview.Callback(text,dataformId);});}};PopupPreview.Callback=function(html,dataformId){if(PopupPreview.dataformId==dataformId){$('popupPreviewContainer').innerHTML=html;$('popupPreview').setStyle('left','-1000px');$('popupPreview').removeClass('cHidden');var width=$('popupPreview').getSize().x;var height=$('popupPreview').getSize().y;var elementLeft=PopupPreview.element.getPosition().x;var elementTop=PopupPreview.element.getPosition().y;var elementWidth=PopupPreview.element.getSize().x;var elementHeight=PopupPreview.element.getSize().y;var desiredLeft=PopupPreview.mouseX-(width*.8);var desiredTop=PopupPreview.mouseY-height-40;if(desiredTop<Viewport.scrollY()){desiredTop=PopupPreview.mouseY+40;if(desiredTop+height>Viewport.scrollY()+Viewport.windowHeight()){desiredTop=Viewport.scrollY()+Viewport.windowHeight()-height-12;}};if(desiredLeft<Viewport.scrollX()){desiredLeft=PopupPreview.mouseX+40;if(desiredLeft+width>Viewport.scrollX()+Viewport.windowWidth()){desiredLeft=Viewport.scrollX()+Viewport.windowWidth()-width-40;}};if((desiredLeft<PopupPreview.mouseX)&&(desiredLeft+width>PopupPreview.mouseX)&&(desiredTop<PopupPreview.mouseY)&&(desiredTop+height>PopupPreview.mouseY)){desiredLeft=PopupPreview.mouseX-width-40;desiredTop=PopupPreview.mouseY-(height/2);if(desiredTop<Viewport.scrollY()){desiredTop=Viewport.scrollY();}else if(desiredTop+height>Viewport.scrollY()+Viewport.windowHeight()){desiredTop=Viewport.scrollY()+Viewport.windowHeight()-height;};if(desiredLeft<Viewport.scrollX()){desiredLeft=PopupPreview.mouseX+40;if(desiredLeft+width>Viewport.scrollX()+Viewport.windowWidth()){desiredLeft=Viewport.scrollX()+Viewport.windowWidth()-width-40;}};if((desiredLeft<PopupPreview.mouseX)&&(desiredLeft+width>PopupPreview.mouseX)&&(desiredTop<PopupPreview.mouseY)&&(desiredTop+height>PopupPreview.mouseY)){$('popupPreview').addClass('cHidden');return;}};var arrowX=-200;var arrowY=0;var arrowWidth=0;var arrowHeight=0;var arrowUrl="";if(desiredTop+height<PopupPreview.mouseY){arrowWidth=64;arrowHeight=34;arrowY=desiredTop+height-6;if(desiredLeft+arrowWidth<PopupPreview.mouseX){arrowX=PopupPreview.mouseX-arrowWidth;arrowUrl="popup_preview_bottomright.png";}else{arrowX=desiredLeft;arrowUrl="popup_preview_bottomleft.png";}}else if(desiredTop>PopupPreview.mouseY){arrowWidth=64;arrowHeight=34;arrowY=desiredTop-arrowHeight+4;if(desiredLeft+arrowWidth<PopupPreview.mouseX){arrowX=PopupPreview.mouseX-arrowWidth;arrowUrl="popup_preview_topright.png";}else{arrowX=desiredLeft;arrowUrl="popup_preview_topleft.png";}}else if(desiredLeft+width<PopupPreview.mouseX){arrowWidth=34;arrowHeight=64;arrowX=desiredLeft+width-6;if(desiredTop+arrowHeight<PopupPreview.mouseY){arrowY=PopupPreview.mouseY-arrowHeight;arrowUrl="popup_preview_rightbottom.png";}else{arrowY=desiredTop;arrowUrl="popup_preview_righttop.png";}}else if(desiredLeft>PopupPreview.mouseX){arrowWidth=34;arrowHeight=64;arrowX=desiredLeft-arrowWidth+4;if(desiredTop+arrowHeight<PopupPreview.mouseY){arrowY=PopupPreview.mouseY-arrowHeight;arrowUrl="popup_preview_leftbottom.png";}else{arrowY=desiredTop;arrowUrl="popup_preview_lefttop.png";}};$('popupPreviewArrow').setStyle('left',arrowX+'px');$('popupPreviewArrow').setStyle('top',arrowY+'px');$('popupPreviewArrow').setStyle('width',arrowWidth+'px');$('popupPreviewArrow').setStyle('height',arrowHeight+'px');$('popupPreviewArrow').setStyle('background-image','url(../images/frames/'+arrowUrl+')');$('popupPreviewArrow').removeClass('cHidden');$('popupPreview').setStyle('left',desiredLeft+'px');$('popupPreview').setStyle('top',desiredTop+'px');}};PopupPreview.Leave=function(){clearTimeout(PopupPreview.timerControl);PopupPreview.dataformId=null;PopupPreview.element=null;$('popupPreview').addClass('cHidden');$('popupPreviewArrow').addClass('cHidden');};var PageHeader={};PageHeader.Display=function(){};var delayedDomReadyEvents=new Array();function addDelayedDomReady(f){delayedDomReadyEvents.push(f);};window.addEvent('domready',function(){PageHeader.SetupNewTabs();PageHeader.SetupTabs();for(var i=0;i<delayedDomReadyEvents.length;i++){setTimeout(delayedDomReadyEvents[i],i*350+200);}});PageHeader.HoverActivitiesList=0;PageHeader.UpdateChannelListDisplay=function(){if($('communityListTab')!=null){if((PageHeader.ShowingCommunityList!=true)&&((PageHeader.HoverCommunitiesTab==true)||(PageHeader.HoverCommunitiesList==true))){$('communityListTab').addClass('highlightCommunities');$('communityListPopup').removeClass('fakeHidden');$('communityListPopup').addClass('shownCommunityList');PageHeader.ShowingCommunityList=true;}else if((PageHeader.ShowingCommunityList==true)&&((PageHeader.HoverCommunitiesTab!=true)&&(PageHeader.HoverCommunitiesList!=true))){$('communityListPopup').addClass('fakeHidden');$('communityListPopup').removeClass('shownCommunityList');PageHeader.ShowingCommunityList=false;};if(((PageHeader.HoverCommunitiesTab!=true)&&(PageHeader.HoverCommunitiesList!=true))){$('communityListTab').removeClass('highlightCommunities');};if((PageHeader.HoverActivitiesTab==true)&&(PageHeader.HoverActivitiesList!=true)){showChannelItemDescription('activityDescription','activityListPopupList',$('activityList'));}};if($('activityList')!=null){if((PageHeader.ShowingChannelList!=true)&&((PageHeader.HoverActivitiesTab==true)||(PageHeader.HoverActivitiesList==true))){$('activityList').addClass('highlightActivities');$('activityListPopup').removeClass('cHidden');PageHeader.ShowingChannelList=true;}else if((PageHeader.ShowingChannelList==true)&&((PageHeader.HoverActivitiesTab!=true)&&(PageHeader.HoverActivitiesList!=true))){$('activityListPopup').addClass('cHidden');PageHeader.ShowingChannelList=false;};if(((PageHeader.HoverActivitiesTab!=true)&&(PageHeader.HoverActivitiesList!=true))){$('activityList').removeClass('highlightActivities');};if((PageHeader.HoverCommunitiesTab==true)&&(PageHeader.HoverCommunitiesList!=true)){showChannelItemDescription('communityDescription','communityListPopupList',$('communityListTab'));}}};PageHeader.UpdateChannelListTimeout=function(delay){if(PageHeader.ActiveChannelListTimeout!=null){clearTimeout(PageHeader.ActiveChannelListTimeout);};PageHeader.ActiveChannelListTimeout=setTimeout(PageHeader.UpdateChannelListDisplay,delay);};PageHeader.SetupNewTabs=function(){if($('homeDropdown')==null){return;};PageHeader.IsHovering=new Array();PageHeader.HoverItems=new Array();$$('#menu .menuItem').each(function(e){var index=PageHeader.IsHovering.length;PageHeader.IsHovering.push(false);PageHeader.HoverItems.push(e);$(e).onmouseover=function(){for(var i=0;i<PageHeader.IsHovering.length;i++){PageHeader.IsHovering[i]=false;};PageHeader.IsHovering[index]=true;PageHeader.SetUpdateDropDowns(50);};$(e).onmouseout=function(){PageHeader.IsHovering[index]=false;PageHeader.SetUpdateDropDowns(600);};});if($('profileDropdown')!=null){$('profileDropdown').onmouseover=function(){PageHeader.IsHoveringProfile=true;PageHeader.SetUpdateDropDowns(50);};$('profileDropdown').onmouseout=function(){PageHeader.IsHoveringProfile=false;PageHeader.SetUpdateDropDowns(600);};};PageHeader.UpdateDropDowns();$('searchBox').onmousedown=function(e){var e=new Event(e);if(e.client.x>$('searchBox').getLeft()+$('searchBox').getSize().x-20){submitSearch();}}};PageHeader.SetUpdateDropDowns=function(delay){if(PageHeader.ActiveChannelListTimeout!=null){clearTimeout(PageHeader.ActiveChannelListTimeout);};PageHeader.ActiveChannelListTimeout=setTimeout(PageHeader.UpdateDropDowns,delay);};PageHeader.UpdateDropDowns=function(){var isHovered=false;for(var i=0;i<PageHeader.IsHovering.length;i++){if(PageHeader.IsHovering[i]==true){$(PageHeader.HoverItems[i]).addClass('headerHover');isHovered=true;}else{$(PageHeader.HoverItems[i]).removeClass('headerHover');}};if($('profileDropdown')!=null){if(PageHeader.IsHoveringProfile){$('profileDropdown').addClass('headerHover');}else{$('profileDropdown').removeClass('headerHover');}};if(!isHovered&&(PageHeader.DefaultHoverIndex!=null)){$(PageHeader.HoverItems[PageHeader.DefaultHoverIndex]).addClass('headerHover');}};PageHeader.SetupTabs=function(){if($('home')==null){return;};$('home').onmouseover=function(){$('home').addClass('highlightHome');PageHeader.UpdateChannelListTimeout(20);};$('home').onmouseout=function(){$('home').removeClass('highlightHome');};$('home').onclick=function(){window.nextType='TopMenu';window.nextUrl='/';backToList();return false;};var activeChannelTimeout=0;if($('communityListTab')!=null){$('communityListTab').addEvent("mouseover",function(){$('communityListTab').addClass('highlightCommunities');PageHeader.HoverCommunitiesTab=true;if(PageHeader.ShowingChannelList){PageHeader.UpdateChannelListTimeout(30);}else{PageHeader.UpdateChannelListTimeout(300);}});$('communityListTab').addEvent("mouseout",function(){if(PageHeader.ShowingCommunityList!=true){$('communityListTab').removeClass('highlightCommunities');};PageHeader.HoverCommunitiesTab=false;PageHeader.UpdateChannelListTimeout(500);});$$('#communityListPopup').forEach(function(e){e.addEvent("mouseenter",function(){PageHeader.HoverCommunitiesList=true;PageHeader.UpdateChannelListTimeout(150);});e.addEvent("mouseleave",function(){PageHeader.HoverCommunitiesList=false;PageHeader.UpdateChannelListTimeout(500);})});$$('#communityListPopup .channelItem').forEach(function(e){e.addEvent("mouseenter",function(){this.addClass('highlightedChannelItem');PageHeader.HoverCommunitiesList=true;PageHeader.UpdateChannelListTimeout(150);showChannelItemDescription('communityDescription','communityListPopupList',this);});e.addEvent("mouseleave",function(){this.removeClass('highlightedChannelItem');PageHeader.HoverCommunitiesList=false;PageHeader.UpdateChannelListTimeout(500);});});};var activeChannelTimeout=0;if($('activityList')!=null){$('activityList').addEvent("mouseover",function(){$('activityList').addClass('highlightActivities');if(PageHeader.HoverActivitiesList!=true){showChannelItemDescription('activityDescription','activityListPopupList',this);};PageHeader.HoverActivitiesTab=true;if(PageHeader.ShowingCommunityList){PageHeader.UpdateChannelListTimeout(30);}else{PageHeader.UpdateChannelListTimeout(300);}});$('activityList').addEvent("mouseout",function(){if(PageHeader.ShowingChannelList!=true){$('activityList').removeClass('highlightActivities');};PageHeader.HoverActivitiesTab=false;PageHeader.UpdateChannelListTimeout(500);});$$('#activityListPopup').forEach(function(e){e.addEvent("mouseenter",function(){PageHeader.HoverActivitiesList=true;PageHeader.UpdateChannelListTimeout(150);});e.addEvent("mouseleave",function(){PageHeader.HoverActivitiesList=false;PageHeader.UpdateChannelListTimeout(500);})});$$('#activityListPopup .channelItem').forEach(function(e){e.addEvent("mouseenter",function(){this.addClass('highlightedChannelItem');PageHeader.HoverActivitiesList=true;PageHeader.UpdateChannelListTimeout(150);showChannelItemDescription('activityDescription','activityListPopupList',this);});e.addEvent("mouseleave",function(){this.removeClass('highlightedChannelItem');PageHeader.HoverActivitiesList=false;PageHeader.UpdateChannelListTimeout(500);});});};$('tabSearch').onmouseover=function(){PageHeader.UpdateChannelListTimeout(20);};$('tabSearch').onmousedown=function(e){e=new Event(e);var tabSearchLeft=$('tabSearch').getLeft();if((e.client.x>=tabSearchLeft+20)&&(e.client.x<=tabSearchLeft+40)){submitSearch();}};if($('loginUsername')!=null){$('loginUsername').onkeydown=loginKeyDown;$('loginPassword').onkeydown=loginKeyDown;};if($('searchRequest')!=null){if(queryString('s')!='false'){$('searchRequest').value=Utf8.decode(queryString('s'));};$('searchRequest').onkeydown=searchRequest;};$('searchRequest').onfocus=function(){if($('searchRequest').value==QSTR.search){$('searchRequest').value='';};};};function showChannelItemDescription(descriptionID,listID,e){var a=e.getElements(".channelDescription");if(a.length>0){$(descriptionID).innerHTML=a[0].innerHTML;if(/MSIE 6/i.test(navigator.userAgent)){$(listID).setStyle('height',$(descriptionID).getSize().y+"px");}else{$(listID).setStyle('min-height',$(descriptionID).getSize().y+"px");}}};function searchRequest(e){var keynum;if(window.event){keynum=window.event.keyCode;}else if(e.which){keynum=e.which;};if(keynum==13){submitSearch();}};function openCMEDiary(){var desturl=QSettings.GetCMEDiaryUrl();window.open(desturl,'CME_Diary','width=780,height=480,resizable=yes,scrollbars=yes,location=no,toolbar=no,status=no,menubar=no');return false;};function openQPoints(){var desturl=QSettings.GetQPointsUrl();window.open(desturl,'Points','width=780,height=480,resizable=yes,scrollbars=yes,location=no,toolbar=no,status=no,menubar=no');return false;};function openProfileManager(){var desturl=QSettings.GetUserProfileUrl();window.open(desturl,'User_Profile','width=940,height=600,resizable=yes,scrollbars=yes,location=no,toolbar=no,status=no,menubar=no');return false;};function openProfilePublic(uid){var desturl=QSettings.GetPublicProfileUrl(uid);window.open(desturl,'User_Profile','width=715,height=500,resizable=yes,scrollbars=yes,location=no,toolbar=no,status=no,menubar=no');return false;};function openForgotPassword(){window.open('/forgotPassword','ForgotPassword','width=535,height=500,resizable=yes,scrollbars=yes,location=no,toolbar=no,status=no,menubar=no');return false;};function openSuggestionBox(){window.open('/suggestionBox.jsp','Suggestion_Box','width=544,height=338,resizable=no,scrollbars=no,location=no,toolbar=no,status=no,menubar=no');return false;};function openReutersPromo(){window.open("/images/reuters/reuters.html",'Reuters_Insight','width=510,height=600, resizable=no,scrollbars=yes,location=no,toolbar=no,status=no,menubar=no');return false;};function handleLogout(){LoginCredentials.AttemptLogout();LoginCredentials.DeleteCachedCredentials();createCookie("com.quantia.wc.volume",50,-1);window.nextType="Logout";window.nextUrl="/home";document.location.href=window.nextUrl;return false;};function openPlayer(dfId){var desturl=QSettings.GetPlayerUrl(dfId);window.open(desturl,'Player');return false;};function refreshTimeZone(){setTimeout(storeTimeZone,20000);};function storeTimeZone(){var tz=new Date().getTimezoneOffset()*-1;createCookie("com.quantia.tz",tz,0);};function openTermsOfUse(){if(locale=="ja"){openPopup("/popups/ja_JP/termsOfUse.html");}else{openPopup("/popups/en_US/termsOfUse.html");};return false;};function openPopup(url){var urlId=url.substring(0,url.lastIndexOf('.'));while(urlId.indexOf("/")!=-1){urlId=urlId.replace("/","_");};window.open(url,urlId,"width=560,height=600,status=no,location=no,menubar=no,scrollbars=yes,resizable=no");};function submitSearch(){if(($('searchRequest').value!=QSTR.search)&&($('searchRequest').value.trim()!='')){window.nextType='Search';var sstring=encodeURI($('searchRequest').value);window.nextUrl=QSettings.GetHomeUrl("s="+sstring);document.location.href=window.nextUrl;}};function joinCommunity(communityId,button,refreshOnChange){var parent=$(button).getParent(".buttonContainer");$(parent).addClass('communityStatusChanging');var communityChangeStatus=parent.getElement(".communityChangeStatus");$(communityChangeStatus).innerHTML="Joining...";setTimeout(function(){AccountInfo.JoinCommunity(communityId,function(){if(refreshOnChange){$(communityChangeStatus).innerHTML="Refreshing...";window.location.reload();}else{parent.addClass('member');$(parent).removeClass('communityStatusChanging');}});},500);};function leaveCommunity(communityId,button,refreshOnChange){var parent=$(button).getParent(".buttonContainer");$(parent).addClass('communityStatusChanging');var communityChangeStatus=parent.getElement(".communityChangeStatus");$(communityChangeStatus).innerHTML="Leaving...";setTimeout(function(){AccountInfo.LeaveCommunity(communityId,function(){if(refreshOnChange){$(communityChangeStatus).innerHTML="Refreshing...";window.location.reload();}else{parent.removeClass('member');$(parent).removeClass('communityStatusChanging');}});},500);};function setupStarWidget(starWrapper,initialRating,allowVoting,onVote){$(starWrapper).actualRating=initialRating;$(starWrapper).hasChangedRating=true;setStarDisplay(starWrapper,initialRating);if(allowVoting){var rating=1;$(starWrapper).getElements('.star').forEach(function(star){star.setStyle('cursor','pointer');var thisStarRating=rating;star.onmouseover=function(){setStarDisplay(starWrapper,thisStarRating,true);};star.onmouseout=function(){setStarDisplay(starWrapper,starWrapper.actualRating,false);};star.onmousedown=function(){if(stopAutoPlay!=null){stopAutoPlay();};starWrapper.actualRating=thisStarRating;starWrapper.hasChangedRating=false;setStarDisplay(starWrapper,starWrapper.actualRating,false);onVote(thisStarRating);};hoveredItems.push(star);rating++;});}};function setStarDisplay(starWrapper,rating,hover){if($(starWrapper).actualRating!=rating){$(starWrapper).hasChangedRating=true;};var numberOfStarsTurned=0;$(starWrapper).getElements('.star').forEach(function(star){numberOfStarsTurned++;if(numberOfStarsTurned<=rating){star.addClass('activeStar');if((hover==true)&&($(starWrapper).hasChangedRating==true)){star.addClass('hoverStar');}else{star.removeClass('hoverStar');}}else{star.removeClass('activeStar');star.removeClass('hoverStar');}});};QSiteState={};QSiteState.WriteChannelCookie=function(strChannelKey){createCookie('com.quantia.wc.curchannel',strChannelKey,0.0007);};QSiteState.ReadChannelCookie=function(){return readCookie('com.quantia.wc.curchannel');};var hoveredItems=new Array();function addHoverFunctions(){var hoverItems;hoverItems=$$('.hoverable');for(var i=0;i<hoverItems.length;i++)addHoverFunction(hoverItems[i],'hoverItem','hoverItem');hoverItems=$$('.transparentButton, .overGrayButton');for(var i=0;i<hoverItems.length;i++)addHoverFunction(hoverItems[i],'onHoverButton','onActiveButton');hoverItems=$$('.orangeButton');for(var i=0;i<hoverItems.length;i++)addHoverFunction(hoverItems[i],'onOrangeHoverButton','onOrangeActiveButton');hoverItems=$$('.grayButton');for(var i=0;i<hoverItems.length;i++)addHoverFunction(hoverItems[i],'onGrayHoverButton','onGrayActiveButton');hoverItems=$$('.wideButton');for(var i=0;i<hoverItems.length;i++)addHoverFunction(hoverItems[i],'wideButtonHover','wideButtonActive');hoverItems=$$('.smallButton');for(var i=0;i<hoverItems.length;i++)addHoverFunction(hoverItems[i],'smallButtonHover','smallButtonActive');hoverItems=$$('.dataformPopupPreviewable');for(var i=0;i<hoverItems.length;i++){setUpPopupPreviewItem(hoverItems[i]);}};function setUpPopupPreviewItem(hoverItem){hoverItem.addEvent('mouseover',function(e){PopupPreview.SetMouseLocation(e.page.x,e.page.y);PopupPreview.Hover(hoverItem.id,hoverItem);});hoverItem.addEvent('mousemove',function(e){PopupPreview.SetMouseLocation(e.page.x,e.page.y);});hoverItem.addEvent('mouseleave',PopupPreview.Leave);hoveredItems.push(hoverItem);};function cleanUpHoverFunctions(){for(var i=0;i<hoveredItems.length;i++){if(hoveredItems[i]!=null){hoveredItems[i].onmouseover=null;hoveredItems[i].onmouseout=null;hoveredItems[i].onmousemove=null;hoveredItems[i].onmouseenter=null;hoveredItems[i].onmouseleave=null;hoveredItems[i].onmousedown=null;hoveredItems[i].onmouseup=null;hoveredItems[i].onclick=null;}};hoveredItems=null;};function backToList(){document.location.href="/";};function addHoverFunction(element,cssClass,activeClass){$(element).addEvent('mouseover',function(){$(element).addClass(cssClass);});$(element).addEvent('mouseleave',function(){$(element).removeClass(cssClass);$(element).removeClass(activeClass);});$(element).addEvent('mousedown',function(){$(element).addClass(activeClass);});$(element).addEvent('mouseup',function(){$(element).removeClass(activeClass);});hoveredItems.push(element);};window.addEvent('domready',function(){addHoverFunctions();addTextChangeFunctions();checkWindowSize();});window.addEvent('unload',function(){cleanUpHoverFunctions();});window.addEvent('resize',function(){checkWindowSize();});function checkWindowSize(){if(Viewport.windowWidth()>1040){$(document.body).removeClass('thin');}else{$(document.body).addClass('thin');}};function addTextChangeFunctions(){var defaultTextItems=$$('.defaultText');for(var i=0;i<defaultTextItems.length;i++){addDefaultTextFunction(defaultTextItems[i]);};var fieldTippableItems=$$('.fieldTippable');for(var i=0;i<fieldTippableItems.length;i++){addFieldTipFunction(fieldTippableItems[i])}};function getExtraAttribute(e,attributeName){if(e[attributeName]!=null){return e[attributeName];};if(e.attributes[attributeName]!=null){return e.attributes[attributeName].value;};return null;};function addDefaultTextFunction(e){var defaultText=getExtraAttribute(e,"defaultText");var alternateElement=null;if(getExtraAttribute(e,"alternateID")!=null){var alternateID=getExtraAttribute(e,"alternateID");alternateElement=$(alternateID);};$(e).addEvent('blur',function(){if(e.value==""){if(alternateElement!=null){$(alternateElement).removeClass('cHidden');$(e).addClass('cHidden');}else{e.value=defaultText;$(e).addClass("hasDefaultText");}}});$(e).addEvent('focus',function(){if(e.value==defaultText){e.value="";$(e).removeClass("hasDefaultText");};if(e.type=="password"){e.select();}});if(alternateElement!=null){$(alternateElement).onfocus=function(){$(alternateElement).addClass('cHidden');$(e).removeClass('cHidden');$(e).focus();};$(e).addClass("cHidden");$(alternateElement).removeClass('cHidden');$(alternateElement).addClass('hasDefaultText');$(alternateElement).value=defaultText;}else{if((e.value=="")||(e.value==defaultText)){$(e).addClass("hasDefaultText");e.value=defaultText;}}};function addFieldTipFunction(e){var fieldTipID=getExtraAttribute(e,"fieldTipID");var fieldTipValueID=getExtraAttribute(e,"fieldTipValueID");if(($(fieldTipID)==null)||($(fieldTipValueID)==null)){return;};$(e).addEvent('blur',function(){$(fieldTipID).inUse=false;setTimeout(function(){if($(fieldTipID).inUse==false){$(fieldTipID).setStyle('left',"-500px");}},250);});$(e).addEvent('focus',function(){$(fieldTipID).inUse=true;$$("#"+fieldTipID+" .innerBody").forEach(function(innerBody){innerBody.innerHTML=$(fieldTipValueID).innerHTML;});$(fieldTipID).setStyle('top',($(e).getPosition().y-10)+"px");$(fieldTipID).setStyle('left',($(e).getPosition().x-$(fieldTipID).getSize().x+8)+"px");});};function getCommentDateDifference(numberOfComments,startingDate){if((numberOfComments==0)||(numberOfComments==null)||(numberOfComments=="0")){return"";};if(startingDate==null){if(numberOfComments==1){return sprintf(QSTR.lastComment,numberOfComments);}else{return sprintf(QSTR.lastComments,numberOfComments);}};var currentTime=new Date();try{currentTime=objDataform.startingServerTime.getTime()+objDataform.GetTimeDelta()}catch(e){};var difference=currentTime-startingDate;var seconds=Math.floor(difference/1000);var minutes=Math.floor(seconds/60);var hours=Math.floor(minutes/60);var days=Math.floor(hours/24);if(days>30){if(numberOfComments==1){return sprintf(QSTR.lastComment,numberOfComments);}else{return sprintf(QSTR.lastComments,numberOfComments);}};if(numberOfComments==1){if(difference<0){return sprintf(QSTR.lastCommentMomentsAgo,numberOfComments);};if(difference<60*1000){if(seconds==1){return sprintf(QSTR.lastCommentSecondAgo,numberOfComments);};return sprintf(QSTR.lastCommentSecondsAgo,numberOfComments,seconds);};if(difference<60*60*1000){if(minutes==1){return sprintf(QSTR.lastCommentMinuteAgo,numberOfComments);};return sprintf(QSTR.lastCommentMinutesAgo,numberOfComments,minutes);};if(difference<24*60*60*1000){if(hours==1){return sprintf(QSTR.lastCommentHourAgo,numberOfComments);};return sprintf(QSTR.lastCommentHoursAgo,numberOfComments,hours);};if(days==1){return sprintf(QSTR.lastCommentDayAgo,numberOfComments);};return sprintf(QSTR.lastCommentDaysAgo,numberOfComments,days);}else{if(difference<0){return sprintf(QSTR.lastCommentsMomentsAgo,numberOfComments);};if(difference<60*1000){if(seconds==1){return sprintf(QSTR.lastCommentsSecondAgo,numberOfComments);};return sprintf(QSTR.lastCommentsSecondsAgo,numberOfComments,seconds);};if(difference<60*60*1000){if(minutes==1){return sprintf(QSTR.lastCommentsMinuteAgo,numberOfComments);};return sprintf(QSTR.lastCommentsMinutesAgo,numberOfComments,minutes);};if(difference<24*60*60*1000){if(hours==1){return sprintf(QSTR.lastCommentsHourAgo,numberOfComments);};return sprintf(QSTR.lastCommentsHoursAgo,numberOfComments,hours);};if(days==1){return sprintf(QSTR.lastCommentsDayAgo,numberOfComments);};return sprintf(QSTR.lastCommentsDaysAgo,numberOfComments,days);}};function newEltOfClass(eltTag,classAttr){var newElt=document.createElement(eltTag);newElt.className=classAttr;return(newElt);};function createCommunityBadgeElement(community){var result=newEltOfClass('div','badge');var aTag="<a class='clearfix' onmouseout=\"$(this).removeClass('shiftedLeft');\" onmouseover=\"$(this).addClass('shiftedLeft');\" href=\"#\" onclick=\"";aTag+="window.nextType='AuthorCommunity'; window.nextUrl='"+community.url+"'; document.location.href=window.nextUrl; return false;\"><img src=\""+community.badgeUrl+"\" /></a>";result.innerHTML=aTag;return result;};function createNewAuthorTagWithPhoto(author){var result=newEltOfClass('div','clearfix authorWithPhoto');var element;if(author._photo){element=newEltOfClass('div','authorPhoto');var inner="<img ";if(author._authorId){inner=inner+"id='photo_"+author._authorId+"' ";};inner=inner+"src='"+QSettings.ContentKeyUrl(author._photo)+"' />";element.innerHTML=inner;result.appendChild(element);};if(author._prefix){element=newEltOfClass('div','authorPrefix');element.innerHTML=author._prefix;result.appendChild(element);};if(author._authorId&&LoginCredentials.Username!='webapp'){element=newEltOfClass('div','authorName');element.innerHTML="<a href='#' onclick='openProfilePublic(\""+author._authorId+"\"); return false;'>"+author._authorName+"</a>";result.appendChild(element);}else{element=newEltOfClass('div','authorName');element.innerHTML=author._authorName;result.appendChild(element);};if(author._authorTitle){element=newEltOfClass('span','authorTitle');element.innerHTML=author._authorTitle;result.appendChild(element);};if((author._authorTitle)&&(author._authorInstitution)){element=newEltOfClass('span','');element.innerHTML=", ";result.appendChild(element);};if(author._authorInstitution){element=newEltOfClass('span','authorInstitution');element.innerHTML=author._authorInstitution;result.appendChild(element);};return result;};function createNewAuthorTag(author,includePhoto){if(arguments.length<2)includePhoto=true;if(includePhoto&&(author._photo!=null)&&(author._photo!="")){return createNewAuthorTagWithPhoto(author);};var newAuthorTag=document.createElement('div');$(newAuthorTag).addClass("authorField");if((author._prefix!=null)&&(author._prefix!="")){var prefixElement=document.createElement('div');$(prefixElement).addClass("authorPrefix");prefixElement.innerHTML=author._prefix;newAuthorTag.appendChild(prefixElement);};var authorId=author._authorId;var authorNameElement=document.createElement('div');if((authorId!=null)&&(authorId.length>0)){var viewAuthorProfileLink=document.createElement('a');$(viewAuthorProfileLink).addClass("authorName");$(viewAuthorProfileLink).href="/profile.jsp?id="+authorId;$(viewAuthorProfileLink).onclick=function(){openProfilePublic(authorId);return false;};viewAuthorProfileLink.innerHTML=author._authorName;authorNameElement.appendChild(viewAuthorProfileLink);}else{$(authorNameElement).addClass("authorName");$(authorNameElement).innerHTML=author._authorName;};newAuthorTag.appendChild(authorNameElement);if((author._authorTitle!=null)&&(author._authorTitle!="")){var titleElement=document.createElement('span');$(titleElement).addClass("authorTitle");titleElement.innerHTML=author._authorTitle;if((author._authorInstitution!=null)&&(author._authorInstitution!="")){titleElement.innerHTML+=", ";};newAuthorTag.appendChild(titleElement);};if((author._authorInstitution!=null)&&(author._authorInstitution!="")){var institutionElement=document.createElement('span');$(institutionElement).addClass("authorInstitution");institutionElement.innerHTML=author._authorInstitution;newAuthorTag.appendChild(institutionElement);};return newAuthorTag;};function isOnExitScreen(){var screenManager=objDataform.GetScreenManager();var stateManager=objDataform.GetStateManager();return screenManager.IsExit(stateManager.CurrentScreen);};function isDefined(variable){return(!(!(variable||false)));};function cleanUp(obj){try{if((obj==null)||(obj.hasCleanedUp==true)){return;};if(!isDefined(obj["nodeType"])){obj.hasCleanedUp=true;};for(prop in obj){switch(typeof(obj[prop])){case"object":{if(!isDefined(obj["nodeType"])){if(obj[prop]!=obj){cleanUp(obj[prop]);};try{obj[prop]=null;}catch(e){}};break;};case"function":{if(!isDefined(obj["nodeType"])){obj[prop]=null;};break;}}}}catch(e){}};var Viewport={windowWidth:function(){return(document.documentElement&&document.documentElement.clientWidth)||window.innerWidth||self.innerWidth||document.body.clientWidth},windowHeight:function(){if(self.innerHeight){return self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight;}else if(document.body){return document.body.clientHeight;}},scrollX:function(){if(self.pageYOffset){return self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollLeft;}else if(document.body){return document.body.scrollLeft;}},scrollY:function(){if(self.pageYOffset){return self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop;}else if(document.body){return document.body.scrollTop;}},pageWidth:function(){return(document.documentElement&&document.documentElement.scrollWidth)?document.documentElement.scrollWidth:(document.body.scrollWidth>document.body.offsetWidth)?document.body.scrollWidth:document.body.offsetWidth},pageHeight:function(){return(document.documentElement&&document.documentElement.scrollHeight)?document.documentElement.scrollHeight:(document.body.scrollHeight>document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight}};function str_repeat(i,m){for(var o=[];m>0;o[--m]=i);return(o.join(''));};function sprintf(){var i=0,a,f=arguments[i++],o=[],m,p,c,x;while(f){if(m=/^[^\x25]+/.exec(f))o.push(m[0]);else if(m=/^\x25{2}/.exec(f))o.push('%');else if(m=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f)){if(((a=arguments[m[1]||i++])==null)||(a==undefined))throw("Too few arguments.");switch(m[7]){case'b':a=a.toString(2);break;case'c':a=String.fromCharCode(a);break;case'd':a=parseInt(a);break;case'e':a=m[6]?a.toExponential(m[6]):a.toExponential();break;case'f':a=m[6]?parseFloat(a).toFixed(m[6]):parseFloat(a);break;case'o':a=a.toString(8);break;case's':a=((a=String(a))&&m[6]?a.substring(0,m[6]):a);break;case'u':a=Math.abs(a);break;case'x':a=a.toString(16);break;case'X':a=a.toString(16).toUpperCase();break;};a=(/[def]/.test(m[7])&&m[2]&&a>0?'+'+a:a);c=m[3]?m[3]=='0'?'0':m[3].charAt(1):' ';x=m[5]-String(a).length;p=m[5]?str_repeat(c,x):'';o.push(m[4]?a+p:p+a);}else throw("Huh ?!");f=f.substring(m[0].length);};return o.join('');};function npiOnKeyDown(e,cmd,buttonText){var keynum;if(window.event){keynum=window.event.keyCode;}else if(e.which){keynum=e.which;};if(keynum==13){npiSubmit(cmd,buttonText);}};function npiSubmit(cmd,buttonText,buttonID){var args="";if($('npiState')!=null){args="&currentState="+$('npiState').value;};$$('.npiChoices').forEach(function(e){if(e.checked){cmd=e.id;};if(e.nodeName.toLowerCase()=='input'){if(e.getAttribute("type")=='text'){args=args+"&"+e.id+"="+e.value;}}});if("0123456789".indexOf(cmd.charAt(0))>-1){cmd="npiGiven&npiNumber="+cmd;};var url="/npiVerify?cmd="+cmd+args;var debug=queryString("debug");if(debug=='true')args=args+"&debug=true";buttonID=buttonID||'submitMe';if(buttonText!=null&&$(buttonID)!=null){$(buttonID).innerHTML='<div id="buttonText" class="buttonBody"><nobr>'+buttonText+'</nobr></div>';};HTTP.post(url,"test",npiSmoothScroll);};function npiSelect(id){var elem=document.getElementById(id);if(elem!=null)elem.checked=true;};function redeemReward(id,msg){var errorDiv=$('error'+id);if(errorDiv==null){if(msg!=''&&!confirm(msg))return;};var url=QSettings.BuildUrlCmd('requestreward');url=url+"&id="+id;HTTP.getText(url,function(text){if(text!=null&&text!=''){var start=text.indexOf(">");text=text.substring(start+1);var xmlDoc=XML.CreateDocument(text);var root=xmlDoc.documentElement;var status=root.getAttribute("value").toLowerCase();if(status!='ok'){status='reward_'+status;if(QSTR[status]!=null){if(errorDiv==null){alert(QSTR[status]);}else errorDiv.innerHTML=QSTR[status];}else{if(errorDiv==null){alert(status);}else errorDiv.innerHTML=status;}}else{window.location.reload(true);}}});};function fadeIn(container,outerdiv,innerdiv){var toggler=new SmoothToggler({bodyDiv:container,clickedOnElement:null,toggleElement:outerdiv,toggleChild:innerdiv,elementToFocus:null,callOnOpen:null,callOnClose:null,duration:500,neverScrollToTop:true,isVisible:false,isAnimating:false});toggler.toggleVisibility(false);};function npiSmoothScroll(content){if(content==null){content='';};if(content==$('validationBox').innerHTML)return;var vbox=$('validationBox');fadeToOpacity($('innerValidation'),0,250,function(){var desiredY=vbox.getTop()-Viewport.windowHeight();getScroller().start(0,desiredY);if(content==''){vbox.addClass('cHidden');}else{vbox.setStyle('height',vbox.getSize().y+"px");vbox.setStyle('overflow','hidden');$('innerValidation').innerHTML=content;var fieldTippableItems=$$('.fieldTippable');for(var i=0;i<fieldTippableItems.length;i++){addFieldTipFunction(fieldTippableItems[i])};scrollToHeight(vbox,$('innerValidation').getSize().y,500,function(){fadeToOpacity($('innerValidation'),1,250,function(){vbox.setStyle('overflow','visible');});});if($('newName')!=null&&$('accountFullName')!=null){$('accountFullName').innerHTML=$('newName').value;}}});};var Utf8={encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}};return utftext;},decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}else if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}};return string;}};function RenderChannel(channel,view,defaultTarget){if(defaultTarget==null){defaultTarget=$('column2');};var channelView=channel.GetView(view);if(channelView!=null){var renderer=GetRenderer(channelView.GetRenderer());if(renderer!=null){renderer.Apply(channel,channelView,defaultTarget);}}else if(view=="full"){GetRenderer("simple").Apply(channel,new ChannelDisplay(),defaultTarget);}else if(view=="suggestion"){GetRenderer("suggestion").Apply(channel,new ChannelDisplay(),defaultTarget);}};function GetRenderer(renderer){switch(renderer){case"simple":return GetSimpleRenderer();case"editorsPicks":return GetEditorsPicksRenderer();case"interestingCases":return GetInterestingCasesRenderer();case"singlePreview":return GetSinglePreviewRenderer();case"suggestion":return GetSuggestionRenderer();case"responseReportSummary":return GetResponseReportRenderer();}};var suggestionRenderer=null;function GetSuggestionRenderer(){if(suggestionRenderer==null){suggestionRenderer=new SuggestionRenderer();};return suggestionRenderer;};function SuggestionRenderer(){this.headerTemplate=TrimPath.parseDOMTemplate("suggestion_header_jst");this.bodyItemTemplate=TrimPath.parseDOMTemplate("suggestion_item_jst");};SuggestionRenderer.prototype.Apply=function(channel,channelDisplay,defaultTarget){var target=defaultTarget;if(channelDisplay.GetParameter("position")=="right"){target=$('column3');};var bodyItemHTML=new StringBuilder();var dataformItems=channel.GetDataformItems();if(channelDisplay.GetParameter("dontDisplayIfEmpty")=="true"){if(dataformItems.length==0){return;}};var dataformItemsWritten=0;var bodyItemTemplate=this.bodyItemTemplate;var createDataformItem=function(dataformItem){dataformItemsWritten++;var url=QSettings.GetPlayerUrl(dataformItem.GetId(),channel.GetId(),dataformItem.GetNamespace());if(dataformItem.GetId()==null){url="";};return bodyItemTemplate.process({title:dataformItem.GetTitle(),url:url,hasRead:dataformItem.GetHasBeenRead()});};for(var i=0;i<dataformItems.length;i++){bodyItemHTML.Append(createDataformItem(dataformItems[i]));};var showViewAll=true;if(channelDisplay.GetParameter("hideViewAll")=="true"){showViewAll=false;};var result=this.headerTemplate.process({url:QSettings.BuildUrlPage("home","ch="+channel.GetId()),channelName:channel.GetTitle(),showViewAll:showViewAll,contents:bodyItemHTML.ToString(),spacerColor:channelDisplay.GetParameter("spacerColor","999999"),viewMoreText:channelDisplay.GetParameter("viewMoreText","View More"),otherChannelLink:QSettings.BuildUrlPage("home","ch="+channelDisplay.GetParameter("otherChannelLink","")),otherChannelLinkText:channelDisplay.GetParameter("otherChannelLinkText",""),otherUrlLink:channelDisplay.GetParameter("otherUrlLink",""),otherUrlLinkText:channelDisplay.GetParameter("otherUrlLinkText","")});var resultElement=document.createElement("div");resultElement.innerHTML=result;target.appendChild(resultElement);};var responseReportRenderer=null;function GetResponseReportRenderer(){if(responseReportRenderer==null){responseReportRenderer=new ResponseReportRenderer();};return responseReportRenderer;};function ResponseReportRenderer(){this.bodyItemTemplate=TrimPath.parseDOMTemplate("responseReport_item_jst");};ResponseReportRenderer.prototype.Apply=function(channel,channelDisplay,defaultTarget){var target=defaultTarget;var bodyItemHTML=new StringBuilder();var dataformItems=channel.GetDataformItems();for(var i=0;i<dataformItems.length;i++){var dataformItem=dataformItems[i];var ratingCount=dataformItem.GetRatingCount();var commentDisplay=getCommentDateDifference(dataformItem.GetNumberOfComments(),dataformItem._lastCommentDate);var numberOfComments=dataformItem.GetNumberOfComments();var thumbImgUrl=QSettings.ContentKeyUrl(dataformItem.GetIcon());var availableDate='';if(dataformItem.GetResponseReportSummary().AvailableDate!=null){availableDate=DateUtils.ToNumberedDate(dataformItem.GetResponseReportSummary().AvailableDate);};var dataformCreationDate='';if(dataformItem.GetResponseReportSummary().DataformCreationDate!=null){dataformCreationDate=DateUtils.ToNumberedDate(dataformItem.GetResponseReportSummary().DataformCreationDate);};bodyItemHTML.Append(this.bodyItemTemplate.process({title:dataformItem.GetTitle(),playerUrl:QSettings.GetPlayerUrl(dataformItem.GetId(),channel.GetId(),dataformItem.GetNamespace()),thumbImgUrl:thumbImgUrl,isOdd:(i%2)==1,author:dataformItem.GetAuthorHtml(),availableDate:availableDate,dataformCreationDate:dataformCreationDate,numberOfComments:numberOfComments,commentDisplay:commentDisplay,rating:dataformItem.GetRating(),ratingCount:ratingCount,totalOpens:dataformItem.GetResponseReportSummary().TotalOpens,uniqueVisitors:dataformItem.GetResponseReportSummary().UniqueVisitors,uniqueResponses:dataformItem.GetResponseReportSummary().UniqueResponders,uniqueCompletes:dataformItem.GetResponseReportSummary().UniqueCompletes,reportId:channelDisplay.GetParameter('responseReportId'),dataformId:dataformItem.GetId(),detailedReportUrl:QSettings.BuildUrlPage('responseReport','df='+dataformItem.GetId()+'&responseReport='+channelDisplay.GetParameter('responseReportId'))}));};var resultElement=document.createElement("div");resultElement.innerHTML=bodyItemHTML.ToString();target.appendChild(resultElement);};var isBlurred=false;var BackgroundBlur={show:function(){if(BackgroundBlur.isBlurred!=true){$('backgroundBlur').setStyle('opacity',0);$('backgroundBlur').removeClass('cHidden');fadeToOpacity($('backgroundBlur'),0.8,500,function(){fadeToOpacity($('backgroundBlurContentWrapper'),1,500);});$('backgroundBlurContentWrapper').setStyle('opacity',0);$('backgroundBlurContentWrapper').removeClass('cHidden');BackgroundBlur.isBlurred=true;BackgroundBlur.update();}},setBlurContents:function(newElement){$(newElement).parentNode.removeChild(newElement);$('backgroundBlurContents').innerHTML="";$('backgroundBlurContents').appendChild(newElement);},hide:function(){if(BackgroundBlur.isBlurred==true){fadeToOpacity($('backgroundBlurContentWrapper'),0,500,function(){$('backgroundBlurContentWrapper').addClass('cHidden');});fadeToOpacity($('backgroundBlur'),0,500,function(){$('backgroundBlur').addClass('cHidden');});BackgroundBlur.isBlurred=false;}},update:function(){if(BackgroundBlur.isBlurred!=true){return;};var desiredWidth=Viewport.scrollX()+Viewport.windowWidth();if(desiredWidth<1024){desiredWidth=1024;};if((BackgroundBlur.width!=desiredWidth)||(BackgroundBlur.height!=Viewport.scrollY()+Viewport.windowHeight()+500)){BackgroundBlur.width=desiredWidth;BackgroundBlur.height=Viewport.scrollY()+Viewport.windowHeight()+500;$('backgroundBlur').setStyle('width',BackgroundBlur.width);$('backgroundBlur').setStyle('height',BackgroundBlur.height);};var newBlurContentsX=Viewport.scrollX()+(Viewport.windowWidth()/ 2) - ($('backgroundBlurContentWrapper').offsetWidth /2)-40;var newBlurContentsY=Viewport.scrollY()+(Viewport.windowHeight()/ 2) - ($('backgroundBlurContentWrapper').offsetHeight /2);if(newBlurContentsY<0){newBlurContentsY=0;};if(newBlurContentsX<0){newBlurContentsX=0;};if((newBlurContentsX!=BackgroundBlur.contentsX)||(newBlurContentsY!=BackgroundBlur.contentsY)){BackgroundBlur.contentsX=newBlurContentsX;BackgroundBlur.contentsY=newBlurContentsY;$('backgroundBlurContentWrapper').setStyle('left',BackgroundBlur.contentsX);$('backgroundBlurContentWrapper').setStyle('top',BackgroundBlur.contentsY);};setTimeout(BackgroundBlur.update,100);}};function updateBlurredBackground(){if(!isBlurred){return;};if((backgroundBlurWidth!=Viewport.scrollX()+Viewport.windowWidth())||(backgroundBlurHeight!=Viewport.scrollY()+Viewport.windowHeight()+500)){backgroundBlurWidth=Viewport.scrollX()+Viewport.windowWidth();backgroundBlurHeight=Viewport.scrollY()+Viewport.windowHeight()+500;$('background_blur').setStyle('width',backgroundBlurWidth);$('background_blur').setStyle('height',backgroundBlurHeight);};setTimeout(updateBlurredBackground,100);}
