// french



// prefix for Netscape layers when needed

agt=navigator.userAgent;
var version = parseInt(navigator.appVersion);
	
if (agt.indexOf("MSIE") == -1)
  		 browser = "ns";
else {
         browser="ms";
}

// constructor for DOM
	if (browser == "ns") {
		if (document.layers) {
		prefix = 'document.layers[\"';
		suffix = '\"]'; 
		}
		else if (document.getElementById) {
		prefix = 'document.getElementById(\"';
		suffix = '\").style';
		}
}		
	else {
		prefix = 'document.all[\"';
		suffix = '\"].style';

		}
function nameLayer(name) {
		var layer = '';
  		if(document.layers) {layer = 'document.layers[\"' + name + '\"].';}
  		return layer;
  	}

// Basic Rollover	
	function BRollOn(layer,imgName) {
		if (ready) {
			eval(nameLayer(layer) + 'document.images[\"' + imgName + '\"].src = ' + imgName + '_on.src');	
		}	
	}

	function BRollOff(layer,imgName) {
		if (ready) {
			eval(nameLayer(layer) + 'document.images[\"' + imgName + '\"].src = ' + imgName + '_off.src');
			}
	}
	
function RollOn(layer,imgName1, imgName2) {
		if (ready) {
			eval(nameLayer(layer) + 'document.images[\"' + imgName1 + '\"].src = ' + imgName2 + '.src');	
		}	
	}

	function RollOff(layer,imgName1, imgName2) {
		if (ready) {
			eval(nameLayer(layer) + 'document.images[\"' + imgName1 + '\"].src = ' + imgName2 + '.src');
			}
	}
	
	
function showLayers(layer){
	if (ready) {
		eval(prefix + layer + suffix + '.visibility="visible"');
	}
}

function hideLayers(layer){
	if (ready) {
		eval(prefix + layer +  suffix + '.visibility="hidden"');
	}
}

var ready = false;

//preload images

function loadImages(){
if (document.images) {

// nav images
	
	home_on = new Image();
	home_on.src = "img/nav_home_on.gif";
	
	common_on = new Image();
	common_on.src = "img/nav_common_on.gif";
		
	cure_on = new Image();
	cure_on.src = "img/nav_cure_on.gif";
		
	advice_on = new Image();
	advice_on.src = "img/nav_advice_on.gif";
		
	faq_on = new Image();
	faq_on.src = "img/nav_faq_on.gif";
		
	features_on = new Image();
	features_on.src = "img/nav_features_on.gif";
		
	about_on = new Image();
	about_on.src = "img/nav_about_on.gif";
	
	youngcta_on = new Image();
	youngcta_on.src = "img/cta_young_on.gif";
	
	maturecta_on = new Image();
	maturecta_on.src = "img/cta_mature_on.gif";
	
	save_on = new Image();
	save_on.src = "img/cta_save_on.gif";
	
	ctafaq_on = new Image();
	ctafaq_on.src = "img/cta_faq_on.gif";
	
	first_on = new Image();
	first_on.src = "img/cta_first_on.gif";
	
	been_on = new Image();
	been_on.src = "img/cta_been_on.gif";
	
	roll1 = new Image();
	roll1.src = "img/spacer.gif";
	
	first_roll = new Image();
	first_roll.src = "img/cta_first_roll.gif";
	
	been_roll = new Image();
	been_roll.src = "img/cta_been_roll.gif";
	
	//CURE images Preloaded
	
	trust_on = new Image();
	trust_on.src = "img/cta_cure_trust_on.gif";
	
	m1_on = new Image();
	m1_on.src = "img/cta_cure_m1_on.gif";
	
	m3_on = new Image();
	m3_on.src = "img/cta_cure_m3_on.gif";
	
	m7_on = new Image();
	m7_on.src = "img/cta_cure_m7_on.gif";
	
	helpful_on = new Image();
	helpful_on.src = "img/cta_cure_helpful_on.gif";

	//advice images
	
	good_on = new Image();
	good_on.src = "img/cta_advice_good_on.gif";
	
	diabetes_on = new Image();
	diabetes_on.src = "img/cta_advice_diabetes_on.gif";
	
	pregnancy_on = new Image();
	pregnancy_on.src = "img/cta_advice_pregnancy_on.gif";
	
	//about images
	
	contact_on = new Image();
	contact_on.src = "img/cta_about_contact_on.gif";
	
	privacy_on = new Image();
	privacy_on.src = "img/cta_about_privacy_on.gif";
	
	legal_on = new Image();
	legal_on.src = "img/cta_about_legal_on.gif";
	
	mon1fl_on = new Image();
	mon1fl_on.src = "img/cure_nav_flower_on.gif";
	
	mon3fl_on = new Image();
	mon3fl_on.src = "img/cure_nav_flower_on.gif";
	
	mon7fl_on = new Image();
	mon7fl_on.src = "img/cure_nav_flower_on.gif";
	
	//faqs images
	f1_on = new Image();
	f1_on.src = "img/cta_faqs_1_about_on.gif";
	
	f2_on = new Image();
	f2_on.src = "img/cta_faqs_2_infections_on.gif";
	
	f3_on = new Image();
	f3_on.src = "img/cta_faqs_3_using_on.gif";
	
	f4_on = new Image();
	f4_on.src = "img/cta_faqs_4_general_on.gif";
	
}
return (ready=true);
}

