/* FUNCTIONS
---------------------------------------- */
/* Pop-up definition*/

var newWin = null;

function popUp(strURL, strType, strWidth, strHeight) {

	if (newWin != null && !newWin.closed)
	newWin.close();  
 	var strOptions="";  
 
 	if (strType=="fixednooptions")    
  	strOptions="height="+strHeight+",width="+strWidth; 
 
 	if (strType=="resizablenooptions")    
  	strOptions="resizable,height="+strHeight+",width="+strWidth;
  
	if (strType=="fixedscroll")    
  	strOptions="scrollbars,"+"height="+strHeight+",width="+strWidth;  

	if (strType=="fixedmenuscroll")    
  	strOptions="menubar,scrollbars,"+"height="+strHeight+",width="+strWidth;  

 	if (strType=="resizablemenuscroll")    
 	strOptions="menubar,scrollbars,"+"resizable,height="+strHeight+",width="+strWidth;
 
 	if (strType=="fixedtoolsmenuscroll")    
  	strOptions="toolbar,menubar,scrollbars,"+"height="+strHeight+",width="+strWidth;  

 	if (strType=="resizabletoolsmenuscroll")    
  	strOptions="toolbar,menubar,scrollbars,"+"resizable,height="+strHeight+",width="+strWidth;
  
 	if (strType=="fixedtoolslocationmenuscroll")    
  	strOptions="toolbar,menubar,scrollbars,"+"location,height="+strHeight+",width="+strWidth;  

 	if (strType=="resizabletoolslocationmenuscroll")    
  	strOptions="toolbar,menubar,scrollbars,"+"resizable,location,height="+strHeight+",width="+strWidth;
  
 	if (strType=="resizablelocationmenuscroll")    
  	strOptions="menubar,scrollbars,"+"resizable,location,height="+strHeight+",width="+strWidth;
 
	/*The option below is being used for printer friendly pop ups*/
 	if (strType=="printerfriendlypage")    
  	strOptions="toolbar,menubar,scrollbars,"+"resizable,location,height="+strHeight+",width="+strWidth;
 
 	newWin = window.open(strURL, 'newWin', strOptions);  
 	newWin.focus();
 
}

/* ROLLOVERS: facts.html */

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		
		/* FACTS PAGE */
		fact_submenu_mortality_over = newImage("im/fact_submenu_mortality_over.gif");
		fact_submenu_education_over = newImage("im/fact_submenu_education_over.gif");
		fact_submenu_nutrition_over = newImage("im/fact_submenu_nutrition_over.gif");
		fact_submenu_immunization_over = newImage("im/fact_submenu_immunization_o.gif");
		fact_submenu_water_over = newImage("im/fact_submenu_water_over.gif");
		fact_submenu_hivaids_over = newImage("im/fact_submenu_hivaids_over.gif");
		fact_submenu_childprotection_over = newImage("im/fact_submenu_childprotec-15.gif");

		/* EVENTS PAGE */		
		events_submenu_aboutc_over = newImage("im/events_submenu_aboutc-over.gif");
		events_submenu_program_over = newImage("im/events_submenu_program-over.gif");
		events_submenu_media_over = newImage("im/events_submenu_media-over.gif");
		events_submenu_location_over = newImage("im/events_submenu_location-ove.gif");
		events_submenu_aboutus_over = newImage("im/events_submenu_aboutus-over.gif");
		preloadFlag = true;

		/* RESOURCES PAGE */			
		res_sub_research_over = newImage("im/res_sub_research-over.gif");
		res_sub_links_over = newImage("im/res_sub_links-over.gif");

	}
}