FormProcessing = false;function SetHidden(name){if (FormProcessing) return false;FormProcessing = true;var f1 = document.getElementById(name + "1");var f2 = document.getElementById(name + "2");var f = document.getElementById(name);if (f1 != null){f1.style.visibility = "hidden";f1.style.display = "none";document.getElementById(name + "_HIDDEN1").style.display = "block";document.getElementById(name + "_HIDDEN1").style.visibility = "visible";} if (f2 != null){f2.style.visibility = "hidden";f2.style.display = "none";document.getElementById(name + "_HIDDEN2").style.display = "block";document.getElementById(name + "_HIDDEN2").style.visibility = "visible";} if (f != null){f.style.visibility = "hidden";f.style.display = "none";document.getElementById(name + "_HIDDEN").style.display = "block";document.getElementById(name + "_HIDDEN").style.visibility = "visible";} return true;} VK_0 = 48;VK_1 = 49;VK_2 = 50;VK_3 = 51;VK_4 = 52;VK_5 = 53;VK_6 = 54;VK_7 = 55;VK_8 = 56;VK_9 = 57;VK_A = 65;VK_B = 66;VK_C = 67;VK_D = 68;VK_E = 69;VK_F = 70;VK_G = 71;VK_H = 72;VK_I = 73;VK_J = 74;VK_K = 75;VK_L = 76;VK_M = 77;VK_N = 78;VK_O = 79;VK_P = 80;VK_Q = 81;VK_R = 82;VK_S = 83;VK_T = 84;VK_U = 85;VK_V = 86;VK_W = 87;VK_X = 88;VK_Y = 89;VK_Z = 90;VK_CEDILLA = 199;VK_BACK_SPACE = 8;VK_TAB = 9;VK_ENTER = 13;VK_SHIFT = 16;VK_CTRL = 17;VK_ALT = 18;VK_PAUSE = 19;VK_CAPS_LOCK = 20;VK_ESCAPE = 27;VK_SPACE = 32;VK_PAGE_UP = 33;VK_PAGE_DOWN = 34;VK_END = 35;VK_HOME = 36;VK_LEFT = 37;VK_UP = 38;VK_RIGHT = 39;VK_DOWN = 40;VK_INSERT = 45;VK_DELETE = 46;VK_WINDOW_LEFT = 91;VK_WINDOW_RIGHT = 92;VK_SELECT = 93;VK_NUMPAD0 = 96;VK_NUMPAD1 = 97;VK_NUMPAD2 = 98;VK_NUMPAD3 = 99;VK_NUMPAD4 = 100;VK_NUMPAD5 = 101;VK_NUMPAD6 = 102;VK_NUMPAD7 = 103;VK_NUMPAD8 = 104;VK_NUMPAD9 = 105;VK_MULTIPLY = 106;VK_ADD = 107;VK_SUBTRACT = 109;VK_DECIMAL = 110;VK_DIVIDE = 111;VK_F1 = 112;VK_F2 = 113;VK_F3 = 114;VK_F4 = 115;VK_F5 = 116;VK_F6 = 117;VK_F7 = 118;VK_F8 = 119;VK_F9 = 120;VK_F10 = 121;VK_F11 = 122;VK_F12 = 123;VK_NUM_LOCK = 144;VK_SCROLL_LOCK = 145;VK_COLON = 186;VK_EQUALS = 187;VK_COMMA = 188;VK_DASH = 189;VK_PERIOD = 190;VK_FORWARD_SLASH = 191;VK_GRAVE_ACCENT = 192;VK_OPEN_BRACKET = 219;VK_BACK_SLASH = 220;VK_CLOSE_BRAKET = 221;VK_SINGLE_QUOTE = 222;PkgEventWrapper = new function(){this.isIE = !(!document.all);this.getEvent = getEvent;this.addEventListener = addEventListener;this.dispatchEvent = dispatchEvent;function EventObject(ev,isIE){this.stopPropagation = stopPropagation;this.preventDefault = preventDefault;this.create = create; this.create(ev,isIE);function create(ev,isIE){this.isIE = isIE;this.obj = ev;if (this.isIE) this.target = ev.srcElement;else this.target = ev.target;this.type = ev.type;this.clientX = ev.clientX;this.clientY = ev.clientY;this.pageX = 0;this.pageY = 0;if (ev.pageX || ev.pageY){this.pageX = ev.pageX;this.pageY = ev.pageY;} else if (ev.clientX || ev.clientY){this.pageX = ev.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;this.pageY = ev.clientY + document.body.scrollTop + document.documentElement.scrollTop;} this.button = ev.button;this.altKey = ev.altKey;this.ctrlKey = ev.ctrlKey;this.shiftKey = ev.shiftKey;if (this.isIE){this.which = ev.keyCode;this.leftClick = this.button == 1;this.middleClick = this.button == 4;this.rightClick = this.button == 2;} else{this.which = ev.which;this.leftClick = this.button == 0;this.middleClick = this.button == 1;this.rightClick = this.button == 2;} if (this.leftClick) this.button = 0;else if (this.middleClick) this.button = 1;if (this.rightClick) this.button = 2;this.keyCode = this.which;};function stopPropagation(){this.obj.cancelBubble = true;if (this.obj.stopPropagation) this.obj.stopPropagation();};function preventDefault(){if (this.isIE) this.obj.returnValue = false;else this.obj.preventDefault();};};function getEvent(ev){if (this.isIE) ev = window.event;var event = new EventObject(ev,this.isIE);return event;};function addEventListener(on,to,func){if (this.isIE){on = "on"+on;to.attachEvent(on,func);} else to.addEventListener(on,func,false);};function dispatchEvent(obj,event,parent){if (!parent) parent = window;if ( obj.fireEvent ){return obj.fireEvent("on"+event);} else{var evt = parent.document.createEvent('HTMLEvents');evt.initEvent(event,true,true);return obj.dispatchEvent(evt);} } };LAYERWINDOWTEMPLATE = "";if (!window.LayerWindowManager){LayerWindowManager = function(){this.open = open;this.close = close;this.show = show;this.showAtPos = showAtPos;this.showBelow = showBelow;this.showAtCenter = showAtCenter;this.setTopMost = setTopMost;this.hide = hide;this.setPos = setPos;this.add = add;this.execEventList = execEventList;this.setOnCloseEvent = setOnCloseEvent;this.setOnOpenEvent = setOnOpenEvent;this.setOnShowEvent = setOnShowEvent;this.appendOnCloseEvent = appendOnCloseEvent;this.appendOnOpenEvent = appendOnOpenEvent;this.appendOnShowEvent = appendOnShowEvent;this.openWindow = openWindow;this._getElementById = _getElementById;this._createModalBackground = _createModalBackground;this._destroyModalBackground = _destroyModalBackground;this._in_array = _in_array;this._findPosX = _findPosX;this._findPosY = _findPosY;this._docOnMouseUp = _docOnMouseUp;this._docOnMouseDown = _docOnMouseDown;this._docOnMouseMove = _docOnMouseMove;this._getDocRootTag = _getDocRootTag;this._getElmParent = _getElmParent;this._getEvent = _getEvent;this._regCallbacks = _regCallbacks;this._getElementWidth = _getElementWidth;this._getViewportHeight = _getViewportHeight;this._getViewportWidth = _getViewportWidth;this._resizeCallBack = _resizeCallBack;this.initialize = initialize; this.initialize();function _regCallbacks(){var mdown = null;eval("mdown = function(e)\n{\ndocument.wManager._docOnMouseDown(e);\n}");var mup = null;eval("mup = function(e)\n{\ndocument.wManager._docOnMouseUp(e);\n}");var mmove = null;eval("mmove = function(e)\n{\ndocument.wManager._docOnMouseMove(e);\n}");PkgEventWrapper.addEventListener("mousedown",document,mdown);PkgEventWrapper.addEventListener("mouseup",document,mup);PkgEventWrapper.addEventListener("mousemove",document,mmove);PkgEventWrapper.addEventListener("resize",window,new Function("wmng._resizeCallBack();"));};function initialize(){this.MODAL_BACKGROUND_ZINDEX = 11000;this.windows = new Array();this.modalWindow = null;this.modalBackground = null;this.isIE = document.all;if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) this.IEVersion = new Number(RegExp.$1);this.isNN = !document.all&&document.getElementById;this.isN4 = document.layers;this.mouseIsOver = false;this.dragging = false;this.resizing = false;this.overResize = false;this.selWindow = null;this.nowX = 0;this.nowY = 0;this.offsetx = 0;this.offsety = 0;this.onClose = new Array();this.onOpen = new Array();this.onShow = new Array();this._regCallbacks();document.wManager = this;};function _findPosX(obj){var curleft = 0;if(obj.offsetParent) while(1){curleft += obj.offsetLeft;if(!obj.offsetParent) break;obj = obj.offsetParent;} else if(obj.x) curleft += obj.x;return curleft;};function _findPosY(obj){var curtop = 0;if(obj.offsetParent) while(1){curtop += obj.offsetTop;if(!obj.offsetParent) break;obj = obj.offsetParent;} else if(obj.y) curtop += obj.y;return curtop;};function _in_array(needle, haystack){var n = haystack.length;for (var i=0; i < n; i++) if (haystack[i] == needle) return true;return false;};function _getElmParent(el){if (this.isIE) return el.parentElement;else return el.parentNode;};function _getEvent(e){return PkgEventWrapper.getEvent(e);};function _getDocRootTag(){if (this.isIE) return "BODY";else return "HTML";};function _docOnMouseUp(e){if (this.dragging){var w = this.selWindow;var e = _getElementById(this.selWindow.id+"_GHOST");w.style.top = e.style.top;w.style.left = e.style.left;document.body.removeChild(e);this.dragging = false;} else if (this.resizing){var w = this.selWindow;var e = _getElementById(this.selWindow.id+"_GHOST");w.style.width = e.style.width;w.style.height = e.style.height;document.body.removeChild(e);this.resizing = false;} };function _docOnMouseMove(e){if (this.dragging){var ev = this._getEvent(e);ev.preventDefault();var e = _getElementById(this.selWindow.id+"_GHOST");e.style.display = "block";var dX = this.nowX + ev.clientX - this.offsetx;var dY = this.nowY + ev.clientY - this.offsety;var viewWidth = _getViewportWidth();var viewHeight = _getViewportHeight();if (dX < 0) dX = 0;if (dY < 0) dY = 0;e.style.left = dX;e.style.top = dY;} else if (this.resizing){var ev = this._getEvent(e);ev.preventDefault();var e = _getElementById(this.selWindow.id+"_GHOST");e.style.display = "block";var posX = parseInt(e.style.left);var posY = parseInt(e.style.top);var offsetx = ev.clientX - this.offsetx;var offsety = ev.clientY - this.offsety;var width = _getElementWidth(e)+offsetx;var height = _getElementHeight(e)+offsety;if (width < 100) width = 100;if (height < 100) height = 100;this.offsetx = ev.clientX;this.offsety = ev.clientY;} };function _createGhostWindow(w){var ndiv = document.createElement('div');ndiv.id = w.id+"_GHOST";ndiv.style.display = "none";ndiv.style.height = _getElementHeight(w)+'px';ndiv.style.width = _getElementWidth(w)+'px';ndiv.style.border = "3px solid #9D9D9D";ndiv.style.position = "absolute";ndiv.style.left = w.style.left;ndiv.style.top = w.style.top;ndiv.style.cursor = "move";ndiv.style.zIndex = parseInt(w.style.zIndex)+1;document.body.appendChild(ndiv);return ndiv;} function _docOnMouseDown(e){var ev = this._getEvent(e);var rootTag = this._getDocRootTag();var selArea = ev.target;if (this.overResize){this.resizing = true;while (selArea.id.substr(selArea.id.length-"resizeIcon".length) != "resizeIcon" && selArea.tagName != rootTag) selArea = this._getElmParent(selArea);if (selArea.id.substr(selArea.id.length-"resizeIcon".length) == "resizeIcon"){ev.preventDefault();this.selWindow = document.getElementById(selArea.id.substr(0,selArea.id.length-"resizeIcon".length-1));var ndiv = _createGhostWindow(this.selWindow);this.offsetx = ev.clientX;this.offsety = ev.clientY;} } else{while (selArea != null && selArea.id != "titleBar" && selArea.tagName != rootTag) try{selArea = this._getElmParent(selArea);} catch(e){} if (selArea == null) return;if (selArea.id == "titleBar"){while (!this._in_array(selArea.id,this.windows) && selArea.tagName != rootTag) selArea = this._getElmParent(selArea);if (selArea.tagName != rootTag){ev.preventDefault();this.selWindow = selArea;this.setTopMost(this.selWindow.id);this.offsetx = ev.clientX;this.offsety = ev.clientY;this.nowX = parseInt(this.selWindow.style.left);this.nowY = parseInt(this.selWindow.style.top);this.dragging = true;var w = this.selWindow;var ndiv = _createGhostWindow(w);} } } };function setOnCloseEvent(wname,f){this.onClose[wname] = new Array(f);};function setOnOpenEvent(wname,f){this.onOpen[wname] = new Array(f);};function setOnShowEvent(wname,f){this.onShow[wname] = new Array(f);};function appendOnOpenEvent(wname,f){if (this.onOpen[wname] == null) this.onOpen[wname] = new Array();this.onOpen[wname][this.onOpen[wname].length] = f;};function appendOnCloseEvent(wname,f){if (this.onClose[wname] == null) this.onClose[wname] = new Array();this.onClose[wname][this.onClose[wname].length] = f;};function appendOnShowEvent(wname,f){if (this.onShow[wname] == null) this.onShow[wname] = new Array();this.onShow[wname][this.onShow[wname].length] = f;};function execEventList(list){var result = true;if (list == null) return result;var i = 0;while (result && i < list.length){result = list[i]();i++;} return result;} function open(wname,modal){if (this.execEventList(this.onOpen[wname])) this.show(wname,modal);};function close(wname){if (this.execEventList(this.onClose[wname])) this.hide(wname);};function setPos(wname,posx,posy){if (this._in_array(wname,this.windows)){var w = this._getElementById(wname);w.style.left = posx;w.style.top = posy;} };function setTopMost(wname){if (this._in_array(wname,this.windows)){for (var i = 0; i < this.windows.length; i++){var visible = (this._getElementById(this.windows[i]).style.visibility == "visible");if (visible) this._getElementById(this.windows[i]).style.zIndex = 0;} var w = this._getElementById(wname);w.style.zIndex = this.MODAL_BACKGROUND_ZINDEX + 1;} };function show(wname,modal){if (this.execEventList(this.onShow[wname])){if (modal){this._createModalBackground();this.modalWindow = wname;} var w = this._getElementById(wname);if (this.isIE || this.isNN) w.style.visibility="visible";else if (isN4) w.visibility="show";w.style.display = "block";this.setTopMost(wname);var body = document.getElementById(wname+"_BODY");if (body){var url = body.getAttribute("_url");if (url && url.length > 0){body.innerHTML = '';var f = document.getElementById(wname+'_FRAME');f.src = url;} } } };function showAtPos(wname,x,y,modal){this.setPos(wname,x,y);this.show(wname,modal);};function _getElementWidth(el){var tmp = el.style.overflow;el.style.overflow = "auto";var w = el.scrollWidth;el.style.overflow = tmp;return w;};function _getElementHeight(el){var tmp = el.style.overflow;el.style.overflow = "auto";var h = el.scrollHeight;el.style.overflow = tmp;return h;};function _getViewportHeight(){if (this.isIE) return document.body.clientHeight;else if( typeof( window.innerHeight ) == 'number' ) return window.innerHeight;else return document.documentElement.clientHeight;};function _getViewportWidth(){if (!document.compatMode || document.compatMode=="CSS1Compat") return document.documentElement.clientWidth;else if (document.compatMode) return document.body.clientWidth;return self.innerWidth;} function _getDocHeight(){var result;if (document.compatMode && document.compatMode != 'BackCompat'){result = document.documentElement.scrollHeight;} else if (document.body && typeof document.body.scrollHeight != 'undefined'){result = document.body.scrollHeight;} else if (typeof document.height != 'undefined'){result = document.height;} return result;} function _getDocWidth(){var result;if (document.compatMode && document.compatMode != 'BackCompat'){result = document.documentElement.scrollWidth;} else if (document.body && typeof document.body.scrollWidth != 'undefined'){result = document.body.scrollWidth;} else if (typeof document.width != 'undefined'){result = document.width;} return result;} function _createModalBackground(){if (this.isIE && this.IEVersion < 7){var div=document.createElement('iframe');} else var div = document.createElement('div');div.style.border = '0pt none';div.style.margin = '0pt';div.style.padding = '0pt';div.style.backgroundColor = '#000';div.style.backgroundImage = 'none';div.style.position = 'absolute';div.style.zIndex = this.MODAL_BACKGROUND_ZINDEX;div.style.top = '0px';div.style.left = '0px';if (div.style.setAttribute) div.style.setAttribute("filter", "alpha(opacity=50);");else div.style.opacity = 0.5;div.style.width = _getDocWidth();div.style.height = _getDocHeight();div.style.display = 'none';document.body.appendChild(div);div.style.display = '';this.modalBackground = div;} function _destroyModalBackground(){if (this.modalBackground){document.body.removeChild(this.modalBackground);delete this.modalBackground;this.modalBackground = null;} } function _resizeCallBack(){if (this.modalBackground){this.modalBackground.style.width = _getDocWidth();this.modalBackground.style.height = _getDocHeight();} } function showAtCenter(wname,modal){var w = this._getElementById(wname);w.style.display = "block";var x = parseInt(this._getViewportWidth() / 2) + document.body.scrollLeft;var y = parseInt(this._getViewportHeight() / 2) + document.body.scrollTop;x = x - parseInt(this._getElementWidth(w)/2);y = y - parseInt(w.offsetHeight/2);this.showAtPos(wname,x,y,modal);};function showBelow(wname,anchor,modal){if (typeof anchor == "object") var obj = anchor;else if (typeof anchor == "string") obj = this._getElementById(anchor);var x = this._findPosX(obj);var y = this._findPosY(obj);y = y + obj.offsetHeight;this.showAtPos(wname,x,y,modal);};function hide(wname){if (this.isIE || this.isNN) this._getElementById(wname).style.visibility="hidden";else if (isN4) this._getElementById(wname).visibility="hide";this._getElementById(wname).style.display = "none";if (this.modalWindow && this.modalWindow == wname) this._destroyModalBackground();};function add(wname){if (!this._in_array(wname,this.windows)) this.windows[this.windows.length] = wname;};function openWindow(url,name,features){var width = 150;var height = 150;var top = 0;var left = 0;var modal = false;var center = false;var title = "";var position = "";var afeatures = features.split(',');for (var i = 0; i < afeatures.length; i++){var atagval = afeatures[i].split('=');if (atagval.length > 1){var tag = _trimStr(atagval[0]).toUpperCase();if (tag == "WIDTH") width = _trimStr(atagval[1]);else if (tag == "HEIGHT") height = _trimStr(atagval[1]);else if (tag == "TOP") top = _trimStr(atagval[1]);else if (tag == "LEFT") left = _trimStr(atagval[1]);else if (tag == "MODAL") modal = (_trimStr(atagval[1]) == '1');else if (tag == "ALIGN") center = (_trimStr(atagval[1]) == 'center');else if (tag == "TITLE") title = _trimStr(atagval[1]);} } if (this._in_array(name,this.windows)){var w = document.getElementById(name+"_MAIN");document.body.removeChild(w);} var windowCode = LAYERWINDOWTEMPLATE;windowCode = windowCode.replace(/<#NAME#>/g,name);windowCode = windowCode.replace(/<#WIDTH#>/g,width+'px');windowCode = windowCode.replace(/<#HEIGHT#>/g,height+'px');windowCode = windowCode.replace(/<#TITLE#>/g,title);windowCode = windowCode.replace(/<#VISIBILITY#>/g,'visible');windowCode = windowCode.replace(/<#BODY_ATTRIBUTES#>/g,' _url="'+url+'"');windowCode = windowCode.replace(/<#[^\#\>]*#>/g,'');var d = document.createElement('div');d.id = name+"_MAIN";d.innerHTML = windowCode;document.body.appendChild(d);this.add(name);if (position == "fixed"){if (_getElementById(name)) _getElementById(name).style.position = position;} if (!center) this.showAtPos(name,top,left,modal);else this.showAtCenter(name,modal);} function _trimStr(str){return str.replace(/^\s*/, "").replace(/\s*$/, "");} function _getElementById(id){var result = null;if (this.isIE) result = document.all[id];else result = document.getElementById(id) return result;};};wmng = new LayerWindowManager();} function popCalendar( field ){idate = eval( 'document.FRM_CONTATO_EVENTO.elements["' + field + '"].value' );document.wManager.openWindow('lib/popupcal.php?control=' + field + '&date=' + idate, 'popupcal', 'width=250, height=250, align=center, title=Calendário, modal=0' );} function setCalendar( control, fdate ){fld_date = eval( 'document.FRM_CONTATO_EVENTO.elements["' + control + '"]');fld_date.value = fdate;if (fld_date.getAttribute('onchange')){if (fld_date.fireEvent){fld_date.fireEvent('onchange');} else{var evt = document.createEvent('HTMLEvents');evt.initEvent('change',true,true);fld_date.dispatchEvent(evt);} } } function ShowTopLayer(){var IEVersion;if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) IEVersion = new Number(RegExp.$1);if (document.all && (IEVersion < 7)) var d = document.createElement("iframe");else var d = document.createElement("div");if (d.style.setAttribute) d.style.setAttribute("filter", "alpha(opacity=30);");else d.style.opacity = 0.3;d.style.backgroundColor = "#000";var width;var height;if (document.all){if (document.compatMode && document.compatMode != "BackCompat"){width = document.documentElement.scrollWidth;height = document.documentElement.scrollHeight;} else if (document.body && typeof document.body.scrollWidth != "undefined"){width = document.body.scrollWidth;height = document.body.scrollHeight;} else if (typeof document.width != "undefined"){width = document.width;height = document.height;} } else{width = "100%";height = "100%";} if (document.all) d.style.position = "absolute";else d.style.position = "fixed";d.style.border = "0pt none";d.style.margin = "0pt";d.style.padding = "0pt";d.style.backgroundImage = "url('https://app.eventize.com.br/template/new/images/loading_bkg_black.gif')";d.style.backgroundRepeat = "no-repeat";d.style.backgroundPosition = "center center";d.style.left = "0px";d.style.top = "0px";d.style.width = width;d.style.height = height;d.style.zIndex = "99999";d.style.display = "none";document.body.appendChild(d);d.style.display = "";document.topLayer = d;return d;} function HideTopLayer(_Div){if (_Div) document.body.removeChild(_Div);else{if (document.topLayer) document.body.removeChild(document.topLayer);} }