
//Disable error display

function stoperror(){
return true
}
window.onerror=stoperror



//Rollover Effects

var rollOverArr=new Array();
function setrollover(OverImgSrc,pageImageName)
{
if (! document.images)return;
if (pageImageName == null)
pageImageName = document.images[document.images.length-1].name;
rollOverArr[pageImageName]=new Object;
rollOverArr[pageImageName].overImg = new Image;
rollOverArr[pageImageName].overImg.src=OverImgSrc;
}


var dynimages=new Array()
dynimages[0]=["thm/thm1.jpg", ""]
dynimages[1]=["thm/thm2.jpg", ""]
dynimages[2]=["thm/thm3.jpg", ""]
dynimages[3]=["thm/thm4.jpg", ""]
dynimages[4]=["thm/thm5.jpg", ""]
dynimages[5]=["thm/thm6.jpg", ""]
dynimages[6]=["thm/thm7.jpg", ""]


//Preload images ("yes" or "no"):
var preloadimg="yes"

//Set optional link target to be added to all images with a link:
var optlinktarget="section"

//Set image border width
var imgborderwidth=0

//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"

///////No need to edit beyond here/////

if (preloadimg=="yes"){
for (x=0; x<dynimages.length; x++){
var myimage=new Image()
myimage.src=dynimages[x][0]
}
}


function returnimgcode(theimg){
var imghtml=""
if (theimg[1]!="")
imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">'
imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'">'
if (theimg[1]!="")
imghtml+='</a>'
return imghtml
}


function returnFilecode(theFile){
	var filehtml = ""
	if (theFile != "")
		filehtml='<a href="'+theFile+'" target="'+optlinktarget+'">'
	if (theFile != "")
		filehtml += '</a>'
	return filehtml
}

// NEW FUNCTION
function rollover(pageImageName, loadarea, imgindex)
{

	if (! document.images)return;
	if (! rollOverArr[pageImageName])return;
	if (! rollOverArr[pageImageName].outImg)
	{
		rollOverArr[pageImageName].outImg = new Image;
		rollOverArr[pageImageName].outImg.src = document.images[pageImageName].src;
	}
	document.images[pageImageName].src=rollOverArr[pageImageName].overImg.src;


	if (document.getElementById){
		var imgobj=document.getElementById(loadarea)
		if (imgobj.filters && window.createPopup){
			imgobj.style.filter=filterstring
			imgobj.filters[0].Apply()
		}
		imgobj.innerHTML=returnimgcode(dynimages[imgindex])
		if (imgobj.filters && window.createPopup)
			imgobj.filters[0].Play()
		return false
	}
}

function rollout(pageImageName)
{
	if (!document.images) return;
	if (!rollOverArr[pageImageName]) return;
	document.images[pageImageName].src = rollOverArr[pageImageName].outImg.src;
}


//Flying circle script

var brOK=false;
var mie=false;
var aver=parseInt(navigator.appVersion.substring(0,1));
var aname=navigator.appName;
function checkbrOK()
{if(aname.indexOf("Internet Explorer")!=-1)
   {if(aver>=4) brOK=navigator.javaEnabled(); mie=true; }
 if(aname.indexOf("Netscape")!=-1)  
   {if(aver>=4) brOK=navigator.javaEnabled(); }}
var vmin=1;
var vmax=3;
var vr=2;
var timer1;
function Chip(chipname,width,height)
{this.named=chipname;
 this.vx=vmin+vmax*Math.random();
 this.vy=vmin+vmax*Math.random();
 this.w=width;
 this.h=height;
 this.xx=0;
 this.yy=0;
 this.timer1=null; }
