// image to be cached

var imagenames = new Array;
imagenames[0]  = "images/lt.jpg";
imagenames[1]  = "images/content_rt.gif";
imagenames[2]  = "images/rt.jpg";
imagenames[3]  = "images/home_26.jpg";
imagenames[4]  = "images/oppt_12.gif";
imagenames[5]  = "images/home_17.gif";
imagenames[6]  = "images/home_16.gif";
imagenames[7]  = "images/book_12.gif";
imagenames[8]  = "images/faqs_12.gif";
imagenames[9]  = "images/book_21.jpg";
imagenames[10] = "images/gpub_25.jpg";
imagenames[11] = "images/book_20.jpg";
imagenames[12] = "images/book_25.jpg";
imagenames[13] = "images/home_25.jpg";
imagenames[14] = "images/gpub_21.jpg";
imagenames[15] = "images/faqs_21.jpg";
imagenames[16] = "images/faqs_20.jpg";
imagenames[17] = "images/gpub_16.gif";
imagenames[18] = "images/gpub_26.jpg";
imagenames[19] = "images/oppt_11.gif";
imagenames[20] = "images/faqs_25.jpg";
imagenames[21] = "images/oppt_13.gif";
imagenames[22] = "images/serv_20.jpg";

var yposition     = 461;		// POSITION OF LOAD BAR FROM TOP OF WINDOW, IN PIXELS
var barheight     = 2;			// HEIGHT OF PROGRESS BAR IN PIXELS
var barwidth      = 250;		// WIDTH OF THE BAR IN PIXELS  
var bordercolor   = 'DDDDDD';	// COLOR OF THE BORDER
var loadedcolor   = '507794';	// PROGRESS BAR COLOR
var unloadedcolor = 'CFCFCF';	// BGCOLOR OF UNLOADED AREA
var nextpage      = 'main.htm';	//  

//DO NOT EDIT BEYOND THIS POINT 

var NS4 = (navigator.appName.indexOf("Netscape")>=0 && parseFloat(navigator.appVersion) >= 4 && parseFloat(navigator.appVersion) < 5)? true : false;
var IE4 = (document.all)? true : false;
var NS6 = (parseFloat(navigator.appVersion) >= 5 && navigator.appName.indexOf("Netscape")>=0 )? true: false;

var imagesdone = false;
var blocksize  = barwidth / (imagenames.length);
//barheight      = Math.max(barheight,25);
var loaded     = 0, perouter, perdone, images=new Array();
var txt        = (NS4)?'<layer name="perouter" bgcolor="'+bordercolor+'" visibility="hide">' : '<div id="perouter" style="position:absolute; visibility:hidden; background-color:'+bordercolor+'">';
txt            +='<table cellpadding="0" cellspacing="1" border="0"><tr><td width="'+barwidth+'" height="'+barheight+'" valign="center">';

if (NS4)txt+='<ilayer width="100%" height="100%"><layer width="100%" height="100%" bgcolor="'+unloadedcolor+'" top="0" left="0">';

txt            +='<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="center" width="'+barwidth+'" height="'+barheight+'" bgcolor="'+unloadedcolor+'"></td></tr></table>';

if(NS4) txt+='</layer>';
txt            +=(NS4)? '<layer name="perdone" width="100%" height="'+barheight+'" bgcolor="'+loadedcolor+'" top="0" left="0">' : '<div id="perdone" style="position:absolute; top:1px; left:1px; width:'+barwidth+'px; height:'+barheight+'px; background-color:'+loadedcolor+'; z-index:100">';
txt            +='<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="center" width="'+barwidth+'" height="'+barheight+'" bgcolor="'+loadedcolor+'"></td></tr></table>';
txt            +=(NS4)? '</layer></ilayer>' : '</div>';
txt            +='</td></tr></table>';
txt            +=(NS4)?'</layer>' : '</div>';

document.write(txt);

function loadimages() {
	if (NS4) {
		perouter=document.perouter;
		perdone=document.perouter.document.layers[0].document.perdone;
	}
	if(NS6) {
		perouter=document.getElementById('perouter');
		perdone=document.getElementById('perdone');
	}
	if(IE4) {
		perouter=document.all.perouter;
		perdone=document.all.perdone;
	}
	cliplayer(perdone,0,0,barheight,0);
	window.onresize=setouterpos;
	setouterpos();
	for(n=0;n<imagenames.length;n++) {
		images[n]=new Image();
		images[n].src=imagenames[n];
		setTimeout('checkload('+n+')' ,n*100);
	}
}

function setouterpos() {
	var ww=(IE4)? document.body.clientWidth : window.innerWidth;
	var x=(ww-barwidth)/2;
	if (NS4) {
		perouter.moveTo(x,yposition);
		perouter.visibility="show";
	}
	if (IE4||NS6) {
		perouter.style.left=x+'px';
		perouter.style.top=yposition+'px';
		perouter.style.visibility="visible";
	}
}

function dispbars() {
	loaded++;
	cliplayer(perdone, 0, blocksize*loaded, barheight, 0);
	if (loaded>=imagenames.length)setTimeout('hideperouter()', 800);
}

function checkload(index) {
	(images[index].complete)? dispbars() : setTimeout('checkload('+index+')', 100);
}

function hideperouter() {
	(NS4)? perouter.visibility="hide" : perouter.style.visibility="hidden";
	imagesdone=true;
        window.location.replace( nextpage );
}

function cliplayer(layer, ct, cr, cb, cl) {
	if(NS4) {
		layer.clip.left=cl;
		layer.clip.top=ct;
		layer.clip.right=cr;
		layer.clip.bottom=cb;
	}
	if(IE4||NS6)layer.style.clip='rect('+ct+' '+cr+' '+cb+' '+cl+')';
}

window.onload=loadimages;