﻿// JScript File

var aHelpTitleFr = new Array()
aHelpTitleFr[0] = "Aide Généalogie Québec: NOM STANDARD PRDH"
aHelpTitleFr[1] = "Aide Généalogie Québec: NOM DE FAMILLE"
aHelpTitleFr[2] = "Aide Généalogie Québec: DATE DE NAISSANCE"
aHelpTitleFr[3] = "Aide Généalogie Québec: PAYS"
aHelpTitleFr[4] = "Aide Généalogie Québec: INFORMATION"
aHelpTitleFr[5] = "Aide Généalogie Québec: VÉRIFICATION"
aHelpTitleFr[6] = "Aide Généalogie Québec: AUTRE NOM - ALIAS"
aHelpTitleFr[7] = "Aide Généalogie Québec: PARENTS"

var aHelpTitleEn = new Array()
aHelpTitleEn[0] = "Help: STANDARD NAME PRDH"
aHelpTitleEn[1] = "Help: FAMILY NAME"
aHelpTitleEn[2] = "Help: DATE OF BIRTH"
aHelpTitleEn[3] = "Help: COUNTRY"
aHelpTitleEn[4] = "Help: INFORMATION"
aHelpTitleEn[5] = "Help: VERIFICATION"
aHelpTitleEn[6] = "Help: OTHER NAME - ALIAS"
aHelpTitleEn[7] = "Help: PARENTS"

var aHelpTextFr = new Array()
aHelpTextFr[0] = "Le nom de famille standardisé sert à la recherche et à l'indexation pour ce site ainsi que pour les moteurs de recherche. Il sert également à regrouper une famille avec des orthographes différents et des noms composés. Sa graphie ne correspond pas nécessairement au nom de famille de la personne. Pour plus d'information <a href='http://www.genealogie.umontreal.ca/fr/public/Rech_Nom.asp' target='_blank'>visitez PRDH de l'université de Montréal</a>. Le système cherche s'il s'agit d'une variante d'un patronyme et changera automatiquement Moricet par Morisette. Conseils:<ul><li>Écrivez dans le cas d'un nom composé par exemple LAVOIE dans nom standard et LAVOIE-CASTONGUAY dans nom de famille.</li><li>Ex: Gagnon DIT Belzile. Écrivez <b>Gagnon</b> dans nom standard et <b>Gagnon dit Belzile</b> dans nom de famille. Dès que le patronyme devient uniquement Belzile n'écrivez que ce nom.</li><li>Trait-d'union et espace, sauf exceptions, ne sont pas permis.</li></ul>Regardez aussi l'aide pour ALIAS."
aHelpTextFr[1] = "Veuillez écrire dans nom de famille le nom réel, l'orthographe utilisé par le curé, le notaire ou tel que trouvé dans les actes. Écrivez par exemple la variante CAMPOST ici et CAMPEAU comme nom standardisé. Utilisez ce champ également pour des noms composés d'aujourd'hui. Pour plus d'information <a href='http://www.genealogie.umontreal.ca/fr/public/Rech_Nom.asp' target='_blank'>visitez PRDH de l'université de Montréal</a>."
aHelpTextFr[2] = "Nous voulons garder chaque personne unique. Avec le bouton <b>VERIFIER</b> en bas vous recherchez si la personne existe déjà dans sa génération à lui. A cause de cela la date de naissance est obligatoire.<br><br>Souvent la date n'est pas certaine ou inconnue. Veuillez dans ce cas juste entrer l'année approximative. En général la date de mariage est connue. Dans ce cas enlevez 25 ans, soit une génération (exemple mariage 1854 -> année de naissance 1829).<br /><br />Pour rendre une date protégée VISIBLE, consultez <b>Afficher les dates</b>"
aHelpTextFr[3] = "Seulement des pays les plus important sont entrés pour faciliter la saisie. Dans votre compte sous <b>mon profil</b> vous pouvez choisir entre une liste de pays abrégée ou élargie. <br /><br />Si vous avez besoin d'un pays veuillez nous écrire et nous allons l'ajouter.<br><br>Nous avons également entré Nouvelle Angleterre, Écosse et Louisiane.<br><br><b>Conseil - quand le focus du curseur se trouve dans le champ pays, cliquez seulement la première lettre du pays, exemple C pour Canada."
aHelpTextFr[4] = "Utilisez ce champ pour entrer des petites remarques. Pour des informations, anecdotes ou biographies, veuillez utiliser le bouton Photo/Info  "
aHelpTextFr[5] = "Avec ce bouton vous vérifiez si la personne existe déjà. Si le système trouve des personnes potentielles ils vous sont proposées dans une liste en bas. Veuillez consulter la liste minutieusement afin d'éviter des doublons. Si vous trouvez la personne dans la liste, vous pouvez incorporer seulement une personne ou le couple. Vous utiliser pour cela:<table border='0'><tr><td><img src='images/personOne.gif'></td><td>Utilisez ce bouton si la personne dans la list n'a pas de conjoint ou si la personne a un conjoint mais vous voulez ajouter un conjoint additionel.</td></tr><td><img src='images/personBoth.gif'></td><td>Utilisez ce bouton pour incorporer les deux personnes</td></tr></table>Dans les deux cas vous héritez également parents et enfants."
aHelpTextFr[6] = "Mettez dans ce champ le nom de famille s'il est standardisé sous nom de famille (exemple Leclaire pour Leclerc, De la Voye pour Lavoie) ou pas permise comme des noms composés (exemple Simard-Lalonde). Vous pouvez forcer le site d'afficher le nom ALIAS en cochant <b>afficher alias</b>.<br /><br />Cochez <b>afficher dates</b> si vous voulez que les dates de naissances etc. d'une personne vivante (moins de 100 ans ou moins de 30 ans après la mort) ne soient plus protégées (i.e. les dates seront visibles pour le public). L'affichage des dates relève de la responsabilité de chacun des participants."
aHelpTextFr[7] = "Mettez les noms des parents quand vous ne connaissez pas leur date de mariage ou quand vous ne voulez pas continuer cette ligné."

