var Idioma_Aux=0;

function mnuCabecera(Cad, Url, Opc)
{
	var Valor;
	Valor = getCookie("Grafton");

	if (!Valor) Valor=2;
	
	if (Opc == Valor)
	{
	if ( Url )
		document.write ('<TR><TD WIDTH=164><TABLE BORDER=0 CELLSPACING=3 CELLPADDING=0 ALIGN=LEFT WIDTH=100%><TR><TD WIDTH=100% height="19" ALIGN=center VALIGN=MIDDLE NOWRAP CLASS=category_blocks><DIV CLASS=container_block><A HREF="' + Url + '" CLASS=categories TARGET="_self">' + Cad + '</A></DIV></TD></TR></TABLE></TD></TR>');
	else
		document.write ('<TR><TD WIDTH=164><TABLE BORDER=0 CELLSPACING=3 CELLPADDING=0 ALIGN=LEFT WIDTH=100%><TR><TD WIDTH=100% height="19" ALIGN=center VALIGN=MIDDLE NOWRAP CLASS=category_blocks><DIV CLASS=container_block ><b>' + Cad + '</b></DIV></TD></TR></TABLE></TD></TR>');
	}
}

function mnuOpcion(Cad, Url, Opc)
{
	var Valor;
	Valor = getCookie("Grafton");
	if (!Valor) Valor=2;
	
	if (Opc == Valor)
		document.write ('<TR><TD WIDTH=164><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=LEFT WIDTH=100%><TR><TD WIDTH=100% height="16" ALIGN=left VALIGN=MIDDLE CLASS=subcategory_blocks><A HREF="' + Url + '" CLASS=subcategories TARGET="_self"> · ' + Cad + '</A></DIV></TD></TR></TABLE></TD></TR>');
}


function mnuSepara()
{
	document.write ('<TR HEIGHT=5><TD></TD></TR>');
}

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_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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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 Cambia (opc)
{
	document.cookie='Grafton=' + opc;
	document.location.href='default.htm';
}


