/*******************************************************************************
 IXF1.11 :: Image cross-fade 
 ------------------------------------------------------------------------------
 Copyright (c) 2004 James Edwards (brothercake)          <cake@brothercake.com>
 BSD License                          See license.txt for licensing information
 Info/Docs       http://www.brothercake.com/site/resources/scripts/transitions/
 ------------------------------------------------------------------------------
*******************************************************************************/
//global object
var ixf = { 'clock' : null, 'count' : 1 }
/*******************************************************



/*****************************************************************************
 List the images that need to be cached
*****************************************************************************/

ixf.imgs = [
	'../img/home/colegios_01.jpg',
	'../img/home/colegios_02.jpg',
	'../img/home/colegios_03.jpg'
	];

/*****************************************************************************
*****************************************************************************/



//cache the images
ixf.imgsLen = ixf.imgs.length;
ixf.cache = [];
for(var i=0; i<ixf.imgsLen; i++)
{
	ixf.cache[i] = new Image;
	ixf.cache[i].src = ixf.imgs[i];
}


//crossfade setup function
function crossfade()
{
	//if the timer is not already going
	if(ixf.clock == null)
	{
		//copy the image object 
		ixf.obj = arguments[0];
		
		//copy the image src argument 
		ixf.src = arguments[1];
		
		//store the supported form of opacity
		if(typeof ixf.obj.style.opacity != 'undefined')
		{
			ixf.type = 'w3c';
		}
		else if(typeof ixf.obj.style.MozOpacity != 'undefined')
		{
			ixf.type = 'moz';
		}
		else if(typeof ixf.obj.style.KhtmlOpacity != 'undefined')
		{
			ixf.type = 'khtml';
		}
		else if(typeof ixf.obj.filters == 'object')
		{
			//weed out win/ie5.0 by testing the length of the filters collection (where filters is an object with no data)
			//then weed out mac/ie5 by testing first the existence of the alpha object (to prevent errors in win/ie5.0)
			//then the returned value type, which should be a number, but in mac/ie5 is an empty string
			ixf.type = (ixf.obj.filters.length > 0 && typeof ixf.obj.filters.alpha == 'object' && typeof ixf.obj.filters.alpha.opacity == 'number') ? 'ie' : 'none';
		}
		else
		{
			ixf.type = 'none';
		}
		
		//change the image alt text if defined
		if(typeof arguments[3] != 'undefined' && arguments[3] != '')
		{
			ixf.obj.alt = arguments[3];
		}
		
		//if any kind of opacity is supported
		if(ixf.type != 'none')
		{
			//create a new image object and append it to body
			//detecting support for namespaced element creation, in case we're in the XML DOM
			ixf.newimg = document.getElementsByTagName('body')[0].appendChild((typeof document.createElementNS != 'undefined') ? document.createElementNS('http://www.w3.org/1999/xhtml', 'img') : document.createElement('img'));

			//set positioning classname
			ixf.newimg.className = 'idupe';
			
			//set src to new image src
			ixf.newimg.src = ixf.src

			//move it to superimpose original image
			ixf.newimg.style.left = ixf.getRealPosition(ixf.obj, 'x') + 'px';
			ixf.newimg.style.top = ixf.getRealPosition(ixf.obj, 'y') + 'px';
			
			//copy and convert fade duration argument 
			ixf.length = parseInt(arguments[2], 10) * 1000;
			
			//create fade resolution argument as 20 steps per transition
			ixf.resolution = parseInt(arguments[2], 10) * 20;
			
			//start the timer
			ixf.clock = setInterval('ixf.crossfade()', ixf.length/ixf.resolution);
		}
		
		//otherwise if opacity is not supported
		else
		{
			//just do the image swap
			ixf.obj.src = ixf.src;
		}
		
	}
};


