// JavaScript Document
// changed by Anil John Itty dated on 16/10/2008
var imageSrcArray = new Array ();
var imageTitleArray = new Array ();

imageSrcArray[0] = 'SchoolWelfareProgram/s1.jpg';
imageSrcArray[1] = 'SchoolWelfareProgram/s2.jpg';
imageSrcArray[2] = 'SchoolWelfareProgram/s3.jpg';

imageSrcArray[3] = 'SchoolWelfareProgram/s4.jpg';
imageSrcArray[4] = 'SchoolWelfareProgram/s5.jpg';
imageSrcArray[5] = 'SchoolWelfareProgram/s6.jpg';

imageSrcArray[6] = 'SchoolWelfareProgram/s7.jpg';
imageSrcArray[7] = 'SchoolWelfareProgram/s8.jpg';
imageSrcArray[8] = 'SchoolWelfareProgram/s9.jpg';

imageTitleArray [0] = '';
imageTitleArray [1] = '';
imageTitleArray [2] = '';
imageTitleArray [3] = '';
imageTitleArray [4] = '';
imageTitleArray [5] = '';
imageTitleArray [6] = '';
imageTitleArray [7] = '';
imageTitleArray [8] = '';

//g_annual_01_t
function loadImage(iSrc){
var iWidth = 470;
		var scrOfY = getScrollXY();
		var popDiv = document.getElementById("popupImage");

		popDiv.style.width = iWidth + 'px';
		//popDiv.style.height = iHeight + 'px';
		//document.getElementById('popcontent').innerHTML = "dfgzdgvzxv";
		document.getElementById('popupImageSrcDiv').innerHTML = "<img id='imageHolderImage' src='images/"+imageSrcArray[iSrc]+"'/>";
		document.getElementById('popupImageTitleDiv').innerHTML = imageTitleArray[iSrc];

		popDiv.style.display = "block";
		if (self.innerWidth){ // Mozilla
			frameWidth = window.innerWidth;
			frameHeight = window.innerHeight;
			scrollHeight = document.body.scrollHeight; // for lengthy pages
			
		}else if (document.documentElement.clientWidth){ // IE
			frameWidth = document.documentElement.clientWidth;
			frameHeight = document.documentElement.clientHeight;
			scrollHeight = document.body.scrollHeight; // for lengthy pages
		}
		halfWidth = Math.round(frameWidth/2);
		halfHeight = Math.round(frameHeight/2); 
		halfDivWidth = Math.round(popDiv.offsetWidth/2);
		halfDivHeight = Math.round(popDiv.offsetHeight/2);
		posLeft = (halfWidth - halfDivWidth) + 'px';
		posTop = (halfHeight - halfDivHeight);// + 'px';
		popDiv.style.left = posLeft;
		popDiv.style.top = (scrOfY + posTop) + 'px';;
		
		showBgDiv ();
}


function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  // return [ scrOfX, scrOfY ];
  return scrOfY;
}


function hideWindow(){
	var popDiv = document.getElementById("popupImage");
	
	if(popDiv.style.display == "block"){
		popDiv.style.display = "none";
		hideBgDiv ();
	}
}



function showBgDiv (){
	var popupImageBg = document.getElementById ("popupImageBg"); // main content
	
	popupImageBg.style.display ="block";
	popupImageBg.style.height = frameHeight +"px";
	
	if (scrollHeight > frameHeight){
		popupImageBg.style.height = scrollHeight +"px";
		} else {
			popupImageBg.style.height = frameHeight +"px";
		}
	popupImageBg.style.width = frameWidth - 20 +"px";
	
	if (navigator.appName == 'Microsoft Internet Explorer'){
		popupImageBg.style.width = frameWidth - 5 +"px";
		//hideform ();
	}
}

function hideBgDiv (){
	var popupImageBg = document.getElementById ("popupImageBg"); // main content

	if(popupImageBg != null){ // if bg mask is displayed
			popupImageBg.style.display = "none";
	}
}



