
butgif=new Image(40,18)
butgif.src="button.gif"

var cr=unescape("%0A")

// menu control

var mdc="CCECCC"  
var moc="00DC00"    

function md(n){n.style.backgroundColor=mdc}
function mo(n){n.style.backgroundColor=moc}

function mou(n){n.style.backgroundColor=""}
function mov(n){n.style.backgroundColor="CCDCCC"}

// intext link control

var luc="00DC00"  
var loc="CCECCC"   


function lu(n){n.style.backgroundColor=luc}
function lo(n){n.style.backgroundColor=loc}


// footer control

var fuc="99CCEC"
var foc="DCECFF"    

function fu(n){n.style.backgroundColor=fuc}
function fo(n){n.style.backgroundColor=foc}


// Email 

function email(n)
{
var re=/@/gi
n=n.replace(re, ".")
re=/#/gi
n=n.replace(re, "@")
return n
}

// Email Us

function emailus()
{
var recip="troy#www-support-services@co@uk"
var re=/@/gi
recip=recip.replace(re, ".")
re=/#/gi
recip=recip.replace(re, "@")
open("mailto:"+recip)
}


// page autosize

var cw=0
var tw=0
var mw=0
var sizefactor=1

function autosize()
{

if(! document.getElementsByTagName){alert("Your Browser is not compatible with web page AutoSize(tm)"); return;}

scrsize()

if(cw!=780){

var w=0
var ih=0
mw=0
tw=0

for(i=0; i<document.images.length; i++){
document.images[i].width=Math.round(document.images[i].width * sizefactor)
document.images[i].height=Math.round(document.images[i].height * 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("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"
eachElement.style.lineHeight=Math.round((size*sizefactor)*1.1)+"px"
}
}
}


function scrsize()
{
if(top.document.body && typeof(top.document.body.clientWidth)=='number'){cw=top.document.body.clientWidth} // NS7+, IE5+
else if(typeof(top.innerWidth)=='number'){cw=top.innerWidth} // NS4x, 6x, CS7, Opera
sizefactor=cw/780
}


function accesscounter()
{
counterwidth=parseInt(88*sizefactor,10)
counterheight=parseInt(22*sizefactor,10)
counterfontsize=parseInt(16*sizefactor,10)
cp=document.getElementById('counter')
cp.innerHTML='<IFRAME SRC=\"http:\/\/www.where-troy-once-stood.co.uk\/cgi-bin\/counter.pl?countfile='+pagecounter+'&fsize='+counterfontsize+'px&totalcountfile='+totalcounter+'\" FRAMEBORDER=0 SCROLLING=NO WIDTH='+counterwidth+' HEIGHT='+counterheight+' marginHeight=0 marginWidth=0><\/IFRAME>'
}