function movechip(chipname)
{if(brOK)
  {eval("chip="+chipname);
   if(!mie)
    {pageX=window.pageXOffset;
     pageW=window.innerWidth;
     pageY=window.pageYOffset;
     pageH=window.innerHeight; }
   else
    {pageX=window.document.body.scrollLeft;
     pageW=window.document.body.offsetWidth-8;
     pageY=window.document.body.scrollTop;
     pageH=window.document.body.offsetHeight; } 
   chip.xx=chip.xx+chip.vx;
   chip.yy=chip.yy+chip.vy;
   
   chip.vx+=vr*(Math.random()-0.5);
   chip.vy+=vr*(Math.random()-0.5);
   if(chip.vx>(vmax+vmin))  chip.vx=(vmax+vmin)*2-chip.vx;
   if(chip.vx<(-vmax-vmin)) chip.vx=(-vmax-vmin)*2-chip.vx;
   if(chip.vy>(vmax+vmin))  chip.vy=(vmax+vmin)*2-chip.vy;
   if(chip.vy<(-vmax-vmin)) chip.vy=(-vmax-vmin)*2-chip.vy;

   if(chip.xx<=pageX)
     {chip.xx=pageX; 
	 chip.vx=vmin+vmax*Math.random(); }
   if(chip.xx>=pageX+pageW-chip.w)
     {chip.xx=pageX+pageW-chip.w; 
	 chip.vx=-vmin-vmax*Math.random(); }
   if(chip.yy<=pageY)
     {chip.yy=pageY;
      chip.vy=vmin+vmax*Math.random(); }
   if(chip.yy>=pageY+pageH-chip.h)
     {chip.yy=pageY+pageH-chip.h;
      chip.vy=-vmin-vmax*Math.random(); }
   if(!mie)
      {eval('document.'+chip.named+'.top ='+chip.yy);
       eval('document.'+chip.named+'.left='+chip.xx); } 
   else
      {eval('document.all.'+chip.named+'.style.pixelLeft='+chip.xx);
       eval('document.all.'+chip.named+'.style.pixelTop ='+chip.yy); }
   chip.timer1=setTimeout("movechip('"+chip.named+"')",100); }}

function stopme(chipname)
{if(brOK)
  {//alert(chipname)
   eval("chip="+chipname);
   if(chip.timer1!=null)
    {clearTimeout(chip.timer1) }}}


var chip1;
//add or delete more variables, depending on how many images you're using
function pagestart()
{checkbrOK(); 
 chip1=new Chip("chip1",60,80);
//add or delete more of the above, depending on how many images you're using
 if(brOK) 
   { movechip("chip1");
     //add or delete more of the above, depending on how many images you're using
	 }}


CSStopExecution = false;
CSInit = new Array;
function CSScriptInit() 
{idxArray = new Array;
 for(var i=0;i<CSInit.length;i++)
	idxArray[i] = i;
 CSAction2(CSInit, idxArray);}
function CSClickReturn () 
 {var bAgent = window.navigator.userAgent; 
  var bAppName = window.navigator.appName;
  if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))
	return true; // dont follow link
  else return false; // dont follow link
  }
CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);
function IsIE() { return CSAg.indexOf("MSIE") > 0;}
function CSIEStyl(s) { return document.all.tags("div")[s].style; }
function CSNSStyl(s) { return CSFindElement(s,0); }
function CSFindElement(n,ly) { if (CSBVers < 4) return document[n];
	var curDoc = ly ? ly.document : document; var elem = curDoc[n];
	if (!elem) { for (var i=0;i<curDoc.layers.length;i++) {elem = CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }}
	return elem;}
function CSButtonReturn () 
  {var bAgent = window.navigator.userAgent; 
   var bAppName = window.navigator.appName;
   if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))
		return false; // follow link
   else return true; // follow link
}
CSIm = new Object();
function CSIShow(n,i) {
	if (document.images) {
		if (CSIm[n]) {
			var img = (!IsIE()) ? CSFindElement(n,0) : document[n];
			if (img && typeof(CSIm[n][i].src) != "undefined") {img.src = CSIm[n][i].src;}
			if(i != 0)
				self.status = CSIm[n][3];
			else
				self.status = " ";
			return true;}} return false; }
function CSILoad(action) {
	im = action[1];
	if (document.images) {
		CSIm[im] = new Object();
		for (var i=2;i<5;i++) {
			if (action[i] != '') { CSIm[im][i-2] = new Image(); CSIm[im][i-2].src = action[i]; }
			else CSIm[im][i-2] = 0;}
		CSIm[im][3] = action[5];}}
CSStopExecution = false;

function CSAction(array) 
  { return CSAction2(CSAct, array);}
function CSAction2(fct, array) 
  { var result;
	for (var i=0;i<array.length;i++) {
		if(CSStopExecution) return false; 
		var actArray = fct[array[i]];
		var tempArray = new Array;
		for(var j=1;j<actArray.length;j++) {
			if((actArray[j] != null) && (typeof(actArray[j]) == "object") && (actArray[j].length == 2)) {
				if(actArray[j][0] == "VAR") {
					tempArray[j] = CSStateArray[actArray[j][1]];}
				else {
					if(actArray[j][0] == "ACT") {
						tempArray[j] = CSAction(new Array(new String(actArray[j][1])));}
				else
					tempArray[j] = actArray[j];}}
			else
				tempArray[j] = actArray[j];}			
		result = actArray[0](tempArray);}
	return result;}
