var image_name='';
var image_src='';
var resize_step=0;
var resize_icur=0;
var resize_end=0;
var tmResizing;
var ResizingIsOn=0;

function NextResizingStep()
{
 resize_icur = resize_icur+resize_step;

 document.images[image_name].src=image_src+resize_icur+'.png';
 
 if( resize_icur>=resize_end )
  {
   clearTimeout( tmResizing );
   ResizingIsOn=0;
   image_name='';
   image_src=''; 
   resize_step=0;
   resize_icur=0;
  }
 else
  {
   tmResizing = setTimeout( 'NextResizingStep();', 50 );
  }
}

function StartResizing( imgName, srcPath, From, To )
{
 image_name = imgName;
 image_src = srcPath;

 if( From<To )
  resize_step=1;
 else
  resize_step=-1;
 
 resize_icur = From+resize_step;
 resize_end = To;

 document.images[imgName].src=srcPath+'1'+'.png';
 
 if( ResizingIsOn==0 )
  {
   clearTimeout( tmResizing );
  }
 
 tmResizing = setTimeout( 'NextResizingStep();', 50 );
 ResizingIsOn = 1;
}


function imgON( imgName, srcPath )
{
 document.images[imgName].src=srcPath;
}

function imgOFF(imgName,srcPath)
{
 document.images[imgName].src=srcPath;
}

var txt_name='';
var txt_resize_step=0;
var txt_resize_icur=0;
var txt_resize_end=0;
var txt_tmResizing;
var txt_ResizingIsOn=0;

function NextResizingTextStep()
{
 txt_resize_icur = txt_resize_icur+txt_resize_step;

 document.getElementById(txt_name).style.fontSize=txt_resize_icur+'px';
 
 if( txt_resize_icur>=txt_resize_end )
  {
   clearTimeout( txt_tmResizing );
   txt_ResizingIsOn=0;
   txt_name='';
   txt_resize_step=0;
   txt_resize_icur=0;
  }
 else
  {
   txt_tmResizing = setTimeout( 'NextResizingTextStep();', 80 );
  }
}

function StartResizingText( txtName, From, To )
{
 txt_name = txtName;

 var FromSize=From; 
 
 var cur_sz = document.getElementById(txt_name).style.fontSize;
 if( cur_sz!='' )
  {
   cur_sz = cur_sz.replace( 'px', '' );
   cur_sz = cur_sz.replace( 'pt', '' );
  }
 
 if( FromSize<To )
  txt_resize_step=1;
 else
  txt_resize_step=-1;
 
 txt_resize_icur = FromSize+txt_resize_step;
 txt_resize_end = To;

 document.getElementById(txt_name).style.fontSize=txt_resize_icur+'px';
 
 if( txt_ResizingIsOn==0 )
  {
   clearTimeout( txt_tmResizing );
  }
 
 txt_tmResizing = setTimeout( 'NextResizingTextStep();', 80 );
 txt_ResizingIsOn = 1;
}


