function popLink(link){ w = window.open('http://www.n2design.com.br//'+link,"link","width=600,height=360,scrollbars=yes,left=0,resizable=yes"); w.focus(); } function flashPutHref( _v ){ } var initY; var InitX; var x; var y; initY = 0; initX = 400; function menu(_div){ y = parseInt(-$('content').offsetTop) - parseInt($('div'+_div).offsetTop) + parseInt($('logo').offsetTop);// - initY x = parseInt(-$('content').offsetLeft) - parseInt($('div'+_div).offsetLeft) + parseInt($('logo').offsetLeft - 300);// - initX new Effect.MoveBy( $('content'), y,x,{duration: 2}); pageTracker._trackPageview(_div); /*new Effect.Parallel( [ new Effect.Opacity($('content'), {duration: 1, to: 0.3, from: 1.0, afterFinish: function() { new Effect.Opacity($('content'), {to: 1.0, from: 0.3,duration: 1 } ); } } ), new Effect.MoveBy( $('content'),0, x, {duration: 2}) ] );*/ } var imgC = 0; function sendWindowForm( divForm, _form ){ $$(".inputField").each(function(_ele){ if(_ele.value == _ele.readAttribute('myvalue')) _ele.value = ''; }); divResp = 'emailResponse'+divForm; var valid; valid = new Validation( _form.id ,{onSubmit:false}); if(valid.validate()){ if($(divForm).firstDescendant().id != divResp) $(divForm).insert({'top' : '
'}); new Effect.Appear($(divResp),{duration: 1}); $(divResp).update('Enviando...').setStyle({ background: '#FFFF99' }); new Ajax.Request('http://www.n2design.com.br//_ajax.php?acao=enviaDados&'+_form.serialize(),{ onComplete: function(transport) { if(transport.responseText == 'ok'){ $(divResp).update('A mensagem foi enviado com sucesso').setStyle({ background: '#dfd' }); }else{ $(divResp).update('Não foi possível enviar a mensagem neste momento. Tente novamente, por favor.').setStyle({ background: '#fdd' }); } } }); } $$(".inputField").each(function(_ele){ if(_ele.value == '') _ele.value = _ele.readAttribute('myvalue'); }); return false; } var initPort = 0; function showPort( _id ){ new Effect.Parallel( [ new Effect.Fade($('divPortfolioContent'),{duration : $('divPortfolioContent').visible() ? 1 : 0.01 }), new Effect.Morph($('divPortfolioContent'),{ style:{width:'0px'}, duration : $('divPortfolioContent').visible() ? 1 : 0.01 }) ],{ afterFinish: function(){ if(initPort != _id){ $('divPortfolioContent').update("Carregando..."); new Ajax.Updater($('divPortfolioContent'),'http://www.n2design.com.br//_ajax.php?acao=atualizaPort&id='+_id,{ onComplete: function(){ new Effect.Parallel( [ new Effect.Appear($('divPortfolioContent')), new Effect.Morph($('divPortfolioContent'),{ style:{width:'560px'}}) ] ); $('portContentTitle_'+_id).setOpacity(0.8); logoMov = true; } }); initPort = _id; } } } ); //pageTracker._trackPageview(_id); return false; } var initSerc = 0; function showSerc( _id ){ new Effect.Parallel( [ new Effect.Fade($('divServicosContent'),{duration : $('divServicosContent').visible() ? 1 : 0.01 }), new Effect.Morph($('divServicosContent'),{ style:{width:'0px'}, duration : $('divServicosContent').visible() ? 1 : 0.01 }) ],{ afterFinish: function(){ if(initPort != _id){ $('divServicosContent').update("Carregando..."); new Ajax.Updater($('divServicosContent'),'http://www.n2design.com.br//_ajax.php?acao=atualizaSerc&id='+_id,{ onComplete: function(){ new Effect.Parallel( [ new Effect.Appear($('divServicosContent')), new Effect.Morph($('divServicosContent'),{ style:{width:'560px'}}) ] ); } }); initPort = _id; } } } ); //pageTracker._trackPageview(_id); return false; } function blog_focus(){ this.addClassName('inputFocus'); this.previous('label').addClassName('labelFocus'); } function blog_blur(){ this.removeClassName('inputFocus'); this.previous('label').removeClassName('labelFocus'); } var uploadArquivo; function init(){ $('conteudo').setStyle({'height':document.viewport.getHeight()+"px"}); //$('conteudo').setStyle({'height':"100px"}); new Draggable($('content'),{zindex:0,starteffect:'',endeffect:''}); //new Effect.Move($('content'),{ x: -100, y: -550, onFinish: function(){ //}}); menu('Home'); } window.onload = init; window.onresize = init; function debugFunction(message) { //$('debug').insert("\n\n\n" + message); } function fileQueueError(file, error_code, message) { try { if (error_code !== "") { alert("Erro: "+message); return; } } catch (ex) { this.debug(ex); } } function fileDialogComplete(num_files_queued) { try { if (num_files_queued > 0) { this.startUpload(); } } catch (ex) { this.debug(ex); } } function uploadStartFunction(file) { //arquivo = document.createElement("div"); //arquivo.id = file.id+"Div"; $('divFileProgressContainer').insert('
'); } function uploadProgress(file, bytesLoaded) { try { var percent = Math.ceil((bytesLoaded / file.size) * 100); $('div_'+file.index).update(percent+" %"); } catch (ex) { this.debug(ex); } } function uploadSuccessArquivo(file, server_data) { try { $('thumbnails').insert(server_data); } catch (ex) { this.debug(ex); } } function uploadCompleteArquivo(file) { try { $('div_'+file.index).fade(); if (this.getStats().files_queued >= 0) { this.startUpload(); } else { $('divFileProgressContainer').insert('O arquivo foi enviado corretamente'); } } catch (ex) { this.debug(ex); } } function uploadError(file, error_code, message) { var image_name = "error.gif"; var progress; try { switch (error_code) { case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED: try { $(file.id).update('Cancelado'); } catch (ex1) { this.debug(ex1); } break; case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED: try { $(file.id).update('Parado'); } catch (ex2) { this.debug(ex2); } case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED: image_name = "uploadlimit.gif"; break; default: $(file.id).update(message); break; } } catch (ex3) { this.debug(ex3); } }