
function ajaxRequest(url,div,id)
{
  // Set up the request
  //var xmlhttp = new XMLHttpRequest();
  var xmlhttp; //declare the variable to hold the object.
  var browser = navigator.appName; //find the browser name
  if(browser == "Microsoft Internet Explorer")
  {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  }else{
    xmlhttp = new XMLHttpRequest();
  }
  xmlhttp.open('POST', url, true);
  // The callback function
  xmlhttp.onreadystatechange = function()
  {
  
   if (xmlhttp.readState !=4){
		document.getElementById(div).innerHTML = '<div style="text-align:center;color:#868686;"><img src="images/loader.gif"> Loading Content...<\/div>';
    	}
  
    try{if (xmlhttp.readyState == 4) // Finished loading
    {
      if (xmlhttp.status == 200) // Completeed Successfully
      {
         var response = xmlhttp.responseText;
         //alert(response_stat);
         document.getElementById(div).innerHTML = response;
      }
    }}catch(e){
      //alert('There was an error!');
    }
  }

  // Send the POST request
  xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  xmlhttp.send("id="+id);
}


ns4 = document.layers;
ie4 = document.all;
nn6 = document.getElementById && !document.all; 

function showObject(e,id) {

   var docX, docY;
   if( e )
   {
      if( typeof( e.pageX ) == 'number' )
      {
         docX = e.pageX;
         docY = e.pageY;
      }
      else
      {
         docX = e.clientX;
         docY = e.clientY;
      }
   }
   else
   {
      e = window.event;
      docX = e.clientX;
      docY = e.clientY;
      if( document.documentElement
        && ( document.documentElement.scrollTop
            || document.documentElement.scrollLeft ) )
      {
         docX += document.documentElement.scrollLeft;
         docY += document.documentElement.scrollTop;
      } 
      else if( document.body
         && ( document.body.scrollTop
             || document.body.scrollLeft ) )
      {
         docX += document.body.scrollLeft;
         docY += document.body.scrollTop;
      }
   }

  if (ie4) {
     document.all[id].style.visibility = "visible";
     document.all[id].style.left = docX + "px;";
     document.all[id].style.top = docY + "px;";
  }
  else if (nn6) {
     document.getElementById(id).style.visibility = "visible";
     document.getElementById(id).style.left = docX + "px;";
     document.getElementById(id).style.top = docY + "px;";
  }
}

function hideObject(id) {
  if (ie4) {
     document.all[id].style.visibility = "hidden";
  }
  else if (nn6) {
     document.getElementById(id).style.visibility = "hidden";
  }
}



function formCheckSeminarSignup(formobj){
//1) Enter name of mandatory fields
var fieldRequired = Array("seminardate","p_status","first_name", "last_name", "day_phone_a", "day_phone_b", "day_phone_c", "email");
//2) Enter field description to appear in the dialog box
var fieldDescription = Array("Seminar Date", "Customer Status", "First Name", "Last Name", "Day Phone 1", "Day Phone 2", "Day Phone 3", "Email");
//3) Enter dialog message
var alertMsg = "Please complete the following fields:\n";

var l_Msg = alertMsg.length;

for (var i = 0; i < fieldRequired.length; i++){
var obj = formobj.elements[fieldRequired[i]];
if (obj){
switch(obj.type){
case "select-one":
if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
alertMsg += " - " + fieldDescription[i] + "\n";
}
break;
case "select-multiple":
if (obj.selectedIndex == -1){
alertMsg += " - " + fieldDescription[i] + "\n";
}
break;
case "text":
case "textarea":
if (obj.value == "" || obj.value == null){
alertMsg += " - " + fieldDescription[i] + "\n";
}
break;
default:
if (obj.value == "" || obj.value == null){
alertMsg += " - " + fieldDescription[i] + "\n";
}
}
}
}

if (alertMsg.length == l_Msg){
return true;
}else{
alert(alertMsg);
return false;
}
}