//crossfade timer function
ixf.crossfade = function()
{
	//decrease the counter on a linear scale
	ixf.count -= (1 / ixf.resolution);
	
	//if the counter has reached the bottom
	if(ixf.count < (1 / ixf.resolution))
	{
		//clear the timer
		clearInterval(ixf.clock);
		ixf.clock = null;
		
		//reset the counter
		ixf.count = 1;
		
		//set the original image to the src of the new image
		ixf.obj.src = ixf.src;
	}
	
	//set new opacity value on both elements
	//using whatever method is supported
	switch(ixf.type)
	{
		case 'ie' :
			ixf.obj.filters.alpha.opacity = ixf.count * 100;
			ixf.newimg.filters.alpha.opacity = (1 - ixf.count) * 100;
			break;
			
		case 'khtml' :
			ixf.obj.style.KhtmlOpacity = ixf.count;
			ixf.newimg.style.KhtmlOpacity = (1 - ixf.count);
			break;
			
		case 'moz' : 
			//restrict max opacity to prevent a visual popping effect in firefox
			ixf.obj.style.MozOpacity = (ixf.count == 1 ? 0.9999999 : ixf.count);
			ixf.newimg.style.MozOpacity = (1 - ixf.count);
			break;
			
		default : 
			//restrict max opacity to prevent a visual popping effect in firefox
			ixf.obj.style.opacity = (ixf.count == 1 ? 0.9999999 : ixf.count);
			ixf.newimg.style.opacity = (1 - ixf.count);
	}
	
	//now that we've gone through one fade iteration 
	//we can show the image that's fading in
	ixf.newimg.style.visibility = 'visible';
	
	//keep new image in position with original image
	//in case text size changes mid transition or something
	ixf.newimg.style.left = ixf.getRealPosition(ixf.obj, 'x') + 'px';
	ixf.newimg.style.top = ixf.getRealPosition(ixf.obj, 'y') + 'px';
	
	//if the counter is at the top, which is just after the timer has finished
	if(ixf.count == 1)
	{
		//remove the duplicate image
		ixf.newimg.parentNode.removeChild(ixf.newimg);
	}
};



//get real position method
ixf.getRealPosition = function()
{
	this.pos = (arguments[1] == 'x') ? arguments[0].offsetLeft : arguments[0].offsetTop;
	this.tmp = arguments[0].offsetParent;
	while(this.tmp != null)
	{
		this.pos += (arguments[1] == 'x') ? this.tmp.offsetLeft : this.tmp.offsetTop;
		this.tmp = this.tmp.offsetParent;
	}
	
	return this.pos;
};

//global object
var ixf2 = { 'clock' : null, 'count' : 1 }
/*******************************************************



/*****************************************************************************
 List the images that need to be cached
*****************************************************************************/

ixf2.imgs = [
	'../img/home/sanidad_01.jpg',
	'../img/home/sanidad_02.jpg',
	'../img/home/sanidad_03.jpg'
	];

/*****************************************************************************
*****************************************************************************/



//cache the images
ixf2.imgsLen = ixf2.imgs.length;
ixf2.cache = [];
for(var i=0; i<ixf2.imgsLen; i++)
{
	ixf2.cache[i] = new Image;
	ixf2.cache[i].src = ixf2.imgs[i];
}


//crossfade setup function
function crossfade2()
{
	//if the timer is not already going
	if(ixf2.clock == null)
	{
		//copy the image object 
		ixf2.obj = arguments[0];
		
		//copy the image src argument 
		ixf2.src = arguments[1];
		
		//store the supported form of opacity
		if(typeof ixf2.obj.style.opacity != 'undefined')
		{
			ixf2.type = 'w3c';
		}
		else if(typeof ixf2.obj.style.MozOpacity != 'undefined')
		{
			ixf2.type = 'moz';
		}
		else if(typeof ixf2.obj.style.KhtmlOpacity != 'undefined')
		{
			ixf2.type = 'khtml';
		}
		else if(typeof ixf2.obj.filters == 'object')
		{
			//weed out win/ie5.0 by testing the length of the filters collection (where filters is an object with no data)
			//then weed out mac/ie5 by testing first the existence of the alpha object (to prevent errors in win/ie5.0)
			//then the returned value type, which should be a number, but in mac/ie5 is an empty string
			ixf2.type = (ixf2.obj.filters.length > 0 && typeof ixf2.obj.filters.alpha == 'object' && typeof ixf2.obj.filters.alpha.opacity == 'number') ? 'ie' : 'none';
		}
		else
		{
			ixf2.type = 'none';
		}
		
		//change the image alt text if defined
		if(typeof arguments[3] != 'undefined' && arguments[3] != '')
		{
			ixf2.obj.alt = arguments[3];
		}
		
		//if any kind of opacity is supported
		if(ixf2.type != 'none')
		{
			//create a new image object and append it to body
			//detecting support for namespaced element creation, in case we're in the XML DOM
			ixf2.newimg = document.getElementsByTagName('body')[0].appendChild((typeof document.createElementNS != 'undefined') ? document.createElementNS('http://www.w3.org/1999/xhtml', 'img') : document.createElement('img'));

			//set positioning classname
			ixf2.newimg.className = 'idupe';
			
			//set src to new image src
			ixf2.newimg.src = ixf2.src

			//move it to superimpose original image
			ixf2.newimg.style.left = ixf2.getRealPosition(ixf2.obj, 'x') + 'px';
			ixf2.newimg.style.top = ixf2.getRealPosition(ixf2.obj, 'y') + 'px';
			
			//copy and convert fade duration argument 
			ixf2.length = parseInt(arguments[2], 10) * 1000;
			
			//create fade resolution argument as 20 steps per transition
			ixf2.resolution = parseInt(arguments[2], 10) * 20;
			
			//start the timer
			ixf2.clock = setInterval('ixf2.crossfade()', ixf2.length/ixf2.resolution);
		}
		
		//otherwise if opacity is not supported
		else
		{
			//just do the image swap
			ixf2.obj.src = ixf2.src;
		}
		
	}
};


