var MSGTIMER=20;var MSGSPEED=5;var MSGOFFSET=3;var MSGHIDE=3;function inlineMsg(target,string,autohide){var msg;var msgcontent;if(!document.getElementById('msg')){msg=document.createElement('div');msg.id='msg';msgcontent=document.createElement('div');msgcontent.id='msgcontent';document.body.appendChild(msg);msg.appendChild(msgcontent);msg.style.filter='alpha(opacity=0)';msg.style.opacity=0;msg.alpha=0}else{msg=document.getElementById('msg');msgcontent=document.getElementById('msgcontent')}msgcontent.innerHTML=string;msg.style.display='block';var msgheight=msg.offsetHeight;var targetdiv=document.getElementById(target);targetdiv.focus();var targetheight=targetdiv.offsetHeight;var targetwidth=targetdiv.offsetWidth;var topposition=topPosition(targetdiv)-((msgheight-targetheight)/2);var leftposition=leftPosition(targetdiv)+targetwidth+MSGOFFSET;msg.style.top=topposition+'px';msg.style.left=leftposition+'px';clearInterval(msg.timer);msg.timer=setInterval("fadeMsg(1)",MSGTIMER);if(!autohide){autohide=MSGHIDE}window.setTimeout("hideMsg()",(autohide*1000))}function hideMsg(msg){var msg=document.getElementById('msg');if(msg!=null){if(!msg.timer){msg.timer=setInterval("fadeMsg(0)",MSGTIMER)}}}function fadeMsg(flag){if(flag==null){flag=1}var msg=document.getElementById('msg');var value;if(flag==1){value=msg.alpha+MSGSPEED}else{value=msg.alpha-MSGSPEED}msg.alpha=value;msg.style.opacity=(value/100);msg.style.filter='alpha(opacity='+value+')';if(value>=99){clearInterval(msg.timer);msg.timer=null}else if(value<=1){msg.style.display="none";clearInterval(msg.timer)}}function leftPosition(target){var left=0;if(target.offsetParent){while(1){left+=target.offsetLeft;if(!target.offsetParent){break}target=target.offsetParent}}else if(target.x){left+=target.x}return left}function topPosition(target){var top=0;if(target.offsetParent){while(1){top+=target.offsetTop;if(!target.offsetParent){break}target=target.offsetParent}}else if(target.y){top+=target.y}return top}if(document.images){arrow=new Image(7,80);arrow.src="imagenes/flechita.png";var konamisound=new Image();konamisound.src="1up.mpeg"}function echeck(str){var at="@";var dot=".";var lat=str.indexOf(at);var lstr=str.length;var ldot=str.indexOf(dot);if(str.indexOf(at)==-1)return false;if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr)return false;if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr)return false;if(str.indexOf(at,(lat+1))!=-1)return false;if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot)return false;if(str.indexOf(dot,(lat+2))==-1)return false;if(str.indexOf(" ")!=-1)return false;return true}function validarContacto(){hideMsg();if(document.form1.nombre.value==''){inlineMsg('nombre','Debe ingresar un nombre',2);return false}if(document.form1.comentario.value==''){inlineMsg('comentario','Debe ingresar una consulta',2);return false}if(document.form1.mail.value==''){inlineMsg('mail','Debe ingresar un e-mail',2);return false}else if(echeck(document.form1.mail.value)==false){inlineMsg('mail','Debe ingresar una dirección de email válida.',2);return false}return true}function irAPos(id){try{Effect.ScrollTo(id, {offset:-20});}catch(e){}return false;}function DialogOverlay(content,container){if(typeof container=='undefined')container=document.body;if(null==(this.container=$(container)))throw("container is not valid");this.content=content;this.overlay=new Element('div',{'class':'overlay'}).hide();this.dialog=new Element('div',{'class':'dialog'}).hide();Event.observe(this.overlay,'click',this.hide.bindAsEventListener(this));this.dialog.insert(this.content);this.overlay.insert(this.dialog);this.container.insert(this.overlay);content.show();this.dialog.hide()}DialogOverlay.prototype.show=function(){new Effect.Appear(this.overlay,{duration:0.5,to:0.5});this.dialog.show();return this};DialogOverlay.prototype.hide=function(event){this.dialog.remove();this.overlay.remove();Effect.Fade('goggles_img1',{duration:0.5});Effect.Fade('goggles_img2',{duration:0.5});Effect.Fade('goggles_img3',{duration:0.5});Effect.Fade('goggles_img4',{duration:0.5});return this};function crazyGoggles(){irAPos('wrapper');Effect.Appear('goggles_img1',{duration:0.5,to:1});Effect.Appear('goggles_img2',{duration:0.5,to:1});Effect.Appear('goggles_img3',{duration:0.5,to:1});Effect.Appear('goggles_img4',{duration:0.5,to:1});var dialog=new Element('div');var overlay=new DialogOverlay(dialog);overlay.show()}var Konami=function(){var a={addEvent:function(b,c,d,e){if(b.addEventListener)b.addEventListener(c,d,false);else if(b.attachEvent){b["e"+c+d]=d;b[c+d]=function(){b["e"+c+d](window.event,e)};b.attachEvent("on"+c,b[c+d])}},input:"",pattern:"3838404037393739666513",load:function(b){this.addEvent(document,"keydown",function(c,d){if(d)a=d;a.input+=c?c.keyCode:event.keyCode;if(a.input.length>a.pattern.length)a.input=a.input.substr(a.input.length-a.pattern.length);if(a.input==a.pattern){a.code(b);a.input=""}},this);this.iphone.load(b)},code:function(b){window.location=b},iphone:{start_x:0,start_y:0,stop_x:0,stop_y:0,tap:false,capture:false,orig_keys:"",keys:["UP","UP","DOWN","DOWN","LEFT","RIGHT","LEFT","RIGHT","TAP","TAP","TAP"],code:function(b){a.code(b)},load:function(b){orig_keys=this.keys;a.addEvent(document,"touchmove",function(c){if(c.touches.length==1&&a.iphone.capture==true){c=c.touches[0];a.iphone.stop_x=c.pageX;a.iphone.stop_y=c.pageY;a.iphone.tap=false;a.iphone.capture=false;a.iphone.check_direction()}});a.addEvent(document,"touchend",function(){a.iphone.tap==true&&a.iphone.check_direction(b)},false);a.addEvent(document,"touchstart",function(c){a.iphone.start_x=c.changedTouches[0].pageX;a.iphone.start_y=c.changedTouches[0].pageY;a.iphone.tap=true;a.iphone.capture=true})},check_direction:function(b){x_magnitude=Math.abs(this.start_x-this.stop_x);y_magnitude=Math.abs(this.start_y-this.stop_y);x=this.start_x-this.stop_x<0?"RIGHT":"LEFT";y=this.start_y-this.stop_y<0?"DOWN":"UP";result=x_magnitude>y_magnitude?x:y;result=this.tap==true?"TAP":result;if(result==this.keys[0])this.keys=this.keys.slice(1,this.keys.length);if(this.keys.length==0){this.keys=this.orig_keys;this.code(b)}}}};return a};konami=new Konami();/*konami.pattern = "38"*/konami.code=function(){/*irAPos('pie');*/ document.location='#pie';Sound.play('1up.mpeg');$('pie').setStyle({backgroundPosition:'110% 100%'});new Effect.Morph('pie',{style:'background-position:-10% 100%;',duration:20,fps:100,transition:Effect.Transitions.linear,delay:0});};konami.load();