var aHelpTextEn = new Array()
aHelpTextEn[0] = "The Standard Family Name is used for indexing and searches on this site as well as for search engines like Google. It groups different orthographs of a family name under one single name. This may not correspond exactly to the family name. For more information <a href='http://www.genealogie.umontreal.ca/en/public/Rech_Nom.asp' target='_blank'>visit PRDH of the University of Montreal</a>. In case of a variant, the system seeks for the standard group name and will change for example Moricet for Morisset. Hints: <ul><li>Write in case of a composed name for example LAVOIE as standard name and LAVOIE-CASTONGUAY as family name.</li><li>Example Gagnon DIT Belzile. Write <b>Gagnon</b> as standard name and <b>Gagnon dit Belzile</b> as family name. Once only the second name is used, just write <b>Belzile</b> once as standard name.</li></ul> See as well help for ALIAS."
aHelpTextEn[1] = "Please enter under family name the real name, the orthograph used by the parson or other offical or as found in the sources. Write for example the variant CAMPOST here and CAMPEAU as Standard Name. Use this field as well for modern composed names. For more information  <a href='http://www.genealogie.umontreal.ca/en/public/Rech_Nom.asp' target='_blank'>visit PRDH of the University of Montreal</a>."
aHelpTextEn[2] = "We try to keep each person in the database unique. With the button <b>VERIFY</b> below you search if a person does already exists within its generation. For this reason the date of birth is mandatory.<br><br>However, often the date is not certain or unknown. Please enter in this case an estimation. Normally the date of marriage is known. Substract simpliy 25 years from the first wedding (example wedding 1854 -> date of birth 1829).<br /><br />To diplay a protected date see <b>Display Dates</b>."
aHelpTextEn[3] = "Only the most important countries are in the system too improve confort. In your account under <b>My Profile</b> you can choose between a short list or an extended list of countries.<br /><br /> If you need a new country, just tell us and we will add it.<br><br>We have as well New England, Scotland and Louisiana as countries.<br><br><b>Hint - when the focus of the cursur is in the country field, just hit the first letter of the country, e.g. C for Canada."
aHelpTextEn[4] = "Use this field to enter small remarks. For information or biographies use the Photo/Info button."
aHelpTextEn[5] = "With this button you verify if the person already exists. When the system finds potential persons they are proposed in a list below. Please verify this list carefully to avoid doubles. If you find the person in the list you can incorporate only one person or the couple. Use:<table border='0'><tr><td><img src='images/personOne.gif'></td><td>This button when the person in the list has no partner or when you wish to add an additional partner.</td></tr><td><img src='images/personBoth.gif'></td><td>This button to incorporate both persons.</td></tr></table>In both cases you will herite parents and children."
aHelpTextEn[6] = "Use this field to enter the family name when it is standardized under family name (e.g. Leclaire for Leclerc, De la Voye for Lavoie) or not permitted like composed names (e.g. Simard-Lalonde). You can force the site to display the ALIAS name by checking <b>Display Alias</b>.<br /><br />Check <b>Display Dates</b> if you like date of birth etc. of a living person (less than 100 years or less than 30 years after death) to be displayed (date visible). The person must consenting or to be a person of public interest."
aHelpTextEn[7] = "Use this field to enter the names of the parents if you don't know any dates and details or if you don't wish to continue this line."

