
var sizefactor=1

function autosize()
{

if (! document.getElementsByTagName){alert("Your Browser is not compatible with PageAutoSize(tm)"); return;}

if(document.body && typeof(document.body.clientWidth)=='number'){cw=document.body.clientWidth} // NS7+, IE5+
else if(typeof(innerWidth)=='number'){cw=innerWidth} // NS4x, 6x, CS7, Opera

if(cw==0){return}

if(cw!=autoscale){

sizefactor=cw/autoscale

var w=0
var ih=0
var mw=0
var wtemp=0
var htemp=0


for(i=0; i<document.images.length; i++){

wtemp=document.images[i].width
htemp=document.images[i].height

document.images[i].width=Math.round(wtemp * sizefactor)
document.images[i].height=Math.round(htemp * sizefactor)

}

document.body.leftMargin=(document.body.leftMargin * sizefactor)
document.body.rightMargin=(document.body.rightMargin * sizefactor)
document.body.topMargin=(document.body.topMargin * sizefactor)

var size
var eachElement
var fontElement=document.getElementsByTagName("a")

for (i=0; i<fontElement.length; i++)
{
eachElement=fontElement[i]
// NS7, Opera
if (document.defaultView){size=document.defaultView.getComputedStyle(eachElement, null).getPropertyValue("font-size")}
// IE6
else if (eachElement.currentStyle){size=eachElement.currentStyle.fontSize}
size=size.substr(0,size.length-2)
eachElement.style.fontSize=Math.round(size*sizefactor)+"px"
}

var fontElement=document.getElementsByTagName("font")
for (i=0; i<fontElement.length; i++)
{
eachElement=fontElement[i]
// NS7, Opera
if (document.defaultView){size=document.defaultView.getComputedStyle(eachElement, null).getPropertyValue("font-size")}
// IE6
else if (eachElement.currentStyle){size=eachElement.currentStyle.fontSize}
size=size.substr(0,size.length-2)
eachElement.style.fontSize=Math.round(size*sizefactor)+"px"
}

}

if(window.name=="menu"){top.menuloaded();}
if(window.name=="manufacturer"){top.manufacturerloaded();}

pagecounter()
	
}


// page read counter

function pagecounter()
{
if(counterfile>"a.js"){
counterwidth=parseInt(80*sizefactor,10)
counterheight=parseInt(20*sizefactor,10)
counterfontsize=parseInt(12*sizefactor,10)
cp=document.getElementById('counter')
cp.innerHTML='<IFRAME SRC=\"http:\/\/www.cardiff-lift.co.uk\/cgi-bin\/counter.pl?countfile='+counterfile+'&fsize='+counterfontsize+'px&fcolor=FFFFFF&fweight=400&bgcolor=FFFFFF&mouseovercolor=000000&totalcountfile='+totalcounter+'\" FRAMEBORDER=0 SCROLLING=NO WIDTH='+counterwidth+' HEIGHT='+counterheight+' marginHeight=0 marginWidth=0><\/IFRAME>'
}
}

// email

function email(n)
{
var re=/@/gi
n=n.replace(re, ".")
re=/#/gi
n=n.replace(re, "@")
open("mailto:"+n)
}

// in text links

function mou(n){n.style.backgroundColor="BCD5FF"}
function mov(n){n.style.backgroundColor="8CA5FF"}

// show big pictures

var picwin=null

function viewpic()
{
if (picwin && window.picwin.open && !window.picwin.closed) {window.picwin.close();}
picwin=open("", "Picture", "scrollbars=yes,toolbar=0,Width=518,Height=400")
window.picwin.document.open()
window.picwin.document.write('<HTML><HEAD><TITLE>Lift Regulations Approval Certificate</TITLE></HEAD><BODY BGCOLOR="#000000" TEXT="#FFFFFF" leftmargin=0 topmargin=0><IMG SRC="certificate-2.jpg" WIDTH=502 HEIGHT=719></BODY></HTML>')
window.picwin.document.close()
}

var guidewin=null

function viewguide()
{
if (guidewin && window.guidewin.open && !window.guidewin.closed) {window.guidewin.close();}
guidewin=open("hse-lift-users-guide.pdf", "Guide", "scrollbars=yes,toolbar=0,Width=600,Height=440")
}

