if(!window.main)
	main=new Object();
ImageZoomRunning = false;
zoomStretch = "BOTH";  //"HORIZONTAL", "VERTICAL"
/*******************************************************************
*
* Function    : zoomIn34
*
* Description : This function is based on the turn_on() function
*		      of animate2.js (animated rollovers from www.roy.whittle.com).
*		      Each zoom object is given a state. 
*			OnMouseOver the state is switched depending on the current state.
*			Current state -> Switch to
*			===========================
*			null		->	OFF.
*			OFF		->	ZOOM_IN
*			ZOOM_OUT	->	ZOOM_IN
*			ZOOM_IN_OUT->	ZOOM_IN
*****************************************************************/
zoomIn34 = function(img, zoomStep, maxZoom)
{
	if(img)
	{
		if(!zoomStep)
		{
			if(zoomStretch == "VERTICAL")
				zoomStep = img.height/10;
			else
				zoomStep = img.width/10;
		}

		if(!maxZoom)
		{
			if(zoomStretch == "VERTICAL")
				maxZoom = img.height;
			else
				maxZoom = img.width;
		}


		if(img.state == null)
		{
			img.state = "OFF";
			img.index = 0;
			img.orgWidth =  img.width;
			img.orgHeight = img.height;
			img.zoomStep = zoomStep;
			img.maxZoom  = 17.83;
		}

		if(img.state == "OFF")
		{
			img.state = "ZOOM_IN";
			start_zooming();
		}
		else if( img.state == "ZOOM_IN_OUT"
			|| img.state == "ZOOM_OUT")
		{
			img.state = "ZOOM_IN";
		}
	}
}
/*******************************************************************
*
* Function    : zoomIn64
*
* Description : This function is based on the turn_on() function
*		      of animate2.js (animated rollovers from www.roy.whittle.com).
*		      Each zoom object is given a state. 
*			OnMouseOver the state is switched depending on the current state.
*			Current state -> Switch to
*			===========================
*			null		->	OFF.
*			OFF		->	ZOOM_IN
*			ZOOM_OUT	->	ZOOM_IN
*			ZOOM_IN_OUT->	ZOOM_IN
*****************************************************************/
zoomIn64 = function(img, zoomStep, maxZoom)
{
	if(img)
	{
		if(!zoomStep)
		{
			if(zoomStretch == "VERTICAL")
				zoomStep = img.height/10;
			else
				zoomStep = img.width/10;
		}

		if(!maxZoom)
		{
			if(zoomStretch == "VERTICAL")
				maxZoom = img.height;
			else
				maxZoom = img.width;
		}


		if(img.state == null)
		{
			img.state = "OFF";
			img.index = 0;
			img.orgWidth =  img.width;
			img.orgHeight = img.height;
			img.zoomStep = zoomStep;
			img.maxZoom  = 33.57;
		}

		if(img.state == "OFF")
		{
			img.state = "ZOOM_IN";
			start_zooming();
		}
		else if( img.state == "ZOOM_IN_OUT"
			|| img.state == "ZOOM_OUT")
		{
			img.state = "ZOOM_IN";
		}
	}
}
/*******************************************************************
*
* Function    : zoomIn89
*
* Description : This function is based on the turn_on() function
*		      of animate2.js (animated rollovers from www.roy.whittle.com).
*		      Each zoom object is given a state. 
*			OnMouseOver the state is switched depending on the current state.
*			Current state -> Switch to
*			===========================
*			null		->	OFF.
*			OFF		->	ZOOM_IN
*			ZOOM_OUT	->	ZOOM_IN
*			ZOOM_IN_OUT->	ZOOM_IN
*****************************************************************/
zoomIn89 = function(img, zoomStep, maxZoom)
{
	if(img)
	{
		if(!zoomStep)
		{
			if(zoomStretch == "VERTICAL")
				zoomStep = img.height/10;
			else
				zoomStep = img.width/10;
		}

		if(!maxZoom)
		{
			if(zoomStretch == "VERTICAL")
				maxZoom = img.height;
			else
				maxZoom = img.width;
		}


		if(img.state == null)
		{
			img.state = "OFF";
			img.index = 0;
			img.orgWidth =  img.width;
			img.orgHeight = img.height;
			img.zoomStep = zoomStep;
			img.maxZoom  = 46.68;
		}

		if(img.state == "OFF")
		{
			img.state = "ZOOM_IN";
			start_zooming();
		}
		else if( img.state == "ZOOM_IN_OUT"
			|| img.state == "ZOOM_OUT")
		{
			img.state = "ZOOM_IN";
		}
	}
}
/*******************************************************************
*
* Function    : zoomInnav
*
* Description : This function is based on the turn_on() function
*		      of animate2.js (animated rollovers from www.roy.whittle.com).
*		      Each zoom object is given a state. 
*			OnMouseOver the state is switched depending on the current state.
*			Current state -> Switch to
*			===========================
*			null		->	OFF.
*			OFF		->	ZOOM_IN
*			ZOOM_OUT	->	ZOOM_IN
*			ZOOM_IN_OUT->	ZOOM_IN
*****************************************************************/
function zoomIn(img, zoomStep, maxZoom)
{
	if(img)
	{
		if(!zoomStep)
		{
			if(zoomStretch == "VERTICAL")
				zoomStep = img.height/zoomStep;
			else
				zoomStep = img.width/zoomStep;
		}

		if(!maxZoom)
		{
			if(zoomStretch == "VERTICAL")
				maxZoom = img.height;
			else
				maxZoom = img.width;
		}


		if(img.state == null)
		{
			img.state = "OFF";
			img.index = 0;
			img.orgWidth =  img.width;
			img.orgHeight = img.height;
			img.zoomStep = zoomStep;
			img.maxZoom  = maxZoom;
		}

		if(img.state == "OFF")
		{
			img.state = "ZOOM_IN";
			start_zooming();
		}
		else if( img.state == "ZOOM_IN_OUT"
			|| img.state == "ZOOM_OUT")
		{
			img.state = "ZOOM_IN";
		}
	}
}
/*******************************************************************
*
* Function    : zoomIn111
*
* Description : This function is based on the turn_on() function
*		      of animate2.js (animated rollovers from www.roy.whittle.com).
*		      Each zoom object is given a state. 
*			OnMouseOver the state is switched depending on the current state.
*			Current state -> Switch to
*			===========================
*			null		->	OFF.
*			OFF		->	ZOOM_IN
*			ZOOM_OUT	->	ZOOM_IN
*			ZOOM_IN_OUT->	ZOOM_IN
*****************************************************************/
zoomIn111 = function(img, zoomStep, maxZoom)
{
	if(img)
	{
		if(!zoomStep)
		{
			if(zoomStretch == "VERTICAL")
				zoomStep = img.height/10;
			else
				zoomStep = img.width/10;
		}

		if(!maxZoom)
		{
			if(zoomStretch == "VERTICAL")
				maxZoom = img.height;
			else
				maxZoom = img.width;
		}


		if(img.state == null)
		{
			img.state = "OFF";
			img.index = 0;
			img.orgWidth =  img.width;
			img.orgHeight = img.height;
			img.zoomStep = zoomStep;
			img.maxZoom  = 58.22;
		}

		if(img.state == "OFF")
		{
			img.state = "ZOOM_IN";
			start_zooming();
		}
		else if( img.state == "ZOOM_IN_OUT"
			|| img.state == "ZOOM_OUT")
		{
			img.state = "ZOOM_IN";
		}
	}
}
/*******************************************************************
*
* Function    : zoomIn164
*
* Description : This function is based on the turn_on() function
*		      of animate2.js (animated rollovers from www.roy.whittle.com).
*		      Each zoom object is given a state. 
*			OnMouseOver the state is switched depending on the current state.
*			Current state -> Switch to
*			===========================
*			null		->	OFF.
*			OFF		->	ZOOM_IN
*			ZOOM_OUT	->	ZOOM_IN
*			ZOOM_IN_OUT->	ZOOM_IN
*****************************************************************/
zoomIn164 = function(img, zoomStep, maxZoom)
{
	if(img)
	{
		if(!zoomStep)
		{
			if(zoomStretch == "VERTICAL")
				zoomStep = img.height/10;
			else
				zoomStep = img.width/10;
		}

		if(!maxZoom)
		{
			if(zoomStretch == "VERTICAL")
				maxZoom = img.height;
			else
				maxZoom = img.width;
		}


		if(img.state == null)
		{
			img.state = "OFF";
			img.index = 0;
			img.orgWidth =  img.width;
			img.orgHeight = img.height;
			img.zoomStep = zoomStep;
			img.maxZoom  = 86.02;
		}

		if(img.state == "OFF")
		{
			img.state = "ZOOM_IN";
			start_zooming();
		}
		else if( img.state == "ZOOM_IN_OUT"
			|| img.state == "ZOOM_OUT")
		{
			img.state = "ZOOM_IN";
		}
	}
}
/*******************************************************************
*
* Function    : zoomIn286
*
* Description : This function is based on the turn_on() function
*		      of animate2.js (animated rollovers from www.roy.whittle.com).
*		      Each zoom object is given a state. 
*			OnMouseOver the state is switched depending on the current state.
*			Current state -> Switch to
*			===========================
*			null		->	OFF.
*			OFF		->	ZOOM_IN
*			ZOOM_OUT	->	ZOOM_IN
*			ZOOM_IN_OUT->	ZOOM_IN
*****************************************************************/
zoomIn286 = function(img, zoomStep, maxZoom)
{
	if(img)
	{
		if(!zoomStep)
		{
			if(zoomStretch == "VERTICAL")
				zoomStep = img.height/10;
			else
				zoomStep = img.width/10;
		}

		if(!maxZoom)
		{
			if(zoomStretch == "VERTICAL")
				maxZoom = img.height;
			else
				maxZoom = img.width;
		}


		if(img.state == null)
		{
			img.state = "OFF";
			img.index = 0;
			img.orgWidth =  img.width;
			img.orgHeight = img.height;
			img.zoomStep = zoomStep;
			img.maxZoom  = 150;
		}

		if(img.state == "OFF")
		{
			img.state = "ZOOM_IN";
			start_zooming();
		}
		else if( img.state == "ZOOM_IN_OUT"
			|| img.state == "ZOOM_OUT")
		{
			img.state = "ZOOM_IN";
		}
	}
}
/*******************************************************************
*
* Function    : zoomOut
*
* Description : This function is based on the turn_off function
*		      of animate2.js (animated rollovers from www.roy.whittle.com).
*		      Each zoom object is given a state. 
*			OnMouseOut the state is switched depending on the current state.
*			Current state -> Switch to
*			===========================
*			ON		->	ZOOM_OUT.
*			ZOOM_IN	->	ZOOM_IN_OUT.
*****************************************************************/
zoomOut = function(img)
{
	if(img)
	{
		if(img.state=="ON")
		{
			img.state="ZOOM_OUT";
			start_zooming();
		}
		else if(img.state == "ZOOM_IN")
		{
			img.state="ZOOM_IN_OUT";
		}
	}
}
/*******************************************************************
*
* Function    : start_zooming
*
* Description : This function is based on the start_animating() function
*	        	of animate2.js (animated rollovers from www.roy.whittle.com).
*			If the timer is not currently running, it is started.
*			Only 1 timer is used for all objects
*****************************************************************/
function start_zooming()
{
	if(!ImageZoomRunning)
		ImageZoomAnimation();
}