//crossfade timer function
ixf2.crossfade = function()
{
	//decrease the counter on a linear scale
	ixf2.count -= (1 / ixf2.resolution);
	
	//if the counter has reached the bottom
	if(ixf2.count < (1 / ixf2.resolution))
	{
		//clear the timer
		clearInterval(ixf2.clock);
		ixf2.clock = null;
		
		//reset the counter
		ixf2.count = 1;
		
		//set the original image to the src of the new image
		ixf2.obj.src = ixf2.src;
	}
	
	//set new opacity value on both elements
	//using whatever method is supported
	switch(ixf2.type)
	{
		case 'ie' :
			ixf2.obj.filters.alpha.opacity = ixf2.count * 100;
			ixf2.newimg.filters.alpha.opacity = (1 - ixf2.count) * 100;
			break;
			
		case 'khtml' :
			ixf2.obj.style.KhtmlOpacity = ixf2.count;
			ixf2.newimg.style.KhtmlOpacity = (1 - ixf2.count);
			break;
			
		case 'moz' : 
			//restrict max opacity to prevent a visual popping effect in firefox
			ixf2.obj.style.MozOpacity = (ixf2.count == 1 ? 0.9999999 : ixf2.count);
			ixf2.newimg.style.MozOpacity = (1 - ixf2.count);
			break;
			
		default : 
			//restrict max opacity to prevent a visual popping effect in firefox
			ixf2.obj.style.opacity = (ixf2.count == 1 ? 0.9999999 : ixf2.count);
			ixf2.newimg.style.opacity = (1 - ixf2.count);
	}
	
	//now that we've gone through one fade iteration 
	//we can show the image that's fading in
	ixf2.newimg.style.visibility = 'visible';
	
	//keep new image in position with original image
	//in case text size changes mid transition or something
	ixf2.newimg.style.left = ixf2.getRealPosition(ixf2.obj, 'x') + 'px';
	ixf2.newimg.style.top = ixf2.getRealPosition(ixf2.obj, 'y') + 'px';
	
	//if the counter is at the top, which is just after the timer has finished
	if(ixf2.count == 1)
	{
		//remove the duplicate image
		ixf2.newimg.parentNode.removeChild(ixf2.newimg);
	}
};



//get real position method
ixf2.getRealPosition = function()
{
	this.pos = (arguments[1] == 'x') ? arguments[0].offsetLeft : arguments[0].offsetTop;
	this.tmp = arguments[0].offsetParent;
	while(this.tmp != null)
	{
		this.pos += (arguments[1] == 'x') ? this.tmp.offsetLeft : this.tmp.offsetTop;
		this.tmp = this.tmp.offsetParent;
	}
	
	return this.pos;
};


//global object
var ixf3 = { 'clock' : null, 'count' : 1 }
/*******************************************************



/*****************************************************************************
 List the images that need to be cached
*****************************************************************************/

ixf3.imgs = [
	'../img/home/ocio_01.jpg',
	'../img/home/ocio_02.jpg',
	'../img/home/ocio_03.jpg'
	];

/*****************************************************************************
*****************************************************************************/



//cache the images
ixf3.imgsLen = ixf3.imgs.length;
ixf3.cache = [];
for(var i=0; i<ixf3.imgsLen; i++)
{
	ixf3.cache[i] = new Image;
	ixf3.cache[i].src = ixf3.imgs[i];
}


