mfp=window.setTimeout("fader()",2000);
var opac = 100;
var boxopac =0;
var maximages = 4;
var currimage=1;
var haltfade=0;
var boxfades=0;
var haltfade2=0;
var t=0;

function mf(id){
clearTimeout(mfp);
//if (currimage>0) { 
currimage=id;
//} else {currimage=4;}
haltfade2=1;

fcont(currimage); 
fu();

document.getElementById("mc3").style.backgroundImage="url('/i/f/"+(id)+"a.jpg')";
document.getElementById("mc").style.backgroundImage="url('/i/f/"+(id)+".jpg')";
document.getElementById("mc").style.filter = "alpha(opacity=50)";
document.getElementById("mc").mozopacity = ".50";
document.getElementById("mc").style.opacity = ".50";

}

function mfa() {
//haltfade2=0;
clearTimeout(mfp);
//alert(mfp);
idb=currimage+1;
if (idb==5) { idb=1;}
document.getElementById("mc").style.filter = "alpha(opacity=100)";
document.getElementById("mc").mozopacity = ".99";
document.getElementById("mc").style.opacity = ".99";
document.getElementById("mc3").style.backgroundImage="url('/i/f/"+(idb)+"a.jpg')";
ft();
opac = 100;
//mfp=window.setTimeout("dofade()",100); 
}

function fader(){
//for (i=100;i>1;i=i-5) {
//document.getElementById("mc-").style.opacity="visible";
//}
dofade();
}

function dofade(){
if (haltfade2==0) {
opac=opac-5;
document.getElementById("mc").style.filter = "alpha(opacity="+opac+")";
opacb=opac;
	if (opacb==100) { opacb=99;}
	document.getElementById("mc").mozopacity = "."+opacb;
	document.getElementById("mc").style.opacity = "."+opacb;


if (opac==10) { 
	//alert (document.getElementById("mc").style.backgroundImage);
	currimage=currimage+1;
	if (currimage>maximages) { currimage=1; }
	document.getElementById("mc").style.backgroundImage="url('/i/f/"+currimage+".jpg')";
	mfp=window.setTimeout("infade()",275);  
} else { 

if (haltfade==0) { mfp=window.setTimeout("dofade()",40); }
}
}
}


function infade(){
if (haltfade2==0) {
	opac=opac+5;
	document.getElementById("mc").style.filter = "alpha(opacity="+opac+")";
	opacb=opac;
	if (opacb==100) { opacb=99;}
	document.getElementById("mc").mozopacity = "."+opacb;
	document.getElementById("mc").style.opacity = "."+opacb;
	//alert(opac);

	if (opac==100) {
	currimageb=currimage+1;
	if (currimageb==5) { currimageb=1;}
  document.getElementById("mc3").style.backgroundImage="url('/i/f/"+(currimageb)+"a.jpg')";
  mfp=window.setTimeout("fader()",4000);}
	else { if (haltfade==0) { mfp=window.setTimeout("infade()",40); }
	}
}
}

function fs(){
//if (boxfades==0) {
//alert('!');
fcont(currimage); 

document.getElementById("mc4").style.visibility = "visible";
document.getElementById("mc4").style.filter = "alpha(opacity=90)";
//document.getElementById("mc4").style.zindex = 104;
//boxfade();
haltfade=1;
}

function fcont(){
if (currimage==1) { document.getElementById("mc4").innerHTML = "The living room is the heart of every house, the place where you eat, watch tv or just be with your family, it is the space that often makes a house a home, so why not fill it with beautiful warm solid wood furniture?";}
if (currimage==2) { document.getElementById("mc4").innerHTML = "Working from home doesn’t have to mean squashed in a corner… we have some great furniture to help create more space and make your working day pass more pleasurably.";}
if (currimage==3) { document.getElementById("mc4").innerHTML = "We offer a range of beds and bedroom furniture in various styles and designs from sleigh beds to paris beds, all designed with you in mind.  Sleeping is a way to escape and relax so why not enjoy it";}
if (currimage==4) { document.getElementById("mc4").innerHTML = "Our furniture is designed with informal eating in mind, we believe that gathering around the table for family meals and dinner with friends is one of life’s simple pleasures.No matter what your dining space – a separate room or an extended kitchen – we have beautifully crafted tables and chairs to suit your taste.  ";}
}

function ft(){
document.getElementById("mc4").style.filter = "alpha(opacity=0)";
document.getElementById("mc4").style.visibility = "hidden";
haltfade=0;
mfp=window.setTimeout("fader()",2000);
}

function fu(){
haltfade=1;
document.getElementById("mc4").style.filter = "alpha(opacity=90)";
document.getElementById("mc4").style.visibility = "visible";
}

function boxfade(){
boxfades=1;
document.getElementById("mc4").style.filter = "alpha(opacity="+boxopac+")";

boxopac=boxopac+5;
//alert(boxopac);
if (boxopac==90) {  }
else { window.setTimeout("boxfade()",20); 
}
}
