/****************************************************************************************
  Fecha: 04/07/2003(19:49)
  Descripcion: En este fichero metemos todos las funciones genericas que nos puedan hacer
    falta.
*****************************************************************************************/



 
 
  
/****************************************************************************************
  Fecha: 4/7/2003(19:45)
  Descripcion: Función imprime en pantalla la fecha actual con el formato 
    [Día de la semana], [Dia del mes] de [nombre del mes] [año]
  Entrada: 
  Salida: 
*****************************************************************************************/
   
  function VisualizarFecha()
  {
    date = new Date();
   	var day_of_week_number = date.getDay();
   	var day_of_month = date.getDate();
	   var month_number = date.getMonth();
	   var mes = month_number + 1;
	   var year = date.getYear();
	
   	if (year<200) year += 1900;
	
   	var day_of_week = '';
   	var month = '' 	
   	var hours = date.getHours();
   	var message = '';	
  	
   	if (hours >= 6) { time_of_day = 'Buenos Días'; message='Morning Message';}
   	if ((hours >= 14) && (hours < 21)) { time_of_day = 'Buenas Tardes'; message='Afternoon Message'}
   	if (hours >= 21) { time_of_day = 'Buenas Noches'; message='Evening Message';}
   	if ((hours >= 0) && (hours < 6)){ time_of_day = 'Buenas Noches'; message='Night Message';}	
   	if(month_number == 0){month = 'January';}
   	if(month_number == 1){month = 'February';}
   	if(month_number == 2){month = 'March';}
   	if(month_number == 3){month = 'April';}
   	if(month_number == 4){month = 'May';}
   	if(month_number == 5){month = 'June';}
   	if(month_number == 6){month = 'July';}
   	if(month_number == 7){month = 'August';}
   	if(month_number == 8){month = 'September';}
   	if(month_number == 9){month = 'October';}
   	if(month_number == 10){month = 'November';}
   	if(month_number == 11){month ='December';}		
   	if(day_of_week_number == 0){day_of_week = 'Sunday';}
   	if(day_of_week_number == 1){day_of_week = 'Monday';}
   	if(day_of_week_number == 2){day_of_week = 'Tuesday';}
   	if(day_of_week_number == 3){day_of_week = 'Webnesday';}
   	if(day_of_week_number == 4){day_of_week = 'Thursday';}
   	if(day_of_week_number == 5){day_of_week = 'Friday';}
   	if(day_of_week_number == 6){day_of_week = 'Saturday';} 	
 	
	   var date_to_show = day_of_week + ' ' + month + '  ' + Formatea(day_of_month) + '  ' + year;
	
   	document.write(date_to_show);	
	
  }
		
		
/****************************************************************************************
  Fecha: 03/09/2003(20:28)
  Descripcion: Esta función se encarga de formatear un fecha.
*****************************************************************************************/

  function Formatea(numero)
  {
    var str = numero;
   	if(numero < 10)
	     str = "0" + numero;
		
    return str;
  }


