// START - Pop Up Windows

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=800,');");
}

function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=900,height=760,');");
}

function popUp3(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=700,height=460,');");
}

function popUp4(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=430,');");
}

function popUp5(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,');");
}

function popUp6(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=auto,height=auto,');");
}

function popUp7(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=900,height=495,');");
}




// START - Toggle Layers

function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"none";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"none";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"none";
}
}

function toggleLayer2(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}

// START - Ask Me

var defaultStr = 'Type your complete question here';

function isBlank(q) {
  var whitespace = new String(" \t\n\r");
 
  for (var i = 0; i<q.length; i++) {
    if (whitespace.indexOf(q.charAt(i)) == -1) {
      return false;
    }
  }
 
  return true;
}
 
function submitForm(){
  var d = document.questionForm;
  if (!isValidForm())
    return;
  d.submit();
}
 
function isValidForm(){
  var d = document.questionForm;
  if (d.question.value==defaultStr  ||  isBlank(d.question.value)) {
    return false;
  }
 
  d.action='http://accd.intelliresponse.com/ACCDSUPPORTIR/results.jsp';
  d.requestType.value='NormalRequest';
  return true;
}
 
function topTen(){
  var d = document.questionForm;
  d.action='http://accd.intelliresponse.com/ACCDSUPPORTIR/topQuestions.jsp';
  d.submit();
}
 
function clearForm(){
  var d = document.questionForm;
  d.id.value=-1;
  d.reset();
  d.question.focus();
  d.question.value='';
}