function Cabecera()
{

	var Valor;
	Valor = getCookie("Grafton");
	if (!Valor) Valor=2;

	document.write ('<tr>');
	document.write ('<td width="55" rowspan=95 background="imagenes/left.jpg"><img src="imagenes/spacer.gif" width="15"></td>');
	document.write ('<td colspan=5 valign="middle"><!---cabecera--->');
	document.write ('<table id="tabla_01" width="870" height="145" border="0" cellpadding="0" cellspacing="0">');
	document.write ('<tr>');
	document.write ('<td align="left"> <div align="left" width="870" height="126" ><img src="imagenes/logo.gif" alt="Learn Spanish" border="0" align="middle" ></div></td>');
	document.write ('<td align="left"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="510" height="150" id="468x60_malaria" align="middle">');
	document.write ('<param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="imagenes/publi/banerRojo.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="imagenes/publi/banerRojo.swf" quality="high" bgcolor="#ffffff" width="468" height="80" name="468x60_malaria" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
	document.write ('</tr>');
	document.write ('<tr>');
	document.write ('<td colspan=2 height="23" bgcolor=#ABC485>');
	document.write ('<div align="center" class="ficha_enlaceQ"> <span class="unnamed1color"> ');

//idiomas
//	document.write ('<a class="ficha_enlaceQ" href="javascript:CambioIdioma(1)">&nbsp;&nbsp;<img width=18 height=18 src="imagenes/spa.gif"></a>&nbsp;&nbsp;<a class="ficha_enlaceQ" href="javascript:CambioIdioma(2)">&nbsp;&nbsp;<img width=18 height=18 src="imagenes/eng.gif"></a>&nbsp;&nbsp;|');

	if (Valor == 1 )
		document.write ('|&nbsp;&nbsp;<a class="ficha_enlaceQ" href="javascript:Cambia(2)">Particulares</a>&nbsp;&nbsp; |&nbsp;&nbsp; ');
	else
		document.write ('|&nbsp;&nbsp;<a class="ficha_enlaceQ" href="javascript:Cambia(1)">Languages</a>&nbsp;&nbsp; |&nbsp;&nbsp; ');


	document.write ('<a class="ficha_enlaceQ" href="default.htm">Tu Escuela</a>&nbsp;&nbsp; |&nbsp;&nbsp; ');
	document.write ('<a class="ficha_enlaceQ" href="courses.htm">Los Cursos</a>&nbsp;&nbsp; |&nbsp;&nbsp; ');
	document.write ('<a class="ficha_enlaceQ" href="price.htm">Precios</a>&nbsp;&nbsp; |&nbsp;&nbsp; ');
	document.write ('<a class="ficha_enlaceQ" href="live.htm">Alojamiento</a>&nbsp;&nbsp; |&nbsp;&nbsp; ');
	document.write ('<a class="ficha_enlaceQ" href="contact.htm">Contacto</a>&nbsp;&nbsp; |&nbsp;&nbsp; ');
	document.write ('<a class="ficha_enlaceQ" href="where.htm">Localización</a>&nbsp;&nbsp; |&nbsp;&nbsp; ');
	document.write ('<a class="ficha_enlaceQ" href="webmap.htm">Mapa Web</a>&nbsp;&nbsp; |&nbsp;&nbsp; ');
	document.write ('<a class="ficha_enlaceQ" href="FAQ.htm">F.A.Q.</a>&nbsp;&nbsp; |&nbsp;&nbsp; ');
	
	
	//document.write ('<a class="ficha_enlaceQ" href="trabajo.htm">Trabaja con nosotros</a>&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; ');

	document.write ('</span></div></td>');
	document.write ('</tr>');
	document.write ('</table><!--- fin cabecera---></td>');
	document.write ('<td width="56" rowspan=95 background="imagenes/right.gif"><img src="imagenes/spacer.gif" width="10"></td>');
	document.write ('</tr>');

}

function Menu()
{
//1 > empresa || 2 > particular
	mnuCabecera("English","", 1);
	mnuOpcion("Inglés","inglesprofesional.htm", 1);
	mnuOpcion("<b>Servicios de traducción</b>","traduccion.htm", 1);
	mnuOpcion("Cursos FORCEM","forcem.htm", 1);
	mnuOpcion("Informática","informatica.htm", 1);
//	mnuOpcion("Cursos personalizados",12, 1);
	mnuSepara();

	mnuCabecera("Trabajadores","", 1);
	mnuOpcion("Cursos FORCEM","forcem.htm", 1);
	mnuOpcion("Informática","informatica.htm", 1);
//	mnuOpcion("Autónomos",12, 1);
//	mnuOpcion("Idiomas",12,1 );
	mnuSepara();

	mnuCabecera("Inglés","inglesprofesional.htm", 1);
	mnuSepara();


	mnuCabecera("TU ESCUELA","", 2);
	mnuOpcion("¿Quienes somos?","who.htm", 2);
	mnuOpcion("¿Dónde estamos?","where.htm", 2);
	mnuSepara();

//	mnuCabecera("Informática","informatica.htm");
//	mnuOpcion("Empresa",12);
//	mnuOpcion("Particulares",12);
//	mnuSepara();

	mnuCabecera("NUESTROS CURSOS","courses.htm", 2);
	mnuOpcion("En grupo","group.htm", 2);
	mnuOpcion("En grupo de amigos","friends.htm", 2);
	mnuOpcion("Preparación D.E.L.E.","dele.htm", 2);
	mnuOpcion("Acceso a la Universidad","univ.htm", 2);
	mnuOpcion("Especializados","espe.htm", 2);
	mnuOpcion("Personal de Empresas","empresas.htm", 2);
	mnuOpcion("Fin de Semana","semana.htm", 2);
	mnuOpcion("Intensivo","intensivo.htm", 2);
	mnuOpcion("Individual","individual.htm", 2);
	mnuOpcion("Clases On-line","online.htm", 2);
	mnuOpcion("Talleres Culturales","talleres.htm", 2);
	mnuOpcion("<b>NIVELES</b>","levels.htm", 2);
	mnuSepara();
	
	mnuCabecera("ALOJAMIENTO","live.htm", 2);
	mnuOpcion("Piso de Estudiantes","estudiantes.htm", 2);
	mnuOpcion("En familias","familia.htm", 2);
	mnuOpcion("Hoteles y hostales","hotel.htm", 2);
	mnuOpcion("Apartamentos","apartamento.htm", 2);
	mnuSepara();

	mnuCabecera("OTRAS ACTIVIDADES","other.htm", 2);
	mnuSepara();

	mnuCabecera("PRECIOS","price.htm", 2);
	mnuSepara();
	
	mnuCabecera("MOCHILA","bag.htm", 2);
	mnuSepara();
	
	mnuCabecera("LA CIUDAD","city.htm", 2);
	mnuSepara();
	
	mnuCabecera("CONDICIONES GENERALES","condiciones.htm", 2);
	mnuSepara();

	mnuCabecera("INSCRIPCIÓN","inscripcion.htm", 2);
	mnuSepara();
	
	mnuCabecera("CONTACTO","es_extranjeros.htm", 2);
	mnuSepara();

	mnuCabecera("");

}


function MenuSelector()
{
//1 > empresa || 2 > particular
	mnuCabecera("Empresa","", 1);
	mnuOpcion("Inglés","inglesprofesional.htm", 1);
	mnuOpcion("<b>Servicios de traducción</b>","traduccion,htm", 1);
	mnuOpcion("Cursos FORCEM","forcem.htm", 1);
	mnuSepara();

	mnuCabecera("Trabajadores","", 1);
	mnuOpcion("Cursos FORCEM","forcem.htm", 1);
	mnuOpcion("Informática","informatica.htm", 1);
	mnuSepara();

	mnuCabecera("Ingeniería","", 2);
	mnuOpcion("Técnica Industrial","ingtecindustrial.htm", 2);
	mnuOpcion("Telecomunicaciones","teleco.htm", 2);
	mnuOpcion("Técnica Telecomunicaciones","telecotec.htm", 2);
	mnuOpcion("Técnica Informática","informaticatec.htm", 2);
	mnuSepara();

	mnuCabecera("Refuerzo Escolar","", 2);
	mnuOpcion("Primaria","primaria.htm", 2);
	mnuOpcion("Secundaria","secundaria.htm", 2);
	mnuOpcion("Bachillerato","bachillerato.htm", 2);
	mnuOpcion("Selectividad","selectividad.htm", 2);
	mnuSepara();

	mnuCabecera("Inglés","", 2);
	mnuOpcion("Exámenes oficiales",12, 2);
	mnuOpcion("Inglés en familia",12, 2);
	mnuSepara();

	mnuCabecera("Español<br>para extranjeros","es_extranjeros.htm", 2);
	mnuSepara();

	mnuCabecera("");

}




function InfoGeneral()
{
	document.write ('<div align="center"><br>');
	document.write ('<table width="96%"  border="1" cellpadding="0" cellspacing="0" bordercolor="EBEAEA"><tr><td>');

	document.write ('<table width="100%" border="1" align="center" cellpadding="0" cellspacing="2" bordercolor="#FFFFFF" >');
	document.write ('  <tr valign="middle" bgcolor="B7C5D1" ><td height="23" bgcolor="4B597E">');
	//Cabecera de la información
	document.write ('<div align="center"><span class="Estilo4"><font color="#FFFFFF">OFERTAS</font></span></div>');
	document.write ('</td></tr>');
	document.write ('  <tr>    <td align="center" valign="top">');
	document.write (' <TABLE WIDTH=100% border="0" align="center" cellpadding="0" cellspacing="2" bordercolor="#FFFFFF">');

	//repetir tantas veces como informaciones se deseen       
	document.write ('<TR><TD width="5" height="20"  align="left" valign="middle"><div align="center">&middot;</div></TD><TD width="957" height="32"  align="left" valign="middle" class="Estilo2 Estilo1"><strong>');
	document.write ('<A class="enlace_enlaces" HREF="verano.htm" >Clases Online 10 x 8</A>');
	document.write ('</strong></TD></TR>');
	//hasta aquí	
	document.write ('<TR><TD width="5" height="20"  align="left" valign="middle"><div align="center">&middot;</div></TD><TD width="957" height="32"  align="left" valign="middle" class="Estilo2 Estilo1"><strong>');
	document.write ('<A class="enlace_enlaces" HREF="verano.htm" >3 x 2 sobre el curso</A>');
	document.write ('</strong></TD></TR>');
	
	document.write ('<TR><TD width="5" height="20"  align="left" valign="middle"><div align="center">&middot;</div></TD><TD width="957" height="32"  align="left" valign="middle" class="Estilo2 Estilo1"><strong>');
	document.write ('<A class="enlace_enlaces" HREF="verano.htm" >20% descuento en grupos cerrados</A>');
	document.write ('</strong></TD></TR>');

	
	document.write ('</TABLE>');

	document.write ('</td></tr></table></td></tr></table></div>');
}


function Pie()
{
	//de momento en blanco
	document.write ('<div align="center">00 34 91.877.12.25 - 00 34 91.881.27.47 &nbsp &nbsp<a href=mailto:info@spanishspoken.com>info@spanishspoken.com</a></div>');
}


function ObtenerP(nParametro) 
{ 
//Capturamos la URL 
var callingURL = document.location.href; 

//Separamos los parametros 
var cgiString = callingURL.substring(callingURL.indexOf('?')+1,callingURL.length); 

// Para manejar control ya que el arreglo empieza en cero restaremos 1 al parametro recibido 
nParametro -=1; 

// Dividimos mediante la función split los parámetros separados por ampersam 
var col_array=cgiString.split("&"); 
var part_num=0; 

// Ahora hacemos un recorrido del arreglo y buscamos el # de parametro solicitado! 
while (part_num < col_array.length) 
{ if ( part_num == nParametro ) 
return col_array[part_num]; 
else 
part_num+=1; 
} 

// evaluar que devolver cuando no lo 
// encuentra... 
return 0; 
} 



function getCookie(name){
  var cname = name + "=";               
  var dc = document.cookie;             
  if (dc.length > 0) {              
    begin = dc.indexOf(cname);       
    if (begin != -1) {           
      begin += cname.length;       
      end = dc.indexOf(";", begin);
      if (end == -1) end = dc.length;
        return unescape(dc.substring(begin, end));
    } 
  }
  return null;
}


function setCookie(name, value, expires, path, domain, secure) {
  document.cookie = name + "=" + escape(value) + 
  ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
  ((path == null) ? "" : "; path=" + path) +
  ((domain == null) ? "" : "; domain=" + domain) +
  ((secure == null) ? "" : "; secure");
}


function CambioIdioma(idioma)
{
	document.cookie='Grafton_ID=' + idioma;
	ControlIdioma();
	Idioma_Aux=idioma;
}

function ControlIdioma()
{

	var Valor;
	if (Idioma_Aux!=0)
	{
		capa=eval("id_" + Idioma_Aux);
		if (capa) capa.style.display="none";
	}

	Valor = getCookie("Grafton_ID");
	if (!Valor) Valor=1;

	capa=eval("id_" + Valor);
	if (capa) capa.style.display="";


}

