function openWindow(url,width,height) {
    x = (640 - width)/2, y = (480 - height)/2;
	if (screen) {
        y = (screen.availHeight - height)/2;
        x = (screen.availWidth - width)/2;
    }
	window.open(url,'newWin','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
}

function PopupPic(sPicURL) { 
     window.open( sPicURL, "", "resizable=1,HEIGHT=100,WIDTH=100"); 
  } 



function VisualizarFecha(idioma){
		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(idioma==1){
			// inglés
			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 = 'Wednesday';}
			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+'&nbsp;'+day_of_month+'/'+mes+'/'+year;
			//var date_to_show=day_of_month+'/'+mes+'/'+year;
			var date_to_show=day_of_week+'&nbsp;'+day_of_month+'  '+month+' '+year;
		}else{
			//	default - need to add french etc
			if(month_number == 0){month = 'Enero';}
			if(month_number == 1){month = 'Febrero';}
			if(month_number == 2){month = 'Marzo';}
			if(month_number == 3){month = 'Abril';}
			if(month_number == 4){month = 'Mayo';}
			if(month_number == 5){month = 'Junio';}
			if(month_number == 6){month = 'Julio';}
			if(month_number == 7){month = 'Agosto';}
			if(month_number == 8){month = 'Septiembre';}
			if(month_number == 9){month = 'Octubre';}
			if(month_number == 10){month = 'Noviembre';}
			if(month_number == 11){month ='Diciembre';}		
			if(day_of_week_number == 0){day_of_week = 'Domingo';}
			if(day_of_week_number == 1){day_of_week = 'Lunes';}
			if(day_of_week_number == 2){day_of_week = 'Martes';}
			if(day_of_week_number == 3){day_of_week = 'Miercoles';}
			if(day_of_week_number == 4){day_of_week = 'Jueves';}
			if(day_of_week_number == 5){day_of_week = 'Viernes';}
			if(day_of_week_number == 6){day_of_week = 'Sábado';} 	
			//var date_to_show=day_of_week+'&nbsp;'+day_of_month+'/'+mes+'/'+year;
			//var date_to_show=day_of_month+'/'+mes+'/'+year;
			var date_to_show=day_of_week+'&nbsp;'+day_of_month+' de '+month+' '+year;
		}
			document.write(date_to_show);	
}
// funtion for toggle rows - FICHA
var selectedRow = null;
var selectedTD = null;

function toggleRow(thisID){
	var rowID	= "row"+thisID;
	var tdID="td"+thisID;

	if(document.getElementById){
		if(document.getElementById(rowID).style.display == 'block'){
			document.getElementById(rowID).style.display = 'none';
			document.getElementById(tdID).className='tabs_off';
		}else{
			if(selectedRow != null) {
				document.getElementById(selectedRow).style.display = 'none';
				document.getElementById(selectedTD).className='tabs_off';
			}
	        document.getElementById(rowID).style.display = 'block';
			document.getElementById(tdID).className='tabs';
			selectedRow = rowID;
			selectedTD	=	tdID;
		}
	}
}
function closeRow(){
	if(document.getElementById){
		if(selectedRow != null) document.getElementById(selectedRow).style.display = 'none';
		
	}
}
function AddBookmark(theUrl, theText)
{
	alertText_en = "Please Press Ctrl+D to Bookmark this Page";
	alertText_es = "Por Favor Presione Ctrl+D para Recordar esta Página";
	alertText_de = "Bitte, Drücken Sie auf Ctrl+D, um Diese Seite zu Bewahren";
	alertText_fr = "S'il Vous Plaît, Appuyez sur Ctrl+D Pour Conserver cette Page";
	ver = navigator.appName;
	num = parseInt(navigator.appVersion);
	if (ver == "Microsoft Internet Explorer" && num>=4)
	{
		window.external.AddFavorite(theUrl, theText);
	}
	else
	{
		window.alert(alertText_es)
	}
}