


 function enviarDatos(form) {
                form.submit();
                return true;

        }

 function abrirVentana(w, h, nombre, direccion) {
                orden = "open(direccion, nombre ,'width="+w+",height="+h+",resizable=yes,scrollbars=yes,status=yes')";
      		var ventana = eval(orden);
                ventana.document.close();
        }
 function abrirVentanaHonrada(w, h, nombre, direccion) {
   orden = "open(direccion, nombre ,'width="+w+",height="+h+",toolbar=yes,directories=yes,menubar=yes,resizable=yes,scrollbars=yes,location=yes,status=yes')";
      		var ventana = eval(orden);
                ventana.document.close();
        }



function ocultarDiv(nombre, h){
		document.getElementById(nombre).style.height=h; 
		document.getElementById(nombre).style.visibility="hidden"; 

}
function mostrarDiv(nombre, h){
	document.getElementById(nombre).style.height=h; 
	document.getElementById(nombre).style.visibility="visible"; 

}

function changeDiv(the_div,the_change) {
  if ((document.getElementById) || (document.all)) {
    var the_style = getStyleObject(the_div);
    if (the_style != false) {
      the_style.display = the_change;
    }
  }
}

function getStyleObject(objectId) {
  if (document.getElementById && document.getElementById(objectId)) {
    return document.getElementById(objectId).style;
  } else if (document.all && document.all(objectId)) {
    return document.all(objectId).style;
  } else {
    return false;
  }
}


function alternarVistaDiv(nombre, size){
  switch(document.getElementById(nombre).style.visibility){
    case "visible":
  	document.getElementById(nombre).style.visibility = "hidden";
  	document.getElementById(nombre).style.height= 0;
    break;
    default:
  	document.getElementById(nombre).style.visibility = "visible";
  	document.getElementById(nombre).style.height= size;
    break;

  }

}

function divWrite(id, texto){
		this.document.getElementById(id).innerHTML=texto;
}


function getWidthScreen(){
	var ancho;
	//No es Explorer
	if(typeof(window.innerWidth) == 'number')
		ancho = window.innerWidth;
	else{
		//Explorer 6 en modo standar-compliant
		if(document.documentElement && document.documentElement.clientWidth)
			ancho = document.documentElement.clientWidth;
		else
			//Explorer 4 compatible
			if(document.body && document.body.clientWidth)	
				ancho = document.body.clientWidth;		
	}
	return ancho;
}
function getHeightScreen(){
	var alto;
	//No es Explorer
	if(typeof(window.innerHeight) == 'number')
		alto = window.innerHeight;
	else{
		//Explorer 6 en modo standar-compliant
		if(document.documentElement && document.documentElement.clientHeight)
			alto = document.documentElement.clientHeight;
		else
			//Explorer 4 compatible
			if(document.body && document.body.clientHeight)	
				alto = document.body.clientHeight;		
	}
	return alto;
}


function divResize(nombreDiv, left, top, width, height){
	if(left != "")
		document.getElementById(nombreDiv).style.left=left;
	if(top != "")
		document.getElementById(nombreDiv).style.top=top;		
	if(width != "")
		document.getElementById(nombreDiv).style.width=width;	
	if(height != "")
		document.getElementById(nombreDiv).style.height=height;	
}


function click(tip){
	switch(tip){
		case "home":
		case "":
			this.divWrite('situador', '>> Home');
			break;
		case "idGrupos":
			var numSel	= this.document.getElementById('secciones').idGrupos.selectedIndex;
			var textoSel	= this.document.getElementById('secciones').idGrupos.options[numSel].text;
			this.divWrite('situador', '>> Tienda >> '+textoSel);
			
			break;
		case "documentos":
			this.divWrite('situador', '>> '+tip);
			break;
		case "eventos":
			
			this.divWrite('situador', '>> '+tip);

			break;
		case "contactar":
		case "informacion":
		case "empresa":
			this.divWrite('situador', '>> '+tip);
			break;
		default:
			this.divWrite('situador', '>> Tienda >> '+tip);
			break;
			

	}

}
