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/2-homeoff.gif";
	var emb1off = new Image();
	emb1off.src = "/images/2-staffoff.gif";
	var emb2off = new Image();
	emb2off.src = "/images/2-servicesoff.gif";
	var emb3off = new Image();
	emb3off.src = "/images/2-financialoff.gif";
	var emb4off = new Image();
	emb4off.src = "/images/2-galleryoff.gif";	
	var emb5off = new Image();
	emb5off.src = "/images/2-contactoff.gif";	
	var emb6off = new Image();
	emb6off.src = "/images/2-educationoff.gif";
	var emb7off = new Image();
	emb7off.src = "/images/2-mariaoff.gif";
	
	var embon = new Image();
	embon.src = "/images/2-homeon.gif";
	var emb1on = new Image();
	emb1on.src = "/images/2-staffon.gif";
	var emb2on = new Image();
	emb2on.src = "/images/2-serviceson.gif";
	var emb3on = new Image();
	emb3on.src = "/images/2-financialon.gif";
	var emb4on = new Image();
	emb4on.src = "/images/2-galleryon.gif";	
	var emb5on = new Image();
	emb5on.src = "/images/2-contacton.gif";	
	var emb6on = new Image();
	emb6on.src = "/images/2-educationon.gif";
	var emb7on = new Image();
	emb7on.src = "/images/2-mariaon.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");
	}
}

}
