var dom = (document.getElementById) ? true : false;
var ns5 = (!document.all && dom || window.opera) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var padrao_fone = /\(?\d{2}\) ?\d{4}-\d{4}/;
var padrao_data = /^((0[1-9]|[12]\d)\/(0[1-9]|1[0-2])|30\/(0[13-9]|1[0-2])|31\/(0[13578]|1[02]))\/\d{4}$/;
var padrao_cep = /\d{5}\-\d{3}/;
var padrao_hora = /([01]\d|2[0-3]):[0-5]\d/;
var cor_principal = '#C00';
var cor_secundaria = '#FFE8E6';
function $(ID) { return document.getElementById(ID); }
function $$(tag) { return document.getElementByTagName(tag); }
function remover(node) { node = $(node); if (node.parentNode) node.parentNode.removeChild(node); }
function mostrar_esconder(area,string) {if ($(area).style.visibility=='visible') { esconder(area,'nao'); } else { $(area).style.visibility='visible'; $(area).style.display = 'block'; } }
function mais(id) { valor = $(id).innerHTML; if (valor=='[+]') { $(id).innerHTML='[-]'; } else if (valor=='[-]') { $(id).innerHTML='[+]'; } }
function mostrar(area) { $(area).style.visibility='visible'; $(area).style.display = 'block'; } 
function esconder(area,limpa) { $(area).style.visibility='hidden'; $(area).style.display = 'none'; if (!limpa) { $(area).innerHTML = ''; } }
function menu(campo) { $(campo).style.display = $(campo).style.display == 'block' ? 'none' : 'block'; $(campo).style.visibility = $(campo).style.visibility== 'visible' ? 'hidden' : 'visible'; }
function tag_esconde(tipo){ var oSelects=document.getElementsByTagName("select"); if (tipo=='esconde') { tipo='hidden'; } if (tipo=='mostra') { tipo='visible'; } for(var i=0;i<oSelects.length;i++) oSelects[i].style.visibility=tipo; }
function abre_url(ligar) { window.location.href=ligar; }
function carregando(acao,larg,alt) { if (acao=='mostra') { if (!$('id_carregando')) { alert("• AGUARDE!\n\ncarregado conteúdo..."); return; } car = $('id_carregando'); car.style.position="absolute"; car.style.visibility='visible'; car.style.display = 'block'; car.style.zIndex="300"; car.style.background="#CC0000"; car.style.color= "#fff"; car.style.padding="7px 16px 8px 16px"; car.style.margin= "0"; car.style.fontSize= "15px"; car.style.fontWeight= "bold"; car.innerHTML="Carregando..."; centralizar(car,larg,alt); } if (acao=='esconde') { esconder('id_carregando'); } }
function centralizar(obj,larg,alt) { var largura = larg; var altura  = alt; var coord = new coordenadas(); var scroll_top  = coord.topo(); var scroll_left = coord.esquerda(); var doc_largura = coord.largura(); var doc_altura = coord.altura(); var top_posicao = (doc_altura>altura)? (((scroll_top+doc_altura)/2)-(altura/2))+"px" : (scroll_top+10)+"px"; obj.style.left = ((doc_largura/2)-(largura/2))+"px"; obj.style.top  = Math.floor(parseInt(top_posicao))+"px"; }
function html(id,valor) { if (valor) { $(id).innerHTML=valor; } else { return $(id).innerHTML; } }
function criar(tag,html,classe) { var tag = tag||"div"; var elem = document.createElement(tag); if (html) elem.innerHTML = html; if (classe) elem.className = classe; return elem;}
/*****************
// FORMULARIOS
*****************/
function campo_errado(rotulo,campo,msg) { alert(msg); if (rotulo) { $(rotulo).className = 'rotulo_errado'; } $(campo).className = 'campo_errado'; $(campo).focus(); }
function campo_correto(rotulo,campo) { if (rotulo) { $(rotulo).className = 'rotulo_correto'; } $(campo).className = 'campo_correto'; }
function formatar_mascara(src, mascara) { var campo = src.value.length; var saida = mascara.substring(0,1); var texto = mascara.substring(campo); if(texto.substring(0,1) != saida) { src.value += texto.substring(0,1); } }
function formata_fone(objeto) { var obj = $(objeto).value; separador1 = '('; separador2 = ')'; separador3 = ' '; separador4 = '-'; conjunto1 = 0; conjunto2 = 3; conjunto3 = 4; conjunto4 = 8; if (obj.length == 0) { obj = '(' + obj ; } if (obj.length == 3) { obj = obj + ') ' ; } if (obj.length == 4) { obj = obj + ' ' ; } if (obj.length == 9) { obj = obj + "-" ; } $(objeto).value = obj; }
function valida_email(str) { var pass = 0; if (window.RegExp) { var tempStr = "a"; var tempReg = new RegExp(tempStr); if (tempReg.test(tempStr)) pass = 1;} if (!pass)return (str.indexOf(".") > 2) && (str.indexOf("@") > 0); var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)"); var r2 = new RegExp("^[a-zA-Z0-9\\.\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\}\\~]*[a-zA-Z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\}\\~]\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"); return (!r1.test(str) && r2.test(str)); }
function trim(a) { return a.replace(/^\s+|\s+$/g,'');}
/*////////////////////
// funções de IMAGENS
*/////////////////////
function coordenadas() 
{
 if (ie5) { standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body; }
 this.topo = function(){ return (ie5)? standardbody.scrollTop : window.pageYOffset; }
 this.esquerda = function(){ return (ie5)? standardbody.scrollLeft : window.pageXOffset; }
 this.largura = function(){ return (ie5)? standardbody.clientWidth : window.innerWidth-16; }
 this.altura = function(){ return (ie5)? standardbody.clientHeight: window.innerHeight; }
}
function video_tamanho(elem,larg,alt){ var video = $(elem); var obj = video.getElementsByTagName('object')[0]; obj.setAttribute('width', larg); obj.setAttribute('height', alt); var embed = video.getElementsByTagName('embed')[0]; embed.setAttribute('width', larg); embed.setAttribute('height', alt); }
// AUMENTA TAMANHO DA FONTE DE UMA DETERMINA ID
var fs = new Array('16px','18px','20px','22px' );var contador = 0;
function tamanhoFonte(x,area){ if(x == 1) { if(contador < fs.length - 1) { contador++; $(area).style.fontSize = fs[contador]; } } if( x == 0) { if(contador > 0) { contador--; $(area).style.fontSize = fs[contador]; } }}
/**************
//	Light v1.4
**************/
function foto_light(foto,larg,alt,pai){ var objBody = pai.document.getElementsByTagName("body").item(0); var pag_larg = (ie5) ? objBody.clientWidth   : objBody.offsetWidth; var pag_alt  = (ie5) ? objBody.clientHeight+744 : objBody.offsetHeight; if (ie5) { pai.tag_esconde('esconde'); } var objAntes = pai.document.createElement("div"); objAntes.setAttribute('id','div_antes'); objAntes.style.background = '#000'; objAntes.style.position = 'absolute'; objAntes.style.zIndex = '80'; objAntes.style.width = pag_larg+'px'; objAntes.style.height = pag_alt+'px'; objAntes.style.top = objAntes.style.bottom = objAntes.style.left = '0';  objAntes.style.opacity = objAntes.style.MozOpacity = objAntes.style.KhtmlOpacity = (0.75); objAntes.style.filter = "alpha(opacity=75)"; objBody.appendChild(objAntes); var objLytebox = pai.document.createElement("div"); objLytebox.setAttribute('id','div_borda'); objLytebox.style.position = 'absolute'; objLytebox.style.zIndex = '100'; objLytebox.style.background = "#fff"; objLytebox.style.padding="5px"; objBody.appendChild(objLytebox); pai.centralizar(objLytebox,larg,alt); Drag.init($('div_borda')); var objImage = pai.document.createElement("img"); objImage.setAttribute('border','0'); objImage.setAttribute('src',foto); objImage.setAttribute('id','id_foto'); objImage.setAttribute('name','id_foto'); objImage.setAttribute('width',larg+'px'); objImage.setAttribute('height',alt+'px'); objLytebox.appendChild(objImage); var objBoxRodape = pai.document.createElement("div"); objBoxRodape.setAttribute('id','div_borda_rodape'); objBoxRodape.style.zIndex = '100'; objBoxRodape.style.background = cor_secundaria; objBoxRodape.style.padding = "4px"; objBoxRodape.style.paddingTop = "10px"; objBoxRodape.style.textAlign = "center";objBoxRodape.style.cursor = "move"; objBoxRodape.innerHTML = "<input id='botao_fecha' value='fechar' type='submit' class='botao_prata'>"; objLytebox.appendChild(objBoxRodape); objAntes.onclick = pai.$('botao_fecha').onclick = function() { foto_apaga(pai); }; }
function foto_apaga(pai) { if (ie5) { tag_esconde('mostra'); } var Body = pai.document.getElementsByTagName("body").item(0); Body.removeChild(pai.$('div_antes')); Body.removeChild(pai.$('div_borda')); }
function frame_light(html,larg,alt,barra,pai){ var objBody = pai.document.getElementsByTagName("body").item(0); var pag_larg = (ie5) ? objBody.clientWidth   : objBody.offsetWidth; var pag_alt  = (ie5) ? objBody.clientHeight+744 : objBody.offsetHeight; if (ie5) { pai.tag_esconde('esconde'); } var objAntes = pai.document.createElement("div"); objAntes.setAttribute('id','div_antes'); objAntes.style.background = '#000'; objAntes.style.position = 'absolute'; objAntes.style.zIndex = '80'; objAntes.style.width = pag_larg+'px'; objAntes.style.height = pag_alt+'px'; objAntes.style.top = objAntes.style.bottom = objAntes.style.left = '0'; objAntes.style.opacity = objAntes.style.MozOpacity = objAntes.style.KhtmlOpacity = (0.75); objAntes.style.filter = "alpha(opacity=75)"; objBody.appendChild(objAntes); var objLytebox = pai.document.createElement("div"); objLytebox.setAttribute('id','div_frame'); objLytebox.style.position = 'absolute'; objLytebox.style.zIndex = '100'; objLytebox.style.background = '#fff'; objLytebox.style.border = '6px solid '+cor_secundaria; objBody.appendChild(objLytebox); pai.centralizar(objLytebox,larg,alt); pai.Drag.init($('div_frame')); pai.carregando('mostra',150,20);var objIframe = pai.document.createElement("iframe"); objIframe.setAttribute('id','id_frame'); objIframe.setAttribute('name','id_frame'); if (barra) { objIframe.style.overflow = 'auto'; } else { objIframe.setAttribute('scrolling','no'); } objIframe.setAttribute('src',html); objIframe.setAttribute('width',larg+'px'); objIframe.setAttribute('height',alt+'px'); objIframe.style.frameborder=0; objIframe.style.border=0; objIframe.style.padding='8px'; objLytebox.appendChild(objIframe);var objBoxRodape = pai.document.createElement("div"); objBoxRodape.setAttribute('id','div_frame_rodape'); objBoxRodape.setAttribute('title','mover janela'); objBoxRodape.style.cursor = "move"; objBoxRodape.style.zIndex = '100'; objBoxRodape.style.background = cor_secundaria; objBoxRodape.style.padding = "4px"; objBoxRodape.style.paddingTop = "10px"; objBoxRodape.style.textAlign = "center";objBoxRodape.innerHTML = '<input id="botao_fecha" value="fechar" type="submit" class="botao_prata">'; objLytebox.appendChild(objBoxRodape); pai.$('botao_fecha').onclick = function() { frame_apaga(pai); };}
function frame_apaga(pai){ if (ie5) { pai.tag_esconde('mostra'); } var Body = pai.document.getElementsByTagName("body").item(0); Body.removeChild(pai.$('div_antes')); Body.removeChild(pai.$('div_frame')); pai.carregando('esconde'); }
function light(id,larg,alt,legenda,conteudo,pai) { var area_titulo=id+'_titulo'; var link_minimiza=id+'_minimiza_link'; var area_minimiza=id+'_minimiza_area'; var objBody = pai.document.getElementsByTagName('body').item(0); var pag_larg = (ie5) ? objBody.clientWidth : objBody.offsetWidth; var pag_alt  = (ie5) ? objBody.clientHeight+744 : objBody.offsetHeight; if (!$(id)) { var DIV = pai.document.createElement('div'); DIV.id = id; DIV.style.background = cor_secundaria; DIV.style.border='1px solid '+cor_principal; DIV.style.display='block'; DIV.style.position = 'absolute'; DIV.style.padding='6px'; DIV.style.width = larg+'px'; DIV.style.zIndex = '200'; DIV.style.fontSize = '10px'; if (ie5) { DIV.style.textAlign = 'left'; } objBody.appendChild(DIV); pai.centralizar(DIV,larg,alt); var titulo = pai.document.createElement('div'); titulo.id = area_titulo; titulo.setAttribute('title','mover'); titulo.style.background = cor_principal; titulo.style.color=cor_secundaria; titulo.style.fontSize = '12px'; titulo.style.height = '18px'; titulo.style.padding = '10px 13px'; titulo.style.fontWeight = '700'; titulo.style.cursor = 'move'; titulo.ondblclick = function(){ light_minimiza(id); }; DIV.appendChild(titulo); var html = ''; html += '<div id="titulo_botao_fechar" style="float:right; width: 45px; font-family: monospace;">'; html += '<a href="#" id="'+link_minimiza+'" style="color:'+cor_secundaria+';text-decoration:none;" onclick="light_minimiza(\''+id+'\'); return false;" title="minimizar" />[-]</a><a href="#" style="color:'+cor_secundaria+';text-decoration:none;" onclick="light_fecha(\''+id+'\'); return false;" title="fechar" />[x]</a>'; html += '</div>'; var larg_legenda = eval(larg)-90; html += '<div style="width: '+larg_legenda+'px;">'+legenda+'</div>'; titulo.innerHTML = html; var corpo = pai.document.createElement("div"); corpo.id = area_minimiza; corpo.style.maxHeight = alt+'px'; corpo.style.paddingBottom = '10px'; corpo.style.background='#fff'; corpo.innerHTML = conteudo; DIV.appendChild(corpo); Drag.init($(area_titulo),$(id)); } else { $(area_minimiza).innerHTML=conteudo; var minimiza=$(link_minimiza).innerHTML; if (minimiza=='[+]') { $(link_minimiza).innerHTML='[-]'; $(link_minimiza).setAttribute('title','minimiza'); mostrar(area_minimiza); } } }
function light_minimiza(id) { var link = id+'_minimiza_link'; var area = id+'_minimiza_area'; a=html(link,''); if (a=='[-]') { html(link,'[+]'); $(link).setAttribute('title','maximiza'); esconder(area,'nao'); } else { html(link,'[-]'); $(link).setAttribute('title','minimiza'); mostrar(area); } return false; }
function light_fecha(id) { if (ie5) { tag_esconde('mostra'); } remover(id); }
/********
* Ajax 
*********/
function OpenAjax() { var obj; try { obj = new XMLHttpRequest(); } catch(ee) { try { obj = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { obj = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { obj=false; } } } return obj; }
function extrai_script(texto) { var ini = 0; while (ini!=-1) { ini = texto.indexOf('<script', ini); if (ini >=0) { ini = texto.indexOf('>', ini) + 1; var fim = texto.indexOf('</script>', ini); codigo = texto.substring(ini,fim); eval(codigo); } } }
function abre(pag,area,esconder,area_seta,carregando) 
{ 
 if (area_seta) { seta_muda(area_seta); } var Area = $(area); if (!Area) { alert('• AGUARDE!\n\ncarregado conteúdo...'); return; }
 if (esconder) { if(Area.innerHTML) { Area.innerHTML = ''; Area.style.display = 'none'; Area.style.visibility='hidden'; return; } else { Area.style.display = 'block'; Area.style.visibility = 'visible'; } } 
 var obj = new OpenAjax(); obj.open('GET', pag, true); obj.setRequestHeader('Cache-Control','no-store, no-cache, must-revalidate'); obj.setRequestHeader('Cache-Control','post-check=0, pre-check=0'); obj.setRequestHeader('Pragma','no-cache'); obj.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
 obj.onreadystatechange = function() { if (carregando) { Area.innerHTML='<div class="carregando">Carregando...</div>'; } if (obj.readyState == 4) { var resultado = obj.responseText; resultado = resultado.replace(/\+/g,' '); resultado = unescape(resultado); Area.innerHTML = resultado; extrai_script(resultado); mostrar(area); } } 
 obj.send(null); 
}
/***********
// CONTATO
***********/
function contato_valida() { nome = $('nome_ad').value; if (!nome) { campo_errado('nome_ad_label','nome_ad','O campo SEU NOME é obrigatório.'); return; } else { campo_correto('nome_ad_label','nome_ad'); } fone = $('fone_ad').value; OK_fone = padrao_fone.exec(fone); if (!OK_fone) { campo_errado('fone_ad_label','fone_ad','Digite o SEU TELEFONE corretamente.\nusando o formato (99) 9999-999'); return; } else { campo_correto('fone_ad_label','fone_ad'); } email = $('email_ad').value; if (!email) { campo_errado('email_ad_label','email_ad','O campo SEU EMAIL é obrigatório.'); return; } else { campo_correto('email_ad_label','email_ad'); } if (!valida_email(email)) { campo_errado('email_ad_label','email_ad','Por favor digite o SEU EMAIL corretamente.'); return; } else { campo_correto('email_ad_label','email_ad'); } assunto = $('assunto_ad').value; if (!assunto) { campo_errado('assunto_ad_label','assunto_ad','O campo ASSUNTO é obrigatório.'); return; } else { campo_correto('assunto_ad_label','assunto_ad'); } descricao = $('descricao_ad').value;  if (!descricao) { campo_errado('descricao_ad_label','descricao_ad','O campo MENSAGEM é obrigatório.'); return; } else { campo_correto('descricao_ad_label','descricao_ad'); } document.form_ad.submit();}
/**********
* FAVORITOS
***********/
function ad_favoritos(url,title) { if (window.sidebar) { window.sidebar.addPanel(title,url,""); } else if( document.all ) { window.external.AddFavorite(url,title); } else if( window.opera && window.print ) { return true; } }
function recomenda(servico,link_chama,titulo,descricao)
{
 link_chama = encodeURIComponent(link_chama);
 if (servico!='yahoo') { titulo =  encodeURIComponent(titulo); descricao = encodeURIComponent(descricao); }
 if (servico=='delicious') { url = "http://del.icio.us/post?url="+link_chama+"&amp;title="+titulo+"&amp;notes="+descricao; }
 else if (servico=='digg') { url = "http://digg.com/submit?phase=2&url="+link_chama+"&title="+titulo+"&bodytext="+descricao+"&media=news"; }
 else if (servico=='digg_video') { url = "http://digg.com/submit?phase=2&url="+link_chama+"&title="+titulo+"&bodytext="+descricao+"&media=video"; }
 else if (servico=='google') { url = "http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk="+link_chama+"&title="+titulo; }
 else if (servico=='yahoo') { url = "http://myweb2.search.yahoo.com/myresults/bookmarklet?u="+link_chama+"&t="+titulo; }
 else if (servico=='facebook') { url = "http://www.facebook.com/share.php?u="+link_chama+"&t="+titulo; }
 else if (servico=='myspace') { url = "http://www.myspace.com/index.cfm?fuseaction=postto&" + "t=" + titulo+"&c="+descricao+"&u="+link_chama+"&l=2"; }
 else if (servico=='orkut') { url = "http://www.orkut.com/FavoriteVideos.aspx?u="+link_chama; }
 else if (servico=='twitter') { url = "http://twitter.com/home/?status="+titulo+' '+link_chama; }
 else if (servico=='live') { url = "http://twitter.com/home/?status=Estou lendo: "+link_chama; }
 window.open(url,'_blank'); return false;
}

function busca(campo,formulario) { var	q = trim($(campo).value); if (q=='Pesquisa...' || !q) { campo_errado('',campo,'Por favor digite algo para continuar a pesquisa.'); $(campo).value=''; return; } else { campo_correto('',campo); } document.formulario.submit(); }

/******************** 
// DRAG ON DROP 
*********************/
var Drag = {
	obj : null,
	init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper) { o.onmousedown	= Drag.start; o.hmode			= bSwapHorzRef ? false : true ; o.vmode			= bSwapVertRef ? false : true ; o.root = oRoot && oRoot != null ? oRoot : o ; if (o.hmode  && isNaN(parseInt(o.root.style.left  ))) o.root.style.left   = "0px"; if (o.vmode  && isNaN(parseInt(o.root.style.top   ))) o.root.style.top    = "0px"; if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right  = "0px"; if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px"; o.minX	= typeof minX != 'undefined' ? minX : null; o.minY	= typeof minY != 'undefined' ? minY : null; o.maxX	= typeof maxX != 'undefined' ? maxX : null; o.maxY	= typeof maxY != 'undefined' ? maxY : null; o.xMapper = fXMapper ? fXMapper : null;	o.yMapper = fYMapper ? fYMapper : null; o.root.onDragStart	= new Function(); o.root.onDragEnd	= new Function(); o.root.onDrag		= new Function(); },
	start : function(e) { var o = Drag.obj = this; e = Drag.fixE(e); var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom); var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right ); o.root.onDragStart(x, y); o.lastMouseX	= e.clientX; o.lastMouseY	= e.clientY; if (o.hmode) { if (o.minX != null)	o.minMouseX	= e.clientX - x + o.minX; if (o.maxX != null)	o.maxMouseX	= o.minMouseX + o.maxX - o.minX; } else { if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x; if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x; } if (o.vmode) { if (o.minY != null)	o.minMouseY	= e.clientY - y + o.minY; if (o.maxY != null)	o.maxMouseY	= o.minMouseY + o.maxY - o.minY; } else { if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y; if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y; } document.onmousemove	= Drag.drag; document.onmouseup		= Drag.end; return false; },
	drag : function(e) { e = Drag.fixE(e); var o = Drag.obj; var ey	= e.clientY; var ex	= e.clientX; var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom); var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right ); var nx, ny; 	if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX); if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX); if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY); if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY); nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1)); ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1)); if (o.xMapper)		{ nx = o.xMapper(y); } else if (o.yMapper)	{ ny = o.yMapper(x); } Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px"; Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px"; Drag.obj.lastMouseX	= ex; Drag.obj.lastMouseY	= ey; Drag.obj.root.onDrag(nx, ny); return false; },
	end : function() { document.onmousemove = null; document.onmouseup   = null; Drag.obj.root.onDragEnd(	parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]), parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"])); Drag.obj = null; },
	fixE : function(e) { if (typeof e == 'undefined') e = window.event; if (typeof e.layerX == 'undefined') e.layerX = e.offsetX; if (typeof e.layerY == 'undefined') e.layerY = e.offsetY; return e; }
}