//crossfade setup function
function crossfade3()
{
	//if the timer is not already going
	if(ixf3.clock == null)
	{
		//copy the image object 
		ixf3.obj = arguments[0];
		
		//copy the image src argument 
		ixf3.src = arguments[1];
		
		//store the supported form of opacity
		if(typeof ixf3.obj.style.opacity != 'undefined')
		{
			ixf3.type = 'w3c';
		}
		else if(typeof ixf3.obj.style.MozOpacity != 'undefined')
		{
			ixf3.type = 'moz';
		}
		else if(typeof ixf3.obj.style.KhtmlOpacity != 'undefined')
		{
			ixf3.type = 'khtml';
		}
		else if(typeof ixf3.obj.filters == 'object')
		{
			//weed out win/ie5.0 by testing the length of the filters collection (where filters is an object with no data)
			//then weed out mac/ie5 by testing first the existence of the alpha object (to prevent errors in win/ie5.0)
			//then the returned value type, which should be a number, but in mac/ie5 is an empty string
			ixf3.type = (ixf3.obj.filters.length > 0 && typeof ixf3.obj.filters.alpha == 'object' && typeof ixf3.obj.filters.alpha.opacity == 'number') ? 'ie' : 'none';
		}
		else
		{
			ixf3.type = 'none';
		}
		
		//change the image alt text if defined
		if(typeof arguments[3] != 'undefined' && arguments[3] != '')
		{
			ixf3.obj.alt = arguments[3];
		}
		
		//if any kind of opacity is supported
		if(ixf3.type != 'none')
		{
			//create a new image object and append it to body
			//detecting support for namespaced element creation, in case we're in the XML DOM
			ixf3.newimg = document.getElementsByTagName('body')[0].appendChild((typeof document.createElementNS != 'undefined') ? document.createElementNS('http://www.w3.org/1999/xhtml', 'img') : document.createElement('img'));

			//set positioning classname
			ixf3.newimg.className = 'idupe';
			
			//set src to new image src
			ixf3.newimg.src = ixf3.src

			//move it to superimpose original image
			ixf3.newimg.style.left = ixf3.getRealPosition(ixf3.obj, 'x') + 'px';
			ixf3.newimg.style.top = ixf3.getRealPosition(ixf3.obj, 'y') + 'px';
			
			//copy and convert fade duration argument 
			ixf3.length = parseInt(arguments[2], 10) * 1000;
			
			//create fade resolution argument as 20 steps per transition
			ixf3.resolution = parseInt(arguments[2], 10) * 20;
			
			//start the timer
			ixf3.clock = setInterval('ixf3.crossfade()', ixf3.length/ixf3.resolution);
		}
		
		//otherwise if opacity is not supported
		else
		{
			//just do the image swap
			ixf3.obj.src = ixf3.src;
		}
		
	}
};


//crossfade timer function
ixf3.crossfade = function()
{
	//decrease the counter on a linear scale
	ixf3.count -= (1 / ixf3.resolution);
	
	//if the counter has reached the bottom
	if(ixf3.count < (1 / ixf3.resolution))
	{
		//clear the timer
		clearInterval(ixf3.clock);
		ixf3.clock = null;
		
		//reset the counter
		ixf3.count = 1;
		
		//set the original image to the src of the new image
		ixf3.obj.src = ixf3.src;
	}
	
	//set new opacity value on both elements
	//using whatever method is supported
	switch(ixf3.type)
	{
		case 'ie' :
			ixf3.obj.filters.alpha.opacity = ixf3.count * 100;
			ixf3.newimg.filters.alpha.opacity = (1 - ixf3.count) * 100;
			break;
			
		case 'khtml' :
			ixf3.obj.style.KhtmlOpacity = ixf3.count;
			ixf3.newimg.style.KhtmlOpacity = (1 - ixf3.count);
			break;
			
		case 'moz' : 
			//restrict max opacity to prevent a visual popping effect in firefox
			ixf3.obj.style.MozOpacity = (ixf3.count == 1 ? 0.9999999 : ixf3.count);
			ixf3.newimg.style.MozOpacity = (1 - ixf3.count);
			break;
			
		default : 
			//restrict max opacity to prevent a visual popping effect in firefox
			ixf3.obj.style.opacity = (ixf3.count == 1 ? 0.9999999 : ixf3.count);
			ixf3.newimg.style.opacity = (1 - ixf3.count);
	}
	
	//now that we've gone through one fade iteration 
	//we can show the image that's fading in
	ixf3.newimg.style.visibility = 'visible';
	
	//keep new image in position with original image
	//in case text size changes mid transition or something
	ixf3.newimg.style.left = ixf3.getRealPosition(ixf3.obj, 'x') + 'px';
	ixf3.newimg.style.top = ixf3.getRealPosition(ixf3.obj, 'y') + 'px';
	
	//if the counter is at the top, which is just after the timer has finished
	if(ixf3.count == 1)
	{
		//remove the duplicate image
		ixf3.newimg.parentNode.removeChild(ixf3.newimg);
	}
};



//get real position method
ixf3.getRealPosition = function()
{
	this.pos = (arguments[1] == 'x') ? arguments[0].offsetLeft : arguments[0].offsetTop;
	this.tmp = arguments[0].offsetParent;
	while(this.tmp != null)
	{
		this.pos += (arguments[1] == 'x') ? this.tmp.offsetLeft : this.tmp.offsetTop;
		this.tmp = this.tmp.offsetParent;
	}
	
	return this.pos;
};

