function init(){
	wW = (is.ns)? window.innerWidth+2 : document.body.offsetWidth
	wH = (is.ns)? window.innerHeight : document.body.offsetHeight-4
	
	if(is.ns){
	origWidth=innerWidth;
	origHeight=innerHeight;
	onresize=function(){
		if(innerWidth!=origWidth||innerHeight!=origHeight)
		location.reload()
		}
	}

	Lnada = new DynLayer("LnadaDiv");
	Lnada.moveTo(0,0)
	Lnada.clipTo(0,wW,wH,0);
	LbandaH = new DynLayer("LbandaHDiv");
	LbandaH.moveTo(wW,wH/2-110)
	LbandaH.deslizadoInit=FacilDeslizadoInit; LbandaH.deslizadoInit();
	setTimeout("LbandaH.deslizadoTo(0,null,5,10);",1400);
	LbandaH1 = new DynLayer("LbandaH1Div");
	LbandaH1.moveTo(0-wW,wH/2-110)
	LbandaH1.clipTo(0,wW,17,0);
	LbandaH1.deslizadoInit=FacilDeslizadoInit; LbandaH1.deslizadoInit();
	Clogo = new DynLayer("ClogoDiv");
	Clogo.moveTo(-350,wH/2-182)
	Clogo.deslizadoInit=FacilDeslizadoInit; Clogo.deslizadoInit();
	setTimeout("Clogo.deslizadoTo(0,null,5,10);",2000);
	Lcast = new DynLayer("LcastDiv");
	Lcast.moveTo(wW-350,wH/2-104)
	Lcast.deslizadoInit=FacilDeslizadoInit; Lcast.deslizadoInit();
	setTimeout("Lcast.deslizadoTo(null,wH/2-94,5,10);Lcast.show();",2500);
	Leuskera = new DynLayer("LeuskeraDiv");
	Leuskera.moveTo(300,wH/2-108)
	Leuskera.deslizadoInit=FacilDeslizadoInit; Leuskera.deslizadoInit();
	setTimeout("Leuskera.deslizadoTo(null,wH/2-120,5,10);Leuskera.show();",2500);
	LReso = new DynLayer("LResoDiv");
	LReso.moveTo(109,wH/2+47)
	setTimeout("LReso.show();",3000);
	Lplayers = new DynLayer("LplayersDiv");
	if(is.ie){
		LplayersDiv.style.filter = "alpha(opacity=40)"
		}
	Lplayers.moveTo(wW/2+80,wH/2-245)
	setTimeout("Lplayers.show();",3500);
	Lplayers1 = new DynLayer("Lplayers1Div");
	if(is.ie){
		Lplayers1Div.style.filter = "alpha(opacity=40)"
		}
	Lplayers1.moveTo(wW/2+95,wH/2-110)
	setTimeout("Lplayers1.show();",3500);
	
	
	if (is.ns) {
    	if(location.reload)
		Lnada.hide();
	}
    if (is.ie) {
   	if(document.all)
		Lnada.hide();
	}
carga();
liNeas();
}
UbicacionX = new Array('205','206','207','213','217');
UbicacionY = new Array('wH/2-109','wH/2-105','wH/2-101','wH/2-97','wH/2-93');
function liNeas(){
	for(var i=0; i<=4; i++){
	eval("rayas"+i+" = new DynLayer('rayas"+i+"Div'); rayas"+i+".clipTo(0,3,3,0);");
	eval("rayas"+i+".moveTo("+UbicacionX[i]+","+UbicacionY[i]+")");
	eval("setTimeout('rayas"+i+".show();',5000);");
	eval("rayas"+i+".deslizadoInit=FacilDeslizadoInit; rayas"+i+".deslizadoInit();");
	}
	for(var i=0;i<4;i++)
	setTimeout("liNeasGo("+i+");",i+100);
}
function liNeasGo(cual){
	capas=Math.round(Math.random()*(wW*2))-wW/2;
	vel=Math.round(Math.random()*50)+1;
	eval("rayas"+cual+".deslizadoTo("+capas+",null,"+vel+",10,'liNeasGo("+cual+")')");
}
function IrCast(){
	Lplayers.hide();
	Lplayers1.hide();
	for(var i=0; i<=4; i++){
	eval("rayas"+i+".hide();");
	}
	LReso.hide();
	setTimeout("Leuskera.deslizadoTo(null,wH/2-108,5,10,'Leuskera.hide();');",1000);
	setTimeout("Lcast.deslizadoTo(null,wH/2-108,5,10,'Lcast.hide();');",1000);
	setTimeout("LbandaH1.deslizadoTo(0,null,5,10);",1500);
	setTimeout("LbandaH.deslizadoTo(wW,null,5,10);",1400);
	setTimeout("Clogo.deslizadoTo(wW,null,5,10);",1510);
	setTimeout("window.location.href='/design/cast'",2000);
}
function IrEusk(){
	Lplayers.hide();
	Lplayers1.hide();
	for(var i=0; i<=4; i++){
	eval("rayas"+i+".hide();");
	}
	LReso.hide();
	setTimeout("Leuskera.deslizadoTo(null,wH/2-108,5,10,'Leuskera.hide();');",1000);
	setTimeout("Lcast.deslizadoTo(null,wH/2-108,5,10,'Lcast.hide();');",1000);
	setTimeout("LbandaH1.deslizadoTo(0,null,5,10);",1500);
	setTimeout("LbandaH.deslizadoTo(wW,null,5,10);",1400);
	setTimeout("Clogo.deslizadoTo(wW,null,5,10);",1510);
	setTimeout("window.location.href='/design/eusk'",2000);
}
function IP_swapImgRestore() {  
  var i,x,a=document.IP_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function IP_findObj(n, d) {  
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=IP_findObj(n,d.layers[i].document); return x;
}

function IP_swapImage() {  
  var i,j=0,x,a=IP_swapImage.arguments; document.IP_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=IP_findObj(a[i]))!=null){document.IP_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function IP_preloadImages() {  
  var d=document; if(d.images){ if(!d.IP_p) d.IP_p=new Array();
    var i,j=d.IP_p.length,a=IP_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.IP_p[j]=new Image; d.IP_p[j++].src=a[i];}}
}
function carga(){

	IP_preloadImages('img/tfederacast.gif','img/tfederacastAct.gif','img/tfederaeusk.gif','img/tfederaeuskAct.gif','img/logo.gif');
}