CSAct = new Object;
function CSOpenWindow(action) {
	var wf = "";	
	wf = wf + "width=" + action[3];
	wf = wf + ",height=" + action[4];
	wf = wf + ",resizable=" + (action[5] ? "yes" : "no");
	wf = wf + ",scrollbars=" + (action[6] ? "yes" : "no");
	wf = wf + ",menubar=" + (action[7] ? "yes" : "no");
	wf = wf + ",toolbar=" + (action[8] ? "yes" : "no");
	wf = wf + ",directories=" + (action[9] ? "yes" : "no");
	wf = wf + ",location=" + (action[10] ? "yes" : "no");
	wf = wf + ",status=" + (action[11] ? "yes" : "no");		
	window.open(action[1],action[2],wf);}

CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'t1',/*URL*/'gph/tab7on.gif',/*URL*/'gph/tab7.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'p2',/*URL*/'images/button_on.gif',/*URL*/'images/button.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'p3',/*URL*/'images/button_on.gif',/*URL*/'images/button.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'p4',/*URL*/'images/button_on.gif',/*URL*/'images/button.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'p5',/*URL*/'images/button_on.gif',/*URL*/'images/button.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'p6',/*URL*/'images/button_on.gif',/*URL*/'images/button.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'button',/*URL*/'images/trouble.gif',/*URL*/'',/*URL*/'','');

CSAct[/*CMP*/ 'CONTACT'] = new Array(CSOpenWindow,/*URL*/ 'contact.htm','',370,410,false,false,false,false,false,false,false);

CSAct[/*CMP*/ 'FORMC1'] = new Array(CSOpenWindow,/*URL*/ 'formc1.htm','',300,400,false,false,false,false,false,false,false);
CSAct[/*CMP*/ 'EZINE'] = new Array(CSOpenWindow,/*URL*/ 'ezine.htm','',300,400,false,false,false,false,false,false,false);
CSAct[/*CMP*/ 'B6B9C2D80'] = new Array(CSOpenWindow,/*URL*/ 'balance.html','',280,440,false,false,false,false,false,false,false);
CSAct[/*CMP*/ 'B6C2FC254'] = new Array(CSOpenWindow,/*URL*/ 'sample_fontsize.html','',300,400,false,false,false,false,false,false,false);
CSAct[/*CMP*/ 'RETREAT'] = new Array(CSOpenWindow,/*URL*/ 'retreat.htm','',280,440,false,false,false,false,false,false,false);




//Chapter Menu Loader


var tickspeed=5000 //ticker speed in miliseconds (2000=2 seconds)
var displaymode="manual" //displaymode ("auto" or "manual"). No need to modify as form at the bottom will control it, unless you wish to remove form.

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.gallerycontent{display:none;}\n')
document.write('</style>\n')
}

var selectedDiv=0
var totalDivs=0

function getElementbyClass(classname){
partscollect=new Array()
var inc=0
var alltags=document.all? document.all.tags("DIV") : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
partscollect[inc++]=alltags[i]
}
}

function contractall(){
var inc=0
while (partscollect[inc]){
partscollect[inc].style.display="none"
inc++
}
}

function expandone(){
var selectedDivObj=partscollect[selectedDiv]
contractall()
selectedDivObj.style.display="block"
temp.options[selectedDiv].selected=true
selectedDiv=(selectedDiv<totalDivs-1)? selectedDiv+1 : 0
if (displaymode=="auto")
autocontrolvar=setTimeout("expandone()",tickspeed)
}

function populatemenu(){
temp=document.gallerycontrol.menu
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<totalDivs;i++){
var thesubject=partscollect[i].getAttribute("subject")
thesubject=(thesubject=="" || thesubject==null)? "HTML Content "+(i+1) : thesubject
temp.options[i]=new Option(thesubject,"")
}
temp.options[0].selected=true
}

function manualcontrol(menuobj){
if (displaymode=="manual"){
selectedDiv=menuobj
expandone()
}
}

function preparemode(themode){
displaymode=themode
if (typeof autocontrolvar!="undefined")
clearTimeout(autocontrolvar)
if (themode=="auto"){
document.gallerycontrol.menu.disabled=true
autocontrolvar=setTimeout("expandone()",tickspeed)
}
else
document.gallerycontrol.menu.disabled=false
}


