function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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_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_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 MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

// CONFIGURATION STARTS HERE
function initializeForm () {
// Fill up initial option values
	document.Recherche.id_continent.length = 0;
	regions[regions.length] = regionsDashes
    document.Recherche.id_continent.options[0] = new Option(regions[0],"",1,1)

	for(count = 1; count < regions.length; count++) {
    	document.Recherche.id_continent.options[count] = new Option(regions[count], "")
        }
	fillcountry()
    }

function fillcountry_backup()
	{
//alert(new String(regions[7]));
//alert(regions.length);
	document.Recherche.id_pays_1.length = 0;
 	reg = new String(regions[document.Recherche.id_continent.selectedIndex])
//alert(reg);
	if (reg == regionsDashes) {
		document.Recherche.id_continent.selectedIndex = document.Recherche.id_continent.selectedIndex - 1
		reg = new String(regions[document.Recherche.id_continent.selectedIndex])
		}
	document.Recherche.id_pays_1.options[0] = new Option(Countries[reg][0],Links[reg][0],1,1);
	/*
	for(count = 1; count < Links[reg].length; count ++)
		document.Recherche.id_pays_1.options[count] = new Option(Countries[reg][count],Links[reg][count]);
	*/
// window.defaultStatus = document.Recherche.id_continent.selectedIndex;
// window.defaultStatus = "ok";
		window.defaultStatus = reg;
		var country_count = 1;
		for(count = 1; count < Links[reg].length; count++)
		{
			var str = Links[reg][count];
			str_num = parseInt(str);

			if (typeof(country_array[str_num]) != 'undefined')
			{
				// alert(country_array[str_num]);
				document.Recherche.id_pays_1.options[country_count] = new Option(Countries[reg][count],Links[reg][count]);
				country_count++;
			}
		}
		
		document.Recherche.id_pays_1.options[document.Recherche.id_pays_1.options.length] = new Option(CountriesDashes,DefaultLink);
	}
	
function fillcountry()
{
	var div_pays1 = document.getElementById("div_pays1");
	var html = "";
	
	document.Recherche.id_pays_1.length = 0;
	reg = new String(regions[document.Recherche.id_continent.selectedIndex])
	if (reg == regionsDashes)
	{
		document.Recherche.id_continent.selectedIndex = document.Recherche.id_continent.selectedIndex - 1;
		reg = new String(regions[document.Recherche.id_continent.selectedIndex]);
	}
	html = "<select name=\"id_pays_1\" onchange=\"check_finalcountry_1()\" class=\"txt_pt3b\" style=\"width: 190px;\"><option value=\""+Links[reg][0]+"\">"+Countries[reg][0]+"</option>";
	window.defaultStatus = reg;
	var country_count = 1;
	for(count = 1; count < Links[reg].length; count++)
	{
		var str = Links[reg][count];
		str_num = parseInt(str);

		if (typeof(country_array[str_num]) != 'undefined')
		{
			html += "<option value=\""+Links[reg][count]+"\">"+Countries[reg][count]+"</option>";
			country_count++;
		}
	}
	
	html += "<option value=\""+DefaultLink+"\">"+CountriesDashes+"</option>";
	
	div_pays1.innerHTML = html;
}

function checkcountry() {
	document.Recherche.submit();
	}

function checkcountry2(){document.Recherche2.submit();}

function checkmonth(){
	document.Recherche3.submit();
	bOut = true;
	return bOut;
	}

function checkForm3() {
	bOut = true;
	return bOut;
	}

function checkForm() {
	bOut = true;
	if(document.Recherche.id_pays.selectedIndex==0 || document.Recherche.id_pays.selectedIndex=="") {
		bOut = false;
	}

	return bOut;
	}

function checkForm2() {
	bOut = true;
	if(document.Recherche.id_religion.selectedIndex==0 || document.Recherche.id_religion.selectedIndex=="") {
		bOut = true;
	} else {
		alert('');
    	bOut = false;}
      	return bOut;
	}