/****************************************************************************************
  Fecha: 08/07/2003(20:16)
  Descripcion: Esta función se encarga de mostrar el menu principal de la página web
*****************************************************************************************/

  function MostrarMenuPrincipal()
  {
    /*** 
      This is the menu creation code - place it right after you body tag
      Feel free to add this to a stand-alone js file and link it to your page.
    **/
				//document.write("<div style='border:1px solid navy; weight:20px; height: 27px'></div>");
				
				//var iAltura = 88
				var iAltura = 86
				var cadena;
				
				cadena = "<br><div id='linea' style='position:absolute; top:107px;'><table width='100%' style='border:1px solid navy'>" + 
				         "<tr><td></td></tr>" +
													"</table></div>"
													
				document.write(cadena);
				
			//var iAltura = 118

    //Menu object creation
    oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname

    oCMenu.frames = 0

    //Menu properties   
    oCMenu.pxBetween=30
    oCMenu.fromLeft=10 
    oCMenu.fromTop = iAltura   
    oCMenu.rows = 1 
    oCMenu.menuPlacement="center"
                                                              
    //oCMenu.offlineRoot="file:///C|/Inetpub/wwwroot/dhtmlcentral/projects/coolmenus/examples/" 
    //oCMenu.onlineRoot="/coolmenus/" 

    oCMenu.offlineRoot="" 
    oCMenu.onlineRoot="" 
    oCMenu.resizeCheck=1 
    //oCMenu.wait = 1000 
				oCMenu.wait = 100 
    //oCMenu.fillImg="cm_fill.gif"
    oCMenu.zIndex = 0

    //Background bar properties
    oCMenu.useBar=1
    //oCMenu.barWidth=975
				oCMenu.barWidth=1003
    oCMenu.barHeight=27 
    oCMenu.barClass="clBar"
    oCMenu.barX=0
    oCMenu.barY = iAltura
    oCMenu.barBorderX=0
    oCMenu.barBorderY=0
    oCMenu.barBorderClass=""

    //Level properties - ALL properties have to be spesified in level 0
    oCMenu.level[0]=new cm_makeLevel() //Add this for each new level
    oCMenu.level[0].width=110
    oCMenu.level[0].height=25
    oCMenu.level[0].regClass="clLevel0"
    oCMenu.level[0].overClass="clLevel0over"
    oCMenu.level[0].borderX=1
    oCMenu.level[0].borderY=1
    oCMenu.level[0].borderClass="clLevel0border"
    oCMenu.level[0].offsetX=0
    oCMenu.level[0].offsetY=0
    oCMenu.level[0].rows=0
    oCMenu.level[0].arrow=0
    oCMenu.level[0].arrowWidth=0
    oCMenu.level[0].arrowHeight=0
    oCMenu.level[0].align="bottom"
 
    //EXAMPLE SUB LEVEL[1] PROPERTIES - You have to specify the properties you want different from LEVEL[0] - If you want all items to look the same just remove this
    oCMenu.level[1]=new cm_makeLevel() //Add this for each new level (adding one to the number)
    oCMenu.level[1].width=oCMenu.level[0].width-2
    oCMenu.level[1].height=22
    oCMenu.level[1].regClass="clLevel1"
    oCMenu.level[1].overClass="clLevel1over"
    oCMenu.level[1].borderX=1
    oCMenu.level[1].borderY=1
    oCMenu.level[1].align="right" 
    oCMenu.level[1].offsetX=-(oCMenu.level[0].width-2)/2+20
    oCMenu.level[1].offsetY=0
    oCMenu.level[1].borderClass="clLevel1border"

    //EXAMPLE SUB LEVEL[2] PROPERTIES - You have to spesify the properties you want different from LEVEL[1] OR LEVEL[0] - If you want all items to look the same just remove this
    oCMenu.level[2]=new cm_makeLevel() //Add this for each new level (adding one to the number)
    oCMenu.level[2].width=150
    oCMenu.level[2].height=25
    oCMenu.level[2].offsetX=0
    oCMenu.level[2].offsetY=0
    oCMenu.level[2].regClass="clLevel2"
    oCMenu.level[2].overClass="clLevel2over"
    oCMenu.level[2].borderClass="clLevel2border"


    /******************************************
      Menu item creation:
      myCoolMenu.makeMenu(name, parent_name, text, link, target, width, height, regImage, overImage, regClass, overClass , align, rows, nolink, onclick, onmouseover, onmouseout) 
    ***********************************/

    oCMenu.makeMenu ('top01','','<center>Home Page</center>','/', 0, 100)

    oCMenu.makeMenu ('top0','','<center>Company Profile</center>','', 0, 140)
      oCMenu.makeMenu('sub00','top0','The Firm','IFrame.asp?asp=theFirm.asp&title=The Firm', 0, 140)
      oCMenu.makeMenu('sub01','top0','Locations','locations.asp', 0, 140)
						oCMenu.makeMenu('sub02','top0','Other Links','otherLinks.asp', 0, 140)
						//oCMenu.makeMenu('sub02','top0','Other Links','', 0, 140)
  
    oCMenu.makeMenu('top1','','<center>Areas</center>','', 0, 160)
	     oCMenu.makeMenu('sub10','top1','Customer Service','IFrame.asp?asp=customerService.asp&title=Customer Service', 0, 160)
	     oCMenu.makeMenu('sub11','top1','Legal and Litigations','IFrame.asp?asp=legalServices.asp&title=Legal and Litigations', 0, 160)
	     oCMenu.makeMenu('sub12','top1','Companies','IFrame.asp?asp=companies.asp&title=Companies', 0, 160)
	     oCMenu.makeMenu('sub13','top1','Financial Services','IFrame.asp?asp=financialServices.asp&title=Financial Services', 0, 160)
	     oCMenu.makeMenu('sub14','top1','Insurances','IFrame.asp?asp=insurances.asp&title=Insurances', 0, 160)
						
	     /*oCMenu.makeMenu('sub10','top1','Customer Services','customerServices.asp', 0, 140)
	     oCMenu.makeMenu('sub11','top1','Legal & Litigations','', 0, 140)
	     oCMenu.makeMenu('sub12','top1','Companies','', 0, 140)
	     oCMenu.makeMenu('sub13','top1','Financial Services','', 0, 140)
	     oCMenu.makeMenu('sub14','top1','Insurances','insurances.asp', 0, 140)*/
						
	
    oCMenu.makeMenu('top2','','<center>Professional Team</center>','', 0, 160)
	     oCMenu.makeMenu('sub21','top2','Professionals','professionals.asp', 0, 160)
	     //oCMenu.makeMenu('sub22','top2','Contact Us','contactUs.asp', 0, 140)
						
/*
				oCMenu.makeMenu('top3','','<center>Contact Us</center>','', 0, 140)
      oCMenu.makeMenu('sub31','top3','Torrevieja Office','mailto: torrevieja@ag2asesores.com', 0, 140)
	     oCMenu.makeMenu('sub32','top3','Mojacar Office','mailto: mojacar@ag2asesores.com', 0, 140)
		    oCMenu.makeMenu('sub33','top3','Marbella Office','mailto: marbella@ag2asesores.com', 0, 140)
		    oCMenu.makeMenu('sub35','top3','Financial Services','mailto: financial@ag2asesores.com', 0, 140)
		    oCMenu.makeMenu('sub36','top3','Insurances','mailto: insurances@ag2asesores.com', 0, 140)
		    oCMenu.makeMenu('sub37','top3','General Information','mailto: info@ag2asesores.com', 0, 140)
*/
						
    oCMenu.makeMenu('top3','','<center>Contact Us</center>','', 0, 140)
      oCMenu.makeMenu('sub31','top3','Torrevieja Office','contactUs.asp?mail=torrevieja@ag2asesores.com&title=Contact to Torrevieja Office', 0, 140)
	     oCMenu.makeMenu('sub32','top3','Mojacar Office','contactUs.asp?mail=mojacar@ag2asesores.com&title=Contact to Mojacar Office', 0, 140)
		    oCMenu.makeMenu('sub33','top3','Marbella Office','contactUs.asp?mail=marbella@ag2asesores.com&title=Contact to Marbella Office', 0, 140)
		    oCMenu.makeMenu('sub35','top3','Financial Services','contactUs.asp?mail=financial@ag2asesores.com&title=Contact to Financial Services', 0, 140)
		    oCMenu.makeMenu('sub36','top3','Insurances','contactUs.asp?mail=insurances@ag2asesores.com&title=Contact to Insurances Services', 0, 140)
		    oCMenu.makeMenu('sub37','top3','General Information','contactUs.asp?mail=info@ag2asesores.com&title=Contact to General Information', 0, 140)

    //Leave this line - it constructs the menu

				oCMenu.construct()		

  }
		
/****************************************************************************************
  Fecha: 29/01/2003 (9:52)
  Descripcion: Funciones para cambiar el estilo al pasar el raton sobre un TABLE, lo que
  				se hara, será cambiar su class por el que viene como parametro
  Entrada: 
          - pObjetoTabla: objeto HTML al que haremos referencia para cambiar el class
		  - pNombreClass: Nombre del class previamente definido como estili CSS
*****************************************************************************************/
  
		function cambiaClass(pObjetoTabla,pNombreClass)
  {
    pObjetoTabla.className=pNombreClass;
  }
		
/****************************************************************************************
  Fecha: 11/10/2003(22:13)
  Descripcion: Función que abre una nueva ventana
*****************************************************************************************/

		function AbrirVentana(p_sPagina, p_iHeight, p_iWidth)
  {
     window.open('' + p_sPagina + '', '_blank', 'height=' + p_iHeight + ',width=' + p_iWidth + ',status=no,toolbar=no,menubar=no,location=center,directories=no,scrollbars=yes'); 
  }


