ВОТ ВТОРАЯ ЧАСТЬ СКРИПТА !!!
* Function : hasOpacity
*
* Description : Tests if the browser allows Opacity
*
*****************************************************************/
JSFX.hasOpacity = function(obj)
{
if(document.layers)
return false;
if(window.opera)
return false;
if(navigator.userAgent.toLowerCase().indexOf("mac") != -1)
return false;
return true;
}
/*******************************************************************
*
* Function : fadeIn /fadeOut
*
* Description : Detects browser that can do opacity and fades the images
* For browsers that do not support opacity it just does an image swap.
* (I only know about NS4 but maybe IE on a Mac also ?)
* For these functions to work you need to name the image
* e.g. for an image named "home" you need
* <IMG .... NAME="home">
* and you need 2 images, the on and the off image
*****************************************************************/
JSFX.fadeIn = function(imgName, rollName)
{
if(rollName == null)
rollName=imgName;
/*** Stop emails because the rollover was named incorrectly ***/
if(!JSFX.RolloverObjects[rollName])
{
JSFX.Rollover.error(rollName);
return;
}
var img = JSFX.findImg(imgName, document);
if(JSFX.hasOpacity(img))
JSFX.imgFadeIn(img, JSFX.RolloverObjects[rollName].img_src);
else
{
if(img.offSrc==null)
img.offSrc=img.src;
img.src=JSFX.RolloverObjects[rollName].img_src;
}
}
JSFX.fadeOut = function(imgName)
{
var img = JSFX.findImg(imgName, document);
if(JSFX.hasOpacity(img))
JSFX.imgFadeOut(img);
else
img.src=img.offSrc;
}
/*******************************************************************
*
* Function : imgOn /imgOff
*
* Description : Included these functions so you can mix simple and
* fading rollovers without having to include 2 ".js" files
*
*****************************************************************/
JSFX.imgOn = function(imgName, rollName)
{
if(rollName == null)
rollName=imgName;
/*** Stop emails because the rollover was named incorrectly ***/
if(!JSFX.RolloverObjects[rollName])
{
JSFX.Rollover.error(rollName);
return;
}
var img = JSFX.findImg(imgName,document);
if(img.offSrc==null)
img.offSrc=img.src;
img.src=JSFX.RolloverObjects[rollName].img_src;
}
JSFX.imgOff = function(imgName)
{
var img = JSFX.findImg(imgName,document);
img.src=img.offSrc;
}
/*************************************************************************/
/* Sort out bandwidth stealers */
/*************************************************************************/