/**
 * @license RequireJS domReady 1.0.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/jrburke/requirejs for details
 */
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*
 RequireJS domReady 1.0.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/requirejs for details

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation
*/
define("domReady",[],function(){function s(d){for(var e=0,b;b=d[e];e++)b(l)}function t(){var d=m,h=k;e&&(d.length&&(m=[],s(d)),b.resourcesDone&&h.length&&(k=[],s(h)))}function n(){e||(e=!0,q&&clearInterval(q),t())}function h(d){e?d(l):m.push(d);return h}var i=typeof window!=="undefined"&&window.document,e=!i,l=i?document:null,m=[],k=[],b=requirejs||require||{},o=b.resourcesReady,q;if("resourcesReady"in b)b.resourcesReady=function(d){o&&o(d);d&&t()};i&&(document.addEventListener?(document.addEventListener("DOMContentLoaded",
n,!1),window.addEventListener("load",n,!1)):window.attachEvent&&(window.attachEvent("onload",n),self===self.top&&(q=setInterval(function(){try{document.body&&(document.documentElement.doScroll("left"),n())}catch(d){}},30))),document.readyState==="complete"&&n());h.withResources=function(d){e&&b.resourcesDone?d(l):k.push(d);return h};h.version="1.0.0";h.load=function(d,e,b,i){i.isBuild?b(null):h(b)};return h});
define("mixloginstatic/LoginWindow",["domReady"],function(s){function t(){function a(a){a=a.target;if(a.value===a.getAttribute("placeholder"))a.value=""}function c(a){a=a.target;if(a.value==="")a.value=a.getAttribute("placeholder")}function g(a){a=a.target;if(a.value===a.getAttribute("placeholder"))a.value="",a.type="password"}function j(a){a=a.target;if(a.value==="")a.value=a.getAttribute("placeholder"),a.type="text"}if(typeof document.createElement("input").placeholder==="undefined")for(var d=document.getElementsByTagName("input"),
b=0;b<d.length;b++){var f=d[b],e=f.getAttribute("placeholder");switch(e&&f.type){case "text":f.value=e;f.addEventListener("focus",a);f.addEventListener("blur",c);break;case "password":f.value=e,f.addEventListener("focus",g),f.addEventListener("blur",j),f.type="text"}}}function n(a){a=RegExp("[\\?&]"+a+"=([^&#]*)").exec(window.location.href);return a===null?void 0:a[1]}function h(a){for(var c="",g,j,d,b,f,e=0,a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");e<a.length;)g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(e++)),
j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(e++)),b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(e++)),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(e++)),g=g<<2|j>>4,j=(j&15)<<4|b>>2,d=(b&3)<<6|f,c+=String.fromCharCode(g),b!==64&&(c+=String.fromCharCode(j)),f!==64&&(c+=String.fromCharCode(d));c=c.replace(/\r\n/g,"\n");a="";for(b=0;b<c.length;b++)f=c.charCodeAt(b),f<128?a+=String.fromCharCode(f):
(f>127&&f<2048?a+=String.fromCharCode(f>>6|192):(a+=String.fromCharCode(f>>12|224),a+=String.fromCharCode(f>>6&63|128)),a+=String.fromCharCode(f&63|128));return a}function i(a,c){document.getElementById("errorMessage").innerHTML=c;document.getElementById("errorWin").style.visibility=""}function e(){var a;if(document.getElementById("reset").value===""&&document.getElementById("resetEmail").value==="")i(!0,"Provide username or email to reset.");else{var c=new XMLHttpRequest;c.onreadystatechange=function(){document.getElementById("errorWin").style.visibility=
"hidden";if(c.readyState===4)if(c.status===200)a=JSON.parse(c.responseText),a.Message?i(!1,a.Message):document.getElementById("errorWin").style.visibility="";else{try{if(a=JSON.parse(c.responseText),a.Message){i(!0,a.Message);return}}catch(b){}i(!0,c.statusText)}};c.open("POST","../useremailconfirmation",!0);c.setRequestHeader("Content-type","application/x-www-form-urlencoded");c.setRequestHeader("Orion-Version","1");c.send("{login='"+document.getElementById("reset").value+"', email='"+document.getElementById("resetEmail").value+
"'}");i(!1,"Sending password reset confirmation...")}}function l(){var a=/[\?&]redirect=([^&#]*)/.exec(window.location.href);return a===null?null:a[1]}function m(a){if(a!==""&&a!==null)return l()!==null?"../login/openid?openid="+encodeURIComponent(a)+"&redirect="+l():"../login/openid?openid="+encodeURIComponent(a)}function k(a,c){if(!a)a=document.getElementById("login").value,c=document.getElementById("password").value;var b=new XMLHttpRequest;b.onreadystatechange=function(){if(b.readyState===4)if(b.status!==
200&&window.location.href.indexOf("http")!==-1){var a=JSON.parse(b.responseText);document.getElementById("errorMessage").innerHTML=a.error;document.getElementById("errorWin").style.visibility=""}else a=l(),a!==null?window.location=decodeURIComponent(a):window.close()};var j="login="+encodeURIComponent(a)+"&password="+encodeURIComponent(c);b.open("POST","../login/form",!0);b.setRequestHeader("Content-type","application/x-www-form-urlencoded");b.setRequestHeader("Orion-Version","1");b.send(j)}function b(){if(document.getElementById("create_password").value!==
document.getElementById("create_passwordRetype").value)return document.getElementById("errorWin").style.visibility="",document.getElementById("errorMessage").innerHTML="Passwords don't match!",!1;document.getElementById("errorWin").style.visibility="hidden";document.getElementById("errorMessage").innerHTML="&nbsp;";return!0}function o(){if(b()){document.getElementById("create_password").setAttribute("aria-invalid","false");document.getElementById("create_passwordRetype").setAttribute("aria-invalid",
"false");var a=new XMLHttpRequest,c=document.getElementById("create_login").value,d=document.getElementById("create_password").value;a.onreadystatechange=function(){if(a.readyState===4)if(a.status!==200&&window.location.href.indexOf("http")!==-1){if(a.responseText){var b=JSON.parse(a.responseText);document.getElementById("errorMessage").innerHTML=b.Message;document.getElementById("errorWin").style.visibility=""}}else k(c,d)};var j="login="+encodeURIComponent(c)+"&password="+encodeURIComponent(d);
a.open("POST","../users",!0);a.setRequestHeader("Content-type","application/x-www-form-urlencoded");a.setRequestHeader("Orion-Version","1");a.send(j)}else document.getElementById("create_password").setAttribute("aria-invalid","true"),document.getElementById("create_passwordRetype").setAttribute("aria-invalid","true")}function q(){!r&&p?window.open(p):(document.getElementById("orionLogin").style.visibility="hidden",document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("newUserHeaderShown").style.visibility=
"")}function d(){document.getElementById("orionLogin").style.visibility="";document.getElementById("orionRegister").style.visibility="";document.getElementById("newUserHeaderShown").style.visibility="hidden"}function u(){document.getElementById("orionLogin").style.visibility="hidden";if(!r&&!p)document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("orionReset").style.height="212px",document.getElementById("orionOpen").style.top="251px",document.getElementById("orionOpen").style.height=
"50px",document.getElementById("orionOpen").style.paddingTop="17px";document.getElementById("newUserHeaderShown").style.display="none";document.getElementById("orionReset").style.visibility=""}function v(){document.getElementById("orionLogin").style.visibility="";r||p?document.getElementById("orionRegister").style.visibility="":(document.getElementById("orionOpen").style.top="188px",document.getElementById("orionOpen").style.height="85px",document.getElementById("orionOpen").style.paddingTop="45px");
document.getElementById("newUserHeaderShown").style.display="";document.getElementById("orionReset").style.visibility="hidden"}var r,p;s(function(){var a=n("error");if(a)a=h(a),document.getElementById("errorWin").style.visibility="",document.getElementById("errorMessage").innerHTML=a;var c=new XMLHttpRequest;c.onreadystatechange=function(){if(c.readyState===4&&c.status===200){var a=JSON.parse(c.responseText);r=a.CanAddUsers;p=a.RegistrationURI;if(!r&&!p)document.getElementById("orionRegister").style.visibility=
"hidden",document.getElementById("orionOpen").style.top="188px",document.getElementById("orionOpen").style.height="85px",document.getElementById("orionOpen").style.paddingTop="45px";document.getElementById("login-window").style.display="";document.getElementById("login").focus()}};c.open("POST","../login/canaddusers",!0);c.setRequestHeader("Content-type","application/x-www-form-urlencoded");c.setRequestHeader("Orion-Version","1");c.send();var g=new XMLHttpRequest;g.onreadystatechange=function(){if(g.readyState===
4&&g.status===200&&JSON.parse(g.responseText).emailConfigured===!1)document.getElementById("resetUserLink").style.display="none"};g.open("POST","../useremailconfirmation/cansendemails",!0);g.setRequestHeader("Content-type","application/x-www-form-urlencoded");g.setRequestHeader("Orion-Version","1");g.send();t();document.getElementById("login").onkeypress=function(a){if(a.keyCode===13)k();else return!0};document.getElementById("password").onkeypress=function(a){if(a.keyCode===13)k();else return!0};
document.getElementById("loginButton").onclick=function(){k()};document.getElementById("resetUserLink").onclick=u;document.getElementById("reset").onkeypress=function(a){a.keyCode===13&&e();return!0};document.getElementById("resetEmail").onkeypress=function(a){a.keyCode===13&&e();return!0};document.getElementById("registerButton").onclick=q;document.getElementById("create_password").onkeyup=function(a){a.keyCode===13?o():b()};document.getElementById("create_passwordRetype").onkeyup=function(a){a.keyCode===
13?o():b()};document.getElementById("createButton").onclick=o;document.getElementById("hideRegisterButton").onclick=d;document.getElementById("googleLoginLink").href=m("https://www.google.com/accounts/o8/id");document.getElementById("yahooLoginLink").href=m("http://me.yahoo.com");document.getElementById("myopenidLoginLink").href=m("http://myopenid.com");document.getElementById("cancleResetButton").onclick=v;document.getElementById("sendResetButton").onclick=e})});