var RO_HASLOADED=false;
var FB_COUNT=0;
var FB_LIST=new Array();

/* ROLLOVER FUNCTIONS */

function ro_end() {
	RO_HASLOADED=true;
	for(var i=0; i<FB_COUNT; i++) {
		self.setTimeout('fb_flip("'+FB_LIST[i]+'")', eval('dly_'+FB_LIST[i]+'['+eval('cur_'+FB_LIST[i])+']')*1000);
	}
	return true;
}

function ro_load(object) {
	if (document.images[object]) {
		var overSource=new String(document.images[object].src);
		var partition=overSource.lastIndexOf('.');
		overSource=overSource.substring(0,partition)+'_o'
		+overSource.substring(partition,overSource.length);
		eval('img_'+object+'=new Image()');
		eval('img_'+object+'.src=document.images[object].src');
		eval('img_'+object+'_o=new Image()');
		eval('img_'+object+'_o.src=overSource');
	}
	return true;
}

function ro_on(object) {
	if(RO_HASLOADED && document.images[object]){
		document.images[object].src=eval('img_'+object+'_o.src');
	}
	return true;
}

function ro_off(object) {
	if(RO_HASLOADED && document.images[object]){
		document.images[object].src=eval('img_'+object+'.src');
	}
	return true;
}

/* FLIPBOOK FUNCTIONS */

function fb_initial(object, delay) {
	if (document.images[object]) {
		FB_LIST[FB_COUNT++]=object;
		eval('img_'+object+'=new Array();');
		eval('lnk_'+object+'=new Array();');
		eval('dly_'+object+'=new Array();');
		eval('img_'+object+'[0]=new Image()');
		eval('img_'+object+'[0].src=document.images[object].src');
		eval('lnk_'+object+'[0]=fb_'+object+'.href');
		eval('dly_'+object+'[0]=delay');
		eval('qty_'+object+'=0');
		eval('cur_'+object+'=0');
	}
	return true;
}

function fb_load(object, index, delay, file, url) {
	if (document.images[object]) {
		eval('img_'+object+'[index]=new Image()');
		eval('img_'+object+'[index].src=file');
		eval('lnk_'+object+'[index]=url');
		eval('dly_'+object+'[index]=delay');
		if (eval('qty_'+object+'<'+index)) {
			eval('qty_'+object+'='+index);
		}
	}
	return true;
}

function fb_flip(object) {
	var current = eval('cur_'+object)*1;
	var quantity = eval('qty_'+object)*1;
	if (++current>quantity) {
		current = 0;
	}
	document.images[object].src = eval('img_'+object+'[current].src');
	eval('fb_'+object+'.href=lnk_'+object+'[current]');
	eval('cur_'+object+'='+current);
	self.setTimeout('fb_flip("'+object+'")', eval('dly_'+object+'[current]')*1000);
	return true;
}