// IXF1.0 :: Image cross-fade // *****************************************************// DOM scripting by brothercake -- http://www.brothercake.com///******************************************************//global objectixA = { 'clock' : null, 'count' : 1 }ixB = { 'clock' : null, 'count' : 1 }ixC = { 'clock' : null, 'count' : 1 }ixD = { 'clock' : null, 'count' : 1 }ixE = { 'clock' : null, 'count' : 1 }/*******************************************************/***************************************************************************** List the images that need to be cached*****************************************************************************/ixA.imgs = [	"../../images/0.gif",	"../../images/1.gif",	"../../images/2.gif",	"../../images/3.gif"	];//cache the imagesixA.imgsLen = ixA.imgs.length;ixA.cache = [];for(var i=0; i<ixA.imgsLen; i++){	ixA.cache[i] = new Image;	ixA.cache[i].src = ixA.imgs[i];	}/**********************************************************************************************************************************************************///crosswipe setup function Afunction crosswipeA() {//if the timer is not already goingif(ixA.clock == null)	{	//copy the image object 	ixA.obj = arguments[0];			//get its dimensions	ixA.size = { 'w' : ixA.obj.width, 'h' : ixA.obj.height };			//copy the image src argument 	ixA.src = arguments[1];			//change the image alt text if defined	if(typeof arguments[4] != 'undefined' && arguments[4] != ''){		ixA.obj.alt = arguments[4];		}	//if dynamic element creation is supported	if(typeof document.createElementNS != 'undefined' || typeof document.createElement != 'undefined') {		//create a new image object and append it to body		//detecting support for namespaced element creation, in case we're in the XML DOM		ixA.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		ixA.newimg.className = 'idupe';		//set src to new image src		ixA.newimg.src = ixA.src;		//move it to superimpose original image		ixA.newimg.style.left = ixA.getRealPosition(ixA.obj, 'x') + 'px';		ixA.newimg.style.top = ixA.getRealPosition(ixA.obj, 'y') + 'px';		//set it to be completely hidden with clip		ixA.newimg.style.clip = 'rect(0, 0, 0, 0)';		//show the image 		ixA.newimg.style.visibility = 'visible';		//copy and convert fade duration argument 		ixA.length = parseInt(arguments[2], 10) * 100;		//create fade resolution argument as 20 steps per transition		ixA.resolution = parseInt(arguments[2], 10) * 20;		//copy slide direction argument		ixA.dir = arguments[3];		//start the timer		ixA.clock = setInterval('ixA.crosswipe()', ixA.length/ixA.resolution);		}			//otherwise if dynamic element creation is not supported	else {		//just do the image swap		ixA.obj.src = ixA.src;		}	}}//crosswipe timer function  AixA.crosswipe = function() {//decrease the counter on a linear scaleixA.count -= (1 / ixA.resolution);	//if the counter has reached the bottomif(ixA.count < (1 / ixA.resolution)){	//clear the timer	clearInterval(ixA.clock);	ixA.clock = null;			//reset the counter	ixA.count = 1;			//set the original image to the src of the new image	ixA.obj.src = ixA.src;	}	//animate the clip of the new image//using the width and height properties we saved earlierixA.newimg.style.clip = 'rect('	+ ( (/bt|bltr|brtl/.test(ixA.dir)) ? (ixA.size.h * ixA.count) : (/che|cc/.test(ixA.dir)) ? ((ixA.size.h * ixA.count) / 2) : (0) )	+ 'px, '	+ ( (/lr|tlbr|bltr/.test(ixA.dir)) ? (ixA.size.w - (ixA.size.w * ixA.count)) : (/cve|cc/.test(ixA.dir)) ? (ixA.size.w - ((ixA.size.w * ixA.count) / 2)) : (ixA.size.w) )	+ 'px, '	+ ( (/tb|tlbr|trbl/.test(ixA.dir)) ? (ixA.size.h - (ixA.size.h * ixA.count)) : (/che|cc/.test(ixA.dir)) ? (ixA.size.h - ((ixA.size.h * ixA.count) / 2)) : (ixA.size.h) )	+ 'px, '	+ ( (/lr|tlbr|bltr/.test(ixA.dir)) ? (0) : (/tb|bt|che/.test(ixA.dir)) ? (0) : (/cve|cc/.test(ixA.dir)) ? ((ixA.size.w * ixA.count) / 2) : (ixA.size.w * ixA.count) ) 	+ 'px)';			//keep new image in position with original image//in case text size changes mid transition or somethingixA.newimg.style.left = ixA.getRealPosition(ixA.obj, 'x') + 'px';ixA.newimg.style.top = ixA.getRealPosition(ixA.obj, 'y') + 'px';	//if the counter is at the top, which is just after the timer has finishedif(ixA.count == 1){	//remove the duplicate image	ixA.newimg.parentNode.removeChild(ixA.newimg);	}}//get real position methodixA.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;}/// ############  End A//crosswipe setup function Bfunction crosswipeB() {//if the timer is not already goingif(ixB.clock == null)	{	//copy the image object 	ixB.obj = arguments[0];			//get its dimensions	ixB.size = { 'w' : ixB.obj.width, 'h' : ixB.obj.height };			//copy the image src argument 	ixB.src = arguments[1];			//change the image alt text if defined	if(typeof arguments[4] != 'undefined' && arguments[4] != ''){		ixB.obj.alt = arguments[4];		}	//if dynamic element creation is supported	if(typeof document.createElementNS != 'undefined' || typeof document.createElement != 'undefined') {		//create a new image object and append it to body		//detecting support for namespaced element creation, in case we're in the XML DOM		ixB.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		ixB.newimg.className = 'idupe';		//set src to new image src		ixB.newimg.src = ixB.src;		//move it to superimpose original image		ixB.newimg.style.left = ixB.getRealPosition(ixB.obj, 'x') + 'px';		ixB.newimg.style.top = ixB.getRealPosition(ixB.obj, 'y') + 'px';		//set it to be completely hidden with clip		ixB.newimg.style.clip = 'rect(0, 0, 0, 0)';		//show the image 		ixB.newimg.style.visibility = 'visible';		//copy and convert fade duration argument 		ixB.length = parseInt(arguments[2], 10) * 100;		//create fade resolution argument as 20 steps per transition		ixB.resolution = parseInt(arguments[2], 10) * 20;		//copy slide direction argument		ixB.dir = arguments[3];		//start the timer		ixB.clock = setInterval('ixB.crosswipe()', ixB.length/ixB.resolution);		}			//otherwise if dynamic element creation is not supported	else {		//just do the image swap		ixB.obj.src = ixB.src;		}	}}//crosswipe timer function BixB.crosswipe = function() {//decrease the counter on a linear scaleixB.count -= (1 / ixB.resolution);	//if the counter has reached the bottomif(ixB.count < (1 / ixB.resolution)){	//clear the timer	clearInterval(ixB.clock);	ixB.clock = null;			//reset the counter	ixB.count = 1;			//set the original image to the src of the new image	ixB.obj.src = ixB.src;	}	//animate the clip of the new image//using the width and height properties we saved earlierixB.newimg.style.clip = 'rect('	+ ( (/bt|bltr|brtl/.test(ixB.dir)) ? (ixB.size.h * ixB.count) : (/che|cc/.test(ixB.dir)) ? ((ixB.size.h * ixB.count) / 2) : (0) )	+ 'px, '	+ ( (/lr|tlbr|bltr/.test(ixB.dir)) ? (ixB.size.w - (ixB.size.w * ixB.count)) : (/cve|cc/.test(ixB.dir)) ? (ixB.size.w - ((ixB.size.w * ixB.count) / 2)) : (ixB.size.w) )	+ 'px, '	+ ( (/tb|tlbr|trbl/.test(ixB.dir)) ? (ixB.size.h - (ixB.size.h * ixB.count)) : (/che|cc/.test(ixB.dir)) ? (ixB.size.h - ((ixB.size.h * ixB.count) / 2)) : (ixB.size.h) )	+ 'px, '	+ ( (/lr|tlbr|bltr/.test(ixB.dir)) ? (0) : (/tb|bt|che/.test(ixB.dir)) ? (0) : (/cve|cc/.test(ixB.dir)) ? ((ixB.size.w * ixB.count) / 2) : (ixB.size.w * ixB.count) ) 	+ 'px)';			//keep new image in position with original image//in case text size changes mid transition or somethingixB.newimg.style.left = ixB.getRealPosition(ixB.obj, 'x') + 'px';ixB.newimg.style.top = ixB.getRealPosition(ixB.obj, 'y') + 'px';	//if the counter is at the top, which is just after the timer has finishedif(ixB.count == 1){	//remove the duplicate image	ixB.newimg.parentNode.removeChild(ixB.newimg);	}}//get real position methodixB.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;}// ##########  End B//crosswipe setup function Cfunction crosswipeC() {//if the timer is not already goingif(ixC.clock == null)	{	//copy the image object 	ixC.obj = arguments[0];			//get its dimensions	ixC.size = { 'w' : ixC.obj.width, 'h' : ixC.obj.height };			//copy the image src argument 	ixC.src = arguments[1];			//change the image alt text if defined	if(typeof arguments[4] != 'undefined' && arguments[4] != ''){		ixC.obj.alt = arguments[4];		}	//if dynamic element creation is supported	if(typeof document.createElementNS != 'undefined' || typeof document.createElement != 'undefined') {		//create a new image object and append it to body		//detecting support for namespaced element creation, in case we're in the XML DOM		ixC.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		ixC.newimg.className = 'idupe';		//set src to new image src		ixC.newimg.src = ixC.src;		//move it to superimpose original image		ixC.newimg.style.left = ixC.getRealPosition(ixC.obj, 'x') + 'px';		ixC.newimg.style.top = ixC.getRealPosition(ixC.obj, 'y') + 'px';		//set it to be completely hidden with clip		ixC.newimg.style.clip = 'rect(0, 0, 0, 0)';		//show the image 		ixC.newimg.style.visibility = 'visible';		//copy and convert fade duration argument 		ixC.length = parseInt(arguments[2], 10) * 100;		//create fade resolution argument as 20 steps per transition		ixC.resolution = parseInt(arguments[2], 10) * 20;		//copy slide direction argument		ixC.dir = arguments[3];		//start the timer		ixC.clock = setInterval('ixC.crosswipe()', ixC.length/ixC.resolution);		}			//otherwise if dynamic element creation is not supported	else {		//just do the image swap		ixC.obj.src = ixC.src;		}	}}//crosswipe timer function CixC.crosswipe = function() {//decrease the counter on a linear scaleixC.count -= (1 / ixC.resolution);	//if the counter has reached the bottomif(ixC.count < (1 / ixC.resolution)){	//clear the timer	clearInterval(ixC.clock);	ixC.clock = null;			//reset the counter	ixC.count = 1;			//set the original image to the src of the new image	ixC.obj.src = ixC.src;	}	//animate the clip of the new image//using the width and height properties we saved earlierixC.newimg.style.clip = 'rect('	+ ( (/bt|bltr|brtl/.test(ixC.dir)) ? (ixC.size.h * ixC.count) : (/che|cc/.test(ixC.dir)) ? ((ixC.size.h * ixC.count) / 2) : (0) )	+ 'px, '	+ ( (/lr|tlbr|bltr/.test(ixC.dir)) ? (ixC.size.w - (ixC.size.w * ixC.count)) : (/cve|cc/.test(ixC.dir)) ? (ixC.size.w - ((ixC.size.w * ixC.count) / 2)) : (ixC.size.w) )	+ 'px, '	+ ( (/tb|tlbr|trbl/.test(ixC.dir)) ? (ixC.size.h - (ixC.size.h * ixC.count)) : (/che|cc/.test(ixC.dir)) ? (ixC.size.h - ((ixC.size.h * ixC.count) / 2)) : (ixC.size.h) )	+ 'px, '	+ ( (/lr|tlbr|bltr/.test(ixC.dir)) ? (0) : (/tb|bt|che/.test(ixC.dir)) ? (0) : (/cve|cc/.test(ixC.dir)) ? ((ixC.size.w * ixC.count) / 2) : (ixC.size.w * ixC.count) ) 	+ 'px)';			//keep new image in position with original image//in case text size changes mid transition or somethingixC.newimg.style.left = ixC.getRealPosition(ixC.obj, 'x') + 'px';ixC.newimg.style.top = ixC.getRealPosition(ixC.obj, 'y') + 'px';	//if the counter is at the top, which is just after the timer has finishedif(ixC.count == 1){	//remove the duplicate image	ixC.newimg.parentNode.removeChild(ixC.newimg);	}}//get real position methodixC.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;}// ##########  End C//crosswipe setup function Dfunction crosswipeD() {//if the timer is not already goingif(ixD.clock == null)	{	//copy the image object 	ixD.obj = arguments[0];			//get its dimensions	ixD.size = { 'w' : ixD.obj.width, 'h' : ixD.obj.height };			//copy the image src argument 	ixD.src = arguments[1];			//change the image alt text if defined	if(typeof arguments[4] != 'undefined' && arguments[4] != ''){		ixD.obj.alt = arguments[4];		}	//if dynamic element creation is supported	if(typeof document.createElementNS != 'undefined' || typeof document.createElement != 'undefined') {		//create a new image object and append it to body		//detecting support for namespaced element creation, in case we're in the XML DOM		ixD.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		ixD.newimg.className = 'idupe';		//set src to new image src		ixD.newimg.src = ixD.src;		//move it to superimpose original image		ixD.newimg.style.left = ixD.getRealPosition(ixD.obj, 'x') + 'px';		ixD.newimg.style.top = ixD.getRealPosition(ixD.obj, 'y') + 'px';		//set it to be completely hidden with clip		ixD.newimg.style.clip = 'rect(0, 0, 0, 0)';		//show the image 		ixD.newimg.style.visibility = 'visible';		//copy and convert fade duration argument 		ixD.length = parseInt(arguments[2], 10) * 100;		//create fade resolution argument as 20 steps per transition		ixD.resolution = parseInt(arguments[2], 10) * 20;		//copy slide direction argument		ixD.dir = arguments[3];		//start the timer		ixD.clock = setInterval('ixD.crosswipe()', ixD.length/ixD.resolution);		}			//otherwise if dynamic element creation is not supported	else {		//just do the image swap		ixD.obj.src = ixD.src;		}	}}//crosswipe timer function DixD.crosswipe = function() {//decrease the counter on a linear scaleixD.count -= (1 / ixD.resolution);	//if the counter has reached the bottomif(ixD.count < (1 / ixD.resolution)){	//clear the timer	clearInterval(ixD.clock);	ixD.clock = null;			//reset the counter	ixD.count = 1;			//set the original image to the src of the new image	ixD.obj.src = ixD.src;	}	//animate the clip of the new image//using the width and height properties we saved earlierixD.newimg.style.clip = 'rect('	+ ( (/bt|bltr|brtl/.test(ixD.dir)) ? (ixD.size.h * ixD.count) : (/che|cc/.test(ixD.dir)) ? ((ixD.size.h * ixD.count) / 2) : (0) )	+ 'px, '	+ ( (/lr|tlbr|bltr/.test(ixD.dir)) ? (ixD.size.w - (ixD.size.w * ixD.count)) : (/cve|cc/.test(ixD.dir)) ? (ixD.size.w - ((ixD.size.w * ixD.count) / 2)) : (ixD.size.w) )	+ 'px, '	+ ( (/tb|tlbr|trbl/.test(ixD.dir)) ? (ixD.size.h - (ixD.size.h * ixD.count)) : (/che|cc/.test(ixD.dir)) ? (ixD.size.h - ((ixD.size.h * ixD.count) / 2)) : (ixD.size.h) )	+ 'px, '	+ ( (/lr|tlbr|bltr/.test(ixD.dir)) ? (0) : (/tb|bt|che/.test(ixD.dir)) ? (0) : (/cve|cc/.test(ixD.dir)) ? ((ixD.size.w * ixD.count) / 2) : (ixD.size.w * ixD.count) ) 	+ 'px)';			//keep new image in position with original image//in case text size changes mid transition or somethingixD.newimg.style.left = ixD.getRealPosition(ixD.obj, 'x') + 'px';ixD.newimg.style.top = ixD.getRealPosition(ixD.obj, 'y') + 'px';	//if the counter is at the top, which is just after the timer has finishedif(ixD.count == 1){	//remove the duplicate image	ixD.newimg.parentNode.removeChild(ixD.newimg);	}}//get real position methodixD.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;}// ##########  End D//crosswipe setup function Efunction crosswipeE() {//if the timer is not already goingif(ixE.clock == null)	{	//copy the image object 	ixE.obj = arguments[0];			//get its dimensions	ixE.size = { 'w' : ixE.obj.width, 'h' : ixE.obj.height };			//copy the image src argument 	ixE.src = arguments[1];			//change the image alt text if defined	if(typeof arguments[4] != 'undefined' && arguments[4] != ''){		ixE.obj.alt = arguments[4];		}	//if dynamic element creation is supported	if(typeof document.createElementNS != 'undefined' || typeof document.createElement != 'undefined') {		//create a new image object and append it to body		//detecting support for namespaced element creation, in case we're in the XML DOM		ixE.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		ixE.newimg.className = 'idupe';		//set src to new image src		ixE.newimg.src = ixE.src;		//move it to superimpose original image		ixE.newimg.style.left = ixE.getRealPosition(ixE.obj, 'x') + 'px';		ixE.newimg.style.top = ixE.getRealPosition(ixE.obj, 'y') + 'px';		//set it to be completely hidden with clip		ixE.newimg.style.clip = 'rect(0, 0, 0, 0)';		//show the image 		ixE.newimg.style.visibility = 'visible';		//copy and convert fade duration argument 		ixE.length = parseInt(arguments[2], 10) * 100;		//create fade resolution argument as 20 steps per transition		ixE.resolution = parseInt(arguments[2], 10) * 20;		//copy slide direction argument		ixE.dir = arguments[3];		//start the timer		ixE.clock = setInterval('ixE.crosswipe()', ixE.length/ixE.resolution);		}			//otherwise if dynamic element creation is not supported	else {		//just do the image swap		ixE.obj.src = ixE.src;		}	}}//crosswipe timer function EixE.crosswipe = function() {//decrease the counter on a linear scaleixE.count -= (1 / ixE.resolution);	//if the counter has reached the bottomif(ixE.count < (1 / ixE.resolution)){	//clear the timer	clearInterval(ixE.clock);	ixE.clock = null;			//reset the counter	ixE.count = 1;			//set the original image to the src of the new image	ixE.obj.src = ixE.src;	}	//animate the clip of the new image//using the width and height properties we saved earlierixE.newimg.style.clip = 'rect('	+ ( (/bt|bltr|brtl/.test(ixE.dir)) ? (ixE.size.h * ixE.count) : (/che|cc/.test(ixE.dir)) ? ((ixE.size.h * ixE.count) / 2) : (0) )	+ 'px, '	+ ( (/lr|tlbr|bltr/.test(ixE.dir)) ? (ixE.size.w - (ixE.size.w * ixE.count)) : (/cve|cc/.test(ixE.dir)) ? (ixE.size.w - ((ixE.size.w * ixE.count) / 2)) : (ixE.size.w) )	+ 'px, '	+ ( (/tb|tlbr|trbl/.test(ixE.dir)) ? (ixE.size.h - (ixE.size.h * ixE.count)) : (/che|cc/.test(ixE.dir)) ? (ixE.size.h - ((ixE.size.h * ixE.count) / 2)) : (ixE.size.h) )	+ 'px, '	+ ( (/lr|tlbr|bltr/.test(ixE.dir)) ? (0) : (/tb|bt|che/.test(ixE.dir)) ? (0) : (/cve|cc/.test(ixE.dir)) ? ((ixE.size.w * ixE.count) / 2) : (ixE.size.w * ixE.count) ) 	+ 'px)';			//keep new image in position with original image//in case text size changes mid transition or somethingixE.newimg.style.left = ixE.getRealPosition(ixE.obj, 'x') + 'px';ixE.newimg.style.top = ixE.getRealPosition(ixE.obj, 'y') + 'px';	//if the counter is at the top, which is just after the timer has finishedif(ixE.count == 1){	//remove the duplicate image	ixE.newimg.parentNode.removeChild(ixE.newimg);	}}//get real position methodixE.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;}// ##########  End E