setZoom = function(img)
{
	if(zoomStretch == "HORIZONTAL")
	{
		img.width  = img.orgWidth  + img.index;
		img.height = img.orgHeight;
	}
	else if(zoomStretch == "VERTICAL")
	{
		img.width  = img.orgWidth;
		img.height = img.orgHeight + img.index;
	}
	else
	{
		img.width  = img.orgWidth  + img.index;
	}
}
/*******************************************************************
*
* Function    : ImageZoomAnimation
*
* Description : This function is based on the Animate function
*		    of animate2.js (animated rollovers from www.roy.whittle.com).
*		    Each zoom object has a state. This function
*		    modifies each object and (possibly) changes its state.
*****************************************************************/
function ImageZoomAnimation()
{
	ImageZoomRunning = false;
	for(i=0 ; i<document.images.length ; i++)
	{
		var img = document.images[i];
		if(img.state)
		{
			if(img.state == "ZOOM_IN")
			{
				if(img.index < img.maxZoom)
					img.index+=img.zoomStep;
				else
					img.index = img.maxZoom;

				setZoom(img);

				if(img.index == img.maxZoom)
					img.state="ON";
				else
					ImageZoomRunning = true;
			}
			else if(img.state == "ZOOM_IN_OUT")
			{
				if(img.index < img.maxZoom)
					img.index+=img.zoomStep;
				else
					img.index = img.maxZoom;

				setZoom(img);
	
				if(img.index == img.maxZoom)
					img.state="ZOOM_OUT";
				ImageZoomRunning = true;
			}
			else if(img.state == "ZOOM_OUT")
			{
				if(img.index > 0)
					img.index-=img.zoomStep;
				else
					img.index = 0;

				setZoom(img);

				if(img.index == 0)
					img.state="OFF";
				else
					ImageZoomRunning = true;
			}
		}
	}
	/*** Check to see if we need to animate any more frames. ***/
	if(ImageZoomRunning)
		setTimeout("ImageZoomAnimation()", 25);
}



