var JSON;JSON||(JSON={});
(function(){function b(a){return a<10?"0"+a:a}function a(a){d.lastIndex=0;return d.test(a)?'"'+a.replace(d,function(a){var c=h[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function e(c,d){var b,h,l,m,n=g,k,f=d[c];f&&typeof f==="object"&&typeof f.toJSON==="function"&&(f=f.toJSON(c));typeof i==="function"&&(f=i.call(d,c,f));switch(typeof f){case "string":return a(f);case "number":return isFinite(f)?String(f):"null";case "boolean":case "null":return String(f);case "object":if(!f)return"null";
g+=j;k=[];if(Object.prototype.toString.apply(f)==="[object Array]"){m=f.length;for(b=0;b<m;b+=1)k[b]=e(b,f)||"null";l=k.length===0?"[]":g?"[\n"+g+k.join(",\n"+g)+"\n"+n+"]":"["+k.join(",")+"]";g=n;return l}if(i&&typeof i==="object"){m=i.length;for(b=0;b<m;b+=1)typeof i[b]==="string"&&(h=i[b],(l=e(h,f))&&k.push(a(h)+(g?": ":":")+l))}else for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(l=e(h,f))&&k.push(a(h)+(g?": ":":")+l);l=k.length===0?"{}":g?"{\n"+g+k.join(",\n"+g)+"\n"+n+"}":"{"+k.join(",")+
"}";g=n;return l}}if(typeof Date.prototype.toJSON!=="function")Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+b(this.getUTCMonth()+1)+"-"+b(this.getUTCDate())+"T"+b(this.getUTCHours())+":"+b(this.getUTCMinutes())+":"+b(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()};var c=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
d=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g,j,h={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},i;if(typeof JSON.stringify!=="function")JSON.stringify=function(a,c,d){var b;j=g="";if(typeof d==="number")for(b=0;b<d;b+=1)j+=" ";else typeof d==="string"&&(j=d);if((i=c)&&typeof c!=="function"&&(typeof c!=="object"||typeof c.length!=="number"))throw Error("JSON.stringify");return e("",
{"":a})};if(typeof JSON.parse!=="function")JSON.parse=function(a,d){function b(a,c){var e,g,f=a[c];if(f&&typeof f==="object")for(e in f)Object.prototype.hasOwnProperty.call(f,e)&&(g=b(f,e),g!==void 0?f[e]=g:delete f[e]);return d.call(a,c,f)}var e,a=String(a);c.lastIndex=0;c.test(a)&&(a=a.replace(c,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),typeof d==="function"?b({"":e},""):e;throw new SyntaxError("JSON.parse");}})();var siws=siws||{};
siws.config={host:"https://www.homestead.com",dialogMethods:{fb_like_auth:{url:"/~site/siteapps/likeDialog.action",addParams:"&serviceProvider=facebook&page=userDialog",width:575,height:375},fb_name:{url:"/~site/siteapps/likeNameDialog.action",width:580,height:530}},launchMethods:{fb_like:{url:"/~site/siteapps/likePublished.action",addParams:"&page=companyDialog",root:"#siws_root",urlToLike:"https://www.homestead.com",layoutStyle:"standard",width:"450",showFaces:"false",verb:"like",colorScheme:"light",
font:"lucida grande"}}};
siws.Promise=function(){function b(){var a=this;this.pending=[];this.resolve=function(e){a.promise_resolve.call(a,e)};this.reject=function(e){a.promise_reject.call(a,e)}}b.prototype.promise_resolve=function(a){this.complete("resolve",a)};b.prototype.promise_reject=function(a){this.complete("reject",a)};b.prototype.then=function(a,e){var c=new siws.Promise;this.pending.push({resolve:a,reject:e,next:c});return c};b.prototype.always=function(a){this.always=a};b.prototype.complete=function(a,e){for(var c,
d;this.pending[0];)if(c=this.pending.shift(),typeof this.always==="function"&&this.always(e,c),d=c[a](e),a==="resolve")c.next.resolve(d);else if(a==="reject")c.next.reject(d);else throw Error("Promise.js: invalid complete type");};return b}();
siws.Utils=function(b){function a(){return((1+Math.random())*65536|0).toString(16).substring(1)}function e(){try{return new XMLHttpRequest}catch(a){}}b.getQueryParam=function(a,d){var d=d||window.location.href,e=d.slice(d.indexOf("?")+1).split("&"),b={},h,i,o;for(i=0;o=e.length,i<o;i++)h=e[i].split("="),b[h[0]]=h[1];return b[a]};b.buildQuery=function(a,d,e){var b,h="",d=d!==void 0?d:"=";seperator=e!==void 0?e:"&";for(b in a)a[b]!=null&&(h+=b+d+a[b]+seperator);return h=h.substr(0,h.length-1)};b.getElementsByClassName=
function(a){var e=document.getElementsByTagName("*"),b=[],j,h,i;j=0;for(h=e.length;j<h;j++)i=RegExp("\\b"+a+"\\b"),e[j].className.match(i)&&b.push(e[j]);return b};b.guid=function(){return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()};b.sizeOfObject=function(a){var e=0,b;for(b in a)a.hasOwnProperty(b)&&e++;return e};b.loadScript=function(a){var e=document.createElement("script");document.getElementsByTagName("head")[0].appendChild(e);e.src=a};b.ajax=function(a){var b;if(!a||a.url===void 0||a.success===
void 0)throw Error("utils.js - ajax: invalid parameters");a.type=a.type||"GET";a.data=a.data||null;var g=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/.test(/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/.exec(location.href.toLowerCase())||[]);if(window.ActiveXObject){if(!(g=!g&&e()))a:{try{g=new ActiveXObject("Microsoft.XMLHTTP");break a}catch(j){}g=void 0}}else g=e();b=g;b.onreadystatechange=function(){b.readyState===4&&typeof a.success==="function"&&a.success(b.responseText)};b.open(a.type,
a.url,!0);b.send(a.data)};return b}({});
siws.XD=function(b){var a=window.location.hash;b.postMessage=function(a,b,d){window.postMessage!==void 0?d.postMessage(a,b.replace(/([^:]+:\/\/[^\/]+).*/,"$1")+"/"):d.location.hash="#"+(new Date).getTime()+"&"+a};b.receiveMessage=function(b,c){var d;window.postMessage!==void 0?(d=function(a){typeof c==="string"&&a.origin!==c||b(a)},window.attachEvent?window.attachEvent("onmessage",d):window.addEventListener("message",d,!1)):(d&&clearInterval(d),b&&(d=setInterval(function(){var c=document.location.hash,
d=/^#?\d+&/;c!==a&&(a=c,b({data:c.replace(d,"")}))},100)))};return b}({});
siws.UI=function(b){b.prevHandler=void 0;b.frames={};b.closeFrame=function(a){a.message=a.action="close";b.sendNoData(a)};b.error=function(a){a.message=a.action="error";b.sendNoData(a)};b.back=function(a){a.message="back";a.action="back";b.sendNoData(a)};b.sendNoData=function(a){var b;switch(a.cid){case "-1":siws.XD.postMessage(JSON.stringify({frameId:siws.Utils.getQueryParam("frame"),message:a.message}),decodeURIComponent(siws.Utils.getQueryParam("target")),parent);break;case "3":a.action=a.action===
"close"?"cancel":a.action;b=a.action==="cancel"?"MESSAGE=FinishPartnerElement":"MESSAGE=FacebookLikeElement";switch(a.source){case "fb_like_auth":b+=a.action!=="error"?"!"+a.action.toUpperCase():"!FBCREDENTIALS!-1";break;case "fb_name":a.action=a.action==="back"?"GOBACK!":a.action,b+="!"+a.action.toUpperCase()}b+="&FBREQUEST=TRUE";window.location.href=a.rUrl.indexOf("?")===-1?a.rUrl+"?"+b:a.rUrl+b;break;default:b={action:a.action,source:a.source},b=siws.Utils.buildQuery(b),window.location.href=a.rUrl.indexOf("?")===
-1?a.rUrl+"?"+b:a.rUrl+"&"+b}};b.sendData=function(a){var b;switch(a.cid){case "-1":siws.XD.postMessage(JSON.stringify({frameId:siws.Utils.getQueryParam("frame"),message:"data",fid:a.data}),decodeURIComponent(siws.Utils.getQueryParam("target")),parent);break;case "3":b="MESSAGE=FacebookLikeElement";switch(a.source){case "fb_like_auth":b+="!FBCREDENTIALS!"+encodeURIComponent(a.data);break;case "fb_name":b+="!SAVESETTINGS!"+encodeURIComponent(a.data)}b+="&FBREQUEST=TRUE";window.location.href=a.rUrl.indexOf("?")===
-1?a.rUrl+"?"+b:a.rUrl+b;break;default:b={action:"success",source:a.source},b[a.paramName]=encodeURIComponent(a.data),b=siws.Utils.buildQuery(b),window.location.href=a.rUrl.indexOf("?")===-1?a.rUrl+"?"+b:a.rUrl+"&"+b}};b.navigate=function(a){siws.XD.postMessage(JSON.stringify({frameId:siws.Utils.getQueryParam("frame"),message:"navigate",page:a}),decodeURIComponent(siws.Utils.getQueryParam("target")),parent)};b.receiveHandler=function(a){a=JSON.parse(a.data);if(a.message===void 0||a.frameId===void 0)throw Error("receiveHandler: malformed xd message");
switch(a.message){case "close":b.deleteFrame(a.frameId);break;case "data":b.receiveData(a);break;case "navigate":b.navigateFrame(a)}};b.navigateFrame=function(a){var e=b.prevHandler.resolve,c=b.prevHandler.reject;b.deleteFrame(a.frameId);b.prevHandler!==void 0&&siws.dialog({name:a.page}).then(e,c)};b.deleteFrame=function(a){var e=b.frames[a];document.body.removeChild(e.frame.parentNode);e.promise.reject("error");delete b.frames[a]};b.receiveData=function(a){b.frames[a.frameId].promise.resolve(a.fid);
b.deleteFrame(a.frameId)};return b}({});
siws.dialog=function(){function b(a,b){siws.UI.prevHandler=b}var a=siws.config.dialogMethods;return function(e){var c={},e=a[e.name];if(e===void 0)throw Error("dialog: invalid dialog name");c.id=siws.Utils.guid();c.promise=new siws.Promise;c.promise.always(b);var d;d=e.url;d+="?"+siws.config.queryBase;e.addParams&&(d+=e.addParams);d+="&frame="+c.id;d+="&target="+encodeURIComponent(window.location.href);c.builtUrl=d;d=document.createElement("div");var g=(window.innerWidth||document.documentElement.clientWidth)/
2-e.width/2,j=(window.innerHeight||document.documentElement.clientHeight)/2-e.height/2;d.style.width=e.width+"px";d.style.height=e.height+"px";d.style.position="absolute";d.style.left=g+"px";d.style.top=j+"px";c.root=d;d=document.createElement("iframe");d.style.border="none";d.style.overflow="hidden";d.style.height=e.height+"px";d.style.width=e.width+"px";d.setAttribute("scrolling","no");d.setAttribute("allowTransparency","true");d.setAttribute("frameborder","0");c.root.appendChild(d);document.body.appendChild(c.root);
c.frame=d;siws.UI.frames[c.id]=c;d.src=siws.config.host+c.builtUrl;return c.promise}}({});
siws.launch=function(){function b(a){var b=a.root.charAt(0),d;b==="#"?d=[document.getElementById(a.root.slice(1))]:b==="."&&(d=siws.Utils.getElementsByClassName(a.root.slice(1)));siws.Utils.ajax({type:"GET",url:a.url,success:function(a){var b,c;b=0;for(c=d.length;b<c;b++)d[b].innerHTML=a}})}var a=siws.config.launchMethods;return function(e){var c={},d=a[e.name];if(d===void 0)throw Error("dialog: invalid launch method");c.root=e.root||d.root;c.urlToLike=e.urlToLike||d.urlToLike;c.layoutStyle=e.layoutStyle||
d.layoutStyle;c.width=e.width||d.width;c.showFaces=e.showFaces||d.showFaces;c.verb=e.verb||d.verb;c.colorScheme=e.colorScheme||d.colorScheme;c.font=e.font||d.font;c.addParams=d.addParams;c.url=d.url;c.url+="?"+siws.config.queryBase;c.addParams&&(c.url+=c.addParams);c.url+="&urlToLike="+c.urlToLike;c.url+="&layoutStyle="+c.layoutStyle;c.url+="&width="+c.width;c.url+="&showFaces="+c.showFaces;c.url+="&verb="+c.verb;c.url+="&colorScheme="+c.colorScheme;c.url+="&font="+c.font;b(c)}}({});
siws.init=function(){return function(b){if(!b||b.u===void 0||b.hid===void 0||b.cid===void 0||b.pid===void 0)throw Error("init: missing necessary parameters. Require u, hid, cid, & pid");siws.config.queryBase="u="+b.u+"&hid="+b.hid+"&cid="+b.cid+"&pid="+b.pid;siws.config.host=b.host||siws.config.host;siws.XD.receiveMessage(siws.UI.receiveHandler,siws.config.host)}}({});
