(function(){function c(a){function b(){setClass(document.body,"loading",false)}setClass(document.body,"loading",true);var f=location.hash.substr(1);if(f&&!(f in x))iui.showPageByHref(f,null,null,null,null,b);else if(f=document.body.getAttribute("home"))iui.showPageByHref(f,null,null,null,null,b);else a&&iui.showPage(a)}function d(){for(var a,b,f=0,e=document.body.firstChild;e;e=b){b=e.nextSibling;if(e.nodeType==1&&!H(e)){e.sourceHref="__"+(e.id||++f);x[e.sourceHref]=e;if(!hasClass(e,"chrome")){n(e);
a||(a=e)}}}A(document.body);setClass(document.body,"ready",true);return a}function h(){if(!y){if(window.innerWidth!=iui.screenWidth){iui.screenWidth=window.innerWidth;iui.screenHeight=window.innerWidth<480?416:270;document.body.setAttribute("orient",window.innerWidth<480?"profile":"landscape");setTimeout(scrollTo,100,0,1);iui.dispatch("resize")}if(location.hash&&location.hash!=D){var a=location.hash.substr(1);iui.showPageById(a);iui.dispatch("navigate")}}}function g(a){function b(e){e.preventDefault();
iui.submitForm(e.target)}if(a.localName.toLowerCase()=="form")a.onsubmit=b;a=a.getElementsByTagName("form");for(var f=0;f<a.length;++f)a[f].onsubmit=b}function i(a,b,f){if(f)j(b,a,true);else{y=true;for(var e=getElementsByClass(document.body,"tops"),k=0;k<e.length;++k)e[k]=E(e[k],"100%");var l=a.offsetWidth;if(f){var r=E(a,l+"px");scrollTo(l,1)}else scrollTo(0,1);b.style.left=f?"0":"100%";setClass(b,"showing",false);setTimeout(function(){if(f){a.style.left=l+"px";document.body.removeChild(r)}var o=
100,p=setInterval(function(){o-=L;if(o<=0){o=0;clearInterval(p)}var u=m(o,0,o,100);scrollTo(f?l+(u-100)/100*l:(100-u)/100*l,1);if(o==0){hasClass(b,"dialog")||n(a);if(!f){var M=E(b,"0");setTimeout(function(){scrollTo(0,1);b.style.left="0";document.body.removeChild(M)},0)}setTimeout(function(){for(var F=0;F<e.length;++F)document.body.removeChild(e[F]);setTimeout(j,0,b,a)},0)}},N)},0)}}function j(a,b,f){if(f){document.body.appendChild(a);setClass(a,"showing",false);n(b);scrollTo(0,1)}iui.closeDialog();
y=false;setClass(a,"showing",false);s(a,"onshow",[b]);g(a);v(a.fromLink);setTimeout(q,0,a);if(t){iui.showPage.apply(iui,t);t=null}}function m(a,b,f,e){a/=e/2;if(a<1)return f/2*a*a*a+b;a-=2;return f/2*(a*a*a+2)+b}function n(a){a&&a.parentNode==document.body&&!a.hasAttribute("keepAlive")&&document.body.removeChild(a)}function A(a){a=a.getElementsByTagName("u");for(var b=0;b<a.length;++b)if(!a[b].onclick)a[b].onclick=function(){}}function q(a){A(a);a=a.getElementsByTagName("img");for(var b=0;b<a.length;++b)if(a[b].hasAttribute("src2")){a[b].src=
a[b].getAttribute("src2");a[b].removeAttribute("src2")}}function E(a,b){var f=a.cloneNode(true);f.style.position="absolute";f.style.left=b;f.style.top=a.offsetTop+"px";f.style.width=a.offsetWidth+"px";document.body.appendChild(f);return f}function O(a){for(var b={},f=0;f<a.elements.length;++f){var e=a.elements[f];if(e.name)b[e.name]=e.value}return b}function B(a){var b=a&&a.getAttribute("radio");if(!a||b){iui.selectedRadio&&iui.selectedRadio.removeAttribute("selected");iui.selectedRadio=a;if(b){a.setAttribute("selected",
"true");return a}}}function v(a,b){I=b;a&&a.getAttribute("radio")=="true"&&b&&setTimeout(function(){setClass(document.body,"loading",I=="loading")},300);a&&setAttr(a,"progress",b)}function P(){if(!--G&&t){iui.showPage.apply(iui,t);t=null}}function H(a){a=a.localName.toLowerCase();return a=="script"||a=="link"}function s(a,b,f){return(b=a&&a.getAttribute(b))?(new Function(b)).apply(a,f)!==false:true}var L=4,N=15,D=location.hash,C=[],J={},x={},w,G=0,y,t,I,z={},K=navigator.userAgent.indexOf("Safari")!=
-1&&navigator.userAgent.indexOf("Pre")!=-1;window.iui={screenWidth:0,screenHeight:0,currentPage:null,currentDialog:null,$:function(a){return x["__"+a]},showPage:function(a,b,f){var e=iui.currentPage;if(a&&a!=e)if(y)t=arguments;else if(e&&a.sourceHref==e.sourceHref){iui.currentPage=a;document.body.replaceChild(a,e);iui.prepContent(a)}else if(hasClass(a,"dialog")){if(!w){w=document.createElement("div");w.className="dialogMask"}w.style.height=window.innerHeight+"px";document.body.appendChild(w);iui.currentDialog=
a;document.body.appendChild(a);scrollTo(0,1);g(a);setTimeout(q,0,a);s(a,"onshowing");s(a,"onshow")}else if(e&&!s(e,"onhiding"))location.href=D="#"+e.sourceHref;else{iui.currentPage=a;setClass(a,"showing",true);e&&K?document.body.replaceChild(a,e):document.body.appendChild(a);location.href=D="#"+a.sourceHref;C.push(a.sourceHref);var k=B(f);if(!k){var l=a.getAttribute("tab");if(l){l=B($(l));f=f||l}}a.fromLink=f;s(a,"onshowing",[e]);if(e&&!k)if(K){scrollTo(0,1);j(a,e,false)}else setTimeout(i,0,e,a,b);
else j(a,e,true)}},showPageById:function(a){var b=x[a];if(b){a=C.indexOf(a);var f=a!=-1;f&&C.splice(a,C.length);B(b.fromLink);iui.showPage(b,f,b.fromLink)}},refresh:function(){iui.currentPage.remote&&this.showPageByHref(iui.currentPage.sourceHref)},showPageByHref:function(a,b,f,e,k,l){v(k,"loading");if(this.req){v(this.loadingLink);this.req.onreadystatechange=function(){};this.req.abort()}this.loadingLink=k;this.req=ajax(f||"GET",a,b,function(r){delete iui.req;if(!l||l(r)!==false){v(k,"loaded");if(e){var o=
k;r=r.responseText;if(o){for(var p=o.getAttribute("container");p&&p.length>1;){o=o.parentNode;p=p.substr(1,p.length)}if(p=o.parentNode){var u=document.createElement(p.localName);u.innerHTML=r||"";for(q(u);u.firstChild;)p.insertBefore(u.firstChild,o);p.removeChild(o)}}v(k)}else{o=document.createElement("div");o.innerHTML=r.responseText;iui.insertPages(o.childNodes,k,a)}}},function(r){v(k);delete iui.req;if(!l||l(r)!==false)alert("There was an error loading this page.")})},insertPages:function(a,b,
f){for(var e=0;e<a.length;++e){var k=a[e];if(k.nodeType==1){k.sourceHref=f;k.remote=true}}var l;for(f=0;f<a.length;++f){e=a[f];if(e.nodeType==1)if(H(e)){if(!e.src||!(e.src in J)){k=document.createElement("script");if(e.src){++G;k.onload=P;k.src=e.src;J[e.src]=1}else k.appendChild(document.createTextNode(e.innerHTML));document.body.appendChild(k)}}else{x[e.sourceHref]=e;l||(l=e)}}if(a=l){b=[a,false,b];if(G)t=b;else iui.showPage.apply(iui,b)}else iui.showPage(null,false,b)},closeDialog:function(){if(iui.currentDialog){document.body.removeChild(w);
document.body.removeChild(iui.currentDialog);iui.currentDialog=null}},focusRow:function(a,b){iui.focusedRow&&iui.focusedRow.removeAttribute("focused");iui.focusedMenu&&iui.focusedMenu.parentNode.removeChild(iui.focusedMenu);iui.focusedRow=a;iui.focusedMenu=b;if(a){a.setAttribute("focused","true");b&&a.appendChild(b)}s(iui.currentDialog||iui.currentPage,"onfocusrow")},focusEditor:function(a,b,f){if(!(!a||a.nodeType!=1||!("form"in a)))if(b){if(a.getAttribute("unedited")=="true"){a.defaultText=a.value;
a.value="";a.removeAttribute("unedited")}}else if(f||a.defaultText&&a.value==""){if(a.defaultText)a.value=a.defaultText;a.setAttribute("unedited","true")}},alertMessage:function(a,b,f,e){if(iui.msgBox&&b!=iui.msgBox){iui.msgBox.parentNode.removeChild(iui.msgBox);delete iui.msgBox}if(a){iui.msgBox=b;b.innerHTML=a;if(e)e==-1?f.parentNode.insertBefore(b,f):f.parentNode.insertBefore(b,f.nextSibling);else{a=findNextElement(f,1,function(k){return k.hasAttribute("menu")});iui.focusRow(a,iui.focusedMenu);
f.parentNode.replaceChild(b,f)}show(b)}},showProgress:function(a,b,f){var e=iui.$("loadingBox");e.innerHTML=a;show(e,b);if(b)insertWhere(b,e,f);else e.parentNode&&e.parentNode.removeChild(e)},submitForm:function(a){if(!a||!a.action||!s(a,"onsend"))return false;var b=a.method||"POST";iui.showPageByHref(a.action,O(a),b,null,null,function(){return s(a,"onrespond",arguments)});return true},prepContent:function(a){q(a)},addListener:function(a,b){(z[a]||(z[a]=[])).push(b)},removeListener:function(a,b){var f=
z[a]||(z[a]=[]),e=f.indexOf(b);e!=-1&&f.splice(e,1)},dispatch:function(a){if(a=z[a])for(var b=0;b<a.length;++b)a[b]()}};addEventListener("load",function(){var a=d();setTimeout(function(){c(a);var b=document.createElement("div");b.id="preloader";document.body.appendChild(b);h()},0);setInterval(h,300)},false);addEventListener("focus",function(a){iui.focusEditor(a.target,true)},true);addEventListener("blur",function(a){setTimeout(function(){iui.focusEditor(a.target,false)},0)},true);addEventListener("click",
function(a){if(!y){var b=findParent(a.target,"a","u");if(b&&b.getAttribute("disabled")!="true"){B(b);var f=b.protocol&&b.protocol!="http:"||b.hostname&&b.hostname!=window.location.hostname,e=b.getAttribute("href")||"",k=b.getAttribute("target")||"",l=e[0]=="#"?e:null;if(e&&l&&l!="#")iui.showPage(iui.$(l.substr(1)),false,b);else if(b.getAttribute("type")=="submit")iui.submitForm(iui.currentDialog);else if(b.getAttribute("type")=="cancel")iui.closeDialog();else if(k=="_replace")iui.showPageByHref(e,
null,null,true,b);else if(!k&&e&&!f)iui.showPageByHref(e,null,null,null,b);else if(a.target.href&&e!="#")return;else if(e&&e!="#")window.location=e;a.preventDefault()}else if(a=findParentWithAttribute(a.target,"menu"))(b=iui.$(a.getAttribute("menu")))&&iui.focusRow(a,b)}},false);addEventListener("click",function(a){var b=findParent(a.target,"div");if(b&&hasClass(b,"toggle")){b.setAttribute("toggled",b.getAttribute("toggled")!="true");a.preventDefault()}},true)})();
function findParent(c){for(;c;){if(c.nodeType==1)for(var d=1;d<arguments.length;++d)if(c.localName.toLowerCase()==arguments[d])return c;c=c.parentNode}}function findChildByClass(c,d,h){for(c=c?c.firstChild:null;c&&(c.nodeType!=1||!hasClass(c,d,h));)c=c.nextSibling;return c}function getElementsByClass(c,d,h){var g=h?h:[];for(c=c.firstChild;c;c=c.nextSibling)if(c.nodeType==1)if(hasClass(c,d))g.push(c);else if(h)getElementsByClass(c,d,g);else break;return g}
function isAncestor(c,d){for(;c;){if(c==d)return true;c=c.parentNode}}function findParentWithAttribute(c,d){for(;c&&(c.nodeType!=1||!c.hasAttribute(d));)c=c.parentNode;return c}function findNextElement(c,d,h){d=d==-1?function(g){return g.previousSibling}:function(g){return g.nextSibling};for(c=c?d(c):null;c;c=d(c))if(c.nodeType==1&&h(c))return c}
function insertWhere(c,d,h){if(h)if(h==-1)c.parentNode.insertBefore(d,c);else if(h==1)c.parentNode.insertBefore(d,c.nextSibling);else d.parentNode!=c&&c.appendChild(d);else c.parentNode.replaceChild(d,c)}function show(c,d){c.style.display=d||d===undefined?"block":"none"}function hide(c){c.style.display="none"}function collapse(c,d){c.style.visibility=d?"collapse":"visible"}function hasClass(c,d,h){return RegExp(h?d:"(^|\\s)"+d+"($|\\s)").exec(c.getAttribute("class"))!=null}
function setClass(c,d,h){var g=RegExp("(^|\\s)"+d+"($|\\s)"),i=c.getAttribute("class");i||(i="");g=i.search(g);if(h)g==-1&&c.setAttribute("class",[i,d].join(" "));else g>=0&&c.setAttribute("class",i.substr(0,g)+i.substr(g+d.length+1))}function setAttr(c,d,h){h?c.setAttribute(d,h):c.removeAttribute(d)}
function ajax(c,d,h,g,i){var j=new XMLHttpRequest;j.onreadystatechange=function(){if(j.readyState==4)if(j.status==200||j.status==302)g(j);else i&&i(j)};j.onerror=function(){i&&i(j)};var m=[];if(h)for(var n in h)m.push((n?n+"=":"")+encodeURIComponent(h[n]));if(c.toUpperCase()=="POST"){j.open(c,d,true);j.setRequestHeader("Content-Type","application/x-www-form-urlencoded");j.send(m.join("&"))}else{if(m.length)d+="?"+m.join("&");j.open(c,d,true);j.send(null)}return j}
function $(c){return document.getElementById(c)}function ddd(){console.log.apply(console,arguments)}
(function(){function c(d,h){ajax("GET","ip_c.aspx",{v:d,id:h},function(g){g=stripBlocker(g.responseText);var i=$("resultsBox_"+d);if(g.length>0){i.innerHTML=g;show(i)}else hide(i)})}setInterval(refreshPage,6E5);window.tep={onSearchShowing:function(){},onSearch_KeyPress:function(d){$(d.id).value.length>=3?c(d.id,$(d.id).value):hide($("resultsBox_"+d.id))},LoginClicked:function(d,h){var g=$("login_email").value,i=$("login_password").value;if(g==""||i=="")alert("Please enter all fields !");else{this.mode=
h;this.sending=true;iui.showPageByHref("ip_c.aspx?v=login&rsv1={0}&rsv2={1}".replace("{0}",g).replace("{1}",i),null,false,null);this.sending=false;return true}},MsgDelete:function(d,h,g){this.mode=h;this.sending=true;confirm(langlist.Sure_Continue)&&iui.showPageByHref(g,null,false,null);this.sending=false;return true},MsgQuickDelete:function(d,h,g){this.mode=h;this.sending=true;confirm(langlist.Sure_Continue)&&iui.showPageByHref(g,null,false,null);this.sending=false;return true},SearchClicked:function(d,
h){var g=$("search_"+h).value;this.mode=h;this.sending=true;iui.showPageByHref("ip_c.aspx?v=text_srch_{0}&id={1}".replace("{0}",h).replace("{1}",g),null,false,null);this.sending=false;return true},HistoryBack:function(d){window.location="iphone#ip_c.aspx?id={0}&v=product_photos".replace("{0}",d)},SendQckMsgClicked:function(d,h,g){if(!this.sending){var i=$("qck_name"),j=$("qck_email"),m=$("qck_phone"),n=$("qck_message");if(i.getAttribute("unedited")||j.getAttribute("unedited")||m.getAttribute("unedited")||
n.getAttribute("unedited")||i.value==""||j.value==""||m.value==""||n.value=="")alert("Please enter all fields !");else{var A=d.innerHTML;d.innerHTML=g;ajax("GET","ip_c.aspx",{v:"txn_send_qck_msg",id:$("hdn_productuid").value,rsv1:i.value,rsv2:j.value,rsv3:m.value,rsv4:n.value},function(q){d.innerHTML=A;q=getdata(q.responseText);if(isSessionNull(q.response))gosignin();else if(q.response==0){i.value=j.value=m.value=n.value="";alert(q.response_text)}else showerrorlist(q.records)});this.sending=false;
return true}}},SendMsgClicked:function(d,h,g){if(!this.sending){var i=$("msg_content");i.value=i.getAttribute("unedited")?"":i.value;var j=d.innerHTML;d.innerHTML=g;ajax("GET","ip_c.aspx",{v:"txn_send_in_msg",id:$("msg_uid").value,rsv1:$("msg_subject").value,rsv2:i.value},function(m){d.innerHTML=j;m=getdata(m.responseText);if(isSessionNull(m.response))gosignin();else if(m.response==0){i.value="";alert(m.response_text)}else showerrorlist(m.records)});this.sending=false;return true}},SendNewMsgClicked:function(d,
h,g){if(!this.sending){var i=$("new_msg_subject"),j=$("new_msg_text");i.value=i.getAttribute("unedited")?"":i.value;j.value=j.getAttribute("unedited")?"":j.value;var m=d.innerHTML;d.innerHTML=g;ajax("GET","ip_c.aspx",{v:"txn_send_new_msg",id:$("new_msg_to").value,rsv1:i.value,rsv2:j.value},function(n){d.innerHTML=m;n=getdata(n.responseText);if(isSessionNull(n.response))gosignin();else if(n.response==0){i.value="";j.value="";alert(n.response_text)}else showerrorlist(n.records)});this.sending=false;
return true}},clearSearch:function(){iui.focusEditor($("searchBox"),false,true);$("search").setAttribute("mode","phonebook");this.search.reset()}};addEventListener("focus",function(d){if(d.target.form&&!iui.currentDialog)if(d=getElementsByClass(iui.currentPage,"editorBar",[])[0]){hasClass(d,"autoHide")&&show(d);d.scrollIntoView()}},true);addEventListener("blur",function(){if(!iui.currentDialog){var d=getElementsByClass(iui.currentPage,"editorBar",[])[0];d&&hasClass(d,"autoHide")&&setTimeout(function(){hide(d)},
500)}},true);addEventListener("click",function(d){if(d.target.className=="requestsLink"){var h=document.body.getAttribute("requestCount")=="0";d.target.setAttribute("disabled",h)}},true)})();function stripBlocker(c){return c.substr(9)}function getForm(){return iui.currentPage.getElementsByTagName("form")[0]}function getFormId(c){return(c=findParentWithAttribute(c,"post_form_id"))?c.getAttribute("post_form_id"):null}
function disableForm(c,d){for(var h in{input:0,textarea:0})for(var g=c.getElementsByTagName(h),i=0;i<g.length;++i)g[i].disabled=d}function insertSource(c,d,h){var g=document.createElement(c.localName);g.innerHTML=d;for(iui.prepContent(g);g.firstChild;)c.insertBefore(g.firstChild,h)}function refreshPage(){iui.currentPage.getAttribute("autoRefresh")=="true"&&iui.refresh()}
function QuickSearch(c,d,h){function g(){d.removeEventListener("blur",g,false);clearInterval(j);i.req&&i.req.abort();d.getAttribute("resetSearch")=="true"&&i.reset()}this.resultsBox=c;this.searchBox=d;this.lastSearchText="";this.args=h;var i=this,j;d.onfocus=function(){j=setInterval(update,500);d.addEventListener("blur",g,false)};this.reset=function(){iui.showProgress();iui.focusRow();iui.focusEditor(this.searchBox,false,true);this.resultsBox.innerHTML=this.lastSearchText=""}}
function disableForm(c,d){for(var h in{input:0,textarea:0})for(var g=c.getElementsByTagName(h),i=0;i<g.length;++i)g[i].disabled=d}function encodeForm(c){for(var d={},h=0;h<c.elements.length;++h){var g=c.elements[h];if(g.name)d[g.name]=g.value}return d}function getdata(c){return eval_parse((c.hasOwnProperty("d")?c.d:c).split("while(1);")[1])}function eval_parse(c){return typeof JSON!=="undefined"&&typeof JSON.parse==="function"?JSON.parse(c):eval("("+c+")")}
function showerrorlist(c){for(var d=[],h=c.length,g=0;g<h;g++)d[g]=c[g].description;alert(d.join("\r\n"))}function isSessionNull(c){return c=="99"}function gosignin(){alert(langlist.Login_First);window.location="iphone#ip_c.aspx?v=mmbr_home"};