//images cached

if (document.images) {

	home_off = new Image();
	home_off.src = "img/nav_home_off.gif";

	common_off = new Image();
	common_off.src = "img/nav_common_off.gif";
	
	cure_off = new Image();
	cure_off.src = "img/nav_cure_off.gif";
	
	advice_off = new Image();
	advice_off.src = "img/nav_advice_off.gif";
	
	faq_off = new Image();
	faq_off.src = "img/nav_faq_off.gif";
	
	features_off = new Image();
	features_off.src = "img/nav_features_off.gif";
	
	about_off = new Image();
	about_off.src = "img/nav_about_off.gif";
	
	monistat_logo = new Image();
	monistat_logo.src = "img/logo.gif";
	
	youngcta_off = new Image();
	youngcta_off.src = "img/cta_young_off.gif";
	
	maturecta_off = new Image();
	maturecta_off.src = "img/cta_mature_off.gif";
	
	save_off = new Image();
	save_off.src = "img/cta_save_off.gif";
	
	ctafaq_off = new Image();
	ctafaq_off.src = "img/cta_faq_off.gif";
	
	first_off = new Image();
	first_off.src = "img/cta_first_off.gif";
	
	been_off = new Image();
	been_off.src = "img/cta_been_off.gif";
	
	//CURE images Preloaded
	
	trust_off = new Image();
	trust_off.src = "img/cta_cure_trust_off.gif";
	
	m1_off = new Image();
	m1_off.src = "img/cta_cure_m1_off.gif";
	
	m3_off = new Image();
	m3_off.src = "img/cta_cure_m3_off.gif";
	
	m7_off = new Image();
	m7_off.src = "img/cta_cure_m7_off.gif";
	
	helpful_off = new Image();
	helpful_off.src = "img/cta_cure_helpful_off.gif";
	
	//advice images
	
	good_off = new Image();
	good_off.src = "img/cta_advice_good_off.gif";
	
	diabetes_off = new Image();
	diabetes_off.src = "img/cta_advice_diabetes_off.gif";
	
	pregnancy_off = new Image();
	pregnancy_off.src = "img/cta_advice_pregnancy_off.gif";
	
	//about images
	
	contact_off = new Image();
	contact_off.src = "img/cta_about_contact_off.gif";
	
	privacy_off = new Image();
	privacy_off.src = "img/cta_about_privacy_off.gif";
	
	legal_off = new Image();
	legal_off.src = "img/cta_about_legal_off.gif";
	
	//faqs images
	f1_off = new Image();
	f1_off.src = "img/cta_faqs_1_about_off.gif";
	
	f2_off = new Image();
	f2_off.src = "img/cta_faqs_2_infections_off.gif";
	
	f3_off = new Image();
	f3_off.src = "img/cta_faqs_3_using_off.gif";
	
	f4_off = new Image();
	f4_off.src = "img/cta_faqs_4_general_off.gif";
	
	//cure small nav flowers
	
	mon1fl_off = new Image();
	mon1fl_off.src = "img/cure_nav_flower_off.gif";
	
	mon3fl_off = new Image();
	mon3fl_off.src = "img/cure_nav_flower_off.gif";
	
	mon7fl_off = new Image();
	mon7fl_off.src = "img/cure_nav_flower_off.gif";
}

