// JavaScript Document

function jObj( ObjID ){
	if (document.getElementById) { return(document.getElementById( ObjID )); }	// IE5, IE6, IE7, NetScape6, Opera, Firefox
	else { if (document.all) {return(document.all[ ObjID ]); }                  // puto IE4, y algo de IE5
		   else { BrVersion = parseInt(navigator.appVersion);							
	       		if ((navigator.appName.indexOf('Netscape')!=-1)&&(BrVersion==4)) { return (document.layers[ ObjID ]); }
		 	}  // puto NetScape4
	} 
}

function jPty( ObjID, Parametro, Valor  ){
		Obj= jObj( ObjID );
		eval( "Obj."+ Parametro +"='"+ Valor +"'" );
}

function jCss( ObjID, Parametro, Valor  ){
		Obj= jObj( ObjID );
		eval( "Obj.style."+ Parametro +"='"+ Valor +"'" );
}

function jDivOn(ObjID){
	Obj = jObj(ObjID);
	Obj.style.display ="block";
}

function jDivOff(ObjID){
	Obj = jObj(ObjID);
	Obj.style.display ="none";
}

function jPageWidth() {
	return window.innerWidth!=null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body!=null ? document.body.clientWidth : null;
} 

function jPageHeight() {
	return  window.innerHeight!=null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body!=null? document.body.clientHeight : null;
} 

function jPosLeft() {
	 return typeof window.pageXOffset!='undefined' ? window.pageXOffset :document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;
} 

function jPosTop() {
	 return typeof window.pageYOffset!='undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;
} 

function jPosRight() {
	 return jsPosLeft()+jsPageWidth();
} 

function jPosBottom() {
	return jsPosTop()+jsPageHeight();
}
//-------------------------------------------------------------- SlideShow rutine

function runSlideShow(){
	if (SlideProc) {  
		   if (SlidePlay) j = j + 1;
		   if ( j>p ) j = 0;  if ( j<0 ) j = p;
		   if (document.all){
			  document.images.SlideShow.style.filter="blendTrans(duration=2)";
			  document.images.SlideShow.style.filter="blendTrans(duration=FadeDuration)";
			  document.images.SlideShow.filters.blendTrans.Apply();
		   }
		   document.images.SlideShow.src = preLoad[j].src;
		   if (document.all){  document.images.SlideShow.filters.blendTrans.Play();	   }
		   if (SlidePlay) t = setTimeout('runSlideShow()', SlideSpeed);
	}
}

function HomeSlide( n, imag ){
	p=n-1;
    preLoad[p] = new Image();  
	preLoad[p].src = imag;
}
function nextSlide() { j=j+1; SlidePlay=false; SlideProc=true; jPty('btPlay','src','images/nav_play.jpg'); runSlideShow();}
function prevSlide() { j=j-1; SlidePlay=false; SlideProc=true; jPty('btPlay','src','images/nav_play.jpg'); runSlideShow(); }
function playSlide() { SlidePlay = !(SlidePlay); SlideProc=SlidePlay; 
									jPty('btPlay','src',SlidePlay?'images/nav_pause.jpg':'images/nav_play.jpg'); runSlideShow();}


//--------------------------------------------------------  function locales ----------------------

//-------------------------------------------------------------- Menu Functions
//
//  MENU TOP BAR: 
//  to show the main menu    		ShowMenu( Popup-active )
//	to create a PopUpMenu use 		CreatePopUp( namepopup, imagen-in-menu, imagen-rollover, popup-height-pixels, page-to-link )
//	to create an option on popup 	CreateOption( label-in-popup, page-to-link )
//	to finish the PopUp creation	ClosePopUp()
//	to separate with |				SpacePopUp()
//

function ShowMenu(){
	CreatePopUp('PopAbout','ABOUT US',260,260,  			'#' );
	CreateOption('Letters from our founder', 	'#');		
	CreateOption('History', 	'#');		
	CreateOption('Our Staff', 	'#');		
	CreateOption('Employment Opportunities', 	'#');		
	ClosePopUp();

	SpacePopUp(350);

	CreatePopUp('PopProgs','MODEL AND RESULTS',366,366,	'#' );
	CreateOption(' ',							'#');	
	ClosePopUp();

	SpacePopUp(533);
	
	CreatePopUp('PopSeniors','OUR SCHOOLS',548,548,			'#' );
	CreateOption(' ',							'#');	
	ClosePopUp();

	SpacePopUp(665);
	
	CreatePopUp('PopGetInvolve','NEWS AND EVENTS',680,680,	'#' );
	CreateOption(' ',							'#');	
	ClosePopUp();
	
}

function CreatePopUp( PopName,  PopTitle, Pox1, Pox2, PopLink  ){
	var StHtm = "";
	StHtm = StHtm + "<a id=X"+PopName+" class='menu_links' href='"+PopLink+"' ";
	StHtm = StHtm + " onmouseover=\"jCss('"+PopName+"','display','block'); \" ";
	StHtm = StHtm + " onmouseout =\"jCss('"+PopName+"','display','none'); \" >"+PopTitle+"</a>"; 
	StHtm = StHtm + "<div id='"+PopName+"' class='menu_popup' ";
	StHtm = StHtm + " onmouseover=\"jCss('"+PopName+"','display','block'); \" ";
	StHtm = StHtm + " onmouseout =\"jCss('"+PopName+"','display','none'); \" >"; 
	document.write ( StHtm );
	Pos = jPageWidth()>1000 ? (jPageWidth()-1000)/2 : 10;
	PoM = Pos+Pox1; PoP = Pos+Pox2;
	jCss("X"+PopName,'left',PoM+'px');
	jCss(PopName,'left',PoP+'px');
}
function CreateOption( OptionName, OptionLink ){
	document.write ("<a class='menu_drop' href='"+OptionLink+"'>"+OptionName+"</a>" );
}
function ClosePopUp(){
	document.write ("</div>" );
}
function SpacePopUp(PopX){
	Pos = jPageWidth()>1000 ? (jPageWidth()-1000)/2 : 10;
	Pos = Pos+PopX;
	document.write ( "<div class='menu_space' style='left:"+Pos+"px;'>|</div>" );
}

function goPage(fpage){
    location.href='../'+fpage+'/index.html';
}
