var a={};window.Hammer=a;if(!a.a)a.a=function(){};a.a.h=document;a.a.B=a.a.h.body;a.a.G=window;if(window.AppOptions==undefined)window.AppOptions=[];a.a.m=function(b){return a.a.h.createElement(b)};a.a.i=function(b){return a.a.h.getElementById(b)};a.a.u=function(b,c){if(c==null)c=a.a.h;return c.getElementsByTagName(b)};a.a.ha=function(b){if(b==null)b=a.a.h;return b.documentElement};a.a.j=function(){return a.a.u("head")[0]||a.a.ha()};if(!a.a.k)a.a.k=function(b){typeof b=="function"&&setTimeout(b,0)};
if(!a.a.n)a.a.n=function(b){return b!==undefined&&b!==null};if(!a.a.o)a.a.o=function(b,c,d){if(a.a.n(b))typeof window[b]=="function"?window[b](d[0],c):eval(b(d[0],c))};if(!a.a.D)a.a.D=function(b,c){for(var d in b)c.hasOwnProperty(d)||(c[d]=b[d]);return c};a.a.ba=function(b){return encodeURIComponent(b)};a.a.aa=function(b){return decodeURIComponent(b)};a.a.C=function(){var b=0;return function(){return b++}}();
a.a.r=function(){var b=a.a.m("div");return function(c){b.innerHTML=c;c=b.childNodes[0];b.removeChild(c);return c}}();a.a.l=function(b,c,d){if(a.a.G.addEventListener)b.addEventListener(c,d,false);else a.a.G.attachEvent&&b.attachEvent("on"+c,function(){d.call(b,a.a.G.event)})};
a.a.X=function(b,c){var d=a.a.j(),e=document.createElement("link");e.setAttribute("rel","stylesheet");e.setAttribute("type","text/css");e.setAttribute("media","screen");e.setAttribute("href",b);e.onload=e.onreadystatechange=function(){if(!this.readyState||this.readyState=="loaded"||this.readyState=="complete"){e.onload=e.onreadystatechange=null;d.removeChild(e);c!=null&&c.call()}};d.appendChild(e)};
a.a.K=function(b,c){var d=a.a.j(),e=a.a.m("script");e.type="text/javascript";e.src=b;e.onload=e.onreadystatechange=function(){if(!this.readyState||this.readyState=="loaded"||this.readyState=="complete"){e.onload=e.onreadystatechange=null;d.removeChild(e);c!=null&&c.call()}};d.appendChild(e)};
a.a.Z=function(b){if(a.a.i(a.b["'"+b+"'"].WrapperName)){var c=a.a.i(a.b["'"+b+"'"].WrapperName);a.a.v(c,"");return c}c=a.a.r("<div>");c.setAttribute("id",a.b["'"+b+"'"].WrapperName);c.setAttribute("Class",a.b["'"+b+"'"].ClassName);c.innerHTML=a.b["'"+b+"'"].LoadingText;a.a.W(a.b["'"+b+"'"].Method+a.b["'"+b+"'"].ServerURL+"/App/Launch/"+a.b["'"+b+"'"].AppId,c,b);return c};
a.a.V=function(b,c){for(var d=a.a.u("script"),e=0;e<d.length;e++)if(d[e].getAttribute("scriptId")==b){d[e].parentNode.removeChild(document.getElementById("AppWrapper"+b));d[e].setAttribute("scriptId",c)}};a.a.W=function(b,c,d){for(var e=a.a.u("script"),g=false,f=0;f<e.length;f++){var h;if(h=e[f].getAttribute("src"))if(h.match(b)){e[f].parentNode.appendChild(c);e[f].setAttribute("scriptId",d);g=true}}if(!g)for(f=0;f<e.length;f++)e[f].getAttribute("scriptId")==d&&e[f].parentNode.appendChild(c)};
a.a.A=function(b){b=b+"=";var c=document.cookie;if(c.length>0){begin=c.indexOf(b);if(begin!=-1){begin+=b.length;end=c.indexOf(";",begin);if(end==-1)end=c.length;return unescape(c.substring(begin,end))}}};a.a.g=function(b,c,d,e){b.cookie=c+"="+escape(d)+"; path=/"+(e==null?"":"; expires="+e.toGMTString())};
a.a.v=function(b,c){var d=c.match(/<script(.|\s)*?\/script>/g);if(d==null)b.innerHTML=c;else{b.innerHTML=c.replace(/<script(.|\s)*?\/script>/g,"");for(b=0;b<d.length;b++){c=d[b].replace(/<script(.|\s)*?>/g,"").replace(/<\/script>/g,"");var e=a.a.m("script");if(c!="")e.text=c;a.a.j().insertBefore(e,a.a.j().firstChild);a.a.j().removeChild(e)}}};
a.a.Y=function(b){if(a.b["'"+b+"'"]!=undefined)for(var c in a.b["'"+b+"'"].q){try{a.a.B.parentNode.removeChild(a.a.i(a.b["'"+b+"'"].q[c]))}catch(d){}a.b["'"+b+"'"].q.pop(a.b["'"+b+"'"].q[c])}};a.a.N=function(b){this.U={};if(b==null)b=location.search.substring(1,location.search.length);if(b.length!=0){b=b.replace(/\+/g," ");b=b.split("&");for(var c=0;c<b.length;c++){var d=b[c].split("="),e=decodeURIComponent(d[0]);d=d.length==2?decodeURIComponent(d[1]):e;this.U[e]=d}}};
function o(b,c,d){b=b.U[c];return b!=null?b:d}if(!a.Core)a.Core=a.a;if(!a.Core.AttachScript)a.Core.AttachScript=a.a.K;if(!a.Core.AttachCSS)a.Core.AttachCSS=a.a.X;if(!a.Core.Later)a.Core.Later=a.a.k;if(!a.Core.Querystring)a.Core.Querystring=a.a.N;if(!a.Core.getCookie)a.Core.getCookie=a.a.A;if(!a.Core.setCookie)a.Core.setCookie=a.a.g;if(!a.Core.AddContainerId)a.Core.AddContainerId=a.a.V;a.d=function(){error="error"};a.d.M={Q:undefined,z:"jsoncallback",ta:undefined,complete:undefined,data:"",error:undefined,success:undefined,url:location.href,appId:undefined};if(window.SendOptions==undefined)window.SendOptions=[];
a.d.prototype={J:function(b,c){window.SendOptions["'"+c+"'"]=a.a.D(a.d.M,b);var d=0;window.SendOptions["'"+c+"'"].abort=function(){d=1};if(a.a.n(window.SendOptions["'"+c+"'"].Q)&&(window.SendOptions["'"+c+"'"].Q(window.SendOptions["'"+c+"'"],window.SendOptions["'"+c+"'"])===false||d))return window.SendOptions["'"+c+"'"];window.SendOptions["'"+c+"'"].z="jsonp"+(new Date).getTime()+Math.floor(Math.random()*999);window.SendOptions["'"+c+"'"].url=a.a.n(window.SendOptions["'"+c+"'"].url)?window.SendOptions["'"+
c+"'"].url:"";window.SendOptions["'"+c+"'"].url+=window.SendOptions["'"+c+"'"].url.indexOf("?")>-1?"&":"?";window.SendOptions["'"+c+"'"].url+="jsoncallback="+window.SendOptions["'"+c+"'"].z+"&_"+(new Date).getTime()+Math.floor(Math.random()*999)+"=";a.d.la=function(e){try{a.a.o(window.SendOptions["'"+e.AppId+"'"].success,window.SendOptions["'"+e.AppId+"'"],[e,"success"])}catch(g){}try{a.a.o(window.SendOptions["'"+e.AppId+"'"].complete,window.SendOptions["'"+e.AppId+"'"],[window.SendOptions["'"+e.AppId+
"'"],"success"])}catch(f){}};a.d.ka=function(e,g){try{a.a.o(window.SendOptions["'"+g.AppId+"'"].error,window.SendOptions["'"+g.AppId+"'"],[window.SendOptions["'"+g.AppId+"'"],e])}catch(f){}try{a.a.o(window.SendOptions["'"+g.AppId+"'"].complete,window.SendOptions["'"+g.AppId+"'"],[window.SendOptions["'"+g.AppId+"'"],e])}catch(h){}};a.d.ma=function(e){if(!d){window.SendOptions["'"+e+"'"].frame=a.a.m("iframe");window.SendOptions["'"+e+"'"].frame.setAttribute("id",e);a.a.j().appendChild(window.SendOptions["'"+
e+"'"].frame);var g,f=window.SendOptions["'"+e+"'"].frame;f=f.contentWindow||f.contentDocument;var h=f.document,j=function(l,n){a.d.R();a.d.ka(a.a.n(n)?n:error)},m=window.SendOptions["'"+e+"'"].z=="E"+e?"X"+e:"E"+e;if(!a.a.n(document)){h=window;f=document.ua()}h.open();f[window.SendOptions["'"+e+"'"].z]=function(l){d=1;a.a.k(function(){a.d.R(e);a.d.la(l)})};f[m]=function(l){(!l||l=="complete")&&!d++&&a.a.k(j)};window.SendOptions["'"+e+"'"].abort=a.d.R=function(l){clearTimeout(g);try{a.a.j().removeChild(a.a.i(l))}catch(n){}};h.write(["<html><head><script src='",window.SendOptions["'"+e+"'"].url,"' onload='",m,"()' onreadystatechange='",m,"(this.readyState)'><\/script></head><body onload='",m,"()'></body></html>"].join(""));h.close();window.SendOptions["'"+e+"'"].timeout>0&&(g=setTimeout(function(){!d&&j("","timeout")},window.SendOptions["'"+e+"'"].timeout))}};a.a.k(a.d.ma(c));return window.SendOptions["'"+c+"'"]}};if(!a.c)a.c=function(b){a.c.F(a.b["'"+b+"'"].s,b)};
if(!a.c.F)a.c.F=function(b,c){if(b!=null){b=a.a.u("*",b);for(i=0;i<b.length;i++)if(b[i].tagName=="FORM"){var d=b[i],e=d.elements;if(e)for(var g=new a.c.p(d,c),f=0;f<e.length;f++)if(e[f])try{if(e[f].type=="submit"){e[f].onclick=function(){g.pa(d.id);return false};e[f].onsubmit=function(){return false}}else e[f].type=="file"&&new a.c.p.O(e[f],c)}catch(h){}}else if(b[i].tagName=="A"){b[i].setAttribute("appId",c);b[i].getAttribute("appId");$(b[i]).click(function(){var j=this.href,m=this.getAttribute("appId");
if(document.location.port=="")j=j.replace(document.domain,a.b["'"+m+"'"].ServerURL);new a.c.w(j,false,m);return false})}}};if(!a.App)a.App=a.c;if(!a.App.Refresh)a.App.Refresh=a.c.F;a.c.w=function(b,c,d){if(c){c=a.a.A("guid");if(c!=undefined&&c!="undefined"){a.b["'"+d+"'"].Guid="?guid="+c;b=window.location.pathname;c=a.a.A("DestUrl");b=b==c?a.b["'"+d+"'"].Method+a.b["'"+d+"'"].ServerURL+a.a.A("AppUrl"):a.b["'"+d+"'"].Method+a.b["'"+d+"'"].ServerURL+a.b["'"+d+"'"].Url;a.a.g(document,"guid",undefined);a.a.g(document,"AppUrl",undefined);a.a.g(document,"DestUrl",undefined)}else{c=o(new a.a.N,"path");if(c!=undefined&&c!="undefined")b=a.b["'"+d+"'"].Method+a.b["'"+d+"'"].ServerURL+
"/"+c}}b+=a.b["'"+d+"'"].Guid;b+="&appId="+a.b["'"+d+"'"].AppId;var e={appId:d,url:b,success:function(g,f){a.a.Y(f.appId);if(g!=null)switch(g.Type){case "PageRedirect":a.a.g(document,"guid",a.b["'"+f.appId+"'"].Guid.replace("?guid=",""));a.a.g(document,"AppUrl",g.AppUrl);a.a.g(document,"DestUrl",g.Url);window.location=g.Url;break;case "Redirect":new a.c.w(a.b["'"+f.appId+"'"].Method+a.b["'"+f.appId+"'"].ServerURL+"/"+g.ControllerName+"/"+g.ActionName,false,f.appId);break;case "Error":a.c.L(g);break;
case "ContentResult":a.a.v(a.b["'"+f.appId+"'"].s,g.Output);new a.c(f.appId);break}},error:function(g,f){a.c.L(g,f)}};typeof jQuery=="undefined"?a.a.K(a.b["'"+d+"'"].Method+a.b["'"+d+"'"].ServerURL+"/scripts/jquery-1.3.2.min.js",function(){a.a.k(p.J(e,d))}):a.a.k(p.J(e,d))};a.c.L=function(b){try{a.a.v(a.b["'"+b.AppId+"'"].s,b.Output)}catch(c){a.a.v(a.b["'"+b.AppId+"'"].s,"<p>Error : "+c.description+".</p><p>  App restarting</p>")}};a.c.p=function(b,c){this.oa={data:{},ja:function(){new a.c.w(a.b["'"+c+"'"].Method+a.b["'"+c+"'"].ServerURL+a.b["'"+c+"'"].ResponseUrl,false,c)}};this.f=c;this.S=this.ga();this.t=this.fa(b,this.S);return false};
a.c.p.prototype={ga:function(){var b="iframe"+a.a.C(),c=a.a.r("<iframe src='javascript:false;' name='"+b+"' />");c.id=b;c.style.display="none";a.a.B.appendChild(c);a.b["'"+this.f+"'"].q.push(c.id);return c},fa:function(b,c){var d=a.a.r("<form method='post' enctype='multipart/form-data'></form>");b=document.location.port==""?b.action.replace(a.a.h.domain,a.b["'"+this.f+"'"].ServerURL):b.action;d.action=b;d.target=c.name;d.id=a.b["'"+this.f+"'"].WrapperName+a.a.C();document.body.appendChild(d);return d},
na:function(b){var c="";b=a.a.u("*",b);for(var d=0;d<b.length;d++){var e=b[d];if(!e.disabled&&e.name&&e.name.length>0)switch(e.tagName.toLowerCase()){case "input":switch(e.type){case "checkbox":case "radio":c=this.I(c,e);break;case "hidden":case "password":case "text":case "file":c=this.I(c,e);break}break;case "select":case "textarea":c=this.I(c,e);break}}return c},I:function(b,c){if(b.length>0)b+="&";b+=c.name+"="+a.a.ba(c.value);return b},pa:function(b){var c=this;b=a.a.i(b);this.ia=this.na(b);
a.b["'"+this.f+"'"].s.innerHTML=a.b["'"+this.f+"'"].LoadingText;var d=this.ia.split("&");for(k=0;k<d.length;k++){var e=d[k].split("="),g=a.a.m("input");g.type="hidden";g.name=e[0];g.value=a.a.aa(e[1]);this.t.appendChild(g)}b=document.location.port==""?b.action.replace(a.a.h.domain,a.b["'"+this.f+"'"].ServerURL)+a.b["'"+this.f+"'"].Guid:b.action+a.b["'"+this.f+"'"].Guid;d=a.b["'"+this.f+"'"].Method+a.b["'"+this.f+"'"].ServerURL;if(b.substr(0,d.length)!=d)b=d+b;this.t.action=b;this.t.submit();document.body.removeChild(this.t);
this.t=null;var f=false,h=this.S;a.a.l(h,"load",function(){if(h.src=="about:blank")f&&setTimeout(function(){a.a.B.removeChild(h)},0);else{f=true;h.src="about:blank";c.oa.ja.call()}});return false}};var q=document.documentElement.getBoundingClientRect?function(b){var c=b.getBoundingClientRect(),d=b.ownerDocument;b=d.body;d=d.documentElement;var e=d.clientTop||b.clientTop||0,g=d.clientLeft||b.clientLeft||0,f=1;if(b.getBoundingClientRect){f=b.getBoundingClientRect();f=(f.right-f.left)/b.clientWidth}if(f>1)g=e=0;return{top:c.top/f+(window.pageYOffset||d&&d.scrollTop/f||b.scrollTop/f)-e,left:c.left/f+(window.pageXOffset||d&&d.scrollLeft/f||b.scrollLeft/f)-g}}:function(b){var c=0,d=0;do{c+=b.offsetTop||
0;d+=b.offsetLeft||0}while(b=b.offsetParent);return{left:d,top:c}};function r(b,c){b.className=b.className.replace(new RegExp("(\\s|^)"+c+"(\\s|$)")," ")}a.c.p.O=function(b,c){this.f=c;this.H=null;this.e=b;this.qa=b.id;this.ra=this.sa=this.da=false;this.P=document.body;this.ca();this.ea()};
a.c.p.O.prototype={ca:function(){var b=this,c=a.a.m("input");c.setAttribute("type","file");c.setAttribute("name",this.e.name);c.setAttribute("id",this.e.id);var d={position:"absolute",margin:"-5px 0 0 -175px",padding:0,width:"220px",height:"30px",opacity:0,cursor:"pointer",display:"none",zIndex:2147483583};for(var e in d)c.style[e]=d[e];if(c.style.opacity!=="0")c.style.filter="alpha(opacity=0)";d=a.b["'"+this.f+"'"].WrapperName+(a.a.C()-1);a.a.i(d).appendChild(c);a.a.l(c,"change",function(){var g=
this.value.replace(/.*(\/|\\)/,"");c.style.display="none";var f=a.a.r("<input type='text' readonly='readonly' value='"+g+"'>"),h=a.a.r("<div id='removeFile"+this.id+"' style='float:right;'>Del</div>");b.e.parentNode.replaceChild(f,b.e);f.parentNode.appendChild(h);a.a.l(a.a.i("removeFile"+this.id),"click",function(){b.e.style.display="block";f.parentNode.replaceChild(b.e,f);b.e.parentNode.removeChild(h)})});a.a.l(c,"click",function(){b.T=true;setTimeout(function(){b.T=false},3E3)});this.H=c},ea:function(){var b=
this,c,d={top:0,left:0},e=false;a.a.l(b.e,"mouseover",function(){if(!(!b.H||e)){e=true;var g=b.e,f,h;h=q(g);f=h.left;h=h.top;c={left:f,right:f+g.offsetWidth,top:h,bottom:h+g.offsetHeight};if(b.P!=document.body)d=q(b.P)}});a.a.l(document,"mousemove",function(g){var f=b.H;if(f&&e)if(b.da){r(b.e,"hover");f.style.display="none"}else{if(!g.pageX&&g.clientX){var h=1,j=document.body;if(j.getBoundingClientRect){h=j.getBoundingClientRect();h=(h.right-h.left)/j.clientWidth}g={x:g.clientX/h+document.body.scrollLeft+
document.documentElement.scrollLeft,y:g.clientY/h+document.body.scrollTop+document.documentElement.scrollTop}}else g={x:g.pageX,y:g.pageY};if(g.x>=c.left&&g.x<=c.right&&g.y>=c.top&&g.y<=c.bottom){f.style.top=g.y-d.top+"px";f.style.left=g.x-d.left+"px";f.style.display="block";f=b.e;f.className.match(/(\s|^)hover(\s|$)/)||(f.className+=" hover")}else{e=false;if(!b.T)f.style.display="none";r(b.e,"hover")}}})}};var p=new a.d;a.comms||(a.comms=p);if(!a.comms.jsonp)a.comms.jsonp=p.J;if(a.b==undefined)a.b=window.AppOptions;a.Options={Method:undefined,ServerURL:undefined,Url:undefined,ResponseUrl:undefined,Guid:undefined,AppId:undefined,ClassName:undefined,WrapperName:undefined,LoadingText:undefined,ErrorText:undefined,Wrapper:undefined,RequestAddress:undefined,Frames:undefined};
a.Init||(a.Init=function(b){a.a.g(document,"csrf",String(b.Guid).replace("?guid=","").replace("?Guid=",""));a.b["'"+b.AppId+"'"]=a.a.D(a.M,b);window.AppOptions["'"+b.AppId+"'"]=a.b["'"+b.AppId+"'"];a.b["'"+b.AppId+"'"].s=a.a.Z(b.AppId);a.b["'"+b.AppId+"'"].q=[];a.b["'"+b.AppId+"'"].$=a.b["'"+b.AppId+"'"].Method+a.b["'"+b.AppId+"'"].ServerURL+a.b["'"+b.AppId+"'"].Url;a.c.w(a.b["'"+b.AppId+"'"].$,true,b.AppId)});Hammer.Init({"Method":"http://","ServerURL":"apps.snapperworld.com","Url":"/App/Build/","ResponseUrl":"/CallBack/Process/","Guid":"?guid=9a3dadd4-f493-42c3-b90c-3a0acc1d8f0b","AppId":64736458,"ClassName":"bodyContent","WrapperName":"AppWrapper64736458","LoadingText":"Please wait...","ErrorText":"An error has occured.  Press here to reset the app","IgnoreRegion":false})
