/*==============================================================================
// Generic JS Functions
// Jeremy Morgan <jdmorgan@syr.edu>
//============================================================================*/

function isIE() {
  return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
}

function isChrome() {
  return navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
}

function doNothing() {
  //do nothing :-) 
}

function recordClick (target, page) {

 strURL = '/ajax/record_clicks.php?target=' + escape(target) + '&page=' + escape(page) + '';
 
 //alert(strURL);
 
 ajax_request(strURL);

}

function ajax_request(strURL) {
 
  if(navigator.appName == "Microsoft Internet Explorer") {
    xhrobj = new ActiveXObject("Microsoft.XMLHTTP");
  } else {
    xhrobj = new XMLHttpRequest();
  }

  xhrobj.open('get', strURL);
  xhrobj.onreadystatechange = ajax_response;
  xhrobj.send(null);

}

function ajax_response() {

  if(xhrobj.readyState == 4) {
    //alert(xhrobj.responseText);
  }

}

function showFAQ (link, id) {
  if (document.selection)  {
    document.selection.empty();
    link.blur();
  } else {
    window.getSelection().removeAllRanges();
  }
  if (document.getElementById(id).style.fontSize == "100%") {
    document.getElementById(id).style.height   = "0px";
    document.getElementById(id).style.fontSize = "0px";
    link.style.listStyleImage="url('/img/bullet_triange_orange_2.png')";
  } else {
    document.getElementById(id).style.height   = "auto";
    document.getElementById(id).style.fontSize = "100%";
    link.style.listStyleImage="url('/img/bullet_triange_orange_2_down.png')";
  }
}

function enableMobile() {
  
  document.cookie = "mobile=1;";
  
}


