
/* 
	////////////////////////////////// 
	HEADER SEARCH FUNCTIONS
	//////////////////////////////////
*/

function searchAccess(){
  
  
  st_access = getObjectById('stab_access');
  st_web = getObjectById('stab_web');

	st_access.className = 'searchHere';
	st_web.className = '';
	
	if(document.headersearch.m)
		document.headersearch.m.value = 'access';
}

function searchWeb(){
  st_access = getObjectById('stab_access');
  st_web = getObjectById('stab_web');

	st_access.className = '';
	st_web.className = 'searchHere';
	
	if(document.headersearch.m)
		document.headersearch.m.value = 'web';
}

function getObjectById(whichLayer){
	var elem;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
    
    return elem;
}

/* clears the text from the search on the header */
function clearSearch(){
	if(document.headersearch.q)
		document.headersearch.q.value='';
}

function ManageTabPanelDisplay() {
var idlist = new Array('tab1focus','tab2focus','tab1ready','tab2ready','latestNews','mostPopular');

// No other customizations are necessary.
if(arguments.length < 1) { return; }
for(var i = 0; i < idlist.length; i++) {
   var block = false;
   for(var ii = 0; ii < arguments.length; ii++) {
      if(idlist[i] == arguments[ii]) {
         block = true;
         break;
         }
      }
   if(block) { document.getElementById(idlist[i]).style.display = "block"; }
   else { document.getElementById(idlist[i]).style.display = "none"; }
   }
}

function setonLayer(whichLayer){
	var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
    
	if(elem && elem.style){
	  vis = elem.style;
	  // if the style.display value is blank we try to figure it out here
	  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
		
	  vis.display = 'block';
	}
}

function setoffLayer( whichLayer ){
	var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
    
	if(elem && elem.style){
		  vis = elem.style;
	  
		  // if the style.display value is blank we try to figure it out here
		  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
			vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
			
		  vis.display = 'none';
	  }
}


function clrAllDrops(){
	clearAllOtherDropdowns();
}

function clearAllOtherDropdowns(){
	setoffLayer('drop-news');
	setoffLayer('drop-sports');
	setoffLayer('drop-weather');
	setoffLayer('drop-community');
	setoffLayer('drop-classifieds');
	setoffLayer('drop-extra');
	setoffLayer('drop-video');
	setoffLayer('drop-access');
}

function toggleLayer( whichLayer )
{
	clearAllOtherDropdowns();

  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
    
	if(elem && elem.style){
	  vis = elem.style;
	  // if the style.display value is blank we try to figure it out here
	  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
	    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
	  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
  
  }
}

function launchMediaCenter_old(){
	//removed 3/11/08 - YV
	fncCenteredChildWindow('/access/media_center.php',500,800,'no','no');
}

function launchMediaCenter(id){
	var url = '/access/media_center.php';
	if((id != null) && (id != 0)){
		url += '?id='+id;
	}
	fncCenteredChildWindow(url,500,800,'no','no');
}

function launchCommentDisclaimer(){
	fncCenteredChildWindow('/access/etc/comment-disclaimer.php',250,300,'no','no');
}

function fncCenteredChildWindow(URL,vHeight,vWidth,vScroll,vStatus) {
	if (screen.width) {
		var winl=(screen.width-vWidth)/2;
		var wint=(screen.height-vHeight)/2;
	} else { 
		winl=0;wint=0;
	}
	if(winl<0)winl=0;
	if(wint<0)wint=0;
	window.open(URL,'myWin','height='+vHeight+',width='+vWidth+',scrollbars='+vScroll+',status='+vStatus+',top='+wint+',left='+winl+',resizable=no')
}
