// JavaScript Document
// START OF SLIDE SHOW STUFF
try {
	if (imgs_L != null) {
		if (document.images) {
			var cache_L = new Array(); 
			for (i=0;i<imgs_L.length;i++) {
				cache_L[i] = new Image();
				cache_L[i].src = imgs_L[i];
			}
		}
		var ie4 = document.all; 
		var dom = document.getElementById;
		var isOpera = (navigator.userAgent.indexOf("Opera") != -1); 
		var isOpera7 = (navigator.userAgent.indexOf("Opera 7.") != -1);
		var ok = ((ie4||dom) && (!(isOpera && !isOpera7)))?true:false;
		
		var current_canvas_L = "canvas0_L"; 
		var current_index_L = 0; 
		var interval_L; 
		var next_canvas_L; 
		var next_canvas_obj_L; 
		var current_opacity_L; 
		var next_index_L = 1;
	}
} catch (ex) {
	// nothing
}

function rotate_L() {
	// Don't run if only one image
	if (imgs_L.length < 2 ) {  
		return;
	};
	var temp = ie4?eval("document.all."+current_canvas_L):document.getElementById(current_canvas_L);
	temp.style.zIndex++;
	current_opacity_L = 11;
	interval_L = eval('setInterval("fade_L()",transTime_L)');
}

function fade_L() {
	// Don't run if only one image
	if (imgs_L.length < 2 ) {  
		return;
	};
	if (current_opacity_L<89) {
		current_opacity_L+=11;
		setOpacity_L(current_canvas_L,current_opacity_L);
	} else {
		clearInterval(interval_L);
		current_canvas_L = (current_canvas_L=="canvas0_L")?"canvas1_L":"canvas0_L";
		next_canvas_L = (current_canvas_L=="canvas0_L")?"canvas0_L":"canvas1_L";
		setOpacity_L(next_canvas_L,11);
		next_canvas_obj_L = ie4?eval("document.all." + next_canvas_L):document.getElementById(next_canvas_L);
		next_canvas_obj_L.innerHTML = '<img src="'+imgs_L[next_index_L]+'" alt="'+alt_L[next_index_L]+'" border="0" width="'+width_L+'" height="'+height_L+'" />';
		current_index_L = (current_index_L<imgs_L.length-1)?current_index_L+1:0;
		next_index_L = (next_index_L<imgs_L.length-1)?next_index_L+1:0;
		if ((loop_L==0) && (current_index_L==0)) {
			return false;
		}
		setTimeout("rotate_L()",time_L);
	}
}

function setOpacity_L(which,num) {
	var obj = ie4?eval("document.all."+which):document.getElementById(which);
	if (obj.filters) {obj.filters.alpha.opacity=num;}
	if (obj.style.MozOpacity) {obj.style.MozOpacity=num/100;}
	if (obj.style.opacity) {obj.style.opacity=num/100;}
	if (obj.style.setProperty) {obj.style.setProperty('-khtml-opacity',num/100,null);}
}

// END OF SLIDE SHOW STUFF

function sideover(element) {
	if (element.className!="current") {
		//var msg = element.id;
		//var statusDiv = document.getElementById('MessageLayer');
		//statusDiv.innerHTML="IN:"+msg;
		//statusDiv.style.visibility = 'visible';
		element.style.background="url(images/navin.gif) no-repeat"; 
	}
} 
function sideout(element) { 
	if (element.className!="current") {
		//var msg = element.id;
		//var statusDiv = document.getElementById('MessageLayer');
		//statusDiv.innerHTML="OUT:"+msg;
		//statusDiv.style.visibility = 'visible';
		element.style.background="url(images/navout.gif) no-repeat"; 
	}
}
function navLoaded() {
	document.getElementById([currentPage]).className = "current";
}

