function alta_de_correo() {
  	window.open('http://www.vodafone.es/Vodafone/PSParticulares/PSParticulares/0,1970,12998,00.html');
}

function buscador() {
	if (document.formBuscador.busqueda_visi.value.toUpperCase() == "3G" || document.formBuscador.busqueda_visi.value.toUpperCase() == "A2") {
		document.formBuscador.busqueda_visi.value = document.formBuscador.busqueda_visi.value + " ";
	}
	if (document.formBuscador.busqueda_visi.value.length <= 2) {
		alert("Por favor introduzca una palabra de mas de 2 caracteres...");
	} else {
		var texto = document.formBuscador.busqueda_visi.value;
		if( (texto.indexOf('[') != -1)||(texto.indexOf(']')!=-1)||
		(texto.indexOf('\'')!=-1)||(texto.indexOf('<') != -1) || (texto.indexOf('>') != -1)||
		 (texto.indexOf('%') != -1) || (texto.indexOf('+') != -1) || (texto.indexOf('{') != -1)||
		 (texto.indexOf('}') != -1) || (texto.indexOf('\"') != -1)|| (texto.indexOf('(') != -1)||
		 (texto.indexOf(')') != -1) || (texto.indexOf('.') != -1)) {
			 alert('No pueden incluirse en la busqueda los caracteres:\n\n    [    <    (    {      \'        %        .    +    \"    }    )    >    ]');

		}
		document.formBuscador.pagina.value = "-1";
		document.formBuscador.busqueda.value = document.formBuscador.busqueda_visi.value;
		document.formBuscador.action = "/Vodafone/VodafoneBuscador";
		document.formBuscador.submit();
	}
}


function ventana_tam(url,tbar,location,resizable,estatus,menubar,scroll,w,h) {
if (w=="") {w=700}
if (h=="") {h=400}
var ventana = window.open(url,'nuevaventana','toolbar='+tbar+',location='+location+',resizable='+resizable+',directories=no,status='+estatus+',menubar='+menubar+',copyhistory=yes,scrollbars='+scroll+',width='+w+',height='+h);
}

function changeImg(elemento, imagen) {
	eval("document."+elemento+".src='"+ imagen+"';");
}

function subir(name) {
	document.write("<A HREF='#top' onMouseOut=\"changeImg('"+name+"','/Vodafone/Imagenes/subir_gr.gif');(window.status='');return true;\" onMouseOver=\"changeImg('"+name+"','/Vodafone/Imagenes/subir_ro.gif');(window.status='Subir');return true;\"><IMG SRC=\"/Vodafone/Imagenes/subir_gr.gif\" HEIGHT=\"11\" WIDTH=\"89\" NAME=\""+name+"\" BORDER=\"0\" ALT=\"Subir\"></A>");
}

function volver(name) {
	document.write("<A HREF='javascript:window.history.back()' onMouseOut=\"changeImg('volver','/Vodafone/Imagenes/volver_gr.gif');(window.status='');return true;\" onMouseOver=\"changeImg('volver','/Vodafone/Imagenes/volver_ro.gif');(window.status='Volver');return true;\"><IMG SRC=\"/Vodafone/Imagenes/volver_gr.gif\" HEIGHT=\"11\" WIDTH=\"89\" NAME=\"volver\" BORDER=\"0\" ALT=\"Volver\"></A>");	
}

function volver() {
document.write("<A HREF='javascript:window.history.back()' class='txtBold'><img src='http://www.vodafone.es/VSharedClient/VodafonePortal/img/red_arrowfilled3.gif' width='8' height='9' border='0'>Volver</a>");
}

function volverEnlace(enlace) {
document.write("<A HREF='"+enlace+"' class='txtBold'><img src='http://www.vodafone.es/VSharedClient/VodafonePortal/img/red_arrowfilled3.gif' width='8' height='9' border='0'>Volver</a>");
}