//global object
var ixf4 = { 'clock' : null, 'count' : 1 }
/*******************************************************



/*****************************************************************************
 List the images that need to be cached
*****************************************************************************/

ixf4.imgs = [
	'../img/home/residencias_01.jpg',
	'../img/home/residencias_02.jpg',
	'../img/home/residencias_03.jpg'
	];

/*****************************************************************************
*****************************************************************************/



//cache the images
ixf4.imgsLen = ixf4.imgs.length;
ixf4.cache = [];
for(var i=0; i<ixf4.imgsLen; i++)
{
	ixf4.cache[i] = new Image;
	ixf4.cache[i].src = ixf4.imgs[i];
}


//crossfade setup function
function crossfade4()
{
	//if the timer is not already going
	if(ixf4.clock == null)
	{
		//copy the image object 
		ixf4.obj = arguments[0];
		
		//copy the image src argument 
		ixf4.src = arguments[1];
		
		//store the supported form of opacity
		if(typeof ixf4.obj.style.opacity != 'undefined')
		{
			ixf4.type = 'w3c';
		}
		else if(typeof ixf4.obj.style.MozOpacity != 'undefined')
		{
			ixf4.type = 'moz';
		}
		else if(typeof ixf4.obj.style.KhtmlOpacity != 'undefined')
		{
			ixf4.type = 'khtml';
		}
		else if(typeof ixf4.obj.filters == 'object')
		{
			//weed out win/ie5.0 by testing the length of the filters collection (where filters is an object with no data)
			//then weed out mac/ie5 by testing first the existence of the alpha object (to prevent errors in win/ie5.0)
			//then the returned value type, which should be a number, but in mac/ie5 is an empty string
			ixf4.type = (ixf4.obj.filters.length > 0 && typeof ixf4.obj.filters.alpha == 'object' && typeof ixf4.obj.filters.alpha.opacity == 'number') ? 'ie' : 'none';
		}
		else
		{
			ixf4.type = 'none';
		}
		
		//change the image alt text if defined
		if(typeof arguments[3] != 'undefined' && arguments[3] != '')
		{
			ixf4.obj.alt = arguments[3];
		}
		
		//if any kind of opacity is supported
		if(ixf4.type != 'none')
		{
			//create a new image object and append it to body
			//detecting support for namespaced element creation, in case we're in the XML DOM
			ixf4.newimg = document.getElementsByTagName('body')[0].appendChild((typeof document.createElementNS != 'undefined') ? document.createElementNS('http://www.w3.org/1999/xhtml', 'img') : document.createElement('img'));

			//set positioning classname
			ixf4.newimg.className = 'idupe';
			
			//set src to new image src
			ixf4.newimg.src = ixf4.src

			//move it to superimpose original image
			ixf4.newimg.style.left = ixf4.getRealPosition(ixf4.obj, 'x') + 'px';
			ixf4.newimg.style.top = ixf4.getRealPosition(ixf4.obj, 'y') + 'px';
			
			//copy and convert fade duration argument 
			ixf4.length = parseInt(arguments[2], 10) * 1000;
			
			//create fade resolution argument as 20 steps per transition
			ixf4.resolution = parseInt(arguments[2], 10) * 20;
			
			//start the timer
			ixf4.clock = setInterval('ixf4.crossfade()', ixf4.length/ixf4.resolution);
		}
		
		//otherwise if opacity is not supported
		else
		{
			//just do the image swap
			ixf4.obj.src = ixf4.src;
		}
		
	}
};


