Object.prototype.extend=function(_1){
return Object.extend.apply(this,[this,_1]);
};
Function.prototype.bindAsObserver=function(){
var _2=this,_3=$A(arguments),_4=_3.shift();
return function(_5){
_3.unshift(_5||window.event);
try{
return _2.apply(_4,_3);
}
finally{
_3.shift();
}
};
};
function gup(_6,_7){
_6=_6.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");
var _8="[\\?&]"+_6+"=([^&#]*)";
var _9=new RegExp(_8);
var _a=_9.exec(window.location.href);
if(_a==null){
return _7?_7:"";
}else{
return decodeURIComponent(_a[1].replace("+"," "));
}
}
function getFragment(_b){
if(_b){
var _c=_b.split("#");
_c.shift();
if(_c.length>0){
return _c.join("#");
}
}
return null;
}
function getQuery(_d){
if(_d){
var _e=_d.split("?");
_e.shift();
_e=_e.join("?").split("#");
if(_e.length>0){
return _e.shift();
}
}
return null;
}
function startHere(_f){
try{
WindowUtil._referrer_url=gup("_referrer_url");
WindowUtil._iframe_id=gup("_iframe_id");
WindowUtil._resize=_f||gup("_resize","true");
WindowUtil._edit=gup("edit","false");
DDMenu.setupIE();
if(Util.isDefined(window.Behaviour)){
Behaviour.apply();
}
CSSUtil.setBrowserSelector();
CycleLogos.startCycle();
}
finally{
WindowUtil.resetSize();
}
}
var CycleLogos={logos:[],counter:0,current:null,startCycle:function(){
try{
var _10=$("logos-cycle");
}
catch(e){
return;
}
if(!_10){
return;
}
this.logos=ProtoView.$childrenByName(_10,"div");
setTimeout(CycleLogos.cycle,4000);
},cycle:function(){
var _11=CycleLogos.logos[CycleLogos.counter];
CycleLogos.counter++;
if(CycleLogos.counter==CycleLogos.logos.length){
CycleLogos.counter=0;
}
Effect.Fade(_11,{duration:2,afterFinish:function(){
Effect.Appear(CycleLogos.logos[CycleLogos.counter],{duration:2,afterFinish:function(){
setTimeout(CycleLogos.cycle,4000);
}});
}});
},fadeOut:function(){
}};
var Tabs={handleClick:function(el){
if(el){
var _13=-1;
var _14=el.parentNode;
var _15=ProtoView.$childrenByName(_14,"A");
for(var i=0;i<_15.length;i++){
Element.removeClassName(_15[i],"selected");
if(el==_15[i]){
_13=i;
}
}
Element.addClassName(el,"selected");
var _17=el.parentNode.parentNode;
var _18=ProtoView.$childById(_17,"tabs-contents");
var _19=ProtoView.$childrenByName(_18,"div");
for(var i=0;i<_19.length;i++){
Element.hide(_19[i]);
}
Element.show(_19[_13]);
}
}};
var WindowUtil={_referrer_url:null,_iframe_id:null,_pubHeight:-1,_pubWidth:-1,_resize:"true",_edit:null,_scrollWidth:null,showAndReset:function(el){
Element.show(el);
},hideAndReset:function(el){
Element.hide(el);
},calculateFrameSize:function(){
var _1c=document.getElementById("center-cell");
if(_1c){
var w=_1c.parentNode.scrollWidth;
var h=_1c.scrollHeight;
if(window["UberController"]&&UberController.editMode){
var _1f=document.getElementById("f-toolbox");
h=Math.max(_1c.scrollHeight,_1f?_1f.scrollHeight:0);
}
return [h,w];
}else{
var _20=document.getElementById("center-content");
if(_20){
return [_20.scrollHeight,_20.scrollWidth];
}
}
return null;
},resetSize:function(){
if(WindowUtil._resize=="false"){
return;
}
var _21=WindowUtil.calculateFrameSize();
if(!_21){
return;
}
var h=WindowUtil._resize=="true"||WindowUtil._resize=="vert"?_21[0]:null;
var w=WindowUtil._resize=="true"||WindowUtil._resize=="horz"?_21[1]:null;
if(WindowUtil._resize=="vert"){
h+=WindowUtil.getScrollBarWidth()+16;
if(WindowUtil._edit=="true"){
h+=400;
}
}else{
if(WindowUtil._resize=="horz"){
w+=WindowUtil.getScrollBarWidth()+20;
}else{
if(WindowUtil._resize=="true"){
w+=WindowUtil.getScrollBarWidth();
h+=WindowUtil.getScrollBarWidth()+8;
if(WindowUtil._edit=="true"){
h+=0;
}
}
}
}
var _24=true;
try{
var f=window.frameElement;
if(f){
var ch=f.style.height||"0px";
var cw=f.style.width||"0px";
_24=false;
if(ch.substr(0,ch.length-2)!=h||cw.substr(0,cw.length-2)!=w){
if(h){
f.style.height=h+"px";
}
if(w){
f.style.width=w+"px";
}
if(WindowUtil._resize=="true"){
window.scrollTo(0,0);
}
}
}
}
catch(e){
_24=true;
}
if(_24){
if(WindowUtil._referrer_url&&WindowUtil._referrer_url.length>0&&WindowUtil._iframe_id&&WindowUtil._iframe_id.length>0){
if(h!=WindowUtil._pubHeight||w!=WindowUtil._pubWidth){
if(!h){
h=WindowUtil._pubHeight;
}
if(!w){
w=WindowUtil._pubWidth;
}
parent.location.replace(WindowUtil._referrer_url+"#"+w+":"+h+":"+WindowUtil._iframe_id);
WindowUtil._pubHeight=h;
WindowUtil._pubWidth=w;
if(WindowUtil._resize=="true"){
window.scrollTo(0,0);
}
}
}
}
setTimeout(WindowUtil.resetSize,300);
},getScrollBarWidth:function(){
if(WindowUtil._scrollWidth){
return WindowUtil._scrollWidth;
}
var _28=document.createElement("p");
_28.style.width="100%";
_28.style.height="200px";
var _29=document.createElement("div");
_29.style.position="absolute";
_29.style.top="0px";
_29.style.left="0px";
_29.style.visibility="hidden";
_29.style.width="200px";
_29.style.height="150px";
_29.style.overflow="hidden";
_29.appendChild(_28);
document.body.appendChild(_29);
var w1=_28.offsetWidth;
_29.style.overflow="scroll";
var w2=_28.offsetWidth;
if(w1==w2){
w2=_29.clientWidth;
}
document.body.removeChild(_29);
WindowUtil._scrollWidth=(w1-w2);
return WindowUtil._scrollWidth;
},visible:function(el){
return el.style.display!="none";
},toggle:function(s){
if(Util.isArray(s)){
for(var i=0;i<s.length;i++){
WindowUtil.doToggle(s[i]);
}
}else{
WindowUtil.doToggle(s);
}
},doToggle:function(s){
var el=document.getElementById(s);
if(el){
if(WindowUtil.visible(el)){
el.style.display="none";
}else{
el.style.display="";
}
}
},hide:function(s){
var el=document.getElementById(s);
if(el){
el.style.display="none";
}
},disableEnter:function(e){
var key;
if(window.event){
key=window.event.keyCode;
}else{
key=e.which;
}
if(key!=Event.KEY_RETURN){
return true;
}
var el=Event.element(e);
if(el.nodeName.toLowerCase()=="textarea"){
return true;
}else{
return false;
}
},IEBody:function(w){
w=w||window;
if(w.document.compatMode&&document.compatMode!="BackCompat"){
return w.document.documentElement;
}else{
return w.document.body;
}
},truePosition:function(){
return (window.innerHeight?window.pageYOffset:WindowUtil.IEBody().scrollTop);
}};
var DDMenu={setupIE:function(){
if(document.all&&document.getElementById){
var sn=document.getElementById("sn");
if(!sn){
return;
}
for(var i=0;i<sn.childNodes.length;i++){
var _39=sn.childNodes[i];
if(_39.nodeName=="LI"){
_39.onmouseover=function(){
this.className+=" over";
};
_39.onmouseout=function(){
this.className=this.className.replace("over","");
};
}
}
}
}};
var ShareForm={showCode:function(_3a){
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-instructions-link");
Element.hide("share-instructions-page");
Element.hide("share-instructions-iframe");
Element.hide("share-instructions-embed");
Element.hide("share-instructions-form");
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.show("share-code-"+_3a);
Element.show("share-instructions-"+_3a);
Element.addClassName("share-links-"+_3a,"s-selected");
return false;
}};
function insertBefore(_3b,_3c){
var _3d=_3c.parentNode;
_3d.insertBefore(_3b,_3c);
}
function insertAfter(_3e,_3f){
var _40=_3f.parentNode;
if(_40.lastChild==_3f){
_40.appendChild(_3e);
}else{
_40.insertBefore(_3e,_3f.nextSibling);
}
}
function insertFirst(_41,_42){
if(_42){
if(_42.hasChildNodes()){
_42.insertBefore(_41,_42.firstChild);
}else{
_42.appendChild(_41);
}
}
}
function removeAllChildren(_43){
for(var i=(_43.childNodes.length-1);i>-1;i--){
_43.removeChild(_43.childNodes[i]);
}
}
function setId(_45,id){
_45.id=id;
}
function debugPrint(_47){
var _48=$("debugPrint");
if(_48){
_48.innerHTML=_47+"<br/>"+$("debugPrint").innerHTML;
}
}
function clearDebugPrint(){
var _49=$("debugPrint");
if(_49){
_49.innerHTML="";
}
return false;
}
function setCursor(el,_4b){
Element.setStyle(el,$H({"cursor":_4b}));
}
function getRelatedTarget(e){
if(!e){
var e=window.event;
}
if(e.relatedTarget){
return e.relatedTarget;
}else{
if(e.type.toLowerCase()=="mouseover".toLowerCase()){
return e.fromElement;
}else{
if(e.type.toLowerCase()=="mouseout".toLowerCase()){
return e.toElement;
}
}
}
}
function isParent(_4d,_4e){
if(_4d==null){
return false;
}
while(_4d!=null){
if(_4d.parentNode==_4e){
return true;
}
_4d=_4d.parentNode;
}
return false;
}
function ignoreMouseEvent(evt,el){
var _51=getRelatedTarget(evt);
try{
if(_51==el){
return true;
}
if(isParent(_51,el)){
return true;
}
}
catch(e){
return true;
}
return false;
}
function addScript(_52,_53){
if(null==_52.canHaveChildren||_52.canHaveChildren){
_52.appendChild(document.createTextNode(_53));
}else{
_52.scriptText=_53;
}
}
var CSSUtil={setBrowserSelector:function(){
var ua=navigator.userAgent.toLowerCase(),is=function(t){
return ua.indexOf(t)!=-1;
},h=document.getElementsByTagName("html")[0],b=(!(/opera|webtv/i.test(ua))&&/msie (\d)/.test(ua))?("ie ie"+RegExp.$1):is("gecko/")?"gecko":is("opera/9")?"opera opera9":/opera (\d)/.test(ua)?"opera opera"+RegExp.$1:is("konqueror")?"konqueror":is("applewebkit/")?"webkit safari":is("mozilla/")?"gecko":"",os=(is("x11")||is("linux"))?" linux":is("mac")?" mac":is("win")?" win":"";
var c=b+os+" js";
h.className+=h.className?" "+c:c;
}};
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(s){
s=encodeURIComponent(s);
return s.replace(this.plusRegex,"%2B");
},zero:function(v){
v=parseInt(v);
return (!isNaN(v)?v:0);
}};
var AjaxRequest={send:function(_65,_66){
_66.contentType="application/x-www-form-urlencoded;charset=utf-8";
_66.originalOnSuccess=_66.onSuccess;
_66.originalOnFailure=_66.onFailure;
_66.onSuccess=function(t,_68,_69,_6a){
try{
if(t.responseText&&(t.responseText.indexOf("page-login")>0)){
document.location.href=document.location.href;
}else{
if(_69.originalOnSuccess){
if(debugPrint&&_6a){
debugPrint(_6a);
}
_69.originalOnSuccess(t,_68,_69);
}
}
}
finally{
Mutex.decrement();
}
};
_66.onFailure=function(t,_6c,_6d,_6e){
try{
if(t.responseText&&(t.responseText.indexOf("page-login")>0)){
document.location.href=document.location.href;
}else{
if(_6d.originalOnFailure){
if(_6e){
debugPrint(_6e);
}
_6d.originalOnFailure(t,_6c,_6d);
}
}
}
finally{
Mutex.decrement();
}
};
Mutex.increment();
new Ajax.Request(_65,_66);
},showError:function(_6f,_70,_71){
if(_71){
LightBoxView.showWaitDialog(ProtoView.makeNode(_70),_70);
w=window;
setTimeout(function(){
LightBoxView.hideWaitDialog();
w.location.reload(true);
},5000);
}else{
LightBoxView.showInfoDialog(ProtoView.makeNode(_6f),_70);
}
}};
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(el){
var _73=new Array();
_73=_73.concat($A(el.getElementsByTagName("input")),$A(el.getElementsByTagName("select")),$A(el.getElementsByTagName("textarea")));
return _73;
},is:function(el){
var tag=el.tagName;
if(tagName=="input"||tagName=="select"||tagName=="textarea"){
return true;
}
return false;
}};
function cloneElement(el){
var _77=el.cloneNode(true);
var w1=document.createElement("div");
w1.appendChild(_77);
var w2=document.createElement("div");
w2.innerHTML=w1.innerHTML;
return w2.firstChild;
}
function showInViewPort(el){
el=$(el);
Position.prepare();
var _7b=(Position.cumulativeOffset(el)[1]+el.clientHeight)-(getPageHeight()+Position.deltaY);
if(_7b>0){
_7b=el.clientHeight-getPageHeight()+32;
new Effect.ScrollTo(el,{offset:_7b,duration:0.3});
}
}
function getPageHeight(){
var _7c=0;
var _7d=0;
if(typeof (window.innerWidth)=="number"){
_7c=window.innerWidth;
_7d=window.innerHeight;
}else{
if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){
_7c=document.documentElement.clientWidth;
_7d=document.documentElement.clientHeight;
}else{
if(document.body&&(document.body.clientWidth||document.body.clientHeight)){
_7c=document.body.clientWidth;
_7d=document.body.clientHeight;
}
}
}
return _7d;
}
var newForm={templates:null,setTemplate:function(el,tid,_80,_81){
if(tid){
WizardController.data.templateId=tid;
}else{
WizardController.data.templateId="";
}
if(_81){
document.getElementById("template-info-head").innerHTML=_80;
document.getElementById("template-info-desc").innerHTML=_81;
}
},setApplication:function(_82,aid){
WizardController.data.application=_82[aid].value;
},setTheme:function(_84,tid){
WizardController.data.theme=_84[tid].value;
var _86=_84[tid].getAttribute("thumbnail");
if(_86){
document.getElementById("theme-thumbnail-img").src=_86.replace(" ","");
}
},setFormName:function(_87){
WizardController.data.formname=_87;
},setWidth:function(_88,tid){
WizardController.data.width=_88[tid].value;
},setControlLayout:function(_8a,tid){
WizardController.data.controlLayout=_8a[tid].value;
},setFontName:function(_8c,tid){
WizardController.data.fontname=_8c[tid].value;
},setFontSize:function(_8e,tid){
WizardController.data.fontsize=_8e[tid].value;
},setFontColor:function(_90){
WizardController.data.fontcolour=_90;
},setEmail:function(_91){
WizardController.data.email=_91;
},setThankYou:function(_92){
WizardController.data.thankyou=_92;
},setUri:function(_93){
WizardController.data.uri=_93;
}};
var savedForms={setSubmissionId:function(_94,tid){
WizardController.data.submissionId=_94[tid].value;
}};
var customControl={handleRule:function(_96,_97){
var _98=WizardController.data.rules;
if(!_98){
WizardController.data.rules=[];
}
if(_96){
WizardController.data.rules.push(_97);
var _99=$("read-only");
if(_99){
_99.disabled=true;
_99.options[0].selected=true;
WizardController.data.readOnly=true;
}
}else{
var _9a=WizardController.data.rules.indexOf(_97);
if(_9a>=0){
WizardController.data.rules[_9a]=null;
WizardController.data.rules=WizardController.data.rules.compact();
}
if(WizardController.data.rules.length==0){
var _99=$("read-only");
if(_99){
_99.disabled=false;
}
WizardController.data.readOnly=true;
}
}
}};
var auth={setEmail:function(_9b){
WizardController.data.email=_9b;
},setPassword:function(_9c){
WizardController.data.password=_9c;
}};
var AbsolutePositioner={display:function(_9d,_9e,_9f,_a0){
_9e.style.position="absolute";
_9e.style.visibility="visible";
_9e.style.display="block";
_9e.style.zIndex=10000;
var pos=this.calculatePosition(_9d,_9e,_9f,_a0);
_9e.style.left=pos.x+"px";
_9e.style.top=pos.y+"px";
},undisplay:function(_a2){
if(_a2){
_a2.style.visibility="";
_a2.style.display="";
_a2.style.zIndex="";
_a2.style.left="";
_a2.style.top="";
_a2.style.position="";
}
},calculatePosition:function(_a3,_a4,_a5,_a6){
if(!_a6){
_a6=0;
}
var _a7=Position.cumulativeOffset(_a3);
var _a8=Element.getDimensions(_a3);
var cx=_a7[0]+_a8.width/2;
var cy=_a7[1]+_a8.height/2;
var _ab=Element.getDimensions(_a4).width;
var _ac=Element.getDimensions(_a4).height;
var _ad=new Object();
_ad.valid=true;
if(Position.within(_a5,cx+_a6+_ab,cy+_ac)){
_ad.x=cx+_a6;
_ad.y=cy;
}else{
if(Position.within(_a5,cx+_a6+_ab,cy-_a6-_ac)){
_ad.x=cx+_a6;
_ad.y=cy-_ac;
}else{
if(Position.within(_a5,cx-_a6-_ab,cy-_a6-_ac)){
_ad.x=cx-_a6-_ab;
_ad.y=cy-_ac;
}else{
if(Position.within(_a5,cx-_a6-_ab,cy+_a6+_ac)){
_ad.x=cx-_a6-_ab;
_ad.y=cy;
}else{
if(Position.within(_a5,cx+_a6,cy-_ac/2)&&Position.within(_a5,cx+_a6+_ab,cy+_ac/2)){
_ad.x=cx+_a6;
_ad.y=cy-_ac/2;
}else{
if(Position.within(_a5,cx-_ab/2,cy+_a6)&&Position.within(_a5,cx+_ab/2,cy+_a6+_ac)){
_ad.x=cx-_ab/2;
_ad.y=cy+_a6;
}else{
if(Position.within(_a5,cx-_a6-_ab,cy-_ac/2)&&Position.within(_a5,cx-_a6,cy+_ac/2)){
_ad.x=cx-_a6-_ab;
_ad.y=cy-_ac/2;
}else{
if(Position.within(_a5,cx-_ab/2,cy-_a6-_ac)&&Position.within(_a5,cx+_ab/2,cy-_a6)){
_ad.x=cx-_ab/2;
_ad.y=cy-_a6-_ac;
}else{
var _ae=Position.cumulativeOffset(_a5);
var _af=(_ae[1]+_a5.offsetHeight)/2;
var _b0=(_ae[0]+_a5.offsetWidth)/2;
_ad.x=_b0-_ab/2;
_ad.y=_af-_ac/2;
}
}
}
}
}
}
}
}
return _ad;
}};