function startgallery(){
document.getElementById("controldiv").style.display="block"
getElementbyClass("gallerycontent")
totalDivs=partscollect.length
populatemenu()
for (i=0; i<document.gallerycontrol.mode.length; i++){
if (document.gallerycontrol.mode[i].checked)
displaymode=document.gallerycontrol.mode[i].value
}
if (displaymode=="auto")
document.gallerycontrol.menu.disabled=true
expandone()
}

if (window.addEventListener)
window.addEventListener("load", startgallery, false)
else if (window.attachEvent)
window.attachEvent("onload", startgallery)
else if (document.getElementById)
window.onload=startgallery





//Disable right-click
//document.oncontextmenu = disableRightClick;

//function disableRightClick()
//{
//  return false;
//}




//Preload images


  if (document.images) {
  gph01 = new Image(119 ,31); gph01.src = "gph/cgif1m.gif";
  gph02 = new Image(119 ,31); gph02.src = "gph/cgif1n.gif";
  gph03 = new Image(114 ,31); gph03.src = "gph/mggif1.gif";
  gph04 = new Image(114 ,31); gph04.src = "gph/gcnr.gif";
  gph05 = new Image(121 ,31); gph05.src = "gph/s_cir.gif";
  gph06 = new Image(121 ,31); gph06.src = "gph/s_dia.gif";
  gph07 = new Image(110 ,31); gph07.src = "gph/twel.gif";
  gph08 = new Image(110 ,31); gph08.src = "gph/tnew.gif";
  gph09 = new Image(115 ,31); gph09.src = "gph/tcon.gif";

  gph10 = new Image(110 ,31); gph10.src = "gph/tabo.gif";
  gph11 = new Image(110 ,31); gph11.src = "gph/tpur.gif";
  gph12 = new Image(115 ,31); gph12.src = "gph/twha.gif";

  gph13 = new Image(115 ,31); gph13.src = "gph/tlea.gif";
  gph14 = new Image(110 ,31); gph14.src = "gph/tphi.gif";
  gph15 = new Image(110 ,31); gph15.src = "gph/tsch.gif";

  gph16 = new Image(110 ,31); gph16.src = "gph/tspo.gif";
  gph17 = new Image(110 ,31); gph17.src = "gph/tcha.gif";

  gph18 = new Image(115 ,31); gph18.src = "gph/tint.gif";
  gph19 = new Image(110 ,31); gph19.src = "gph/trus.gif";
  gph20 = new Image(110 ,31); gph20.src = "gph/trec.gif";

  gph21 = new Image(110 ,31); gph21.src = "gph/tmem.gif";
  gph22 = new Image(110 ,31); gph22.src = "gph/tadm.gif";

  gph23 = new Image(115 ,31); gph23.src = "gph/tdoc.gif";
  gph24 = new Image(110 ,31); gph24.src = "gph/tpic.gif";

  gph25 = new Image(110 ,31); gph25.src = "gph/tiss.gif";
  gph26 = new Image(115 ,31); gph26.src = "gph/tezi.gif";

  gph27 = new Image(110 ,31); gph27.src = "gph/tcon.gif";


  gph28 = new Image(115 ,31); gph28.src = "gph/title.gif";
  gph29 = new Image(115 ,31); gph29.src = "gph/title2.gif";


  gph30 = new Image(119 ,31); gph30.src = "gph/tab1on.gif";
  gph31 = new Image(114 ,31); gph31.src = "gph/tab2on.gif";
  gph32 = new Image(114 ,31); gph32.src = "gph/tab3on.gif";
  gph33 = new Image(121 ,31); gph33.src = "gph/tab4on.gif";
  gph34 = new Image(121 ,31); gph34.src = "gph/tab5on.gif";
  gph35 = new Image(110 ,31); gph35.src = "gph/tab6on.gif";
  gph36 = new Image(110 ,31); gph36.src = "gph/tab7on.gif";
  gph37 = new Image(115 ,31); gph37.src = "gph/cgif2m.gif";
  gph38 = new Image(115 ,31); gph38.src = "gph/mggif2.gif";
  gph39 = new Image(115 ,31); gph39.src = "gph/dotsbgr.gif";


  thm01 = new Image(119 ,31); thm01.src = "thm/thm1.gif";
  thm02 = new Image(114 ,31); thm02.src = "thm/thm2.gif";
  thm03 = new Image(114 ,31); thm03.src = "thm/thm3.gif";
  thm04 = new Image(121 ,31); thm04.src = "thm/thm4.gif";
  thm05 = new Image(121 ,31); thm05.src = "thm/thm5.gif";
  thm06 = new Image(110 ,31); thm06.src = "thm/thm6.gif"

  }

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