// Pop-up 
	
	var ie5 = (document.all && document.getElementbyID) ? false : true;
	var ns = (document.layers) ? false : true;
	var isMac = (navigator.appVersion.indexOf("Mac") == -1) ? false : true;
	var win, win2;	

	function openWin(url, popWidth, popHeight, popScroll, popStatus) {
		var winName =  "popup";
		// popStatus is a new parameter; it is optional so that old calls will not cause an error
		var statusBar = popScroll; 
		
		if (popStatus != null) { 
			statusBar  = popStatus;
			// 'fix' for Mac IE's problem when including a status bar in the pop up window
			// - the browser chops off the bottom 18 pixels of the window to accomodate for the
			//   the status bar, and so we add 18 pixels to the height			
			if (!ie5 && !ns && isMac) { popHeight += 18; }
		}

		if(win) {
			if(!win.closed) {
				if(win.name == "popup") winName = "popup2";	
			  	win.close(); 
			}			
			win = null;	
		}
		
		win=window.open(url, winName, 'width=' + popWidth + ',height=' + popHeight + ',screenX=220,screenY=200,left=220,top=200,scrollbars=' + popScroll + ',resize=no,status=' + statusBar + '');
		
		if (win.opener == null) win.opener = self;
		win.focus();
	}

	function openWin2(url, popWidth, popHeight, popScroll, popStatus) {
		var winName =  "popup2";
		// popStatus is a new parameter; it is optional so that old calls will not cause an error
		var statusBar = popScroll; 
		
		if (popStatus != null) { 
			statusBar  = popStatus;
			// 'fix' for Mac IE's problem when including a status bar in the pop up window
			// - the browser chops off the bottom 18 pixels of the window to accomodate for the
			//   the status bar, and so we add 18 pixels to the height			
			if (!ie5 && !ns && isMac) { popHeight += 18; }
		}

		if(win) {
			if(!win.closed) {
				if(win.name == "popup2") winName = "popup3";	
			  	win.close(); 
			}			
			win = null;	
		}
		
		win=window.open(url, winName, 'width=' + popWidth + ',height=' + popHeight + ',screenX=220,screenY=200,left=220,top=200,scrollbars=' + popScroll + ',resize=no,status=' + statusBar + '');
		
		if (win.opener == null) win.opener = self;
		win.focus();
	}
	
// end of pop-up

//switch lang
function switchLang () {
	engDelimiter = "english";
	freDelimeter = "french";
	newURL = switchLangSearch(engDelimiter, freDelimeter);
	if (newURL != 'null') {
		self.location = newURL;
		return;
	}
}



function switchLangSearch (engDelim, freDelim) {
	docURL = document.URL;
	newURL = 'null';
	engPosition = 0;
	frePosition = 0;
	charStart = 0;
	charEnd = docURL.length + 1;
	engDelimiter = engDelim;
	freDelimiter = freDelim;
	do {
		var test = docURL.substr(charStart, engDelimiter.length);
		if (test == engDelimiter) { engPosition = charStart;}
		charStart++;
	}
	while (charStart < charEnd - engDelimiter.length);
	if (engPosition > 0) {
		newURL = docURL.substr(0,engPosition) + freDelimiter + docURL.substr((engPosition + engDelimiter.length),docURL.length);
	} else {
		charStart = 0;
		do {
			var test = docURL.substr(charStart, freDelimiter.length)
			if (test == freDelimiter) { frePosition = charStart;}
			charStart++;
		}
		while (charStart < charEnd - freDelimiter.length);
		if (frePosition > 0) {
			newURL = docURL.substr(0,frePosition) + engDelimiter + docURL.substr((frePosition + freDelimiter.length),docURL.length);
		}
	}
	return newURL;
}


function last_modified() {
  months = new Array("janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", " novembre", "décembre"); 
  
  mod_date = new Date(document.lastModified);

  if (mod_date != 0 ) {
    //document.write("Ce site est publié par &copy; Soins-santé grand public McNeil, qui est entièrement responsable de son contenu.<br> Il s’adresse aux visiteurs du Canada seulement.<br>* Marque de commerce<br><br>Dernière mise à jour : "+mod_date.getDate()+" "+months[mod_date.getMonth()]+" "+mod_date.getFullYear()); 
    document.write("Ce site est publié par &copy; Soins-santé grand public McNeil, division de Johnson &amp; Johnson Inc., seule responsable de son contenu.<br> Il s’adresse aux visiteurs du Canada seulement.<br>* Marque de commerce<br><br>Dernière mise à jour : 11 juin 2007"); 
  }

}

