// JavaScript Document

// JavaScript Document
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

function OpenAdmin(theURL){
	LeftPosition = (screen.width) ? (screen.width)-510 : 0;
	cmsheight = (screen.height) ? (screen.height)*.75 : 550;
	settings = 'height='+cmsheight+',width=600,top=0,left='+LeftPosition+',scrollbars=yes,resizable=yes'
	win = window.open(theURL,'viewit',settings)
}

function OpenMap(theURL){
	LeftPosition = (screen.width) ? (screen.width)-900 : 0;
	cmsheight = (screen.height) ? (screen.height)*.80 : 550;
	settings = 'height='+cmsheight+',width=900,top=0,left='+LeftPosition+',scrollbars=yes,resizable=yes'
	win = window.open(theURL,'viewit',settings)
}

function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}


 function changeBox()
 {
    document.getElementById('div1').style.display='none';
    document.getElementById('div2').style.display='';
    document.getElementById('password').focus();
 }
 function restoreBox()
 {
    if(document.getElementById('password').value=='')
    {
      document.getElementById('div1').style.display='';
      document.getElementById('div2').style.display='none';
    }
 }
 
 
function show_div(div_id,menu) { 
// hide all the divs and show all menus
if(document.getElementById('tab1')){
document.getElementById('news').style.display = 'none';
document.getElementById('tab1a').className = "off";
}
if(document.getElementById('tab2')){
document.getElementById('docs').style.display = 'none';
document.getElementById('tab2a').className = "off";
}
if(document.getElementById('tab3')){
document.getElementById('links').style.display = 'none';
document.getElementById('tab3a').className = "off";
}
if(document.getElementById('tab4')){
document.getElementById('offic').style.display = 'none';
document.getElementById('tab4a').className = "off";
}
// show the requested div 
document.getElementById(div_id).style.display = 'block';
document.getElementById(menu).className = "on";
}