
// zoOom 1.0
// (c) 2002 Premshree Pillai
// http://www.qiksearch.com
// premshree@hotmail.com
// Loaction of this script :
// http://www.qiksearch.com/javascripts/zooom10.htm
// Visit http://www.qiksearch.com/javascripts.htm for more FREE scripts

// Configure zoOom

//-----------------------------------------------------------------------
var time_length=1;        		// Zoom delay in milliseconds           |
var step=10;               		// Pixels by which image should zoomm   |
var magnification=2;			// 3x Zoom								|
var original_time=time_length;	//										|	
//-----------------------------------------------------------------------

function zoom_out(figura, img_act_width, img_act_height)
{
	var min_width=img_act_width;
	 if(figura.width==0)
	  {
	   figura.border=0;
	  }
	 if(figura.width!=0)
	  {
	   if(figura.width>min_width)
	   {
		figura.width-=step;
		figura.height=Math.round(figura.width*((img_act_height)/(img_act_width)));
	    setTimeout(function(){zoom_out(figura,img_act_width,img_act_height);},time_length);	
	   }
	   else
	   {
	   		figura.style.filter='';	   
	   		figura.onclick=function(){eval('resume_zoom(this,' + img_act_width + ',' + img_act_height + ');zoom_in(this,' + img_act_width + ',' + img_act_height + ');figura.style.filter="progid:DXImageTransform.Microsoft.Shadow(color=\'gray\',Direction=135,Strength=6)";')};			
	   }
	  }  
} 

function zoom_in(figura,img_act_width,img_act_height)
{
	var min_width=img_act_width;
	max_width=Math.round(img_act_width*magnification);
	
	 if(figura.width==0)
	  {
	   figura.border=0;
	  }
	 if(figura.width!=0)
	  {
	   if(figura.width<max_width)
	   {
		figura.width+=step;
		figura.height=Math.round(figura.width*((img_act_height)/(img_act_width)));
		figura.onclick='';
	    setTimeout(function(){zoom_in(figura,img_act_width,img_act_height);},time_length);	
	   }
	   else
	   {
	   		figura.onclick=function(){eval('resume_zoom(this,' + img_act_width + ',' + img_act_height + ');zoom_out(this,' + img_act_width + ',' + img_act_height + ');')};			
	   }
	  }  

}

function resume_zoom()
{
 time_length=original_time;
}

function pause_zoom()
{
// time_length=1000000000;
 time_length=100;
}

function set_original()
{
 figura.width=img_act_width;
 figura.height=img_act_height;
}

