Object.prototype.extend=function(A){return Object.extend.apply(this,[this,A]);
};
Function.prototype.bindAsObserver=function(){var A=this,C=$A(arguments),B=C.shift();
return function(D){C.unshift(D||window.event);
try{return A.apply(B,C);
}finally{C.shift();
}};
};
function gup(B,E){B=B.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");
var A="[\\?&]"+B+"=([^&#]*)";
var D=new RegExp(A);
var C=D.exec(window.location.href);
if(C==null){return E?E:"";
}else{return decodeURIComponent(C[1].replace("+"," "));
}}function getFragment(B){if(B){var A=B.split("#");
A.shift();
if(A.length>0){return A.join("#");
}}return null;
}function getQuery(B){if(B){var A=B.split("?");
A.shift();
A=A.join("?").split("#");
if(A.length>0){return A.shift();
}}return null;
}function startHere(A){try{WindowUtil._referrer_url=gup("_referrer_url");
WindowUtil._iframe_id=gup("_iframe_id");
WindowUtil._resize=A||gup("_resize","true");
WindowUtil._edit=gup("edit","false");
DDMenu.setupIE();
if(Util.isDefined(window.Behaviour)){Behaviour.apply();
}CSSUtil.setBrowserSelector();
}finally{WindowUtil.resetSize();
try{parent.scrollTo(0,0);
}catch(B){}}}var Tabs={handleClick:function(A,C){if(A){var B=-1;
var I=A.parentNode;
var G=ProtoView.$childrenByName(I,"A");
for(var F=0;
F<G.length;
F++){Element.removeClassName(G[F],"selected");
if(A==G[F]){B=F;
}}Element.addClassName(A,"selected");
var E=A.parentNode.parentNode;
var D=ProtoView.$childById(E,"tabs-contents");
var H=ProtoView.$childrenByName(D,"div");
for(var F=0;
F<H.length;
F++){Element.hide(H[F]);
}Element.show(H[B]);
if(C&&_gaq){_gaq.push(["_trackEvent",C,"click"]);
}}}};
var ToggleAndTrack={doIt:function(E,B){if(B){for(var C=0;
C<B.length;
C++){Element.hide(B[C]);
}}var D=document.getElementById(E);
if(D){if(D.style.display!="none"){D.style.display="none";
}else{D.style.display="";
if(_gaq){_gaq.push(["_trackEvent",E,"click"]);
}}var A=document.getElementById(E+"-h3");
if(Element.hasClassName(A,"s-collapsed")){Element.removeClassName(A,"s-collapsed");
Element.addClassName(A,"s-expanded");
}else{Element.removeClassName(A,"s-expanded");
Element.addClassName(A,"s-collapsed");
}}},showPartnerInfo:function(C){if(C){var B=C.parentNode;
if(B){var A=ProtoView.$childByClass(B,"partner-detail");
if(A){if(A.style.display!="none"){A.style.display="none";
Element.removeClassName(B,"s-expanded");
Element.addClassName(B,"s-collapsed");
}else{A.style.display="";
Element.removeClassName(B,"s-collapsed");
Element.addClassName(B,"s-expanded");
}}}}}};
var WindowUtil={_referrer_url:null,_iframe_id:null,_pubHeight:-1,_pubWidth:-1,_resize:"true",_edit:null,_scrollWidth:null,_refreshTime:-1,showAndReset:function(A){Element.show(A);
},hideAndReset:function(A){Element.hide(A);
},calculateFrameSize:function(){var A=document.getElementById("center-cell");
if(A){var C=A.parentNode.scrollWidth;
var D=A.scrollHeight;
if(window.UberController&&UberController.editMode){var E=document.getElementById("f-toolbox");
D=Math.max(A.scrollHeight,E?E.scrollHeight:0);
}return[D,C];
}else{var B=document.getElementById("center-content");
if(B){return[B.scrollHeight,B.scrollWidth];
}}return null;
},resetSize:function(){if(WindowUtil._resize=="false"){return ;
}var D=WindowUtil.calculateFrameSize();
if(!D||(D[0]==0&&D[1]==0)){return ;
}var F=WindowUtil._resize=="true"||WindowUtil._resize=="vert"?D[0]:-1;
var B=WindowUtil._resize=="true"||WindowUtil._resize=="horz"?D[1]:-1;
if(WindowUtil._resize=="vert"){F+=WindowUtil.getScrollBarWidth()+16;
if(WindowUtil._edit=="true"){F+=400;
}}else{if(WindowUtil._resize=="horz"){B+=WindowUtil.getScrollBarWidth()+20;
}else{if(WindowUtil._resize=="true"){B+=WindowUtil.getScrollBarWidth()+8;
F+=WindowUtil.getScrollBarWidth()+8;
if(WindowUtil._edit=="true"){F+=0;
}}}}var C=true;
try{var G=window.frameElement;
if(G){var E=G.style.height||"0px";
var A=G.style.width||"0px";
C=false;
if(E.substr(0,E.length-2)!=(""+F)||A.substr(0,A.length-2)!=(""+B)){if(F>0){G.style.height=F+"px";
}if(B>0){G.style.width=B+"px";
}if(WindowUtil._resize=="true"){window.scrollTo(0,0);
}}}}catch(H){C=true;
}if(C){if(WindowUtil._referrer_url&&WindowUtil._referrer_url.length>0&&WindowUtil._iframe_id&&WindowUtil._iframe_id.length>0){if(F!=WindowUtil._pubHeight||B!=WindowUtil._pubWidth){if(!F){F=WindowUtil._pubHeight;
}if(!B){B=WindowUtil._pubWidth;
}parent.location.replace(WindowUtil._referrer_url+"#"+B+":"+F+":"+WindowUtil._iframe_id);
WindowUtil._pubHeight=F;
WindowUtil._pubWidth=B;
if(WindowUtil._resize=="true"){window.scrollTo(0,0);
}}}}setTimeout(WindowUtil.resetSize,100);
},setupAutoRefresh:function(A){WindowUtil._refreshTime=A;
setTimeout(WindowUtil.autoRefresh,WindowUtil._refreshTime);
},autoRefresh:function(){if(WindowUtil._refreshTime<0){return ;
}window.location.reload(true);
setTimeout(WindowUtil.autoRefresh,WindowUtil._refreshTime);
},getScrollBarWidth:function(){if(WindowUtil._scrollWidth){return WindowUtil._scrollWidth;
}var C=document.createElement("p");
C.style.width="100%";
C.style.height="200px";
var D=document.createElement("div");
D.style.position="absolute";
D.style.top="0px";
D.style.left="0px";
D.style.visibility="hidden";
D.style.width="200px";
D.style.height="150px";
D.style.overflow="hidden";
D.appendChild(C);
document.body.appendChild(D);
var B=C.offsetWidth;
D.style.overflow="scroll";
var A=C.offsetWidth;
if(B==A){A=D.clientWidth;
}document.body.removeChild(D);
WindowUtil._scrollWidth=(B-A);
return WindowUtil._scrollWidth;
},visible:function(A){return A.style.display!="none";
},toggle:function(B){if(Util.isArray(B)){for(var A=0;
A<B.length;
A++){WindowUtil.doToggle(B[A]);
}}else{WindowUtil.doToggle(B);
}},doToggle:function(B){var A=document.getElementById(B);
if(A){if(WindowUtil.visible(A)){A.style.display="none";
}else{A.style.display="";
}}},toggleAndSet:function(C,A){if(Util.isArray(C)){for(var B=0;
B<C.length;
B++){WindowUtil.doToggleAndSet(C[B],A);
}}else{WindowUtil.doToggleAndSet(C,A);
}},doToggleAndSet:function(C,A){var B=document.getElementById(C);
if(B){if(WindowUtil.visible(B)){B.style.display="none";
Element.removeClassName(A,"s-expanded");
Element.addClassName(A,"s-collapsed");
}else{B.style.display="";
Element.removeClassName(A,"s-collapsed");
Element.addClassName(A,"s-expanded");
}}},hide:function(B){var A=document.getElementById(B);
if(A){A.style.display="none";
}},disableEnter:function(C){var A;
if(window.event){A=window.event.keyCode;
}else{A=C.which;
}if(A!=Event.KEY_RETURN){return true;
}var B=Event.element(C);
if(B.nodeName.toLowerCase()=="textarea"){return true;
}else{return false;
}},IEBody:function(A){A=A||window;
if(A.document.compatMode&&document.compatMode!="BackCompat"){return A.document.documentElement;
}else{return A.document.body;
}},truePosition:function(){return(window.innerHeight?window.pageYOffset:WindowUtil.IEBody().scrollTop);
}};
var DDMenu={setupIE:function(){if(document.all&&document.getElementById){var C=document.getElementById("sn");
if(!C){return ;
}for(var A=0;
A<C.childNodes.length;
A++){var B=C.childNodes[A];
if(B.nodeName=="LI"){B.onmouseover=function(){this.className+=" over";
};
B.onmouseout=function(){this.className=this.className.replace("over","");
};
}}}}};
var ShareForm={showCode:function(A){Element.hide("share-code-link");
Element.hide("share-code-page");
Element.hide("share-code-iframe");
Element.hide("share-code-embed");
Element.hide("share-code-form");
Element.hide("share-code-googlegadget");
Element.hide("share-instructions-link");
Element.hide("share-instructions-page");
Element.hide("share-instructions-iframe");
Element.hide("share-instructions-embed");
Element.hide("share-instructions-form");
Element.hide("share-instructions-googlegadget");
Element.removeClassName("share-links-link","s-selected");
Element.removeClassName("share-links-page","s-selected");
Element.removeClassName("share-links-iframe","s-selected");
Element.removeClassName("share-links-embed","s-selected");
Element.removeClassName("share-links-form","s-selected");
Element.removeClassName("share-links-googlegadget","s-selected");
Element.show("share-code-"+A);
Element.show("share-instructions-"+A);
Element.addClassName("share-links-"+A,"s-selected");
return false;
}};
var ShareFlow={showCode:function(A){Element.hide("share-code-link");
Element.hide("share-code-page");
Element.hide("share-code-embed");
Element.hide("share-code-flow");
Element.hide("share-code-googlegadget");
Element.hide("share-instructions-link");
Element.hide("share-instructions-page");
Element.hide("share-instructions-embed");
Element.hide("share-instructions-flow");
Element.hide("share-instructions-googlegadget");
Element.removeClassName("share-links-link","s-selected");
Element.removeClassName("share-links-page","s-selected");
Element.removeClassName("share-links-embed","s-selected");
Element.removeClassName("share-links-flow","s-selected");
Element.removeClassName("share-links-googlegadget","s-selected");
Element.show("share-code-"+A);
Element.show("share-instructions-"+A);
Element.addClassName("share-links-"+A,"s-selected");
return false;
}};
var ShareTasks={showCode:function(A){Element.hide("share-code-link");
Element.hide("share-code-embed");
Element.hide("share-code-googlegadget");
Element.hide("share-instructions-link");
Element.hide("share-instructions-embed");
Element.hide("share-instructions-googlegadget");
Element.removeClassName("share-links-link","s-selected");
Element.removeClassName("share-links-embed","s-selected");
Element.removeClassName("share-links-googlegadget","s-selected");
Element.show("share-code-"+A);
Element.show("share-instructions-"+A);
Element.addClassName("share-links-"+A,"s-selected");
return false;
}};
function insertBefore(C,A){var B=A.parentNode;
B.insertBefore(C,A);
}function insertAfter(C,A){var B=A.parentNode;
if(B.lastChild==A){B.appendChild(C);
}else{B.insertBefore(C,A.nextSibling);
}}function insertFirst(B,A){if(A){if(A.hasChildNodes()){A.insertBefore(B,A.firstChild);
}else{A.appendChild(B);
}}}function removeAllChildren(B){for(var A=(B.childNodes.length-1);
A>-1;
A--){B.removeChild(B.childNodes[A]);
}}function setId(A,B){A.id=B;
}function debugPrint(B){var A=$("debugPrint");
if(A){A.innerHTML=B+"<br/>"+$("debugPrint").innerHTML;
}}function clearDebugPrint(){var A=$("debugPrint");
if(A){A.innerHTML="";
}return false;
}function setCursor(A,B){Element.setStyle(A,$H({cursor:B}));
}function getRelatedTarget(A){if(!A){var A=window.event;
}if(A.relatedTarget){return A.relatedTarget;
}else{if(A.type.toLowerCase()=="mouseover".toLowerCase()){return A.fromElement;
}else{if(A.type.toLowerCase()=="mouseout".toLowerCase()){return A.toElement;
}}}}function isParent(A,B){if(A==null){return false;
}while(A!=null){if(A.parentNode==B){return true;
}A=A.parentNode;
}return false;
}function ignoreMouseEvent(A,C){var B=getRelatedTarget(A);
try{if(B==C){return true;
}if(isParent(B,C)){return true;
}}catch(D){return true;
}return false;
}function addScript(A,B){if(null==A.canHaveChildren||A.canHaveChildren){A.appendChild(document.createTextNode(B));
}else{A.scriptText=B;
}}var CSSUtil={setBrowserSelector:function(){var B=navigator.userAgent.toLowerCase(),D=function(G){return B.indexOf(G)!=-1;
},C=document.getElementsByTagName("html")[0],A=(!(/opera|webtv/i.test(B))&&/msie (\d)/.test(B))?("ie ie"+RegExp.$1):D("gecko/")?"gecko":D("opera/9")?"opera opera9":/opera (\d)/.test(B)?"opera opera"+RegExp.$1:D("konqueror")?"konqueror":D("applewebkit/")?"webkit safari":D("mozilla/")?"gecko":"",E=(D("x11")||D("linux"))?" linux":D("mac")?" mac":D("win")?" win":"";
var F=A+E+" js";
C.className+=C.className?" "+F:F;
}};
var Util={idCounter:0,makeId:function(){return"e-generated-id"+this.idCounter++;
},isFunction:function(A){return typeof A=="function";
},isNull:function(A){return typeof A=="object"&&!A;
},isNumber:function(A){return typeof A=="number"&&isFinite(A);
},isObject:function(A){return(A&&typeof A=="object")||this.isFunction(A);
},isString:function(A){return typeof A=="string";
},isUndefined:function(A){return typeof A=="undefined";
},isDefined:function(A){return typeof A!="undefined";
},isArray:function(A){return this.isObject(A)&&A.constructor==Array;
},plusRegex:new RegExp("\\+","g"),escapePlus:function(A){A=encodeURIComponent(A);
return A.replace(this.plusRegex,"%2B");
},zero:function(A){A=parseInt(A);
return(!isNaN(A)?A:0);
}};
var AjaxRequest={send:function(A,B){B.contentType="application/x-www-form-urlencoded;charset=utf-8";
B.originalOnSuccess=B.onSuccess;
B.originalOnFailure=B.onFailure;
B.onSuccess=function(F,E,D,C){try{if(F.responseText&&(F.responseText.indexOf("page-login")>0)){document.location.href=document.location.href;
}else{if(F.responseText&&(F.responseText.indexOf("page-error")>0)){LightBoxView.showInfoDialog(ProtoView.makeNode("<span>"+LocaleStrings.sessionexpired+"</span>"),"Error");
}else{if(D.originalOnSuccess){if(debugPrint&&C){debugPrint(C);
}D.originalOnSuccess(F,E,D);
}}}}finally{Mutex.decrement();
}};
B.onFailure=function(F,E,D,C){try{if(F.responseText&&(F.responseText.indexOf("page-login")>0)){document.location.href=document.location.href;
}else{if(D.originalOnFailure){if(C){debugPrint(C);
}D.originalOnFailure(F,E,D);
}}}finally{Mutex.decrement();
}};
Mutex.increment();
new Ajax.Request(A,B);
},showError:function(B,C,A){if(A){LightBoxView.showWaitDialog(ProtoView.makeNode(C),C);
w=window;
setTimeout(function(){LightBoxView.hideWaitDialog();
w.location.reload(true);
},5000);
}else{LightBoxView.showInfoDialog(ProtoView.makeNode(B),C);
}}};
var Mutex={pendingRequestCounter:0,increment:function(){Mutex.pendingRequestCounter++;
},decrement:function(){Mutex.pendingRequestCounter--;
},checkCounter:function(){if(Mutex.pendingRequestCounter==0){return true;
}else{return false;
}}};
var FormInputs={getInputs:function(B){var A=new Array();
A=A.concat($A(B.getElementsByTagName("input")),$A(B.getElementsByTagName("select")),$A(B.getElementsByTagName("textarea")));
return A;
},is:function(B){var A=B.tagName;
if(tagName=="input"||tagName=="select"||tagName=="textarea"){return true;
}return false;
}};
function cloneElement(C){var D=C.cloneNode(true);
var B=document.createElement("div");
B.appendChild(D);
var A=document.createElement("div");
A.innerHTML=B.innerHTML;
return A.firstChild;
}function showInViewPort(A){A=$(A);
Position.prepare();
var B=(Position.cumulativeOffset(A)[1]+A.clientHeight)-(getPageHeight()+Position.deltaY);
if(B>0){B=A.clientHeight-getPageHeight()+32;
new Effect.ScrollTo(A,{offset:B,duration:0.3});
}}function getPageHeight(){var B=0;
var A=0;
if(typeof (window.innerWidth)=="number"){B=window.innerWidth;
A=window.innerHeight;
}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){B=document.documentElement.clientWidth;
A=document.documentElement.clientHeight;
}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){B=document.body.clientWidth;
A=document.body.clientHeight;
}}}return A;
}var newForm={templates:null,setTemplate:function(B,C,A,D){if(C){WizardController.data.templateId=C;
}else{WizardController.data.templateId="";
}if(D){document.getElementById("template-info-head").innerHTML=A;
document.getElementById("template-info-desc").innerHTML=D;
}},setApplication:function(A,B){WizardController.data.application=A[B].value;
},setTheme:function(A,B){WizardController.data.theme=A[B].value;
var C=A[B].getAttribute("thumbnail");
if(C){document.getElementById("theme-thumbnail-img").src=C.replace(" ","");
}},setFormName:function(A){WizardController.data.formname=A;
},setWidth:function(A,B){WizardController.data.width=A[B].value;
},setControlLayout:function(A,B){WizardController.data.controlLayout=A[B].value;
},setFontName:function(A,B){WizardController.data.fontname=A[B].value;
},setFontSize:function(A,B){WizardController.data.fontsize=A[B].value;
},setFontColor:function(A){WizardController.data.fontcolour=A;
},setEmail:function(A){WizardController.data.email=A;
},setThankYou:function(A){WizardController.data.thankyou=A;
},setUri:function(A){WizardController.data.uri=A;
}};
var savedForms={setSubmissionId:function(A,B){WizardController.data.submissionId=A[B].value;
}};
var customControl={handleRule:function(C,D){var E=WizardController.data.rules;
if(!E){WizardController.data.rules=[];
}if(C){WizardController.data.rules.push(D);
var B=$("read-only");
if(B){B.disabled=true;
B.options[0].selected=true;
WizardController.data.readOnly=true;
}}else{var A=WizardController.data.rules.indexOf(D);
if(A>=0){WizardController.data.rules[A]=null;
WizardController.data.rules=WizardController.data.rules.compact();
}if(WizardController.data.rules.length==0){var B=$("read-only");
if(B){B.disabled=false;
}WizardController.data.readOnly=true;
}}}};
var auth={setUserName:function(A){WizardController.data.userName=A;
},setPassword:function(A){WizardController.data.password=A;
},setTenantId:function(A){WizardController.data.tenantId=A;
}};
var AbsolutePositioner={display:function(B,E,C,A){E.style.position="absolute";
E.style.visibility="visible";
E.style.display="block";
E.style.zIndex=10000;
var D=this.calculatePosition(B,E,C,A);
E.style.left=D.x+"px";
E.style.top=D.y+"px";
},undisplay:function(A){if(A){A.style.visibility="";
A.style.display="";
A.style.zIndex="";
A.style.left="";
A.style.top="";
A.style.position="";
}},calculatePosition:function(D,C,L,M){if(!M){M=0;
}var B=Position.cumulativeOffset(D);
var A=Element.getDimensions(D);
var G=B[0]+A.width/2;
var E=B[1]+A.height/2;
var N=Element.getDimensions(C).width;
var I=Element.getDimensions(C).height;
var K=new Object();
K.valid=true;
if(Position.within(L,G+M+N,E+I)){K.x=G+M;
K.y=E;
}else{if(Position.within(L,G+M+N,E-M-I)){K.x=G+M;
K.y=E-I;
}else{if(Position.within(L,G-M-N,E-M-I)){K.x=G-M-N;
K.y=E-I;
}else{if(Position.within(L,G-M-N,E+M+I)){K.x=G-M-N;
K.y=E;
}else{if(Position.within(L,G+M,E-I/2)&&Position.within(L,G+M+N,E+I/2)){K.x=G+M;
K.y=E-I/2;
}else{if(Position.within(L,G-N/2,E+M)&&Position.within(L,G+N/2,E+M+I)){K.x=G-N/2;
K.y=E+M;
}else{if(Position.within(L,G-M-N,E-I/2)&&Position.within(L,G-M,E+I/2)){K.x=G-M-N;
K.y=E-I/2;
}else{if(Position.within(L,G-N/2,E-M-I)&&Position.within(L,G+N/2,E-M)){K.x=G-N/2;
K.y=E-M-I;
}else{var J=Position.cumulativeOffset(L);
var F=(J[1]+L.offsetHeight)/2;
var H=(J[0]+L.offsetWidth)/2;
K.x=H-N/2;
K.y=F-I/2;
}}}}}}}}return K;
}};
var frevvoContext=document.getElementById("frevvo.context");
if(frevvoContext){frevvoContext=frevvoContext.content;
}function createCookie(C,D,E){path=frevvoContext||"/";
if(E){var B=new Date();
B.setTime(B.getTime()+(E*24*60*60*1000));
var A="; expires="+B.toGMTString();
}else{var A="";
}document.cookie=C+"="+D+A+"; path="+path;
}function readCookie(B){var D=B+"=";
var A=document.cookie.split(";");
for(var C=0;
C<A.length;
C++){var E=A[C];
while(E.charAt(0)==" "){E=E.substring(1,E.length);
}if(E.indexOf(D)==0){return E.substring(D.length,E.length);
}}return null;
}function eraseCookie(A){createCookie(A,"",-1);
}function toggleVisible(A){$A(A).each(function(B){Element.toggle(B);
});
}function toggleClassName(B,A){$A(B).each(function(C){if(Element.hasClassName(C,A)){Element.removeClassName(C,A);
}else{Element.addClassName(C,A);
}});
}function indexOf(A,C){for(var B=0;
B<A.length;
B++){if(A[B]==C){return B;
}}return -1;
}
