
function launch(newURL, newName, newFeatures, orgName) {
  var remote = open(newURL, newName, newFeatures);
  if (remote.opener == null)
    remote.opener = window;
  remote.opener.name = orgName;
  return remote;
}


function PopupWindow(url) {
  myRemote = launch(url, "myRemote", "height=100,width=270,alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=0,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=1,toolbar=0,z-lock=0", "myWindow");
}


function virtualpopup(url) {
	  myRemote = launch(url, "virtual", "height=350,width=350,alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=0,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=1,toolbar=0,z-lock=0", "myWindow");
}


function launchRemote() {
  myRemote = launch("http://www.webreference.com/js/column7/demoontop.html", "myRemote", "height=400,width=110,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0", "myWindow");
}

function showhide(v)
{
  var s=document.getElementById(v);
  //alert(s.style.display);
  if(s.style.display=="none")
  {
    s.style.display="inline";
    return true;
  }
  else
  {
    s.style.display="none";
    return true;
  }
  return false;

}


function toggleDisplay(element) {
	element2 = "advancedSearch2";
	if (document.getElementById) { // is IE
		if (document.getElementById(element).style.display=='block') {
			eval("document.getElementById('"+element+"').style.display='none';");
			eval("document.getElementById('"+element2+"').style.display='block';");
		} else {
			eval("document.getElementById('"+element+"').style.display='block';");
			eval("document.getElementById('"+element2+"').style.display='none';");
		}
	} else { // is NS?
		if (document.layers[element].display=='block') {
			eval("document.layers['"+element+"'].display='none';");
			eval("document.getElementById('"+element2+"').style.display='block';");
		} else {
			eval("document.layers['"+element+"'].display='block';");
			eval("document.getElementById('"+element2+"').style.display='none';");
		}
	}
	return false;
}

function allTrim(s) {
    for(i=0;i<s.length;i++) {
	if(s.charAt(i)!=' ') {
	     break;
	}
    }
    s=s.substr(i)
    if(s.length>0) {
	for(i=s.length-1,j=0;i>=0;i--,j++) {
	    if(s.charAt(i)!=' ') {
		break;
	    }
	}
	s=s.substr(0,s.length-j)
    }
    return s;
}

function isEmail(string) {
	if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
		return true;
	else
		return false;
}