function masInfo(name, link, text, status) {
	document.write("<A HREF='" + link + "' onMouseOver=\"changeImg('" + name + "', '/Vodafone/Imagenes/b_masinfo_on.gif');(window.status='" + status + "');return true;\" onMouseOut=\"changeImg('" + name + "','/Vodafone/Imagenes/b_masinfo.gif');window.status=''\"><IMG SRC='/Vodafone/Imagenes/b_masinfo.gif' WIDTH='121' HEIGHT='11' VSPACE='7' BORDER='0' ALT='" + text + "' NAME='" + name + "'></A>"); 
}

function mainHeader(name, link, text, status, imgOn, imgOff) {
	document.write("<A target=\"_top\" HREF=\"" + link + "\" onMouseOver=\"changeImg('" + name + "', '" + imgOn + "');(window.status='" + status + "');return true;\" onMouseOut=\"changeImg('" + name + "','" + imgOff + "');window.status='';\"><IMG SRC=\"" + imgOff + "\" NAME=\"" + name + "\" BORDER=\"0\" alt='" + text + "'></A>");
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


// Create a new dropdown array.
drop = new Array();

// Create a new image array.
image = new Array();

// Define the image preload function.
function imgPreload(name) {
	eval( name + " = new Image()" );
	eval( name + ".src = \"/vodafone/Campus/images/" + name + ".gif\"" );
}

// Define browser version.
var ns4 = (document.layers)? true:false;
var ns6 = (document.getElementById)? true:false;
var ie4 = (document.all)? true:false;
var ie5 = false; 

function validar_cab(que) {
if (que=="buscar") {
var texto = document.formBuscador.busqueda.value;
while(''+texto.charAt(0)==' ')texto=texto.substring(1,texto.length);  while(''+texto.charAt(texto.length-1)==' ')texto=texto.substring(0,texto.length-1); document.formBuscador.busqueda.value = texto;
if( (texto.indexOf('[') != -1)||(texto.indexOf(']')!=-1)||
(texto.indexOf('\'')!=-1)||(texto.indexOf('<') != -1) || (texto.indexOf('>') != -1)||
(texto.indexOf('%') != -1) || (texto.indexOf('+') != -1) || (texto.indexOf('{') != -1)||
(texto.indexOf('}') != -1) || (texto.indexOf('\"') != -1)|| (texto.indexOf('(') != -1)||
(texto.indexOf(')') != -1) || (texto.indexOf('.') != -1)) {
alert('No pueden incluirse en la busqueda los caracteres:\n\n    [    <    (    {      \'        %        .    +    \"    }    )    >    ]');
} else if(texto.length < 2) {
alert('La busqueda debe tener al menos 2 letras');
} else {
document.formBuscador.target="_top";
document.formBuscador.action="http://www.vodafone.es/Vodafone/Buscador/BuscadorVodafone";
document.formBuscador.submit();
}
} else if (que=="ok") {
document.pixelClick.src="http://www.vodafone.es/Clickthrough/banner.jsp?banner_id=636";
document.formBuscador.target="_blank";
document.formBuscador.action='http://www.vodafone.es/cgi-bin/login_WM.cgi';
document.formBuscador.submit();
document.formBuscador.usuario.value="";
document.formBuscador.clave.value="";
} else if (que=="correo") {
document.formCorreo.target="_blank";
document.formCorreo.action='http://www.vodafone.es/cgi-bin/login_WM.cgi';
document.formCorreo.submit();
document.formCorreo.usuario.value="";
document.formCorreo.clave.value="";
} else if (que=="alta") {
var h = window.open('http://www.vodafone.es/airtelaltas/jsp/provision/AltasCondicionesGeneralesD.jsp','alta','scrollbars=yes,maximized=no,resizable=no,status=no,title=no,toolbar=no,width=795,height=600');
}
}


function abrirventana(mywindow,mywindow2,myurl,mywidth,myheight,myscroll)
{
  width = "width="+mywidth;
  height= "height="+myheight;
  auxscroll= "scrollbars="+myscroll;
  mywindow=window.open(myurl,mywindow2,width+","+height+",resizable=no,"+auxscroll+",toolbars=no,directories=no,titlebar=no,status=no");
}

function carga_ventana(web_ventana,resx,resy,posx,posy)
{
	var ancho_interface=10
	var alto_interface=29	
	if ((posx==-1) && (posy==-1))
	{
		var tamx=screen.width;
		var tamy=screen.height;
		posx=(tamx-(resx+ancho_interface))/2;
		posy=(tamy -(resy+alto_interface))/2;
		var testo=tamx + " " + tamy + " " + posx + " " + posy;
		//window.alert(testo);
	}
	var cadena_opciones="width=" + resx + ",height=" + resy + ",left=" + posx + ",top=" + posy ;
	myventanashockwave=window.open(web_ventana,"",cadena_opciones);
}
//devuelve un objeto que controla el navegador


function oculta(i)
{
MM_showHideLayers('capa'+i,'','hide')

}

function muestra(i)
{
MM_showHideLayers('capa'+i,'','show')
}

var ancho,anterior;


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  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=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
  

function openwindow(mywindow,mywindow2,myurl,mywidth,myheight,myscroll)
{
  width = "width="+mywidth;
  height= "height="+myheight;
  auxscroll= "scrollbars="+myscroll;
  mywindow=window.open(myurl,mywindow2,width+","+height+",resizable=no,"+auxscroll+",toolbars=no,directories=no,titlebar=no,status=no");
}

var FDK_loaded=false;

function FDK_goToFrame(ID,frameNum) {
	loc = eval("window.document."+ID);
	frameNum = (parseInt(frameNum));
	if (navigator.appName.indexOf ("Microsoft") !=-1) {
		TFrames = (parseInt(loc.TotalFrames));
	}
	else  {
		TFrames = (parseInt(loc.TotalFrames()));
	}
	if (frameNum <= TFrames) {
		if (!FDK_loaded) {
			while (!FDK_loaded) {
				if(loc.PercentLoaded() == 100)  {
					loc.GotoFrame(frameNum);
					FDK_loaded = true;
				}
			}
		}
		else  {
			loc.GotoFrame(frameNum);
		}
	}
	else {
		alert("Flash Scripting Error: The jump frame you specified is greater than the total number of fames in the Flash movie. Choose a lesser value.");
	}
}

function includeTAG(referer) {
var a = Math.random();
a = a * 10000000000000;
var htmlreferer = "";
if (typeof(referer)!="undefined"){htmlreferer = "app="+referer+"&";}
document.write('<img src="http://www.vodafone.es/AppVodafone/VodafoneTags/ServletTags?'+htmlreferer+'origen=jmstags&id='+a+'" width=0 height=0 border=0>');
}


// JAVASCRIPT CON PUBLICIDAD STATUS
var current = 0
var x = 0
var speed = 60
var speed2 = 2000
var cont = 0

function initArray(n) {
  this.length = n;
  for (var i =1; i <= n; i++) {
    this[i] = ' '
  }
}

typ = new initArray(5)
typ[0]="*http://www.vodafone.es - Toda la información sobre Vodafone España en Internet...";
typ[1]="*... Vodafone live! con 3G, descubre la Videollamada, la Descarga de Música, la TV, los Videojuegos, y mucho más...*";
typ[2]="*... Si tienes Puntos, canjéalos y estrena móvil...*";
typ[3]="*... Las mejores ofertas para su Empresa...*";
typ[4]="*... Date de alta en Mi Vodafone y podrás gestionar todos tus servicios desde Internet...*";

function typewrite() {
	var m = typ[current]

	window.status = m.substring(0, x++) + "*"

	if (x >= m.length + 1 && cont>(speed2/speed)) {
		cont = 0
		x = 0
		current++

		if (current > typ.length - 1) {
			current = 0
		}

		setTimeout("typewrite()", speed)
	} 
	else if(x >= m.length + 1 && cont<=(speed2/speed)) {
		cont++
		setTimeout("typewrite()", speed)
	}
	else {
		setTimeout("typewrite()", speed)
	}
}

typewrite();


