// bcwireless.js : javascript stuff

var _debugWindow = false;

function doConfirm(prompt,link)
{
	if(confirm(prompt)==true)
		window.location=link;
}

function doPeopleFinder(parentform)
{
	window.open('/users/people.find.php?srchpopup='+parentform,'pplfinder','width=480,height=400,scrollbars=yes,resizeable=yes,menubar=no,statusbar=no');
}

function doChangeVis(what)
{
	foo=document.getElementById(what);
	if(foo.style.display=='none') {
		foo.style.display='block';
	} else {
		foo.style.display='none';
	}
}

function DoSpellCheck(aTextField) {
	var newspellwin = window.open('/sphpell/spellcheckwindowframeset.php?spellcheckfield=' + aTextField, 'SpellCheckWin', 'status=no,location=no,directories=no,menubar=yno,toolbar=no,scrollbars=yes,height=340,width=510,resizable=yes,top=150,left=150,screenX=150,screenY=150');
}


var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}

function trim(str)
{
   return str.replace(/^\s*|\s*$/g,"");
   }


function modal_toggle(div)
{
	var mdiv = $(div);
	if(mdiv.style.visibility == 'visible'){
		mdiv.style.visibility = 'hidden';
	} else {


 		mdiv.setStyle( { height: document.body.offsetHeight +10 +"px"});
        mdiv.setStyle( { width: document.body.offsetWidth + 10 + "px"} );
		mdiv.style.visibility = 'visible';
	}
}


sfHover = function() {
	var sfEls =
document.getElementById("ddmenu").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);