var im_path = 'img/';
var eX = '.gif'

//Preload Nav
var home_ = new Image();
home_.src  = im_path + 'home_' + eX;
var fabrics_ = new Image();
fabrics_.src  = im_path + 'fabrics_' + eX;
var garments_ = new Image();
garments_.src = im_path + 'garments_' + eX;
var interiors_ = new Image();
interiors_.src = im_path + 'interiors_' + eX;
var contact_ = new Image();
contact_.src = im_path + 'contact_' + eX;
//Preload Other


// gp rollover script - needs name of graphic and what to change to only
function swap_im(name,to){
	document.images[name].src = im_path  + to;
}


//Swap
// target='_self' onMouseOver='swap_im("","_")' onMouseOut = 'swap_im("","")'
// name=''

// Provides rollovers for navigation
var im = new Array('home', 'fabrics', 'garments', 'interiors', 'contact');

function nav_im(button,pos){
for (i = 0; i < im.length; i++){
	if (button == im[i]) {//alert(im_path + button + pos + eX);
document.images[button].src = im_path + button + pos + eX;}
	}
}

// Changing the visibility (display property) of an element
// 
//assign on page the areas to hide/show: var area = new Array('', '', '', '', '');

var areaName = 0;

function getObj(value)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(value);
	this.style = document.getElementById(value).style;
  }
}

  
function chDisplay(name){	
	// set display state of all areas to 'none'
	for(i=0; i < area.length ; i++){
		var displayState = new getObj(area[i]);
		//alert('changing to none: ' + area[i]);
		displayState.style.display = 'none';
	}
	// go thro all areas, and set display state of chosen area to 'inline'
	for(i=0; i < area.length; i++){
		if(area[i] == name){
		var displayState = new getObj(name);
		//alert('chosen display matches: ' + area[i]);
		displayState.style.display = 'inline';
		//alert('If: yes, changing to inline');
		break
		}
	}
}