//crossfade timer function
ixf4.crossfade = function()
{
	//decrease the counter on a linear scale
	ixf4.count -= (1 / ixf4.resolution);
	
	//if the counter has reached the bottom
	if(ixf4.count < (1 / ixf4.resolution))
	{
		//clear the timer
		clearInterval(ixf4.clock);
		ixf4.clock = null;
		
		//reset the counter
		ixf4.count = 1;
		
		//set the original image to the src of the new image
		ixf4.obj.src = ixf4.src;
	}
	
	//set new opacity value on both elements
	//using whatever method is supported
	switch(ixf4.type)
	{
		case 'ie' :
			ixf4.obj.filters.alpha.opacity = ixf4.count * 100;
			ixf4.newimg.filters.alpha.opacity = (1 - ixf4.count) * 100;
			break;
			
		case 'khtml' :
			ixf4.obj.style.KhtmlOpacity = ixf4.count;
			ixf4.newimg.style.KhtmlOpacity = (1 - ixf4.count);
			break;
			
		case 'moz' : 
			//restrict max opacity to prevent a visual popping effect in firefox
			ixf4.obj.style.MozOpacity = (ixf4.count == 1 ? 0.9999999 : ixf4.count);
			ixf4.newimg.style.MozOpacity = (1 - ixf4.count);
			break;
			
		default : 
			//restrict max opacity to prevent a visual popping effect in firefox
			ixf4.obj.style.opacity = (ixf4.count == 1 ? 0.9999999 : ixf4.count);
			ixf4.newimg.style.opacity = (1 - ixf4.count);
	}
	
	//now that we've gone through one fade iteration 
	//we can show the image that's fading in
	ixf4.newimg.style.visibility = 'visible';
	
	//keep new image in position with original image
	//in case text size changes mid transition or something
	ixf4.newimg.style.left = ixf4.getRealPosition(ixf4.obj, 'x') + 'px';
	ixf4.newimg.style.top = ixf4.getRealPosition(ixf4.obj, 'y') + 'px';
	
	//if the counter is at the top, which is just after the timer has finished
	if(ixf4.count == 1)
	{
		//remove the duplicate image
		ixf4.newimg.parentNode.removeChild(ixf4.newimg);
	}
};



//get real position method
ixf4.getRealPosition = function()
{
	this.pos = (arguments[1] == 'x') ? arguments[0].offsetLeft : arguments[0].offsetTop;
	this.tmp = arguments[0].offsetParent;
	while(this.tmp != null)
	{
		this.pos += (arguments[1] == 'x') ? this.tmp.offsetLeft : this.tmp.offsetTop;
		this.tmp = this.tmp.offsetParent;
	}
	
	return this.pos;
};

//global object
var ixf5 = { 'clock' : null, 'count' : 1 }
/*******************************************************



/*****************************************************************************
 List the images that need to be cached
*****************************************************************************/

ixf5.imgs = [
	'../img/home/universidades_01.jpg',
	'../img/home/universidades_02.jpg',
	'../img/home/universidades_03.jpg'
	];

/*****************************************************************************
*****************************************************************************/



//cache the images
ixf5.imgsLen = ixf5.imgs.length;
ixf5.cache = [];
for(var i=0; i<ixf5.imgsLen; i++)
{
	ixf5.cache[i] = new Image;
	ixf5.cache[i].src = ixf5.imgs[i];
}


//crossfade setup function
function crossfade5()
{
	//if the timer is not already going
	if(ixf5.clock == null)
	{
		//copy the image object 
		ixf5.obj = arguments[0];
		
		//copy the image src argument 
		ixf5.src = arguments[1];
		
		//store the supported form of opacity
		if(typeof ixf5.obj.style.opacity != 'undefined')
		{
			ixf5.type = 'w3c';
		}
		else if(typeof ixf5.obj.style.MozOpacity != 'undefined')
		{
			ixf5.type = 'moz';
		}
		else if(typeof ixf5.obj.style.KhtmlOpacity != 'undefined')
		{
			ixf5.type = 'khtml';
		}
		else if(typeof ixf5.obj.filters == 'object')
		{
			//weed out win/ie5.0 by testing the length of the filters collection (where filters is an object with no data)
			//then weed out mac/ie5 by testing first the existence of the alpha object (to prevent errors in win/ie5.0)
			//then the returned value type, which should be a number, but in mac/ie5 is an empty string
			ixf5.type = (ixf5.obj.filters.length > 0 && typeof ixf5.obj.filters.alpha == 'object' && typeof ixf5.obj.filters.alpha.opacity == 'number') ? 'ie' : 'none';
		}
		else
		{
			ixf5.type = 'none';
		}
		
		//change the image alt text if defined
		if(typeof arguments[3] != 'undefined' && arguments[3] != '')
		{
			ixf5.obj.alt = arguments[3];
		}
		
		//if any kind of opacity is supported
		if(ixf5.type != 'none')
		{
			//create a new image object and append it to body
			//detecting support for namespaced element creation, in case we're in the XML DOM
			ixf5.newimg = document.getElementsByTagName('body')[0].appendChild((typeof document.createElementNS != 'undefined') ? document.createElementNS('http://www.w3.org/1999/xhtml', 'img') : document.createElement('img'));

			//set positioning classname
			ixf5.newimg.className = 'idupe';
			
			//set src to new image src
			ixf5.newimg.src = ixf5.src

			//move it to superimpose original image
			ixf5.newimg.style.left = ixf5.getRealPosition(ixf5.obj, 'x') + 'px';
			ixf5.newimg.style.top = ixf5.getRealPosition(ixf5.obj, 'y') + 'px';
			
			//copy and convert fade duration argument 
			ixf5.length = parseInt(arguments[2], 10) * 1000;
			
			//create fade resolution argument as 20 steps per transition
			ixf5.resolution = parseInt(arguments[2], 10) * 20;
			
			//start the timer
			ixf5.clock = setInterval('ixf5.crossfade()', ixf5.length/ixf5.resolution);
		}
		
		//otherwise if opacity is not supported
		else
		{
			//just do the image swap
			ixf5.obj.src = ixf5.src;
		}
		
	}
};


