function getAuthors(){var a=new Array();if(JSONMeta!=undefined){try{var b=jsonPath(JSONMeta,key.author).toJSONString();if(b!="false"){var c=JSON.parse(b);for(var i=0;i<c.length;i++){if(isArray(c[i])){if(c[i][0].attributes.contributor_role=="author"){a=toArray(c[i])}}else{if(c[i].attributes.contributor_role=="author"){a=toArray(c[i])}}}}}catch(e){}}else{var d=hashMeta.getItem(key.author);if(d!=undefined){a=d.split("||")}}return a}function getEditors(){var a=new Array();if(JSONMeta!=undefined){try{var b=jsonPath(JSONMeta,key.editor).toJSONString();if(b!="false"){var c=JSON.parse(b);for(var i=0;i<c.length;i++){if(isArray(c[i])){if(c[i][0].attributes.contributor_role=="editor"){a=toArray(c[i])}}else{if(c[i].attributes.contributor_role=="editor"){a=toArray(c[i])}}}}}catch(e){}}else{}return a}function getDay(){var a;if(JSONMeta!=undefined){try{var b=jsonPath(JSONMeta,key.day).toJSONString();if(b!="false"){var c=JSON.parse(b);if(isArray(c)){a=c[0].day}else{a=c.day}}}catch(e){var d=document.getElementsByName(key.day)[0];if(d!=undefined){a=partitionDate(d.getAttribute("content"),2)}}}else{var b=hashMeta.getItem(key.day);if(b!=undefined){a=partitionDate(b,2)}}if(a==undefined&&selectedExport==undefined){a="<font color = 'RED'>unknown day</font>"}return a}function getMonth(){var a;if(JSONMeta!=undefined){try{var b=jsonPath(JSONMeta,key.month).toJSONString();if(b!="false"){var c=JSON.parse(b);if(isArray(c)){a=c[0].month}else{a=c.month}}}catch(e){var d=document.getElementsByName(key.month)[0];if(d!=undefined){a=partitionDate(d.getAttribute("content"),1)}}}else{var b=hashMeta.getItem(key.month);if(b!=undefined){a=partitionDate(b,1)}}if(a==undefined&&selectedExport==undefined){a="<font color = 'RED'>unknown month</font>"}return a}function getYear(){var a;if(JSONMeta!=undefined){try{var b=jsonPath(JSONMeta,key.year).toJSONString();if(b!="false"){var c=JSON.parse(b);if(isArray(c)){a=c[0].year}else{a=c.year}}}catch(e){var d=document.getElementsByName(key.year)[0];if(d!=undefined){a=partitionDate(d.getAttribute("content"),2)}}}else{var b=hashMeta.getItem(key.year);if(b!=undefined){a=partitionDate(b,0)}}if(a==undefined&&selectedExport==undefined){a="<font color = 'RED'>unknown year</font>"}return a}function getTitle(){var a;if(JSONMeta!=undefined){try{var b=jsonPath(JSONMeta,key.title).toJSONString();if(b!="false"){var c=JSON.parse(b);if(isArray(c)){a=c[0]}else{a=c}}}catch(e){var b=document.getElementsByName(key.title)[0];if(b!=undefined){a=b.getAttribute("content")}}}else{a=hashMeta.getItem(key.title)}if(a==undefined&&selectedExport==undefined){a="<font color = 'RED'>unknown title</font>"}return a}function getPlaceOfPublication(){var a;if(JSONMeta!=undefined){try{var b=jsonPath(JSONMeta,key.placeOfPublication).toJSONString();if(b!="false"){a=JSON.parse(b)}}catch(e){}}else{a=hashMeta.getItem(key.placeOfPublication)}if(a==undefined&&selectedExport==undefined){a="<font color = 'RED'>unknown place of publication</font>"}return a}function getPublisher(){var a;if(JSONMeta!=undefined){try{var b=jsonPath(JSONMeta,key.publisher).toJSONString();if(b!="false"){var c=JSON.parse(b);if(isArray(c)){a=c[0]}else{a=c}}}catch(e){b=document.getElementsByName(key.publisher)[0];if(b!=undefined)a=b.getAttribute("content")}}else{a=hashMeta.getItem(key.publisher)}if(a==undefined&&selectedExport==undefined){a="<font color = 'RED'>unknown publisher</font>"}return a}function getNameOfPublication(){var a;if(JSONMeta!=undefined){try{var b=jsonPath(JSONMeta,key.titleOfJournal).toJSONString();if(b=="false"){b=jsonPath(JSONMeta,key.nameOfConference).toJSONString()}if(b=="false"){b=jsonPath(JSONMeta,key.titleOfBook).toJSONString()}if(b!="false"){var c=JSON.parse(b);if(isArray(c)){a=c[0]}else{a=c}}}catch(e){if(type=="journal article"){var d=document.getElementsByName("DCTERMS.bibliographicCitation")[0];if(d!=undefined){a=partitionJournalCitation(d.getAttribute("content"),"$1")}}}}else{var f;if(type=="journal article"){var d=hashMeta.getItem("DCTERMS.bibliographicCitation");a=partitionJournalCitation(d,"$1");f="unknown name of Journal"}else if(type=="conference paper"){f="unknown mame of conference"}else if(type=="conference poster"){f="unknown name of conference"}else if(type=="book chapter"){a=hashMeta.getItem("DCTERMS.isPartOf");f="unknown name of book"}}if((a==undefined||a=="")&&selectedExport==undefined){a="<font color = 'red'>"+f+"</font>"}return a}function getConferenceDate(){var a;if(JSONMeta!=undefined){try{var b=jsonPath(JSONMeta,key.dateOfConference).toJSONString();var c=JSON.parse(b)[0];if(typeof(c)!="string"){var d=c.attributes;if(d.start_month==d.end_month){a=month(d.start_month);if(d.start_day==d.end_day){a+=" "+d.start_day}else{a+=" "+d.start_day+'-'+d.end_day}}else{a=month(d.start_month)+" "+d.start_day+"-"+month(d.end_month)+" "+d.end_day}a+=", "+d.end_year}else{a=c}}catch(e){}}else{}if(a==undefined&&selectedExport==undefined){a="<font color = 'red'>unknown year of conference</font>"}return a}function getVolume(){var a;if(JSONMeta!=undefined){try{var b=jsonPath(JSONMeta,key.volume).toJSONString();if(b!="false"){a=JSON.parse(b)}}catch(e){var c=document.getElementsByName(key.volume)[0];if(c!=undefined){a=partitionJournalCitation(c.getAttribute("content"),"$2")}}}else{var c=hashMeta.getItem(key.volume);a=partitionJournalCitation(c,"$2")}if(a==undefined&&selectedExport==undefined){a="<font color = 'RED'>unknown volume</font>"}return a}function getIssue(){var a;if(JSONMeta!=undefined){try{var b=jsonPath(JSONMeta,key.issue).toJSONString();if(b!="false"){a=JSON.parse(b)}}catch(e){var c=document.getElementsByName(key.issue)[0];if(c!=undefined){a=partitionJournalCitation(c.getAttribute("content"),"$3")}}}else{var c=hashMeta.getItem(key.issue);a=partitionJournalCitation(c,"$3")}if(a==undefined&&selectedExport==undefined){a="<font color = 'RED'>unknown issue</font>"}return a}function getPages(){var a;if(JSONMeta!=undefined){try{var b=jsonPath(JSONMeta,key.page).toJSONString();if(b!="false"){b=JSON.parse(b);if(b[0].first_page!=undefined){a=b[0].first_page;if(b[0].last_page!=undefined){a+="-"+b[0].last_page}}}}catch(e){if(type=="journal article"){var c=document.getElementsByName(key.page)[0];if(c!=undefined){a=partitionJournalCitation(c.getAttribute("content"),"$4")}}}}else{if(type=="journal article"){var c=hashMeta.getItem(key.page);a=partitionJournalCitation(c,"$4")}if(type=="conference paper"){}}if(a==undefined&&selectedExport==undefined){a="<font color = 'RED'>unknown pages</font>"}return a}function getThesisLevel(){var a;if(hashMeta!=undefined){a=hashMeta.getItem(key.thesisLevel)}if(a!=undefined){a=a.split('-')[0].trim()}else if(selectedExport==undefined){a="<font color = 'RED'>unknown thesis type</font>"}return a}function getThesisGrantor(){var a;if(hashMeta!=undefined){a=hashMeta.getItem(key.thesisGrantor)}if(a!=undefined){a=a.split('-')[1].trim()}else if(selectedExport==undefined){a="<font color = 'RED'>unknown university</font>"}return a}function getURL(){if(hashMeta!=undefined){var a=hashMeta.getItem(key.url);if(a!=undefined){var b=a.split("||");for(var i=0;i<b.length;i++){var c=/^http/;var d=b[i].trim();if(d.match(c)!=null){return"Retrieved from "+d}}}}return""}function getResourceType(){var a;if(JSONMeta!=undefined){if(JSONMeta.journal!=undefined){a="journal article"}else if(JSONMeta.conference!=undefined){a="conference paper"}else if(JSONMeta.book!=undefined){if(JSONMeta.book.content_item.attributes.component_type=="chapter"){a="book chapter"}}}else{a=hashMeta.getItem(key.type);if(a!=undefined){a=a.toLowerCase()}}return a}function getDOI(){var a=document.getElementsByName("DC.source");var b=/10\.\d{4}/;for(var k=0;k<a.length;k++){var c=a[k].getAttribute("content");var d=c.search(b);if(d!=-1){return c.substring(d)}}return undefined}var selectedFormat;var selectedExport;var JSONMeta;var hashMeta;var type;var key;function citeMain(a,b){selectedFormat=a;selectedExport=b;if(JSONMeta==undefined&&hashMeta==undefined){var c=getDOI();if(c==undefined){localAccess()}else{initiateRemoteAc(c)}}else if(a!=undefined){displayCitation()}else if(b!=undefined){chooseForm()}}function localAccess(){hashMeta=extractMeta();keyForLookUp("local");type=getResourceType();if(selectedFormat!=undefined){displayCitation()}else if(selectedExport!=undefined){chooseForm()}}function displayCitation(){try{display(window[selectedFormat]())}catch(e){alert("Error: "+e.message)}}function chooseForm(){try{window[selectedExport]();document.getElementById("exportloading_gif").style.display="none"}catch(e){alert("Error: "+e.message)}}function keyForLookUp(a){if(a=="local"){key={author:"DC.creator",day:"DCTERMS.issued",month:"DCTERMS.issued",year:"DCTERMS.issued",title:'DC.title',editor:"",placeOfPublication:"",publisher:"DC.publisher",titleOfJournal:"DCTERMS.bibliographicCitation",nameOfConference:"DCTERMS.bibliographicCitation",titleOfBook:"DCTERMS.isPartOf",dateOfConference:"",volume:"DCTERMS.bibliographicCitation",issue:"DCTERMS.bibliographicCitation",page:"DCTERMS.bibliographicCitation",thesisLevel:"DCTERMS.isPartOf",thesisGrantor:"DCTERMS.isPartOf",url:"DC.identifier",type:"DC.type"}}else if(a=="remote"){key={author:"$..person_name",day:"$..publication_date",month:"$..publication_date",year:"$..publication_date",title:"$..title",editor:"$..person_name",placeOfPublication:"$..[conference_location,publisher_place]",publisher:"$..publisher_name",titleOfJournal:"$..[full_title]",nameOfConference:"$..[conference_name]",titleOfBook:"$..[book_metadata.titles.title]",dateOfConference:"$..conference_date",volume:"$..volume",issue:"$..issue",page:"$..pages"}}}String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.ltrim=function(){return this.replace(/^\s+/,"")};String.prototype.rtrim=function(){return this.replace(/\s+$/,"")};function isArray(a){return Object.prototype.toString.call(a)==='[object Array]'}function toArray(a){var b=new Array();var i=0;try{if(isArray(a)){for(;i<a.length;i++){var c=a[i];b[i]=c.surname.trim()+", "+c.given_name.trim()}}else{var c=a;b[0]=c.surname.trim()+", "+c.given_name.trim()}}catch(e){if(c.surname!=undefined){b[i]=c.surname.trim()}else if(c.given_name!=undefined){b[i]=c.given_name.trim()}}return b}function abbreviatedName(a){var b="";for(var i=0;i<a.length;i++){var c=a[i].split(/,|\s|\./);for(var j=0;j<c.length;j++){if(c[j]!=""){if(j=="0"){b+=c[j].trim()+", "}else{b+=c[j].trim().charAt(0).toUpperCase()+"."}}}if(i<a.length-2){b+=", "}else if(i==a.length-2){b+=", & "}else{b+=" "}}return b}function fullName(a){var b="";var c=/\.$/;for(var i=0;i<a.length;i++){var d=a[i].trim();b+=d;if(i<a.length-2){b+=", "}else if(i==a.length-2){b+=", and "}else{if(!c.test(b))b+="."}}return b}function extractMeta(){var a=new Hash();var b=document.getElementsByTagName('meta');for(var i=0;i<b.length;i++){a.setItem(b[i].getAttribute('name'),b[i].getAttribute('content'))}return a}function month(a){if(a.length==1){a="0"+a}switch(a){case"01":return"January";case"02":return"February";case"03":return"March";case"04":return"April";case"05":return"May";case"06":return"June";case"07":return"July";case"08":return"August";case"09":return"Septemper";case"10":return"October";case"11":return"November";case"12":return"December"}}function display(a){document.getElementById("cite_text_container").innerHTML=a;resizeCiteContainer()}function addInput(a,b){var c=document.getElementById("dataForm");var d=document.createElement('input');d.setAttribute('type','hidden');d.setAttribute('name',a);d.setAttribute('value',b);c.appendChild(d)}function escapeAll(){var a=document.getElementById("dataForm");var b=a.childNodes;for(var i=0;i<b.length;i++){b[i].value=escape(b[i].value)}}function displayDOI(a){if(a!=undefined){return"doi: "+a}else{return""}}function partitionJournalCitation(a,b){var c;try{var d=/[^\.|.]+\s\d+\s{0,1}\([\d|\-]*\),\s{0,1}[p\.]{0,3}\s{0,1}[\d|\-]*/;var f=a.match(d);if(f!=null){var g=/^([^\.|.]+)\s(\d+)\s{0,1}\(([\d|\-]*)\),\s{0,1}[p\.]{0,3}\s{0,1}([\d|\-]*)$/;c=f[0].replace(g,b)}}catch(e){}return c}function partitionDate(a,b){var c;var d=/\d{4}-{0,1}(\d{2}){0,2}-{0,1}(\d{2}){0,2}/g;a=a.match(d);if(a!=null){var e=a.toString().split("-");c=e[b]}return c}function Hash(){this.length=0;this.items=new Array();for(var i=0;i<arguments.length;i+=2){if(typeof(arguments[i+1])!='undefined'){this.items[arguments[i]]=arguments[i+1];this.length++}}}Hash.prototype.getItem=function(a){return this.items[a]};Hash.prototype.setItem=function(a,b){if(typeof(b)!='undefined'){if(typeof(this.items[a])=='undefined'){this.length++;this.items[a]=b}else{this.items[a]=this.items[a]+"||"+b}}};Hash.prototype.hasItem=function(a){return typeof(this.items[a])!='undefined'};Hash.prototype.clear=function(){for(var i in this.items){delete this.items[i]}this.length=0};if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?'0'+n:n}if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(a){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z':null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()}}var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(b){escapable.lastIndex=0;return escapable.test(b)?'"'+b.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+b+'"'}function str(a,b){var i,k,v,length,mind=gap,partial,value=b[a];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(a)}if(typeof rep==='function'){value=rep.call(b,a,value)}switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null'}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null'}v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v}if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v)}}}}v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v}}if(typeof JSON.stringify!=='function'){JSON.stringify=function(a,b,c){var i;gap='';indent='';if(typeof c==='number'){for(i=0;i<c;i+=1){indent+=' '}}else if(typeof c==='string'){indent=c}rep=b;if(b&&typeof b!=='function'&&(typeof b!=='object'||typeof b.length!=='number')){throw new Error('JSON.stringify');}return str('',{'':a})}}if(typeof JSON.parse!=='function'){JSON.parse=function(c,d){var j;function walk(a,b){var k,v,value=a[b];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return d.call(a,b,value)}e.lastIndex=0;if(e.test(c)){c=c.replace(e,function(a){return'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(c.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+c+')');return typeof d==='function'?walk({'':j},''):j}throw new SyntaxError('JSON.parse');}}}());if(!Object.prototype.toJSONString){Array.prototype.toJSONString=function(){var a=['['],b,i,l=this.length,v;function p(s){if(b){a.push(',')}a.push(s);b=true}for(i=0;i<l;i+=1){v=this[i];switch(typeof v){case'undefined':case'function':case'unknown':break;case'object':if(v){if(typeof v.toJSONString==='function'){p(v.toJSONString())}}else{p("null")}break;default:p(v.toJSONString())}}a.push(']');return a.join('')};Boolean.prototype.toJSONString=function(){return String(this)};Date.prototype.toJSONString=function(){function f(n){return n<10?'0'+n:n}return'"'+this.getFullYear()+'-'+f(this.getMonth()+1)+'-'+f(this.getDate())+'T'+f(this.getHours())+':'+f(this.getMinutes())+':'+f(this.getSeconds())+'"'};Number.prototype.toJSONString=function(){return isFinite(this)?String(this):"null"};Object.prototype.toJSONString=function(){var a=['{'],b,i,v;function p(s){if(b){a.push(',')}a.push(i.toJSONString(),':',s);b=true}for(i in this){if(this.hasOwnProperty(i)){v=this[i];switch(typeof v){case'undefined':case'function':case'unknown':break;case'object':if(v){if(typeof v.toJSONString==='function'){p(v.toJSONString())}}else{p("null")}break;default:p(v.toJSONString())}}}a.push('}');return a.join('')};(function(s){var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};s.parseJSON=function(a){try{if(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(this)){var j=eval('('+this+')');if(typeof a==='function'){function walk(v){if(v&&typeof v==='object'){for(var i in v){if(v.hasOwnProperty(i)){v[i]=walk(v[i])}}}return a(v)}return walk(j)}return j}}catch(e){}throw new SyntaxError("parseJSON");};s.toJSONString=function(){if(/["\\\x00-\x1f]/.test(this)){return'"'+this.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+this+'"'}})(String.prototype)}function jsonPath(k,o,q){var P={resultType:q&&q.resultType||"VALUE",result:[],normalize:function(c){var d=[];return c.replace(/[\['](\??\(.*?\))[\]']/g,function(a,b){return"[#"+(d.push(b)-1)+"]"}).replace(/'?\.'?|\['?/g,";").replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,"").replace(/#([0-9]+)/g,function(a,b){return d[b]})},asPath:function(a){var x=a.split(";"),p="$";for(var i=1,n=x.length;i<n;i++)p+=/^[0-9*]+$/.test(x[i])?("["+x[i]+"]"):("['"+x[i]+"']");return p},store:function(p,v){if(p)P.result[P.result.length]=P.resultType=="PATH"?P.asPath(p):v;return!!p},trace:function(a,b,c){if(a){var x=a.split(";"),loc=x.shift();x=x.join(";");if(b&&b.hasOwnProperty(loc))P.trace(x,b[loc],c+";"+loc);else if(loc==="*")P.walk(loc,x,b,c,function(m,l,x,v,p){P.trace(m+";"+x,v,p)});else if(loc===".."){P.trace(x,b,c);P.walk(loc,x,b,c,function(m,l,x,v,p){typeof v[m]==="object"&&P.trace("..;"+x,v[m],p+";"+m)})}else if(/,/.test(loc)){for(var s=loc.split(/'?,'?/),i=0,n=s.length;i<n;i++)P.trace(s[i]+";"+x,b,c)}else if(/^\(.*?\)$/.test(loc))P.trace(P.eval(loc,b,c.substr(c.lastIndexOf(";")+1))+";"+x,b,c);else if(/^\?\(.*?\)$/.test(loc))P.walk(loc,x,b,c,function(m,l,x,v,p){if(P.eval(l.replace(/^\?\((.*?)\)$/,"$1"),v[m],m))P.trace(m+";"+x,v,p)});else if(/^(-?[0-9]*):(-?[0-9]*):?([0-9]*)$/.test(loc))P.slice(loc,x,b,c)}else P.store(c,b)},walk:function(a,b,c,d,f){if(c instanceof Array){for(var i=0,n=c.length;i<n;i++)if(i in c)f(i,a,b,c,d)}else if(typeof c==="object"){for(var m in c)if(c.hasOwnProperty(m))f(m,a,b,c,d)}},slice:function(e,f,g,h){if(g instanceof Array){var j=g.length,start=0,end=j,step=1;e.replace(/^(-?[0-9]*):(-?[0-9]*):?(-?[0-9]*)$/g,function(a,b,c,d){start=parseInt(b||start);end=parseInt(c||end);step=parseInt(d||step)});start=(start<0)?Math.max(0,start+j):Math.min(j,start);end=(end<0)?Math.max(0,end+j):Math.min(j,end);for(var i=start;i<end;i+=step)P.trace(i+";"+f,g,h)}},eval:function(x,a,b){try{return $&&a&&eval(x.replace(/@/g,"_v"))}catch(e){throw new SyntaxError("jsonPath: "+e.message+": "+x.replace(/@/g,"_v").replace(/\^/g,"_a"));}}};var $=k;if(o&&k&&(P.resultType=="VALUE"||P.resultType=="PATH")){P.trace(P.normalize(o).replace(/^\$;/,""),k,"$");return P.result.length?P.result:false}}var xmlhttprequest;var Timeout;var requesting=false;function initiateRemoteAc(a){if(!requesting){xmlhttprequest=new flensed.flXHR();xmlhttprequest.open("GET",citeWidgetServerHost+"backend/proxy.php?doi="+a);xmlhttprequest.onreadystatechange=getData;xmlhttprequest.setRequestHeader('Content-Type',"text/plain");xmlhttprequest.send(null);Timeout=setTimeout("ajaxTimeout();",8000);requesting=true}}function getData(){if((xmlhttprequest.readyState==4)&&(xmlhttprequest.status==200)){requesting=false;clearTimeout(Timeout);try{var a=xmlhttprequest.responseText.replace(/.*"crossref":(.*)}}}/gi,"$1");if(a.match(/error/)!=null)throw"error";a=a.replace(/@attributes/g,"attributes");JSONMeta=JSON.parse(a);keyForLookUp("remote");type=getResourceType()}catch(e){localAccess();return}if(selectedFormat!=undefined){displayCitation()}else if(selectedExport!=undefined){chooseForm()}}}function ajaxTimeout(){xmlhttprequest.abort();localAccess()}function BibTex(){addInput("fileName",selectedExport);addInput("fileExt",'.bib');var a;switch(type){case"journal article":a="@article{";break;case"conference paper":a="@conference{";break;case"technical report":a="@techreport{";break;case"working paper":a="@techreport{";break;case"thesis":a="@"+getThesisLevel().toLowerCase().replace(" ","")+"{";break;case"book":a="@book{";break;case"book chapter":a="@inbook{";break;default:a="@MISC{";break}a+=selectedExport+",\n";addInput("Type",a);if(getAuthors()!=""){var b="author = \"";for(var x=0;x<getAuthors().length;x++){if(x==0){b+=getAuthors()[x]}else{b+=" and "+getAuthors()[x]}if(x==getAuthors().length-1){b+="\""}}b+=",\n";addInput("Author",b)}if(getEditors()!=""){var c="editor = \"";for(var x=0;x<getEditors().length;x++){if(x==0){c+=getEditors()[x]}else{c+=" and "+getEditors()[x]}if(x==getEditors().length-1){c+="\""}}c+=",\n";addInput("Editor",c)}if(getYear()!=undefined){var d="year = \"";d+=getYear()+"\",\n";addInput("Year",d)}if(getMonth()!=undefined){var e="month = \"";e+=month(getMonth())+"\",\n";addInput("Month",e)}if(getPages()!=undefined){var f="pages = \"";var g=getPages().split("-")[0];var h=getPages().split("-")[1];f+=g+"--"+h+"\",\n";addInput("Pages",f)}if(getVolume()!=undefined){var i="volume = \"";i+=getVolume()+"\",\n";addInput("Volume",i)}if(getPublisher()!=undefined){var j="publisher = \"";j+=getPublisher()+"\",\n";addInput("Publisher",j)}if(getNameOfPublication()!=undefined){if(getResourceType()=="Journal Article"){var k="journal = \"";k+=getNameOfPublication()+"\",\n";addInput("bigTitle",k)}else if(getResourceType()=="Conference Paper"){var k="booktitle = \"";k+=getNameOfPublication()+"\",\n";addInput("bigTitle",k)}}if(getTitle()!=undefined){var l="title = \"";l+=getTitle()+"\",\n";addInput("Title",l)}if(getThesisGrantor()!=undefined){if(getThesisLevel().toLowerCase().search("thesis")!=-1){var m="school = \"";m+=getThesisGrantor()+"\",\n";addInput("School",m)}else if(getThesisLevel().toLowerCase().search("report")!=-1){var n="institution = \"";n+=getThesisGrantor()+"\",\n";addInput("Institution",n)}}var o="}";addInput("EOF",o);escapeAll();var p=document.getElementById("dataForm");p.submit()}function EndNote(){addInput("fileName",selectedExport);addInput("fileExt",'.ris');var a;switch(type){case"journal article":a="TY  - JOUR\n";break;case"conference paper":a="TY  - CONF\n";break;case"technical report":a="TY  - RPRT\n";break;case"working paper":a="TY  - RPRT\n";break;case"thesis":a="TY  - THES\n";break;case"book":a="TY  - BOOK\n";break;case"book chapter":a="TY  - CHAP\n";break;default:a="TY  - "+"\n";break}addInput("TY",a);if(getAuthors()!=""){var b=getAuthors().length;for(var x=0;x<b;x++){var c="A1  - "+getAuthors()[x]+"\n";addInput("A"+x,c)}}if(getYear()!=undefined){var d="Y1  - "+getYear()+"/";if(getMonth()!=undefined){d+=getMonth()}d+="/";if(getDay()!=undefined){d+=getDay()}d+="/"+"\n";addInput("Y1",d)}if(getPages()!=undefined){var e="SP  - "+getPages().split("-")[0]+"\n";addInput("SP",e);var f="EP  - "+getPages().split("-")[1]+"\n";addInput("EP",f)}if(getVolume()!=undefined){var g="VL  - "+getVolume()+"\n";addInput("VL",g)}if(getIssue()!=undefined){var h="IS  - "+getIssue()+"\n";addInput("IS",h)}if(getPublisher()!=undefined){var i="PB  - "+getPublisher()+"\n";addInput("PB",i)}if(getNameOfPublication()!=undefined){var j="JF  - "+getNameOfPublication()+"\n";addInput("JF",j)}if(getTitle()!=undefined){var k="T1  - "+getTitle()+"\n";addInput('T1',k)}var l="ER  - ";addInput('ER',l);escapeAll();var m=document.getElementById("dataForm");m.submit()}function APA(){var a;switch(type){case"research report":case"technical report":a=authorsInAPA(getAuthors())+"("+getYear()+"). "+"<i>"+getTitle()+"</i>. "+getPlaceOfPublication()+": "+getPublisher()+". "+getURL();break;case"working paper":a=authorsInAPA(getAuthors())+"("+getYear()+"). "+"<i>"+getTitle()+"</i>. "+"working paper, "+getPublisher()+". "+getURL();break;case"journal article":a=authorsInAPA(getAuthors())+"("+getYear()+"). "+"<i>"+getTitle()+"</i>. "+getNameOfPublication()+", "+getVolume()+"("+getIssue()+"), "+getPages()+". "+displayDOI(getDOI());break;case"conference paper":a=authorsInAPA(getAuthors())+"("+getYear()+"). "+"<i>"+getTitle()+"</i>. "+getNameOfPublication()+" (pp. "+getPages()+"). "+getPlaceOfPublication()+": "+getPublisher()+". "+displayDOI(getDOI());break;case"thesis":a=authorsInAPA(getAuthors())+"("+getYear()+"). "+"<i>"+getTitle()+"</i>. "+getThesisLevel()+", "+getThesisGrantor()+". ";break;case"book":a=authorsInAPA(getAuthors())+"("+getYear()+"). "+"<i>"+getTitle()+"</i>. "+getPlaceOfPublication()+": "+getPublisher()+".";break;case"book chapter":a=authorsInAPA(getAuthors())+"("+getYear()+"). "+getTitle()+". "+"In "+abbreviatedName(getEditors())+"(Ed.), "+"<i>"+getNameOfPublication()+"</i>. "+" (pp. "+getPages()+"). "+getPlaceOfPublication()+": "+getPublisher()+". ";break;case"conference poster":a=authorsInAPA(getAuthors())+"("+getYear()+", "+month(getMonth())+"). "+"<i>"+getTitle()+"</i>. "+getNameOfPublication()+", "+getPlaceOfPublication()+".";break;case"image":a=authorsInAPA(getAuthors())+"("+getYear()+"). "+"<i>"+getTitle()+"</i>. "+getCurrentDate()+" "+getURL();break;default:a=authorsInAPA(getAuthors())+"("+getYear()+"). "+"<i>"+getTitle()+"</i>."}var b=/^(\(.*\)\.{0,1}\s{0,1})(<i>.*<\/i>\.*\s*)(.*)$/;a=a.replace(b,"$2$1$3");return a}function authorsInAPA(a){var b=6;var c="";for(var i=0;i<a.length&&i<b;i++){var d=a[i].split(/,|\s|\./);for(var j=0;j<d.length;j++){if(d[j]!=""){if(j=="0"){c+=d[j].trim()+", "}else{c+=d[j].trim().charAt(0).toUpperCase()+"."}}}if(i==b-2){c+=", & "}else if(i!=b-1){if(i<a.length-2){c+=", "}else if(i==a.length-2){c+=", & "}else{c+=" "}}}if(a.length>b){c=c+", et al. "}return c}function Chicago(){var a;switch(type){case"research report":case"technical report":a=authorsInChicago(getAuthors())+" <i>"+getTitle()+"</i>. "+getPlaceOfPublication()+": "+getPublisher()+", "+getYear()+". "+getURL();break;case"working paper":a=authorsInChicago(getAuthors())+" <i>"+getTitle()+"</i>. "+"working paper, "+getPublisher()+", "+getYear()+". "+getURL();break;case"journal article":a=authorsInChicago(getAuthors())+" \""+getTitle()+"\". "+"<i>"+getNameOfPublication()+"</i>, "+getVolume()+"."+getIssue()+" ("+getYear()+"): "+getPages()+". "+displayDOI(getDOI());break;case"conference paper":a=authorsInChicago(getAuthors())+" \""+getTitle()+"\". "+"<i>"+getNameOfPublication()+", "+getConferenceDate()+"</i>. "+getPlaceOfPublication()+": "+getPublisher()+", "+getYear()+". "+getPages()+". "+displayDOI(getDOI());break;case"thesis":a=authorsInChicago(getAuthors())+" \""+getTitle()+"\". "+getThesisLevel()+", "+getThesisGrantor()+", "+getYear()+".";break;case"book":a=authorsInChicago(getAuthors())+" <i>"+getTitle()+"</i>. "+getPlaceOfPublication()+": "+getPublisher()+", "+getYear()+". ";break;case"book chapter":a=authorsInChicago(getAuthors())+"\""+getTitle()+"\". In"+"<i>"+getNameOfPublication()+"</i>. edited by "+fullName(getEditors())+", "+getPages()+". "+getPlaceOfPublication()+": "+getPublisher()+". "+getYear()+". ";break;case"conference poster":a=authorsInChicago(getAuthors())+" \""+getTitle()+"\". "+"<i>"+getNameOfPublication()+"</i>, "+getPlaceOfPublication()+". "+getYear()+", "+month(getMonth())+'.';break;case"image":a=authorsInChicago(getAuthors())+"("+getYear()+"). "+"<i>"+getTitle()+"</i>. "+getCurrentDate()+" "+getURL();break;default:a=authorsInChicago(getAuthors())+" \""+getTitle()+". "+getYear()+"."}return a}function authorsInChicago(a){var b=4;var c="";var d=/\.$/;if(a.length>0){c+=a[0].trim();if(a.length>1){if(a.length==2){c+=", and "}else{c+=", "}}else{if(!d.test(c))c+="."}}for(var i=1;i<a.length&&i<b;i++){var e=a[i].trim().replace(/(.*),\s(.*)$/,"$2 $1");c+=e;if(i==b-2&&i<a.length-2){c+=", and "}else if(i!=b-1){if(i<a.length-2){c+=", "}else if(i==a.length-2){c+=", and "}else{if(!d.test(c))c+="."}}}return c}function Harvard(){var a;switch(type){case"research report":case"technical report":a=abbreviatedName(getAuthors())+" ("+getYear()+"). <i>"+getTitle()+"</i>. "+getPlaceOfPublication()+": "+getPublisher()+". "+getURL();break;case"working paper":a=abbreviatedName(getAuthors())+" ("+getYear()+"). <i>"+getTitle()+"</i>. "+"working paper, "+getPublisher()+". "+getURL();break;case"journal article":a=abbreviatedName(getAuthors())+" ("+getYear()+") \'"+getTitle()+"\', "+"<i>"+getNameOfPublication()+"</i>, "+"vol. "+getVolume()+", no. "+getIssue()+", pp. "+getPages()+". "+displayDOI(getDOI());break;case"conference paper":a=abbreviatedName(getAuthors())+" ("+getYear()+") \'"+getTitle()+"\', "+"<i>"+getNameOfPublication()+"</i>, "+getPlaceOfPublication()+": "+getPublisher()+". "+displayDOI(getDOI());break;case"thesis":a=abbreviatedName(getAuthors())+" ("+getYear()+") "+"<i>"+getTitle()+"</i>. "+getThesisLevel()+", "+getThesisGrantor()+".";break;case"book":a=abbreviatedName(getAuthors())+" ("+getYear()+") <i>"+getTitle()+"</i>. "+getPlaceOfPublication()+": "+getPublisher()+".";break;case"book chapter":a=abbreviatedName(getAuthors())+getYear()+". \'"+getTitle()+"\'. in "+abbreviatedName(getEditors())+" (eds) "+"<i>"+getNameOfPublication()+"</i>. "+" (pp. "+getPages()+"). "+getPlaceOfPublication()+": "+getPublisher()+". ";break;case"conference poster":a=abbreviatedName(getAuthors())+" ("+getYear()+", "+month(getMonth())+") \'"+getTitle()+"\', "+"<i>"+getNameOfPublication()+"</i>, "+getPlaceOfPublication()+".";break;case"image":a=abbreviatedName(getAuthors())+"("+getYear()+"). "+"<i>"+getTitle()+"</i>. "+getCurrentDate()+" "+getURL();break;default:a=abbreviatedName(getAuthors())+"("+getYear()+"). "+"<i>"+getTitle()+"</i>."}var b=/^(\(.*\)\.{0,1}\s{0,1})(<i>.*<\/i>\.*\s*)(.*)$/;a=a.replace(b,"$2$1$3");return a}function MLA(){var a;switch(type){case"research report":case"technical report":a=authorsInMLA(getAuthors())+" <u>"+getTitle()+"</u>. "+getPlaceOfPublication()+": "+getPublisher()+", "+getYear()+". "+getURL();break;case"working paper":a=authorsInMLA(getAuthors())+" <u>"+getTitle()+"</u>. "+"working paper, "+getPublisher()+", "+getYear()+". "+getURL();break;case"journal article":a=authorsInMLA(getAuthors())+" \""+getTitle()+"\". "+"<u>"+getNameOfPublication()+"</u>, "+getVolume()+"."+getIssue()+" ("+getYear()+"): "+getPages()+". "+displayDOI(getDOI());break;case"conference paper":a=authorsInMLA(getAuthors())+" \""+getTitle()+"\". "+"<u>"+getNameOfPublication()+", "+getConferenceDate()+"</u>. "+getPlaceOfPublication()+": "+getPublisher()+", "+getYear()+". "+getPages()+". "+displayDOI(getDOI());break;case"thesis":a=authorsInMLA(getAuthors())+" \""+getTitle()+"\". "+getThesisLevel()+", "+getThesisGrantor()+", "+getYear()+".";break;case"book":a=authorsInMLA(getAuthors())+" <u>"+getTitle()+"</u>. "+getPlaceOfPublication()+": "+getPublisher()+", "+getYear()+". ";break;case"book chapter":a=authorsInMLA(getAuthors())+" \""+getTitle()+"\". "+". "+"<u>"+getNameOfPublication()+"</u>. Ed. "+fullName(getEditors())+". "+getPlaceOfPublication()+": "+getPublisher()+", "+ +getYear()+". "+getPages()+". ";break;case"conference poster":a=authorsInMLA(getAuthors())+" \""+getTitle()+"\". "+"<u>"+getNameOfPublication()+"</u>, "+getPlaceOfPublication()+"."+getYear()+", "+month(getMonth());break;case"image":a=authorsInMLA(getAuthors())+"("+getYear()+"). "+"<u>"+getTitle()+"</u>. "+getCurrentDate()+" "+getURL();break;default:a=authorsInMLA(getAuthors())+" \""+getTitle()+"\". "+getYear()+"."}return a}function authorsInMLA(a){var b="";var c=/\.$/;if(a.length>0){b+=a[0].trim();if(a.length>1){if(a.length==2){b+=", and "}else{b+=", "}}else{if(!c.test(b))b+="."}}if(a.length<3){for(var i=1;i<a.length;i++){var d=a[i].trim().replace(/(.*),\s(.*)$/,"$2 $1");b+=d;if(i<a.length-2){b+=" "}else if(i==a.length-2){b+=", and "}else{if(!c.test(b))b+="."}}}else{b=a[0].trim()+", et al."}return b}var TimeToFade=250.0;function fade(a){var b=document.getElementById(a);if(b==null)return;if(b.FadeState==null){if(b.style.opacity==null||b.style.opacity==''||b.style.opacity=='1'){b.FadeState=2}else{b.FadeState=-2}}if(b.FadeState==1||b.FadeState==-1){b.FadeState=b.FadeState==1?-1:1;b.FadeTimeLeft=TimeToFade-b.FadeTimeLeft}else{b.FadeState=b.FadeState==2?-1:1;b.FadeTimeLeft=TimeToFade;setTimeout("animateFade("+new Date().getTime()+",'"+a+"')",10)}}function animateFade(a,b){var c=new Date().getTime();var d=c-a;var e=document.getElementById(b);if(e.FadeTimeLeft<=d){e.style.opacity=e.FadeState==1?'1':'0';e.style.filter='alpha(opacity = '+(e.FadeState==1?'100':'0')+')';if(e.style.visibility=='visible'&&e.FadeState==-1){e.style.visibility='hidden'}e.FadeState=e.FadeState==1?2:-2;return}e.FadeTimeLeft-=d;var f=e.FadeTimeLeft/TimeToFade;if(e.FadeState==1)f=1-f;e.style.opacity=f;e.style.filter='alpha(opacity = '+(f*100)+')';setTimeout("animateFade("+c+",'"+b+"')",10)}var citeWidgetServerHost="http://cite.ws/w/";var javaScriptArray=["Function","Hash","json","citeMain","XmlHttpRequest","Accessor","jsonpath-0.8.0"];var citeFormatArray=["MLA","APA","Harvard","Chicago"];var citeExportArray=["EndNote","BibTex"];if(typeof customFormatArray!="undefined"){citeFormatArray=customFormatArray}if(typeof customExportArray!="undefined"){citeExportArray=customExportArray}function initialise(){var a=document.createElement('link');a.setAttribute('rel','stylesheet');a.setAttribute('type','text/css');a.setAttribute('href',citeWidgetServerHost+'interface/interface.css');document.getElementsByTagName("head")[0].appendChild(a);document.write('<script type="text/javascript" src="',citeWidgetServerHost,'backend/flensed-1.0/deploy/flXHR.js"></script>');document.write('<div id="cite_button_container">');document.write('<a id="cite_button" onclick="light()" href="javascript:void(0);" title="cite_button">');document.write('Cite This');document.write('</a>');document.write('</div>');document.write('<div id="fade" class="black_overlay" onclick="dark();"></div>');document.write('<div id="light" class="white_content" style="filter:alpha(opacity:0); opacity:0;">');document.write('<span id="title"">Citation/Export Service</span><a id="close_button" onclick="dark();" href="javascript:void(0);">X</a>');document.write('<div id="text_line"></div>');document.write('<div id="title_border"></div>');document.write('<ul id="cite_wdgt_tabs" style="overflow: hidden;">');for(var x=0;x<citeFormatArray.length;x++){var b=citeFormatArray[x];var c='<li><a href="javascript:void(0);" title="'+b+' Format" onclick="getCitation(this);" id="'+b+'">'+b+'</a></li>';document.write(c)}document.write('</ul>');document.write('<div id="text_line"></div>');document.write("<div id=\"cite_text_container\" style=\"display:none; font-size:11px;\">");document.write('<img id="formatloading_gif" src="',citeWidgetServerHost,'picture/formatload.gif"/>');document.write('</div>');document.write('<div id="cite_export_container">');document.write('<span style="font-weight:bold; float:left;">Export to:</span>');document.write('<img id="exportloading_gif" src="',citeWidgetServerHost,'picture/exportload.gif" style="float:right; margin-left:.5em; display: none;"/>');for(x=0;x<citeExportArray.length;x++){var d=citeExportArray[x];var c='<a href="javascript:getExport(\''+d+'\');" id="'+d+'_Export">'+d+'</a>';document.write(c)}document.write('</div>');document.write('<div id="cite_disclaimer_container">');document.write('<div id="cite_disclaimer_text">');document.write('<span style="color:red;">Note:</span> Citations are based on reference '+'standards. However, formatting rules can '+'vary widely between applications and fields '+'of interest or study. The specific requirements '+'or preferences of your reviewing publisher, '+'classroom teacher, institution or organization '+"should be applied.<br />"+'Parts of citation appeared in <span style="color:red;">red</span> '+'are placeholders for missing data that were '+'not found.');document.write('</div>');document.write('</div>');document.write('</div>');document.write('<form name="data" method="POST" id="dataForm" action="'+citeWidgetServerHost+'export/Export.php"></form>')}var original_height;var currentExpanded;function getCitation(a){var b=document.getElementById("cite_text_container");var c=document.getElementById("light");if(original_height===undefined){original_height=c.clientHeight}if(b.style.display=="none"){currentExpanded=a.id;a.style.background="#ddebf2";b.style.display="block";resizeCiteContainer();citeMain(a.id,undefined)}else{if(currentExpanded==a.id){a.style.background="#ccc";b.style.display="none";c.style.height=original_height+"px";currentExpanded=undefined}else{a.style.background="#ddebf2";document.getElementById(currentExpanded).style.background="#ccc";currentExpanded=a.id;citeMain(a.id,undefined)}}}function getExport(a){var b=document.getElementById("dataForm");var c=[];for(var x=0;x<b.childNodes.length;x++){c[x]=b.childNodes[x]}for(var x=0;x<c.length;x++){b.removeChild(c[x])}document.getElementById("exportloading_gif").style.display="inline";citeMain(undefined,a)}function resizeCiteContainer(){var a=document.getElementById("cite_text_container");var b=document.getElementById("light");var c=original_height+a.clientHeight;b.style.height=c+"px"}function light(){if(currentExpanded===undefined){var a=document.getElementById(citeFormatArray[0]);getCitation(a)}centerCiteContainerX();if(document.getElementById("light").style.visibility=='visible'){dark();return}document.getElementById("light").style.visibility='visible';document.getElementById('fade').style.display='block';fade('light')}function dark(){if(document.getElementById("light").style.visibility=='hidden'){light();return}document.getElementById('fade').style.display='none';fade('light')}function centerCiteContainerX(){var a=document.getElementById("light");if(typeof(window.innerWidth)=='number'){var x=(window.innerWidth/2)-(a.offsetWidth/2);x=x/window.innerWidth*100}else{var x=(document.documentElement.clientWidth/2)-(a.offsetWidth/2);x=x/document.documentElement.clientWidth*100}a.style.left=x+"%"}function iniMenuHeight(){var a=document.getElementById('title').offsetHeight+document.getElementById('title_border').offsetHeight+document.getElementById('cite_wdgt_tabs').offsetHeight+document.getElementById('cite_export_container').offsetHeight+document.getElementById('cite_disclaimer_container').offsetHeight;document.getElementById('light').style.height=a+"px";document.getElementById('cite_disclaimer_container').style.top=document.getElementById('cite_export_container').offsetHeight+"px"}function iniAll(){iniMenuHeight()}initialise();window.onload=iniAll;