function imprime()
{
var IE5 = parseInt(navigator.appVersion.indexOf('MSIE 5.')) ;
{  
	if (navigator.appName == 'Netscape' ) { 
	window.print() ;  } else if(IE5!= -1) { window.print() ;  
} else if(IE5==-1)
 { var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>'; 
	document.body.insertAdjacentHTML('beforeEnd', WebBrowser); 
	WebBrowser1.ExecWB(6,2);//Use a 1 vs. a 2 for a prompting dialog box
	WebBrowser1.outerHTML = "";  }}
}

function OuvreTeimoignage(IdVoyage)
	{
	PopupCentre(url_site+'PRIVATE/F_UCB_TOUR/F02_MODULES/F02_04_popup_zoom.asp?IdVoyage='+IdVoyage,'zoomvoyage','430','430','scrollbar=no');
	}
function PopupCentreVoyage(url,namepopup,largeur,hauteur,options)
{
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	dest = document.temoignage.ID_VOYAGE.options[document.temoignage.ID_VOYAGE.selectedIndex].value;
	window.open(url+"?DESTINATION="+dest,namepopup,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}
function PrintPage(UrlPageImpression)
	{
	alert(UrlPageImpression);
	}

function VideInputIdentifiant()
	{
	if(document.AccesCompte.ABO_USER.value=="Votre identifiant")
		{
		document.AccesCompte.ABO_USER.value="";
		}
	}
function VideInputMotDePasse()
	{
	if(document.AccesCompte.Mot_Passe.value=="mot de passe")
		{
		document.AccesCompte.Mot_Passe.value="";
		}
	}
function VideInputEmailDemandeMotPasse()
	{
	if(document.DemandePasse.email.value=="Adresse email")
		{
		document.DemandePasse.email.value="";
		}
	}
function Lien(Url){document.location=Url;}
function PopupCentre(url,namepopup,largeur,hauteur,options){var top=(screen.height-hauteur)/2;var left=(screen.width-largeur)/2;window.open(url,namepopup,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);}
function PopupParametre(url,namepopup,largeur,hauteur,options,left,top){window.open(url,namepopup,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);}
function AjouterFavoris(url, description)
{

if (navigator.appName=='Microsoft Internet Explorer')
   {
   window.external.AddFavorite(url, description);
   }
   else 
if (navigator.appName=='Netscape')
   {
   alert("This function is only available with Microsoft Internet Explorer");
   }
}
function FermerFenetre()
{
window.close();
}
function RecommanderSite()
{
	if(document.layers)
	{
	var W=360;
	var H=238;//148;
	var x=parseInt((screen.width-W)/2,10);
	var y=parseInt((screen.height-H)/2,10);
	window.open(url_site+"/INCLUDES/02_MODULES/02_11_popup_recommander_site.asp","recommandersite","scrollbars=no, resizable = yes, width="+W+",height="+H+",top="+y+",left="+x);
	}	
	else
	{
	var W=360;
	var H=255;//165;
	var x=parseInt((screen.width-W)/2,10);
	var y=parseInt((screen.height-H)/2,10);
	window.open(url_site+"/INCLUDES/02_MODULES/02_11_popup_recommander_site.asp","recommandersite","scrollbars=no, resizable = yes, width="+W+",height="+H+",top="+y+",left="+x);
	}
}
function checkMail(mail)
{
	if(mail == null)
	{
		return null;
	}
	if(mail.match(/^.+@.+\..+$/))
	{
		return mail;
	} 
	else 
	{
	return null;
	}
}
function RecommanderSiteMailto()
	{
	if (document.Recommander.Email.value=="" || !checkMail(document.Recommander.Email.value))
	{
		alert("Veuillez entrer un E-mail valide svp !");
		document.Recommander.Email.focus();
		return;
	}
	//self.location="mailto:"+document.Recommander.Email.value
	//self.close();
		document.Recommander.submit();
	}
	
function TestMotdePass(user)
	{
		if ((document.ModifPasse.newPWD.value ==document.ModifPasse.ConfirmPWD.value))
		{	
			if (!document.ModifPasse.newPWD.value.match(/^.*(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[$£*µù%!§:/;.,?=+)\°à@ç^_è`('{&quot;#é&²]).*$/))
			{
				alert("Le mot de passe doit avoir au moins 2 caractères alphabétiques(dont un minuscule et un majuscule), 1 caractère numérique et 1 caractère spécial");
				document.ModifPasse.newPWD.focus();
				return;
			}
			if (!document.ModifPasse.newPWD.value.match(/^.*(?=.{8,20}).*$/))
			{
				alert("Le mot de passe doit posséder huit caractères au minimum");
				document.ModifPasse.newPWD.focus();
				return;
			}
			
			if (document.ModifPasse.newPWD.value.lastIndexOf(user)>= 0)
			{	
				alert("Le mot de passe ne doit pas contenir votre identifiant");
				document.ModifPasse.newPWD.focus();
				return;
			}
			
		}
		document.ModifPasse.submit();
	}
	
function CalculetteFinancieres()
{
	/*if ((document.CalculFinancier.TypeCalcul[0].checked == false) && (document.CalculFinancier.TypeCalcul[1].checked == false))
	{	
		alert("Veuillez choisir le type de calcul");
		return;
	}*/
	
	document.CalculFinancier.submit();
}

function EtatDiv(lediv)
{
	if (document.layers)
	{
		if (lediv == 1)
		{	
			document.CalculFinancier.getElementById('capital').style.visibility="visible";
			document.CalculFinancier.getElementById('mensu').style.visibility="hide";
			document.CalculFinancier.montant.value = ""
		}
		else
		{
			document.CalculFinancier.getElementById('mensu').style.visibility="visible";
			document.CalculFinancier.getElementById('capital').style.visibility="hide";
			document.CalculFinancier.mensualite.value = ""
		}
	}
	else
	{
		if (lediv == 1)
		{	
			document.CalculFinancier.all['capital'].style.visibility="visible";
			document.CalculFinancier.all['mensu'].style.visibility="hidden";
			document.CalculFinancier.montant.value = ""
		}
		else
		{
			document.CalculFinancier.all['mensu'].style.visibility="visible";
			document.CalculFinancier.all['capital'].style.visibility="hidden";
			document.CalculFinancier.mensualite.value = ""
		}
	}
}



function printit()
{
	var v=""+navigator.appVersion;
	v=v.substring(v.indexOf("MSIE")+5,v.indexOf("MSIE")+6);  
	if ((navigator.appName == 'Netscape') || (v == "5"))
	{
	parent.frames.spy.print();  
	}
	else 
	{
	var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
	if(!(parent.frames.spy.document.all["WebBrowser1"]))
		parent.frames.spy.document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
	parent.frames.spy.focus();
	parent.frames.spy.document.WebBrowser1.ExecWB(6,10);
	}
}

// isInteger (STRING s [, BOOLEAN emptyOK])
// 
// Returns true if all characters in string s are numbers.
//
// Accepts non-signed integers only. Does not accept floating 
// point, exponential notation, etc.
//
// We don't use parseInt because that would accept a string
// with trailing non-numeric characters.
//
// By default, returns defaultEmptyOK if s is empty.
// There is an optional second argument called emptyOK.
// emptyOK is used to override for a single function call
//      the default behavior which is specified globally by
//      defaultEmptyOK.
// If emptyOK is false (or any value other than true), 
//      the function will return false if s is empty.
// If emptyOK is true, the function will return true if s is empty.
//
// EXAMPLE FUNCTION CALL:     RESULT:
// isInteger ("5")            true 
// isInteger ("")             defaultEmptyOK
// isInteger ("-5")           false
// isInteger ("", true)       true
// isInteger ("", false)      false
// isInteger ("5", false)     true

function isInteger (s)

{   var i;

    if (isEmpty(s)) 
       if (isInteger.arguments.length == 1) return defaultEmptyOK;
       else return (isInteger.arguments[1] == true);

    // Search through string's characters one by one
    // until we find a non-numeric character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);

        if (!isDigit(c)) return false;
    }

    // All characters are numbers.
    return true;
}

// Check whether string s is empty

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}

// Returns true if character c is a digit 
// (0 .. 9).

function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}