//crossfade timer function
ixf5.crossfade = function()
{
	//decrease the counter on a linear scale
	ixf5.count -= (1 / ixf5.resolution);
	
	//if the counter has reached the bottom
	if(ixf5.count < (1 / ixf5.resolution))
	{
		//clear the timer
		clearInterval(ixf5.clock);
		ixf5.clock = null;
		
		//reset the counter
		ixf5.count = 1;
		
		//set the original image to the src of the new image
		ixf5.obj.src = ixf5.src;
	}
	
	//set new opacity value on both elements
	//using whatever method is supported
	switch(ixf5.type)
	{
		case 'ie' :
			ixf5.obj.filters.alpha.opacity = ixf5.count * 100;
			ixf5.newimg.filters.alpha.opacity = (1 - ixf5.count) * 100;
			break;
			
		case 'khtml' :
			ixf5.obj.style.KhtmlOpacity = ixf5.count;
			ixf5.newimg.style.KhtmlOpacity = (1 - ixf5.count);
			break;
			
		case 'moz' : 
			//restrict max opacity to prevent a visual popping effect in firefox
			ixf5.obj.style.MozOpacity = (ixf5.count == 1 ? 0.9999999 : ixf5.count);
			ixf5.newimg.style.MozOpacity = (1 - ixf5.count);
			break;
			
		default : 
			//restrict max opacity to prevent a visual popping effect in firefox
			ixf5.obj.style.opacity = (ixf5.count == 1 ? 0.9999999 : ixf5.count);
			ixf5.newimg.style.opacity = (1 - ixf5.count);
	}
	
	//now that we've gone through one fade iteration 
	//we can show the image that's fading in
	ixf5.newimg.style.visibility = 'visible';
	
	//keep new image in position with original image
	//in case text size changes mid transition or something
	ixf5.newimg.style.left = ixf5.getRealPosition(ixf5.obj, 'x') + 'px';
	ixf5.newimg.style.top = ixf5.getRealPosition(ixf5.obj, 'y') + 'px';
	
	//if the counter is at the top, which is just after the timer has finished
	if(ixf5.count == 1)
	{
		//remove the duplicate image
		ixf5.newimg.parentNode.removeChild(ixf5.newimg);
	}
};



//get real position method
ixf5.getRealPosition = function()
{
	this.pos = (arguments[1] == 'x') ? arguments[0].offsetLeft : arguments[0].offsetTop;
	this.tmp = arguments[0].offsetParent;
	while(this.tmp != null)
	{
		this.pos += (arguments[1] == 'x') ? this.tmp.offsetLeft : this.tmp.offsetTop;
		this.tmp = this.tmp.offsetParent;
	}
	
	return this.pos;
};

//global object
var ixf6 = { 'clock' : null, 'count' : 1 }
/*******************************************************



/*****************************************************************************
 List the images that need to be cached
*****************************************************************************/

ixf6.imgs = [
	'../img/home/empresas_01.jpg',
	'../img/home/empresas_02.jpg',
	'../img/home/empresas_03.jpg'
	];

/*****************************************************************************
*****************************************************************************/



//cache the images
ixf6.imgsLen = ixf6.imgs.length;
ixf6.cache = [];
for(var i=0; i<ixf6.imgsLen; i++)
{
	ixf6.cache[i] = new Image;
	ixf6.cache[i].src = ixf6.imgs[i];
}