/*
Gradual-Highlight Image Script III- 
*/
dimObjects = new Object();
dimTimers = new Object();
/* object - image to be dimd (actual object, not name);
 * destop - destination transparency level (ie 80, for mostly solid)
 * rate   - time in milliseconds between trasparency changes (best under 100)
 * delta  - amount of change each time (ie 5, for 5% change in transparency)
 */
var rate=20
var delta=20

function dim(object, destOp)
{
   if (navigator.appName == "Microsoft Internet Explorer")
   {
     if (object != "[object]"){  //do this so I can take a string too
        setTimeout("dim("+object+","+destOp+",rate,delta)",0);
        return;
        }
     clearTimeout(dimTimers[object.sourceIndex]);    
     diff = destOp-object.filters.alpha.opacity;
     direction = 1;
     if (object.filters.alpha.opacity > destOp){
        direction = -1;
        }
     delta=Math.min(direction*diff,10);
     object.filters.alpha.opacity+=direction*delta;
     if (object.filters.alpha.opacity != destOp){
        dimObjects[object.sourceIndex]=object;
        dimTimers[object.sourceIndex]=setTimeout("dim(dimObjects["+object.sourceIndex+"],"+destOp+",rate,delta)",rate);
        }
   }
else document.getElementById(object).style.MozOpacity=destOp/100;
}
/*document.getElementById(object).style.MozOpacity=destOp/100;
------------object.style.MozOpacity=destOp/100;  document.images.vimage.style.MozOpacity="1.0";
*/


// EMAIL HIDER
// Code written by Fajar Siswandaru
function showsifu() {
    var name = "sifu";
    var host = "shaolinchowka.com";
    var delim = "\@";
    var href = 'mailto:';
    var text = '\<a href="' + href + name + delim + host + '">';
document.write(text); 
}


function preload() {
 var arImages=new Array();
 var temp = preload.arguments; 
 for(x=0; x < temp.length; x++) {
  arImages[x]=new Image();
  arImages[x].src=preload.arguments[x];
 }
}


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_findObj(n, d) { //v3.0
  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); 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_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];}}
}


function blurAnchors(){
  if(document.getElementsByTagName){
    var a = document.getElementsByTagName("a");
    for(var i = 0; i < a.length; i++){
      a[i].onfocus = function(){this.blur()};
    }
  }
}