function displayHelp(i, lng)
{
    document.getElementById('divHelp').style.visibility = 'visible';
    if (lng == "en")
    {
        document.getElementById('divHelpText').innerHTML = aHelpTextEn[i];
        document.getElementById('divHelpTitle').innerHTML = aHelpTitleEn[i];
    }
    else
    {
        document.getElementById('divHelpText').innerHTML = aHelpTextFr[i];
        document.getElementById('divHelpTitle').innerHTML = aHelpTitleFr[i];
    }
}

function checkDay(strDay)
{   
    if (strDay > 31)
        strDay = strDay / 53
    if (strDay == "")
        return true
    if (!reg.exec(strDay))  // must be 0 - 9
        return false
    if (strDay < 1) 
        return false
    if (strDay > 31)
        return false
    return true
}

function checkMonth(strMonth)
{   
    if (strMonth > 12)
        strMonth = strMonth / 54
    if (strMonth == "")
        return true
    if (!reg.exec(strMonth)) // must be 0 - 9
        return false
    if (strMonth < 1) 
        return false
    if (strMonth > 12)
        return false
    return true
}

function checkYear(strYear)
{   
    var curDate = new Date();
    
    if (strYear > 2500)
        strYear = strYear / 7
    if (strYear == "")
        return false
    if (!reg.exec(strYear)) // must be 0 - 9
        return false
    if (strYear < 1400) 
        return false
    if (strYear > curDate.getFullYear())
        return false
    return true
}

function getYear(strYear)
{
    if (strYear > 2550)
        return(strYear / 7)
    else
        return(strYear)
}

function checkYearFak(strYear)
{           
    var curDate = new Date();

    if (strYear > 2500)
        strYear = strYear / 7
    if (strYear == "")
        return true
    if (isNaN(strYear))
        return false
    if (strYear < 1400) 
        return false
    if (strYear > curDate.getFullYear())
        return false
    return true
}

function initGenealogyDesc()
{
   document.getElementById('txbFirstNameA').style.background = "#ffffff";
   document.getElementById('txbFamilyNameA').style.background = "#ffffff";
   document.getElementById('ddlSexA').style.background = "#ffffff";
   document.getElementById('txbDayBornA').style.background = "#ffffff";
   document.getElementById('txbMonthBornA').style.background = "#ffffff";
   document.getElementById('txbYearBornA').style.background = "#ffffff";
   document.getElementById('txbDayDeathA').style.background = "#ffffff";
   document.getElementById('txbMonthDeathA').style.background = "#ffffff";
   document.getElementById('txbYearDeathA').style.background = "#ffffff";

   document.getElementById('txbFirstNameB').style.background = "#ffffff";
   document.getElementById('txbFamilyNameB').style.background = "#ffffff";
   document.getElementById('ddlSexB').style.background = "#ffffff";
   document.getElementById('txbDayBornB').style.background = "#ffffff";
   document.getElementById('txbMonthBornB').style.background = "#ffffff";
   document.getElementById('txbYearBornB').style.background = "#ffffff";
   document.getElementById('txbDayDeathB').style.background = "#ffffff";
   document.getElementById('txbMonthDeathB').style.background = "#ffffff";
   document.getElementById('txbYearDeathB').style.background = "#ffffff";

   document.getElementById('txbDayMary').style.background = "#ffffff";
   document.getElementById('txbMonthMary').style.background = "#ffffff";
   document.getElementById('txbYearMary').style.background = "#ffffff";
   
   document.getElementById('txbPersonInfoA').style.background = "#ffffff";
   document.getElementById('txbPersonInfoB').style.background = "#ffffff";
}

function writeError(field, message)
{
  document.getElementById('litMessageA').innerHTML = message
  field.style.background = "#ff6e6e";
  field.focus();
}

function addBookmark(bookmarkurl,bookmarktitle) {
  if (isIE5up) {
	window.external.AddFavorite (bookmarkurl,bookmarktitle);
  } else if(navigator.appName == "Netscape") {
	alert("Please press (CTRL-D) to bookmark this page.");
  } else {
	alert("Sorry! Your browser doesn't support this function.");
  }
}
var win= null; var win2= null; var win3= null; var win4= null; var win5= null;
  
  var isIE = false; var navVer = navigator.appVersion; var ver = parseFloat(navVer);
  var IEPos = navVer.indexOf('MSIE');
  if (IEPos !=-1) { isIE = true; ver = parseFloat(navVer.substring(IEPos+5,navVer.indexOf(';',IEPos))); }
  var isIE5up = (isIE && ver >= 5);

