var current_div = null;

function show_hide_by_id(myID, showhide) {
    var v;
    var x = document.getElementById(myID);
    if (x) { 
    	v=x.style; 
    	if (showhide=='show') {
      		v.left = 'auto';
      		v.backgroundPosition = '0 0';
    	}
		else
		  v.left = '-9999px'; 
	}
}
  
  function swap_divs(myID) {
	if (myID == current_div) {
	  return;
	}
	else {
      show_hide_by_id(myID, 'show');
	  if (current_div) {
	    show_hide_by_id(current_div, 'hide');
	  }
	  current_div = myID;
	}
  }

// setTimeout('addInputFocus()', 200);
function initswap() {
	swap_divs('feat1');
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(initswap);


function dat(item) {
	item.style.background="../feature-over.png";
}

function dap (item) {
}




// Son-Of-Sucker-Fish IE Hack
// -----------------------------------------------------------------
sfHover = function() {
  if (document.getElementById("nav")) {
	  var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	  for (var i=0; i < sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
		  this.className+=" sfHover";
		}
		sfEls[i].onmouseout=function() {
		  this.className=this.className.replace(new RegExp(" sfHover\\b"), "");
		}
	  }
   }
 }
 if (window.attachEvent) window.attachEvent("onload", sfHover);


//------------------- OPEN NEW WINDOW -------------------//
var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, type, strWidth, strHeight){
	closeWin();
	if (type == "fullScreen"){
		strWidth = screen.availWidth - 10;
		strHeight = screen.availHeight - 160;
	}
	var tools="";
	if (type == "standard" || type == "fullScreen") tools = "resizable=no,toolbar=no,location=no,scroll=yes,scrollbars=yes,menubar=no,width="+strWidth+",height="+strHeight+",top=0,left=0";
	if (type == "console") tools = "resizable=no,toolbar=no,location=no,directories=no,status=no,scroll=no,scrollbars=no,menubar=no,width="+strWidth+",height="+strHeight+",left=0,top=0";
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}

function popUpSWF(url, type, Width, Height, arg1, arg2, arg3){
	closeWin();
	tools = "resizable=no,toolbar=no,location=no,directories=no,status=no,scroll=no,scrollbars=no,menubar=no,width="+Width+",height="+Height+",left=0,top=0";
	if(type == "mp"){
		newWindow = window.open(url+"?bandwidth="+arg1+"&video="+arg2+"&lan="+arg3, 'newWin', tools);
	}
	if(type == "mc"){
		newWindow = window.open(url+"?category="+arg1+"&videoNum="+arg2, 'newWin', tools);
	}
	if(type == "bna"){
		newWindow = window.open(url+"?procedure="+arg1+"&caseNum="+arg2, 'newWin', tools);
	}
	newWindow.focus();
}