//crossfade setup function
function crossfade6()
{
	//if the timer is not already going
	if(ixf6.clock == null)
	{
		//copy the image object 
		ixf6.obj = arguments[0];
		
		//copy the image src argument 
		ixf6.src = arguments[1];
		
		//store the supported form of opacity
		if(typeof ixf6.obj.style.opacity != 'undefined')
		{
			ixf6.type = 'w3c';
		}
		else if(typeof ixf6.obj.style.MozOpacity != 'undefined')
		{
			ixf6.type = 'moz';
		}
		else if(typeof ixf6.obj.style.KhtmlOpacity != 'undefined')
		{
			ixf6.type = 'khtml';
		}
		else if(typeof ixf6.obj.filters == 'object')
		{
			//weed out win/ie5.0 by testing the length of the filters collection (where filters is an object with no data)
			//then weed out mac/ie5 by testing first the existence of the alpha object (to prevent errors in win/ie5.0)
			//then the returned value type, which should be a number, but in mac/ie5 is an empty string
			ixf6.type = (ixf6.obj.filters.length > 0 && typeof ixf6.obj.filters.alpha == 'object' && typeof ixf6.obj.filters.alpha.opacity == 'number') ? 'ie' : 'none';
		}
		else
		{
			ixf6.type = 'none';
		}
		
		//change the image alt text if defined
		if(typeof arguments[3] != 'undefined' && arguments[3] != '')
		{
			ixf6.obj.alt = arguments[3];
		}
		
		//if any kind of opacity is supported
		if(ixf6.type != 'none')
		{
			//create a new image object and append it to body
			//detecting support for namespaced element creation, in case we're in the XML DOM
			ixf6.newimg = document.getElementsByTagName('body')[0].appendChild((typeof document.createElementNS != 'undefined') ? document.createElementNS('http://www.w3.org/1999/xhtml', 'img') : document.createElement('img'));

			//set positioning classname
			ixf6.newimg.className = 'idupe';
			
			//set src to new image src
			ixf6.newimg.src = ixf6.src

			//move it to superimpose original image
			ixf6.newimg.style.left = ixf6.getRealPosition(ixf6.obj, 'x') + 'px';
			ixf6.newimg.style.top = ixf6.getRealPosition(ixf6.obj, 'y') + 'px';
			
			//copy and convert fade duration argument 
			ixf6.length = parseInt(arguments[2], 10) * 1000;
			
			//create fade resolution argument as 20 steps per transition
			ixf6.resolution = parseInt(arguments[2], 10) * 20;
			
			//start the timer
			ixf6.clock = setInterval('ixf6.crossfade()', ixf6.length/ixf6.resolution);
		}
		
		//otherwise if opacity is not supported
		else
		{
			//just do the image swap
			ixf6.obj.src = ixf6.src;
		}
		
	}
};


//crossfade timer function
ixf6.crossfade = function()
{
	//decrease the counter on a linear scale
	ixf6.count -= (1 / ixf6.resolution);
	
	//if the counter has reached the bottom
	if(ixf6.count < (1 / ixf6.resolution))
	{
		//clear the timer
		clearInterval(ixf6.clock);
		ixf6.clock = null;
		
		//reset the counter
		ixf6.count = 1;
		
		//set the original image to the src of the new image
		ixf6.obj.src = ixf6.src;
	}
	
	//set new opacity value on both elements
	//using whatever method is supported
	switch(ixf6.type)
	{
		case 'ie' :
			ixf6.obj.filters.alpha.opacity = ixf6.count * 100;
			ixf6.newimg.filters.alpha.opacity = (1 - ixf6.count) * 100;
			break;
			
		case 'khtml' :
			ixf6.obj.style.KhtmlOpacity = ixf6.count;
			ixf6.newimg.style.KhtmlOpacity = (1 - ixf6.count);
			break;
			
		case 'moz' : 
			//restrict max opacity to prevent a visual popping effect in firefox
			ixf6.obj.style.MozOpacity = (ixf6.count == 1 ? 0.9999999 : ixf6.count);
			ixf6.newimg.style.MozOpacity = (1 - ixf6.count);
			break;
			
		default : 
			//restrict max opacity to prevent a visual popping effect in firefox
			ixf6.obj.style.opacity = (ixf6.count == 1 ? 0.9999999 : ixf6.count);
			ixf6.newimg.style.opacity = (1 - ixf6.count);
	}
	
	//now that we've gone through one fade iteration 
	//we can show the image that's fading in
	ixf6.newimg.style.visibility = 'visible';
	
	//keep new image in position with original image
	//in case text size changes mid transition or something
	ixf6.newimg.style.left = ixf6.getRealPosition(ixf6.obj, 'x') + 'px';
	ixf6.newimg.style.top = ixf6.getRealPosition(ixf6.obj, 'y') + 'px';
	
	//if the counter is at the top, which is just after the timer has finished
	if(ixf6.count == 1)
	{
		//remove the duplicate image
		ixf6.newimg.parentNode.removeChild(ixf6.newimg);
	}
};



//get real position method
ixf6.getRealPosition = function()
{
	this.pos = (arguments[1] == 'x') ? arguments[0].offsetLeft : arguments[0].offsetTop;
	this.tmp = arguments[0].offsetParent;
	while(this.tmp != null)
	{
		this.pos += (arguments[1] == 'x') ? this.tmp.offsetLeft : this.tmp.offsetTop;
		this.tmp = this.tmp.offsetParent;
	}
	
	return this.pos;
};

