

window.onload=init;

function init(){
printLink();
}

function printLink(){
var linkEl

	if(document.getElementById("print")){
	
		linkEl = document.createElement("a");
		linkEl.setAttribute("href","javascript:self.print()");
		linkEl.appendChild(document.createTextNode("Print page"));
		document.getElementById("print").appendChild(linkEl);
		document.getElementById("print").removeChild(document.getElementById("print").firstChild);

	}
}

function test(){
alert("hello");
self.print;
}


if(document.images){
ProductsRoll = new Image();
ProductsRoll.src = "/images/nav-1-selected.gif";
ProductsOff = new Image();
ProductsOff.src = "/images/nav-1.gif";

CustomerRoll = new Image();
CustomerRoll.src = "/images/nav-2-selected.gif";
CustomerOff = new Image();
CustomerOff.src = "/images/nav-2.gif";

PartsRoll = new Image();
PartsRoll.src = "/images/nav-3-selected.gif";
PartsOff = new Image();
PartsOff.src = "/images/nav-3.gif";

TradeRoll = new Image();
TradeRoll.src = "/images/nav-4-selected.gif";
TradeOff = new Image();
TradeOff.src = "/images/nav-4.gif";

}

function imgRoll(n){
	if(document.getElementById(n+"Link")){document.getElementById(n+"Link").src = eval(n+"Roll").src}
}

function imgOff(n){
	if(document.getElementById(n+"Link")){document.getElementById(n+"Link").src = eval(n+"Off").src}
}


function updateImg(l){
	var thumb = l.firstChild.src;
	var start = thumb.lastIndexOf("/");
	start++;
	var end = thumb.lastIndexOf(".");
	var url = l.firstChild.src;
	document.getElementById("productImg").src=url;
}

function updateImgFromThumbnail(target, path){
	document.getElementById(target).src=path;
}

function chkForm(fo){
	if(fo.place.value==""){
		alert("Please enter a place name or postcode")
		return false;
	}
}


function popup(url,features){
	window.open(url,"popup",features);
}

function openLoc(url){
window.open(url,"installers","width=620px,height=500px,scrollbars=yes")
}











