var browser_name = navigator.appName;


var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
	if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
	settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes";
	win=window.open(mypage,myname,settings);
	win.focus();
}

 /////////////////////////////////////////
 //FORMS/AUTOTAB: Auto Tab with phone numbers
 /////////////////////////////////////////
 var isNN = (navigator.appName.indexOf("Netscape")!=-1);
 function autoTab(input,len, e) {
 var keyCode = (isNN) ? e.which : e.keyCode;
 var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
 if(input.value.length >= len && !containsElement(filter,keyCode)) {
 input.value = input.value.slice(0, len);
 input.form[(getIndex(input)+1) % input.form.length].focus();
 }
 function containsElement(arr, ele) {
 var found = false, index = 0;
 while(!found && index < arr.length)
 if(arr[index] == ele)
 found = true;
 else
 index++;
 return found;
 }
 function getIndex(input) {
 var index = -1, i = 0, found = false;
 while (i < input.form.length && index == -1)
 if (input.form[i] == input)index = i;
 else i++;
 return index;
 }
 return true;
}

///////////////////////////////////////////
//NAVIGATION: rolls
///////////////////////////////////////////
if (document.images) {
	var emboff = new Image();
	emboff.src = "/images/3-homeoff.gif";
	var emb1off = new Image();
	emb1off.src = "/images/3-staffoff.gif";
	var emb2off = new Image();
	emb2off.src = "/images/3-servicesoff.gif";
	var emb3off = new Image();
	emb3off.src = "/images/3-financialoff.gif";
	var emb4off = new Image();
	emb4off.src = "/images/3-galleryoff.gif";	
	var emb5off = new Image();
	emb5off.src = "/images/3-contactoff.gif";	
	var emb6off = new Image();
	emb6off.src = "/images/3-cosmeticoff.gif";	
	var emb7off = new Image();
	emb7off.src = "/images/3-restorativeoff.gif";	
	var emb8off = new Image();
	emb8off.src = "/images/3-specialneedsoff.gif";	
	
	var embon = new Image();
	embon.src = "/images/3-homeon.gif";
	var emb1on = new Image();
	emb1on.src = "/images/3-staffon.gif";
	var emb2on = new Image();
	emb2on.src = "/images/3-serviceson.gif";
	var emb3on = new Image();
	emb3on.src = "/images/3-financialon.gif";
	var emb4on = new Image();
	emb4on.src = "/images/3-galleryon.gif";	
	var emb5on = new Image();
	emb5on.src = "/images/3-contacton.gif";	
	var emb6on = new Image();
	emb6on.src = "/images/3-cosmeticon.gif";	
	var emb7on = new Image();
	emb7on.src = "/images/3-restorativeon.gif";	
	var emb8on = new Image();
	emb8on.src = "/images/3-specialneedson.gif";	
	
	
function img_act(imgName) {
	if (document.images) {
		document.images[imgName].src = eval(imgName + "on.src");
	}
}

function img_inact(imgName) {
	if (document.images) {
		document.images[imgName].src = eval(imgName + "off.src");
	}
}

}

