var msg = 'Ce lien vous dirigera vers un autre site Web auquel cette Politique de confidentialité ne s’applique pas. Nous vous encourageons à lire la Politique de confidentialité de chaque site Web que vous consultez. Cliquez sur le bouton Annuler pour revenir au site ou sur OK pour continuer.';

// Initialize the footer text for all pages but about this site and index
var footer = '<br /><a href="about-this-site.htm">À propos de ce site</a> | <a href="links.htm">Liens utiles</a> | <a href="glossary.htm">Glossaires</a> | <a href="privacy.htm">Politique de confidentialité</a> | <a href="legal.htm">Conditions juridiques</a> | <a href="sitemap.htm">Plan du site</a> | <a href="contact.htm">Nous contacter</a> | <a href="http://www.EmpowerThePatient.com">English</a><br><br>Dernière mise à jour en janvier 2010.  © Janssen Inc. 2007-2011. <br />Ce site s’adresse au public canadien et il est publié par Janssen Inc. qui assume l’entière responsabilité de son contenu.';

/*  Validate the search box before submitting */
function validateQuestion(who) {
	var validForm = true;
	var errmsg = document.getElementById("errormsg");
	errmsg.innerHTML = "";	
	if (!exists(document.askquestion.question.value)) {
		validForm = false;
		errmsg.innerHTML = 'Entrez votre question. ';
	} 
	if (!exists(document.askquestion.email.value)) {
		validForm = false;
		errmsg.innerHTML = errmsg.innerHTML + 'Entrez votre courriel. ';
	} else {
		apos=document.askquestion.email.value.indexOf("@");
		dotpos=document.askquestion.email.value.lastIndexOf(".");
		if (apos<1||dotpos-apos<2) {
	  		errmsg.innerHTML = errmsg.innerHTML + "Entrez un courriel valide.";
			validForm = false;
		}
	}
	document.askquestion.expert.value = who;
	return validForm;
}

// Check if value entered into field
function exists(inputValue) {
	var aCharExists = false;
	for (var i=0; i<= inputValue.length; i++) {
		if (inputValue.charAt(i) != " " && inputValue.charAt(i) != "") {
			aCharExists = true;
			break
		}
	}
	return aCharExists;
}

// Play with  the visibility for the section
function toggle(section) { 
	if (document.getElementById(section).style.display == "block")
		document.getElementById(section).style.display = "none";
	else
		document.getElementById(section).style.display = "block";
}
function show(section) { 
	document.getElementById(section).style.display = "block";
}
function hide(section) { 
	document.getElementById(section).style.display = "none";
}

// Change characteristics of submit button on hover and on mouse out
function hoverButton(what) {
	document.getElementById(what).style.color = '#ED1C24';
	document.getElementById(what).style.backgroundColor = '#cccccc';
}
function outButton(what) {
	document.getElementById(what).style.color = '#333333';
	document.getElementById(what).style.backgroundColor = '#cccccc';
}
/*  Resize the fatigue assessment box and load with script */

function loadTool() {
	document.getElementById("FSimage").style.display = "none";
	document.getElementById("FSmovie").style.display = "block";
}
function unTool() {
	document.getElementById("FSimage").style.display = "block";
	document.getElementById("FSmovie").style.display = "none"

}

// Parse the URL variable and return the expert name
function getWho() { 
  	var searchString = document.location.search;
	if (searchString == '') {
		return '';
	
	}
	
	// should be a leading '?'
	apos=searchString.indexOf("?");
	if (apos < 0) {
		return '';
	
	}
	// should be an '='
	apos=searchString.indexOf("=");
	if (apos < 0) {
		return '';
	
	}
	searchString = searchString.substring(1);
	if (searchString == '') {
		return '';
	
	}
	var nvPairs = searchString.split("&");
	if (nvPairs == '') {
		return '';
	
	}
	var nvPair = nvPairs[0].split("=");
	if ((nvPair == '') || (nvPair.length == 0)) {
		return '';
	
	}
	// remove any '%20'
	if (nvPair[1] == '') {
		return '';
	
	}
	nvPair[1] = nvPair[1].replace(/%20/g, " ");

	return nvPair[1];
} // end of function

/* Standard Dreamweaver functions */
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]+"'");
}

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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}


