/* functions to open a new window and center it also not a function to close the window */

//global variables
//global variables
var n4x=(document.layers)? true:false;
var ie4x=(document.all)? true:false;
var n6x=(document.getElementById)? true:false;

//style sheet change add a class file = to equipment to allow the change to take place
function menuon(name,cssref) {
	document.getElementById(name).className=cssref;
	}
function menuoff(name) {
	//document.getElementById(name).className='highlightoff';
	}

var newWin;
function childwindow(url,winname,w,h)
{
windowleft = (screen.width -w)/2;
windowtop = (screen.height -h)/2;

settings = '"toolbar=no,directories=no,menubar=no,scrollbars=no,resizable=no,status=no,width='+w+',height='+h+',left='+windowleft+',top='+windowtop+'"';
closeWindow();
newWin = window.open(url,winname,settings);
newWin.focus();

}

/* function closes the window */
function closeWindow() {
	if (newWin && !newWin.closed) {
		newWin.close();
	}
}
function childwindow2(url,winname,w,h)
{
windowleft = (screen.width -w)/2;
windowtop = (screen.height -h)/2;

settings = '"toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=no,status=no,width='+w+',height='+h+',left='+windowleft+',top='+windowtop+'"';
closeWindow();
newWin = window.open(url,winname,settings);
newWin.focus();

}

/* function closes the window */
function closeWindow() {
	if (newWin && !newWin.closed) {
		newWin.close();
	}
}

/*function to display text in the status toolbar */

function navstatus(msg) {

window.status=msg;
return true;
}


//top array navigation rollovers
 var pics = new Array("images/home_on.gif","images/about_us_on.gif","images/property_cycle_on.gif", "images/clients_on.gif","images/references_on.gif","images/newsletter_on.gif","images/meet_theteam_on.gif","images/linksout_on.gif");
 
 // create an empty array
 var preload = new Array();
 
 // create the preload with a new image object
 for(var i =0; i <pics.length; i++)
 {	
 	preload[i] = new Image();
	preload[i].src = pics[i];
 }
 
 
function swap(n)
 {
	 
switch(n)
	 {
	case 1 : document.images.homes.src="images/home_on.gif";
	break;
	case 2 : document.images.about.src="images/about_us_on.gif";
	break;
	case 3 : document.images.property.src="images/property_cycle_on.gif";
	break; 
	case 4 : document.images.clients.src="images/clients_on.gif";
	break;
	case 5 : document.images.references.src="images/references_on.gif";
	break;
	case 6 : document.images.news.src="images/newsletter_on.gif";
	break;
	case 7 : document.images.team.src="images/meet_theteam_on.gif";
	break; 
	case 8 : document.images.links.src="images/linksout_on.gif";
	break;
	case 11 : document.images.homes.src="images/home.gif";
	break;
	case 22 : document.images.about.src="images/about_us.gif";
	break;
	case 33 : document.images.property.src="images/property_cycle.gif";
	break; 
	case 44 : document.images.clients.src="images/clients.gif";
	break;
	case 55 : document.images.references.src="images/references.gif";
	break;
	case 66 : document.images.news.src="images/newsletter.gif";
	break;
	case 77 : document.images.team.src="images/meet_theteam.gif";
	break; 
	case 88 : document.images.links.src="images/linksout.gif";
	break;
	 }
 }
 
 /* DHTML API BY C COLLINGE 2003 */


 function objectlayer(layername){
    if (n4x) {
       this.layerRef=document.layers[layername];

   }
   if (ie4x){
      this.layerRef=document.all[layername].style;

          }else

          if (n6x)
          {
             this.layerRef=document.getElementById(layername).style;
			 

          }
        this.x = this.layerRef.left;
        this.y = this.layerRef.top;
        this.showmylayer = showLayer;
        this.hidemylayer = hideLayer;
        this.movemylayer = movelayer;
}
//****end object definition

//**** methods of objects
function showLayer()
 {
  this.layerRef.visibility ="visible";
 }


function hideLayer()
        {

         this.layerRef.visibility ="hidden";
    }

function movelayer(x,y)
{
this.x = x;
this.y = y;
this.layerRef.left = this.x;
this.layerRef.top = this.y;

}



//create a new instance of a layer named mylayer place ths in your HTML code
function init()
{
//the parameter is the name of the <div> id
//layer1 = new objectlayer('mylayer');
//layer1.hidemylayer();
//layer2 = new objectlayer("mylayer2");

// example of use with an event <input type="button" name="viewupload" value="upload images" //onClick='layer1.showmylayer();'>

}
 