function showaccessories () {
	document.getElementById('accessories').style.display = "block";
	document.getElementById('accesspull2').innerHTML = "<img class=\"veryleft\" onclick=\"hideaccessories()\" src=\"img1/collapse1.gif\"/>";	

}

function hideaccessories () {
	document.getElementById('accessories').style.display = "none";
	document.getElementById('accesspull2').innerHTML = "<img class=\"veryleft\" onclick=\"showaccessories()\" src=\"img1/expand.gif\"/> ";
}


function nextaccess(x, amount) {
	if (x == 1) {
		//shows 4 to 6
		document.getElementById('altern1').style.display = "none";
		document.getElementById('altern2').style.display = "none";
		document.getElementById('altern3').style.display = "none";
		
		if (amount == 7) {
			document.getElementById('altern7').style.display = "none";			
		}
		else if (amount == 8) {
			document.getElementById('altern7').style.display = "none";		
			document.getElementById('altern8').style.display = "none";			
		}
		else if (amount == 9) {
			document.getElementById('altern7').style.display = "none";		
			document.getElementById('altern8').style.display = "none";	
			document.getElementById('altern9').style.display = "none";			
		}

		
		for (i=4; i <= 6; i++) {
			elem = "altern" + i;
			document.getElementById(elem).style.display = "block";		
		}

		if (amount <= 6) {
			document.getElementById('slidedown').innerHTML = "<img src=\"img1/sideslider.gif\"/>";
		}
		else {
			document.getElementById('slidedown').innerHTML = "<img class=\"slidebutton\" onclick=\"nextaccess('3'," + amount + ")\" src=\"img1/sideslidemore.gif\"/>";
		}
		
		document.getElementById('slideup').innerHTML = "<img class=\"slidebutton\" onclick=\"nextaccess('0'," + amount + ")\" src=\"img1/sideslidemore1.gif\"/>";


	}
	else if (x == 0 ){
		//shows 1 to 3
		document.getElementById('altern1').style.display = "block";	
		document.getElementById('altern2').style.display = "block";	
		document.getElementById('altern3').style.display = "block";	
		
		for (i=4; i <= amount; i++) {
			elem = "altern" + i;
			document.getElementById(elem).style.display = "none";		
		}



		document.getElementById('slideup').innerHTML = "<img src=\"img1/sideslide.gif\"/>";
		document.getElementById('slidedown').innerHTML = "<img class=\"slidebutton\" onclick=\"nextaccess('1'," + amount + ")\" src=\"img1/sideslidemore.gif\"/>";
	}
		
	else if (x == 3 ){
		//shows 6 to 9
		
		document.getElementById('altern4').style.display = "none";	
		document.getElementById('altern5').style.display = "none";	
		document.getElementById('altern6').style.display = "none";	

		
		for (i=7; i <= amount; i++) {
			elem = "altern" + i;
			document.getElementById(elem).style.display = "block";		
		}



		document.getElementById('slideup').innerHTML = "<img class=\"slidebutton\" onclick=\"nextaccess('1', " + amount + ")\" src=\"img1/sideslidemore1.gif\"/>";
		document.getElementById('slidedown').innerHTML = "<img src=\"img1/sideslider.gif\"/>";
	}
	
	
}


function changebg($id) {
document.getElementById($id).style.background = "white";
}

function changeback($id) {
document.getElementById($id).style.background = "background: url(img1/cattop.gif) repeat-x";
}

function changebg1($id) {
document.getElementById($id).style.border = "10px solid #CE003D";
}

function changeback1($id) {
document.getElementById($id).style.border = "10px solid #ECECEC";
}


function setOpacity(domId, val) {
obj = document.getElementById(domId);
obj.style.MozOpacity = val;
obj.style.opacity = val/10;
obj.style.filter = 'alpha(opacity=' + val*10 + ')';

};


function photocopiers () {
fade('mainphotocopier');	
}

function fade(domId){

obj = document.getElementById(domId); 

 if(obj.style.display == "none") return false; 

 var alpha = 10; 
 function f(){ 

  alpha--; 
  setOpacity(domId, alpha); 

  if(alpha > -1){ 
   setTimeout(f, 100); 

  }else{ 
   obj.style.display = 'none';

	appear('mainphotocopier');
	x = document.getElementById('mainphotocopier').src;
	if (x == 'http://www.digipro.co.uk/img1/promo1.gif') {
		document.getElementById('mainphotocopier').src = 'http://www.digipro.co.uk/img1/promo.gif';
		document.getElementById('phtotocopierschange').href= "http://www.digipro.co.uk/photocopiers/toshiba/toshiba-estudio-5520c-photocopier/";
	}

	else {
		document.getElementById('mainphotocopier').src = 'http://www.digipro.co.uk/img1/promo1.gif';
				document.getElementById('phtotocopierschange').href= "http://www.digipro.co.uk/photocopiers/";

	}

	
	

  }
}
setTimeout(f, 100); 
};


function appear(domId){
obj = document.getElementById(domId); 

 if(obj.style.display != "none") return false; 

 obj.style.display = ''; 
 var alpha = 0; 

 function a(){ 
  alpha++; 

  setOpacity(domId, alpha);
  if(alpha < 11)setTimeout(a, 100);

}
setTimeout(photocopiers, 5000);
setTimeout(a, 0);


};

function dropselect(x) {
	if (x == 'billing') {
		document.getElementById('dropadds').style.display = "";
	}
	
	else if (x =='shipping') {
		document.getElementById('dropadde').style.display = "";
	}
	else if (x == 'billingup') {
		document.getElementById('dropadde').style.display = "none";
	}
	
	else {
		document.getElementById('dropadds').style.display = "none";
	}
}

function changebord(x) {
document.getElementById(x).style.borderColor = "#0000ff";
}

function backbord(x) {
document.getElementById(x).style.borderColor = "#999999";
}
