var url='http://www.audi.es/a4';

//--wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
// Produced by DoubleYou, Dec 2001
// www.doubleyou.com
// info@doubleyou.com
//wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww-->






function BrowserCheck(){var b=navigator.appName;if(b=="Netscape")this.b="ns";else if(b=="Microsoft Internet Explorer")this.b="ie";else this.b=b;this.version=navigator.appVersion;this.v=parseInt(this.version);this.ns=(this.b=="ns"&&this.v>=4);this.ns4=(this.b=="ns"&&this.v==4);this.ns5=(this.b=="ns"&&this.v==5);this.ie=(this.b=="ie"&&this.v>=4);this.ie4=(this.version.indexOf('MSIE 4')>0);this.ie5=(this.version.indexOf('MSIE 5')>0);this.min=(this.ns||this.ie);}is=new BrowserCheck();function DynLayer(id,nestref,frame){if(!is.ns5&&!DynLayer.set&&!frame)DynLayerInit();this.frame=frame||self;this.elm=this.event=this.frame.document.all[id];this.css=this.frame.document.all[id].style;this.doc=document;this.x=this.elm.offsetLeft;this.y=this.elm.offsetTop;this.w=(is.ie4)?this.css.pixelWidth:this.elm.offsetWidth;this.h=(is.ie4)?this.css.pixelHeight:this.elm.offsetHeight;this.id=id;this.nestref=nestref;this.obj=id+"DynLayer";eval(this.obj+"=this");}function DynLayerMoveTo(x,y){if(x!=null){this.x=x;this.css.pixelLeft=this.x;}if(y!=null){this.y=y;this.css.pixelTop=this.y;}}function DynLayerMoveBy(x,y){this.moveTo(this.x+x,this.y+y);}function DynLayerShow(){this.css.visibility="visible";}function DynLayerHide(){this.css.visibility="hidden";}DynLayer.prototype.moveTo=DynLayerMoveTo;DynLayer.prototype.moveBy=DynLayerMoveBy;DynLayer.prototype.show=DynLayerShow;DynLayer.prototype.hide=DynLayerHide;DynLayerTest=new Function('return true');function DynLayerInit(nestref){if(!DynLayer.set)DynLayer.set=true;if(is.ie){for(var i=0;i<document.all.tags("DIV").length;i++){var divname=document.all.tags("DIV")[i].id;var index=divname.indexOf("Div");if(index>0){eval(divname.substr(0,index)+' = new DynLayer("'+divname+'")');}}}return true;}DynLayer.nestRefArray=new Array();DynLayer.refArray=new Array();DynLayer.refArray.i=0;DynLayer.set=false;function createLayer(id,nestref,left,top,width,height,content,bgColor,visibility,zIndex,other){var str='\n<DIV id='+id+' style="position:absolute; left:'+left+'; top:'+top+'; width:'+width;if(height!=null){str+='; height:'+height;str+='; clip:rect(0,'+width+','+height+',0)';}if(bgColor!=null)str+='; background-color:'+bgColor;if(zIndex!=null)str+='; z-index:'+zIndex;if(visibility)str+='; visibility:'+visibility;str+=';">'+((content)?content:'')+'</DIV>';if(nestref){index=nestref.lastIndexOf(".");var nestlyr=(index!=-1)?nestref.substr(index+1):nestref;document.all[nestlyr].insertAdjacentHTML("BeforeEnd",str);}else{document.body.insertAdjacentHTML("BeforeEnd",str);}}function initMouseEvents(){document.onmousedown=mouseDown;document.onmousemove=mouseMove;document.onmouseup=mouseUp;}function mouseDown(e){if(is.ie&&event.button!=1)return true;var x=event.x+document.body.scrollLeft;var y=event.y+document.body.scrollTop;if(Scroll&&ScrollTestActive())return false;else if(Drag&&drag.mouseDown(x,y))return false;else return DynMouseDown(x,y);}function mouseMove(e){var x=event.x+document.body.scrollLeft;var y=event.y+document.body.scrollTop;if(Scroll&&ScrollTestActive())return false;else if(Drag&&drag.mouseMove(x,y))return false;else return DynMouseMove(x,y);}function mouseUp(e){var x=event.x+document.body.scrollLeft;var y=event.y+document.body.scrollTop;if(Drag&&drag.mouseUp(x,y))return false;else return DynMouseUp(x,y);}function DynMouseDown(x,y){return true}function DynMouseMove(x,y){return true}function DynMouseUp(x,y){return true}Scroll=null;Drag=null;function DoubleYouFrenadoTo(finalx,finaly,velocidad,intervalo,fn){if(finalx==null)this.finalx=this.x;else this.finalx=finalx;if(finaly==null)this.finaly=this.y;else this.finaly=finaly;this.velocidad=velocidad;this.intervalo=intervalo;this.fn=fn;this.frenadoActive=true;this.posx=this.x;this.posy=this.y;this.frenadoloop();}function DoubleYouFrenadoLoop(){if(this.frenadoActive){this.posx=(this.finalx+this.velocidad*this.posx)/(this.velocidad+1);this.posy=(this.finaly+this.velocidad*this.posy)/(this.velocidad+1);this.moveTo(this.posx,this.posy);if((Math.abs(this.finaly-this.posy)<1)&&(Math.abs(this.finalx-this.posx)<1)){this.moveTo(this.finalx,this.finaly);if(this.fn!=null)eval(this.fn);}else setTimeout(this.obj+".frenadoloop()",this.intervalo);}}DynLayer.prototype.frenadoTo=DoubleYouFrenadoTo;DynLayer.prototype.frenadoloop=DoubleYouFrenadoLoop;function DoubleYouAceleradoInit(){this.aceleradoTo=DoubleYouAceleradoTo;this.aceleradoBy=DoubleYouAceleradoBy;this.aceleradoloop=DoubleYouAceleradoLoop;}function DoubleYouAceleradoTo(finalx,finaly,velocidad,intervalo,fn){if(finalx==null)this.finalx=this.x;else this.finalx=finalx;if(finaly==null)this.finaly=this.y;else this.finaly=finaly;this.intervalo=intervalo;this.distx=this.finalx-this.x;this.disty=this.finaly-this.y;this.angulo=90;this.velocidad=Math.round(90/velocidad);this.fn=fn;this.aceleradoActive=true;this.posx=this.x;this.posy=this.y;this.aceleradoloop();}function DoubleYouAceleradoLoop(){if(this.aceleradoActive){this.posx=this.finalx-this.distx*Math.sin(this.angulo*Math.PI/180);this.posy=this.finaly-this.disty*Math.sin(this.angulo*Math.PI/180);this.angulo-=this.velocidad;this.moveTo(this.posx,this.posy);if(this.angulo<this.velocidad){this.moveTo(this.finalx,this.finaly);if(this.fn!=null)eval(this.fn);}else setTimeout(this.obj+".aceleradoloop()",this.intervalo);}}DynLayer.prototype.aceleradoTo=DoubleYouAceleradoTo;DynLayer.prototype.aceleradoloop=DoubleYouAceleradoLoop;function DynLayerWrite(html){this.event.innerHTML=html;}DynLayer.prototype.write=DynLayerWrite;function preload(imgObj,imgSrc){eval(imgObj+' = new Image()');eval(imgObj+'.src = "'+imgSrc+'"');}function changeImage(layer,imgName,imgObj){document.images[imgName].src=eval(imgObj+".src");}var imgArray=[0,0,0,0,0,0,0,0];var mascaraX=0;var mascaraY=0;var mascaraX2=0;var mascaraY2=0;var imgs_to_load=['coche1','coche1b','coche2','coche2b','coche3','coche3b','empty','final','fondo','introducing','introducing2','introducingconaudi','quattro'];var imgs_loaded=-1;function init_loading(){ww=document.body.offsetWidth;wh=document.body.offsetHeight;b=document.getElementById('DY');createLayer('mascaraDiv',null,-500,-100,468,60,null,null,'hidden',10000);mascara=new DynLayer('mascaraDiv');load_imgs();}function load_imgs(){imgs_loaded++;if(imgs_loaded>=imgs_to_load.length)init();else mascara.write('<img src="audia4quattro_'+imgs_to_load[imgs_loaded]+'.gif" onLoad="load_imgs()" onError="load_imgs()">');}function start(){changeImage(null,'bannerIMG','audibanner3');mascara.moveTo(mascaraX,mascaraY-1);blinka();}var mascaraX=0;var mascaraY=0;var ww=0;var wh=0;function init(){ww=document.body.offsetWidth;wh=document.body.offsetHeight;preload('frame0','audiA4quattro_empty.gif');preload('frame1','audiA4quattro_coche2.gif');preload('frame2','audiA4quattro_coche3.gif');preload('frameb0','audiA4quattro_empty.gif');preload('frameb1','audiA4quattro_coche2b.gif');preload('frameb2','audiA4quattro_coche3b.gif');preload('audibanner2','audiA4quattro_introducingconaudi.gif');preload('audibanner3','audiA4quattro_introducing.gif');mascara.write('');mascara.show();mascara.id='mascaraDiv';mascaraX=jab.offsetLeft;mascaraY=jab.offsetTop+1;createLayer('lankDiv','mascaraDiv',0,0,468,60,'<a href="'+url+'" onmouseover="beginna()" onmouseout=""><img src="audiA4quattro_empty.gif" alt="" width="468" height="60" border="0"></a>',null,null,1000);lank=new DynLayer('lankDiv','mascaraDiv');createLayer('cocheDiv','mascaraDiv',-200,1,148,60,null,null,null,200);coche=new DynLayer('cocheDiv','mascaraDiv');createLayer('coche0Div','mascaraDiv.document.cocheDiv',0,7,148,51,'<img src="audiA4quattro_empty.gif" alt="" name="cocheIMG" width="148" height="58" border="0">',null,null,200);coche0=new DynLayer('coche0Div','mascaraDiv.document.cocheDiv');createLayer('coche0bDiv','mascaraDiv.document.cocheDiv',0,-7,148,58,'<img src="audiA4quattro_empty.gif" alt="" name="cocheIMGb" width="148" height="58" border="0">',null,'hidden',200);coche0b=new DynLayer('coche0bDiv','mascaraDiv.document.cocheDiv');createLayer('coche1Div','mascaraDiv.document.cocheDiv',0,7,148,51,'<img src="audiA4quattro_coche1.gif" alt="" width="148" height="58" border="0">',null,null,105);coche1=new DynLayer('coche1Div','mascaraDiv.document.cocheDivv');createLayer('coche1bDiv','mascaraDiv.document.cocheDiv',0,-7,148,58,'<img src="audiA4quattro_coche1b.gif" alt="" width="148" height="58" border="0">',null,'hidden',100);coche1b=new DynLayer('coche1bDiv','mascaraDiv.document.cocheDivv');createLayer('lineDiv','mascaraDiv',180,20,1,20,null,'#cc0000',null,105);line=new DynLayer('lineDiv','mascaraDiv');createLayer('fraseDiv','mascaraDiv',0,0,468,60,'<img src="audiA4quattro_introducing2.gif" alt="" width="468" height="60" border="0">',null,null,100);frase=new DynLayer('fraseDiv','mascaraDiv');createLayer('quattroDiv','mascaraDiv',282,20,78,20,'<img src="audiA4quattro_quattro.gif" alt="" width="78" height="20" border="0">',null,'hidden',120);quattro=new DynLayer('quattroDiv','mascaraDiv');createLayer('fondoDiv','mascaraDiv',0,0,468,60,'<img src="audiA4quattro_fondo.gif" alt="" width="468" height="60" border="0">',null,null,10);fondo=new DynLayer('fondoDiv','mascaraDiv');start();}var blinkaAktivo=false;function blinka(){if(gang>0){line.hide();return;}if(blinkaAktivo){blinkaAktivo=false;line.show();}else{line.hide();blinkaAktivo=true;}if(gang<1)setTimeout("blinka()",500);else line.hide();}var gang=0;function beginna(){gang+=1;if(gang==1){frase.show();setTimeout('entrada()',500);}}function entrada(){adelante();coche0.moveTo(0,7);coche.frenadoTo(41,null,8,10,'clearTimeout(nopuedor2);starta()');}function starta(){lank.hide();changeImage(null,'bannerIMG','audibanner2');frase.hide();fondo.hide();coche.hide();coche0.hide();coche1.hide();jab.style.filter="progid:DXImageTransform.Microsoft.Matrix(sizingmethod='auto expand')";setTimeout("DoAnimation();",1000);}var nopuedor1,nopuedor2,nopuedor3;var contador=10000;function adelante(){contador+=1;changeImage(null,'cocheIMG','frame'+contador%3);nopuedor2=setTimeout("adelante()",50);}function atras(){contador-=1;changeImage(null,'cocheIMGb','frameb'+contador%3);nopuedor3=setTimeout("atras()",50);}var ii=0;var deg2rad=Math.PI*2/360;function SetRotation(deg){rad=deg*deg2rad;costheta=Math.cos(rad);sintheta=Math.sin(rad);jab.filters.item(0).M11=costheta;jab.filters.item(0).M12=-sintheta;jab.filters.item(0).M21=sintheta;jab.filters.item(0).M22=costheta;}var vuelta=false;function DoAnimation(){coche0.moveTo(-2000,-20);ii+=10;if(ii>180){changeImage(null,'cocheIMGb','frameb0');coche0.hide();coche1.hide();coche0b.show();coche1b.show();coche.moveTo(280,null);changeImage(null,'bannerIMG','audibanner3');coche.show();vuelta=true;jab.onfilterchange=null;setTimeout("volver()",1000);}else{jab.onfilterchange=DoAnimation;SetRotation(ii);}}function volver(){lank.show();atras();coche.aceleradoTo(-180,null,20,20,'posFinal()');}function posFinal(){clearTimeout(nopuedor3);quattro.show();setTimeout("reset()",5000);}function reset(){jab.style.filter=null;blinkaAktivo=false;line.hide();gang=0;frase.hide();coche.moveTo(-200,1);coche0b.hide();coche1b.hide();coche0.show();coche1.show();contador=10000;ii=0;deg2rad=Math.PI*2/360;lank.show();quattro.hide();changeImage(null,'bannerIMG','frame0');start();}function ApplyMatrix(){jab.filters.item(0).M11=M11.value;jab.filters.item(0).M12=M12.value;jab.filters.item(0).DX=DX.value;jab.filters.item(0).M21=M21.value;jab.filters.item(0).M22=M22.value;jab.filters.item(0).DY=DY.value;}function GetCurrentMatrix(){M11.value=jab.filters.item(0).M11;M12.value=jab.filters.item(0).M12;DX.value=jab.filters.item(0).DX;M21.value=jab.filters.item(0).M21;M22.value=jab.filters.item(0).M22;DY.value=jab.filters.item(0).DY;}onresize=function(){ww=document.body.offsetWidth;wh=document.body.offsetHeight;}
window.onload=init_loading;
