// JavaScript Document

//**********************************************************************
//
// MM_reloadPage
//
// this is a function that apparaently fixes a bug in NetscapeNavigator 4.0, where
// the page does not get redrawn when resized. 
//
// notice that this function is actually called after it is declared.
//
//**********************************************************************
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {
		if ((appName=="Netscape") && (parseInt(appVersion)==4)) {
	    document.MM_pgW = innerWidth; 
			document.MM_pgH = innerHeight; 
			onresize = MM_reloadPage; 
		}
	} else if (innerWidth != document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}


MM_reloadPage(true);


//**********************************************************************
//
// MM_openBrWindow
//
//**********************************************************************
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


//**********************************************************************
//**********************************************************************


function imgOn(imgName) {
	if (!document.images) return;
	document.images[imgName].src = eval(imgName + "_on.src");
}

function imgOff(imgName) {
	if (!document.images) return;
	
	// the off image depends on which page is active.
	// if the oof image matches the page we are on, then the off image should be the "on" image
	//
	// the active page will be indicated by the variable "page_button".
	// if page_button == imgName, then we know that is the page we're on
	
	if ( page_button == imgName ) {
		source = imgName + "_on.src"
	} else {
		source = imgName + "_off.src"
	}
	document.images[imgName].src = eval(source);
}

function newImage( path ) {
	var i = new Image();
	i.src = path;
	return i;
}

function testjs() {
	alert('testjs ok!');
}

// this is run always at beginning of page

if (document.images) {

	var but_home_on  = newImage("cfe_images/but_cfe_home_on.gif");
	var but_home_off = newImage("cfe_images/but_cfe_home_off.gif");

	var but_products_on  = newImage("cfe_images/but_cfe_products_on.gif");
	var but_products_off = newImage("cfe_images/but_cfe_products_off.gif");

	var but_about_on  = newImage("cfe_images/but_cfe_about_on.gif");
	var but_about_off = newImage("cfe_images/but_cfe_about_off.gif");

	var but_news_on  = newImage("cfe_images/but_cfe_news_on.gif");
	var but_news_off = newImage("cfe_images/but_cfe_news_off.gif");

	var but_dist_on  = newImage("cfe_images/but_cfe_distribute_on.gif");
	var but_dist_off = newImage("cfe_images/but_cfe_distribute_off.gif");

	var but_mfaire_on  = newImage("cfe_images/but_cfe_mfaire_on.gif");
	var but_mfaire_off = newImage("cfe_images/but_cfe_mfaire_off.gif");


	var but_showcart_on  = newImage("cfe_images/but_showcart_on.gif");
	var but_showcart_off = newImage("cfe_images/but_showcart_off.gif");

	var but_join_pop_on  = newImage("cfe_images/join_mail_on.gif");
	var but_join_pop_off = newImage("cfe_images/join_mail_off.gif");

	var but_legal_pop_on  = newImage("cfe_images/cfe_legalnotice_on.gif");
	var but_legal_pop_off = newImage("cfe_images/cfe_legalnotice_off.gif");

}