function showMessage(ev, message, width) {
	if (message == "")
	{
		return;
	}
	if (width == "" || width == null)
		width = '250px'
	var messageLayer = document.getElementById('MessageLayer');
	messageLayer.innerHTML = "" + message;
	messageLayer.style.width = width;
	//messageLayer.style.left = 0 + event.screenX - event.offsetX - 2;
	
	var pageDiv = document.getElementById("page");
		
	var se = ev.srcElement;
	var firefox = false;
	
	if (se==null) {
		firefox = true;
		se = ev.target;
	}
		
	var leftPos;
	
	if (firefox == true)
		leftPos = se.offsetLeft + 0 + 0 + 1 + pageDiv.offsetLeft;
	else
		leftPos = se.offsetLeft + se.clientLeft + document.body.clientLeft + pageDiv.clientLeft + pageDiv.offsetLeft;
	
	if (firefox == true) {
		messageLayer.style.top = 0 + ev.clientY - se.offsetTop - messageLayer.clientHeight + 1 + "px";
		messageLayer.style.left = 0 + leftPos + "px";
	} else {
		messageLayer.style.top = 0 + ev.y - ev.offsetY - messageLayer.clientHeight + 1; 
		messageLayer.style.left = 0 + leftPos;	
	}
	messageLayer.style.visibility = 'visible';
}

function hideMessageLayer() {
	var messageLayer = document.getElementById('MessageLayer');
	messageLayer.style.visibility = 'hidden';
	messageLayer.innerHTML = "";
}

var constructionLineMessage = new String("Action Building Maintenance is registered with Constructionline.<BR><BR>");
constructionLineMessage = constructionLineMessage.concat("This is administered by The Department of Trade and Industry and is a list of approved building contractors who have all met strict pre-qualification requirements agreed by industry working groups.  It was set up in 1998 in order to streamline procurement procedures and to make the construction industry more efficient.<BR><BR>");
constructionLineMessage = constructionLineMessage.concat("Members, due to their working practices are pre-qualified to work for various Public Sector Clients, such as Local Authorities, Housing Associations, Universities and NHS Trusts.");

var fmb = new String("Action Building Maintenance is a member of the Federation of Master Builders. We therefore have to meet their strict guidelines in work practices etc in order to remain a member.");

var fmb_warranted = new String("What’s more, being a warranted building contractor, we are able to offer third party insurance, with the backing of the F.M.B. using their Masterbond Warranty Scheme");

var fensa = new String("FENSA is the Governments self-assessment scheme regulating contractors who supply and fit uPVC windows, doors and conservatories. As a member we have to comply with the current regulations and industry ‘best practice.’<BR><BR>");
fensa = fensa.concat("We inform FENSA of every installation we undertake. Once FENSA is satisfied the installation and materials comply, they issue a FENSA certificate which shows the windows, doors or conservatories we fit meet their high and ever increasing standards.<BR><BR>");
fensa = fensa.concat("We can arrange an insurance backed guarantee for all our doors, windows and conservatories to give you absolute peace of mind.");

var invest_people = new String("We achieved the ‘Investors in People’ standard in 2005. This standard is recognised universally and demonstrates our commitment to improving and training our staff so they can provide a high standard of work and customer service, to the satisfaction of our clients.");

//var corgi = new String("CORGI, The Confederation for the Registration of Gas Installers is the national watch dog for gas safety in the UK. It was formed in 1970 and maintains a register of all competent gas installers. It also ensures that gas works are carried out safely by carrying out routine checks on all certified installers.<BR><BR>");
//corgi = corgi.concat("Action Building Maintenance is enrolled on the CORGI Register so our customers can be sure that all our gas works carried out meet all official guidelines on safety and working practices. These regulations are monitored by The Health and Safety Executive in accordance with the Gas Safety Regulations.");
var corgi = new String("");
var chas = new String("");

var nic = new String("Action Building Maintenance are NIC EIC approved electrical contractors. The National Inspection Council for Electrical Installation Contracting is an independent organisation, set up to protect customers from against unsafe and dangerous electrical installations.<BR><BR>");
nic = nic.concat("We are able to carry out periodic electrical tests to offer peace of mind that all wiring meets current regulations. Electrical repairs ranging from the straightforward installation of a new shower or light circuit to the full re-wiring of a property can are carried out by our fully qualified team.");