// JScript File

 function setSpacerTopSize(doc)
{

if (document.all) {
     w = document.body.clientWidth;
     h = document.body.clientHeight;
     alert(w + " : " + h);
}

alert(doc.body.offsetWidth);
alert(doc.body.offsetHeight);

 alert("Client : " + doc.body.clientHeight); 

   
var size;

            if(window.innerHeight)
			{
			    size = window.innerHeight;	
			}
			else
			{
			    size = doc.body.clientHeight
			}

    // calculate new size
   size = (size - 550) / 2;
   
   alert(size);
   
   var ele = doc.getElementById("spacerTop");
   
   ele.height = size;
   
   }
   
   
var currentlyPressedButton;
// Preset the Images
    homen = loadImage('Home.gif')
    homed = loadImage('Home_down.gif')
    homeo = loadImage('Home_over.gif')
    insun = loadImage('Insurance.gif')
    insud = loadImage('Insurance_down.gif')
    insuo = loadImage('Insurance_over.gif')
    newhn = loadImage('New_Homes.gif')
    newhd = loadImage('New_Homes_down.gif')
    newho = loadImage('New_Homes_over.gif')
    renon = loadImage('Renovations.gif')
    renod = loadImage('Renovations_down.gif')
    renoo = loadImage('Renovations_over.gif')
    commn = loadImage('Commercial.gif')
    commd = loadImage('Commercial_down.gif')
    commo = loadImage('Commercial_over.gif')
    contn = loadImage('Contact.gif')
    contd = loadImage('Contact_down.gif')
    conto = loadImage('Contact_over.gif')

// Load the Image
function loadImage(im)
{
	var i=new Image();
	i.src='Images/'+im;
	return i;
} 

// Toggle the images
function toggle(id,doc)
{ 
	x=id.substring(0,id.length-1); // get the name 'home' or 'insu' or 'newh' or 'reno' or 'comm' or 'cont'
	xe=id.substring(id.length-1,id.length); // get the end char 'o' or 'n' or 'd'

	if (currentlyPressedButton==x&&(xe=='n'||xe=='o'))   // if we're already pressed and a mouse out or mouse over then do nothing
		return;
	
	if (xe=='d') // if we are a mouse down
	{
		if(currentlyPressedButton != '-1')  // if currently pressed button is already pressed
		{
			doc.getElementById(currentlyPressedButton).src=eval(currentlyPressedButton+'n'+'.src'); // switch the currently pressed item to the normal gif
		}

		currentlyPressedButton=x; // assign the currently pressed item to the selected item
	} 

	doc.getElementById(x).src=eval(id+'.src'); // load the new image for the selected button

}

function setCurrent(im)
{
    currentlyPressedButton = im;
}

function preloadImages(doc)
{
    // set the image to
    if(currentlyPressedButton != '-1')
	    toggle(currentlyPressedButton+'d',doc);
}