;(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked;}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt="";}).mouseover(save).mouseout(hide).click(hide);},fixPNG:IE?function(){return this.each(function(){var image=$(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css('position');if(position!='absolute'&&position!='relative')
$(this).css('position','relative');});}});}:function(){return this;},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]();});},url:function(){return this.attr('href')||this.attr('src');}});function createHelper(settings){if(helper.parent)
return;helper.parent=$('<div id="'+settings.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)
helper.parent.bgiframe();helper.title=$('h3',helper.parent);helper.body=$('div.body',helper.parent);helper.url=$('div.url',helper.parent);}
function settings(element){return $.data(element,"tooltip");}
function handle(event){if(settings(this).delay)
tID=setTimeout(show,settings(this).delay);else
show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(event);}
function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))
return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent);}
helper.body.show();}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)
helper.body.append("<br/>");helper.body.append(part);}
helper.body.hideWhenEmpty();}else{helper.title.html(title).show();helper.body.hide();}
if(settings(this).showURL&&$(this).url())
helper.url.html($(this).url().replace('http://','')).show();else
helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)
helper.parent.fixPNG();handle.apply(this,arguments);}
function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))
helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else
helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}
update();}
function update(event){if($.tooltip.blocked)
return;if(event&&event.target.tagName=="OPTION"){return;}
if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}
if(current==null){$(document.body).unbind('mousemove',update);return;}
helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto';}
helper.parent.css({left:left,right:right,top:top});}
var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}
if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}
function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()};}
function hide(event){if($.tooltip.blocked)
return;if(tID)
clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}
if((!IE||!$.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))
helper.parent.stop().fadeTo(tsettings.fade,0,complete);else
helper.parent.stop().fadeOut(tsettings.fade,complete);}else
complete();if(settings(this).fixPNG)
helper.parent.unfixPNG();}})(jQuery);;var rootUrl=document.location.href;rootUrl=rootUrl.substr(0,rootUrl.indexOf('/',8));function showFlash(swf,width,height,flashAlternative){monta_swf="";if((navigator.appName=="Microsoft Internet Explorer"&&navigator.appVersion.indexOf("Mac")==-1&&navigator.appVersion.indexOf("3.1")==-1)||(navigator.plugins&&navigator.plugins["Shockwave Flash"])||navigator.plugins["Shockwave Flash 2.0"]){monta_swf+="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"  width=\""+width+"\" height=\""+height+"\" title=\"\">";monta_swf+="<param name=\"movie\" value=\""+swf+"\" />";monta_swf+="<param name=\"quality\" value=\"high\" />";monta_swf+="<param name=\"menu\" value=\"0\" />";monta_swf+="<param name=\"wmode\" value=\"transparent\" />";monta_swf+="<embed src=\""+swf+"\" quality=\"high\" wmode=\"transparent\" type=\"application/x-shockwave-flash\" width=\""+width+"\" height=\""+height+"\"></embed>";monta_swf+="</object>";}else if(flashAlternative!=""&&flashAlternative!=null){monta_swf+=flashAlternative;}
document.write(monta_swf);}
function showFash(swf,width,height,flashAlternative){showFlash(swf,width,height,flashAlternative);}
function showSwf(swf,width,height,flashId,flashVersion){flashId=flashId==""?"FlashID":flashId;flashVersion=flashVersion==""?"6.0.65.0":flashVersion;var monta_swf='';monta_swf+='<object id="'+flashId+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'">';monta_swf+='<param name="movie" value="'+swf+'" />';monta_swf+='<param name="quality" value="high" />';monta_swf+='<param name="wmode" value="transparent" />';monta_swf+='<param name="swfversion" value="'+flashVersion+'" />';monta_swf+='<param name="expressinstall" value="/scripts/expressInstall.swf" />';if(navigator.appName!="Microsoft Internet Explorer"){monta_swf+='<object type="application/x-shockwave-flash" data="'+swf+'" width="'+width+'" height="'+height+'">';}
monta_swf+='<param name="quality" value="high" />';monta_swf+='<param name="wmode" value="transparent" />';monta_swf+='<param name="swfversion" value="'+flashVersion+'" />';monta_swf+='<param name="expressinstall" value="/scripts/expressInstall.swf" />';if(navigator.appName!="Microsoft Internet Explorer"){monta_swf+='</object>';}
monta_swf+='</object>';document.write(monta_swf);}
function openPopup(url,name,w,h,conf){var winl=(screen.width-w)/2;var wint=((screen.height-h)/2);name=window.open(url,"_blank",'width='+w+',height='+h+',left='+winl+',top='+wint+','+conf);name.window.focus();}
function getXmlHttp(){try{xmlhttp=new XMLHttpRequest();}catch(ee){try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(E){xmlhttp=false;}}}
return xmlhttp;}
function setComboAjax(url,target,selectValue,fCallback){xmlhttp=getXmlHttp();xmlhttp.open("GET",url,true);document.getElementById(target).length=0;document.getElementById(target).options[0]=new Option('Loading...','');xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){document.getElementById(target).length=0;document.getElementById(target).options[0]=new Option('Select','');if(selectValue==""){document.getElementById(target).options[0].selected=true;}
json=eval('('+xmlhttp.responseText+')');for(i=0;i<json.length;i++){document.getElementById(target).options[i+1]=new Option(json[i].name,json[i].id);if(selectValue==json[i].id){document.getElementById(target).options[i+1].selected=true;}}
if(fCallback!=""){getCallback(fCallback);}}}
xmlhttp.send(null);}
function getCallback(fCallback){if(fCallback!=undefined&&fCallback!=""){funcoes=fCallback.split(",");parametros="";for(i=1;i<funcoes.length;i++){parametros+="'"+funcoes[i]+"'";if(i<funcoes.length-1)parametros+=",";}
setTimeout(funcoes[0]+"("+parametros+")",0);}}
function goTab(tab,target){if(target==""||target==undefined){target="tab";}
var c=0;var liObj=new Array();tabObj=document.getElementById(target);for(i=0;i<tabObj.childNodes.length;i++){if(tabObj.childNodes[i].nodeName=="UL"){for(j=0;j<tabObj.childNodes[i].childNodes.length;j++){if(tabObj.childNodes[i].childNodes[j].nodeName=="LI"){tabObj.childNodes[i].childNodes[j].attributes["class"].value="";liObj[c]=tabObj.childNodes[i].childNodes[j];c++;}}}}
n=tabObj.getElementsByTagName('li').length;liObj[tab].attributes["class"].value="current";for(i=0;i<n;i++)
document.getElementById(target+"-"+i).className="invisible tab";document.getElementById(target+"-"+tab).className="visible tab";}
var tgs=new Array('div');var szs=new Array('xx-small','x-small','small','medium','large','x-large','xx-large');var startSz=2;function ts(trgt,inc){if(!document.getElementById)return
var d=document,cEl=null,sz=startSz,i,j,cTags;sz+=inc;if(sz<0)sz=0;if(sz>4)sz=4;startSz=sz;if(!(cEl=d.getElementById(trgt)))cEl=d.getElementsByTagName(trgt)[0];cEl.style.fontSize=szs[sz];for(i=0;i<tgs.length;i++){cTags=cEl.getElementsByTagName(tgs[i]);for(j=0;j<cTags.length;j++)cTags[j].style.fontSize=szs[sz];}}
function getNelements(targetId,elementName,elementClassName){target=document.getElementById(targetId);elements=target.getElementsByTagName(elementName);n=0;for(i=0;i<elements.length;i++){if(elements[i].className==elementClassName||elementClassName==null){n++;}}
return n;}
function addElement(targetId,elementId){target=document.getElementById(targetId);element=document.getElementById(elementId);var clone=element.cloneNode(true);target.appendChild(clone);}
document.getElementsByClassName=function(clsName){var retVal=new Array();var elements=document.getElementsByTagName("*");for(var i=0;i<elements.length;i++){if(elements[i].className.indexOf(" ")>=0){var classes=elements[i].className.split(" ");for(var j=0;j<classes.length;j++){if(classes[j]==clsName)
retVal.push(elements[i]);}}
else if(elements[i].className==clsName)
retVal.push(elements[i]);}
return retVal;}
function text2Edit(editorName,w,h,url){if(url==null)url=rootUrl+'/scripts/'+editorName+".js";if(w==null)w="100%";if(h==null)h="100%";sBasePath=rootUrl+'/libs/javascript/fckeditor/';for(i=0;i<editor.length;i++){if(editor[i].nodeName=='TEXTAREA'){elementName=editor[i].attributes['name'].nodeValue;elementValue=editor[i].value;oFCKeditor=new FCKeditor(elementName);oFCKeditor.BasePath=sBasePath;oFCKeditor.Config["CustomConfigurationsPath"]=url+"?"+(new Date()*1);oFCKeditor.Width=w;oFCKeditor.Height=h;oFCKeditor.ReplaceTextarea();}}}
function createExternalLinks(){if(document.getElementsByTagName){var anchors=document.getElementsByTagName('a');for(var i=0;i<anchors.length;i++){var anchor=anchors[i];if(anchor.getAttribute("href")&&anchor.getAttribute('rel')=='external'){anchor.target='_blank';var title=anchor.title;anchor.title=title;}}}}
function stripAccents(str){var rExps=[{re:/[\xC0-\xC6]/g,ch:'A'},{re:/[\xE0-\xE6]/g,ch:'a'},{re:/[\xC8-\xCB]/g,ch:'E'},{re:/[\xE8-\xEB]/g,ch:'e'},{re:/[\xCC-\xCF]/g,ch:'I'},{re:/[\xEC-\xEF]/g,ch:'i'},{re:/[\xD2-\xD6]/g,ch:'O'},{re:/[\xF2-\xF6]/g,ch:'o'},{re:/[\xD9-\xDC]/g,ch:'U'},{re:/[\xF9-\xFC]/g,ch:'u'},{re:/[\xD1]/g,ch:'N'},{re:/[\xF1]/g,ch:'n'}];for(var i=0,len=rExps.length;i<len;i++)
str=str.replace(rExps[i].re,rExps[i].ch);return str;}
function replaceAll(string,token,newtoken){return(string).split(token).join(newtoken);}
function trim(str){return str.replace(/^\s+|\s+$/g,"");}
fmtMoney=function(n,c,d,t){var m=(c=Math.abs(c)+1?c:2,d=d||",",t=t||".",/(\d+)(?:(\.\d+)|)/.exec(n+"")),x=m[1].length>3?m[1].length%3:0;return(x?m[1].substr(0,x)+t:"")+m[1].substr(x).replace(/(\d{3})(?=\d)/g,"$1"+t)+(c?d+(+m[2]||0).toFixed(c).substr(2):"");};;function showMsn(){msn='<div id="Microsoft_Live_Messenger_PresenceButton_bbb1b65209433223"';msn+='msgr:width="320" msgr:backColor="#DBDBDB"';msn+='msgr:altBackColor="#FFFFFF"';msn+='msgr:foreColor="#424542"';msn+='msgr:conversationUrl="http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee=bbb1b65209433223@apps.messenger.live.com&mkt=pt-br&useTheme=true&foreColor=676769&backColor=DBDBDB&linkColor=444444&borderColor=8D8D8D&buttonForeColor=99CC33&buttonBackColor=676769&buttonBorderColor=99CC33&buttonDisabledColor=F1F1F1&headerForeColor=729527&headerBackColor=B2B2B2&menuForeColor=676769&menuBackColor=BBBBBB&chatForeColor=99CC33&chatBackColor=EAEAEA&chatDisabledColor=B2B2B2&chatErrorColor=760502&chatLabelColor=6E6C6C">';msn+='</div>';document.write(msn);}
function setCiTyCombo(id,target){if(target==parseFloat(target)){target=document.getElementsByClassName('city')[target].getElementsByTagName("span")[0];comboName=target.getElementsByTagName("select")[0].name;}else{target=document.getElementById(target);comboName="city_id";}
var urlAjax=rootUrl+"/contato?id="+id+"&comboName="+comboName;var xmlhttp=getXmlHttp();xmlhttp.open("GET",urlAjax,true);target.innerHTML='<br/>Carregando...';xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){target.innerHTML=xmlhttp.responseText;}}
xmlhttp.send(null);}
function webMailLocaweb(form){var dominio,usuario;var userid=form.useremail.value;var ch=userid.indexOf('@');var usuario=userid.substr(0,ch);var dominio=userid.substr(ch+1,userid.length-ch);form.userid.value=usuario;form.setAttribute('target','_blank');form.setAttribute('action','http://pop.'+dominio+'/cgi-bin/webmail/webmail.pl');return true;}
function webMailRevenda(form){var dominio;var userid=form.imapuser.value;var ch=userid.indexOf('@');var dominio=userid.substr(ch+1,userid.length-ch);form.setAttribute('target','_blank');form.setAttribute('action','http://webmail.'+dominio+'/horde/imp/redirect.php');return true;}
function formTargetBlank(form){form.setAttribute('target','_blank');return true;}
function getCityTarget(stateCombo){stateCombos=document.getElementsByName('state_id[]');nElement=stateCombos.length;for(i=0;i<nElement;i++){if(stateCombos[i]==stateCombo){return i;}}
return 0;}
$(document).ready(function(){$('a[rel*=lightbox]').lightBox();$("a[rel=external]").attr('target','_blank');$("a[rel=external]").addClass("external");if($("#player").length>0){flowplayer("player","http://intranet.mkx.com.br/swf/flowplayer-3.1.5.swf");}
if($("a.tooltip").length>0){$("a.tooltip[title]").tooltip('#tooltip');}
$("a.tooltip").click(function(){var target=$(this).attr("rel");window.open("http://www.mkx.com.br/"+target,"Ajuda");});var nClones=$("input.rmclone").length;var elementClone="";var classClone="";for(i=0;i<nClones;i++){elementClone=$("input.rmclone").get(i);classClone=$(elementClone).attr("class");if(classClone.indexOf("visible")==-1){$($("input.rmclone").get(i)).addClass("invisible");$($("input.rmclone").get(i)).removeClass("visible");}}
$("h5.question").click(function(){var $divSelecionada=$(this).attr("id").split("-");var $nomeDiv=$divSelecionada[1];var $minhaDiv='answer-'+$nomeDiv;var $id="div#"+$minhaDiv;if($($id).is(":hidden")){$($id).slideDown(500,function(){$($id).css("visibility","visible");});$(this).addClass('visible');}else{$($id).slideUp(500,function(){$($id).hide();});$(this).removeClass('visible');}});$(".clone").click(function(){var targetColone=$(this).attr("value");unMask();$("."+targetColone+":first").clone(true).insertAfter("."+targetColone+":last");$("."+targetColone+" input.rmclone").removeClass("invisible");setMask();});$(".rmclone").click(function(){var target=$(this).attr("value");var nElements=$("."+target).length;if(nElements==2){$("."+target+" input.rmclone").addClass("invisible");}
if(nElements>1){$(this).parent().parent().remove();}});setMask();$("input#goog-wm-sb").attr("value","");$("form#form-login").validate();$("form#form-person-insert").validate();$("form#form-person-update").validate();$("form#form-remember-pass").validate();$("form#form-contactus").validate();$("form#form-orcamento").validate();$("form#form-remember-pass").validate();$("form#form-estatistica").validate();$("form#form-painel-revenda").validate();$("form#form-painel-locaweb").validate();$("form#form-webmail-revenda").validate();$("form#form-webmail-locaweb").validate();$("form#form-search").validate();$('#sucess').pulse({speed:500,opacityRange:[0.0,0.9],duration:10000});$('#exception').pulse({speed:500,opacityRange:[0.0,0.9],duration:10000});$('#tabs').tabs({fxFade:true,fxSpeed:'fast'});$("form#helpdesk-list-form #tabs ul li a").click(function(){var actionForm=$(this).attr("href");$("form#helpdesk-list-form").attr("action","./helpdesk"+actionForm);});$("form#helpdesk-list-form #tabs ul.pagination a").click(function(){var hrefHelpDeskPagination=$(this).attr("href");$(this).attr("href",hrefHelpDeskPagination+"#finalizados");});if(document.location.href.indexOf("#cpf")!=-1){$("input.txt-cpf").addClass("required");$("input.txt-cpf").attr("name","document");$("input.txt-cnpj").removeClass("required");$("input.txt-cnpj").attr("name","none");$("form#form-company-insert").validate();}
$("div#tabs li a[href=#cpf]").click(function(){$("input.txt-cpf").addClass("required");$("input.txt-cpf").attr("name","document");$("input.txt-cnpj").removeClass("required");$("input.txt-cnpj").attr("name","none");$("form#form-company-insert").validate();});$("div#tabs li a[href=#cnpj]").click(function(){$("input.txt-cpf").removeClass("required");$("input.txt-cpf").attr("name","none");$("input.txt-cnpj").addClass("required");$("input.txt-cnpj").attr("name","document");$("form#form-company-insert").validate();});});function unMask(){$(".txt-date").unmask();$(".txt-date-my").unmask();$(".txt-time").unmask();$(".txt-time-extend").unmask();$(".txt-phone").unmask();$(".txt-cnpj").unmask();$(".txt-cpf").unmask();$(".txt-cep").unmask();$(".txt-dimensions").unmask();}
function setMask(){$(".txt-date").mask("99/99/9999");$(".txt-date-my").mask("99/9999");$(".txt-time").mask("99:99");$(".txt-time-extend").mask("99h99");$(".txt-phone").mask("(99) 9999-9999");$(".txt-cnpj").mask("99.999.999/9999-99");$(".txt-cpf").mask("999.999.999-99");$(".txt-cep").mask("99999-999");$(".txt-dimensions").mask("9999x9999x9999");}