var http=createRequestObject();
var http2=createRequestObject();

function detectflash()
{ 
if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]){

/* document.getelementById('menu').innerHTML='<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=250 height=600> <param name=movie value=newedit.swf> <param name=quality value=high> <embed src=newedit.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=250 height=600></embed> </object>';  */
}

//Otherwise,...
else {
http.open('get','canvas.php');
	http.onreadystatechange=handleResponsemenu;
		http.send(null);	
}
}
function showjobs()
{ 


http.open('get','Employment/index.php');
	http.onreadystatechange=handleResponse3;
		http.send(null);	



}
function showform()
{


http.open('get','work.php?func=showform');
	http.onreadystatechange=handleResponse3;
		http.send(null);	

}
function textonly()
{

http.open('get','canvas.php');
	http.onreadystatechange=handleResponsemenu;
		http.send(null);	

}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function handleResponse3(a)
{ 
	response3=http.responseText;
if (http.readyState == 4)
	{ 
		document.getElementById('content').innerHTML=response3;
	}

	else
	{ 
	}
}
function showpractice(a)
{

http.open('get','work.php?func=showpractice&practice='+a);
	http.onreadystatechange=handleResponse3;
		http.send(null);
}
function showprofiles(a)
{

http.open('get','work.php?func=showprofiles');
	http.onreadystatechange=handleResponse3;
		http.send(null);
}


function handleResponsemenu(a)
{ 
	response3=http.responseText;
if (http.readyState == 4)
	{ 
		document.getElementById('menu').innerHTML=response3;

	}

	else
	{ 
	}
}




function createRequestObject()
{ 
	var ro;
	var browser=navigator.appName;
	if (browser=="Microsoft Internet Explorer")
	{ 

	 ro=new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	else
	{ 
	ro= new XMLHttpRequest();
	}
	return ro;
}
function changepage(a)
	{ 

cookiename="counts";
var day=new Date();
var expire=day.setDate(day.getDate()+3);
var counts=0;
if (document.cookie[counts])
{ 
cookiecount=parseInt(document.cookie.indexOf('counts')+1);
document.cookie=cookiename+"="+cookiecount+";expires="+expire;
}
else
{

document.cookie=cookiename+"=1"+"; expires="+expire;


}
location.href=a+'.php';
/* http.open('get','work.php?func=changepage'+'&content='+a)
	http.onreadystatechange=handleResponse3;
		http.send(null);	*/
	}

function getform(name,phone,matter,email)
{ 
url='work.php?func=sendform&name='+name+'&phonenumber='+phone+'&matter='+matter+'&email='+email;
http.open('get',url)
	http.onreadystatechange=handleResponse3;
		http.send(null);	

}
function changeme(b)
{ 
document.getElementById('activecell').value=b;
http.open('get','work.php?func=changepage&content='+b)
	http.onreadystatechange=handlemenu;
		http.send(null);	


}
function handlemenu()
{ 
var c=document.getElementById('activecell').value
response=http.responseText;
document.getElementById(c).innerHTML='';
 /* document.getElementById(c).innerHTML=response; */
}

var http=createRequestObject();
function getmap(to,from)
{ 
alert(to);
alert(from);
http.open('get','/newsite/sm2/getmap.php?daddr='+from+'&saddr='+to)
	http.onreadystatechange=handlemap
http.send(null);
}
function handlemap()
{
response=http.responseText;
document.getElementById('content').innerHTML=response;

}


function FrontPage_Form1_Validator(theForm)
{

  if (theForm.State.value == '')
  {
    alert('Please enter a value for the \State\ field.');
    theForm.State.focus();
    return (false);
  }

  if (theForm.State.value.length < 2)
  {
    alert('Please enter at least 2 characters in the \State\ field.');
    theForm.State.focus();
    return (false);
  }

  if (theForm.State.value.length > 2)
  {
    alert('Please enter at most 2 characters in the \State\ field.');
    theForm.State.focus();
    return (false);
  }

  if (theForm.ZipCode.value == '' )
  {
    alert('Please enter a value for the \ZipCode\ field.');
    theForm.ZipCode.focus();
    return (false);
  }

  if (theForm.ZipCode.value.length < 5)
  {
    alert('Please enter at least 5 characters in the \ZipCode\ field.');
    theForm.ZipCode.focus();
    return (false);
  }

  if (theForm.ZipCode.value.length > 5)
  {
    alert('Please enter at most 5 characters in the \ZipCode\ field.');
    theForm.ZipCode.focus();
    return (false);
  }

  var checkOK = '0123456789-';
  var checkStr = theForm.ZipCode.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum='' ;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert('Please enter only digit characters in the \ZipCode\ field.');
    theForm.ZipCode.focus();
    return (false);
  }

  if (theForm.HomeAreaCode.value =='' )
  {
    alert('Please enter a value for the \HomeAreaCode\ field.');
    theForm.HomeAreaCode.focus();
    return (false);
  }

  if (theForm.HomeAreaCode.value.length > 3)
  {
    alert('Please enter at most 3 characters in the \HomeAreaCode\ field.');
    theForm.HomeAreaCode.focus();
    return (false);
  }

  var checkOK = '0123456789-';
  var checkStr = theForm.HomeAreaCode.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum='' ;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert('Please enter only digit characters in the \HomeAreaCode\ field.');
    theForm.HomeAreaCode.focus();
    return (false);
  }

  if (theForm.HomePrefixPhone.value =='' )
  {
    alert('Please enter a value for the \HomePrefixPhone\ field.');
    theForm.HomePrefixPhone.focus();
    return (false);
  }

  if (theForm.HomePrefixPhone.value.length > 3)
  {
    alert('Please enter at most 3 characters in the \HomePrefixPhone\ field.');
    theForm.HomePrefixPhone.focus();
    return (false);
  }

  var checkOK = '0123456789-';
  var checkStr = theForm.HomePrefixPhone.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum='' ;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert('Please enter only digit characters in the \HomePrefixPhone\ field.');
    theForm.HomePrefixPhone.focus();
    return (false);
  }

  if (theForm.HomeLastFourPhone.value =='' )
  {
    alert('Please enter a value for the \HomeLastFourPhone\ field.');
    theForm.HomeLastFourPhone.focus();
    return (false);
  }

  if (theForm.HomeLastFourPhone.value.length > 4)
  {
    alert('Please enter at most 4 characters in the \HomeLastFourPhone\ field.');
    theForm.HomeLastFourPhone.focus();
    return (false);
  }

  var checkOK = '0123456789-';
  var checkStr = theForm.HomeLastFourPhone.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum='' ;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert('Please enter only digit characters in the \HomeLastFourPhone\ field.');
    theForm.HomeLastFourPhone.focus();
    return (false);
  }

  if (theForm.OfficeAreaCode.value =='' )
  {
    alert('Please enter a value for the \OfficeAreaCode\ field.');
    theForm.OfficeAreaCode.focus();
    return (false);
  }

  if (theForm.OfficeAreaCode.value.length > 3)
  {
    alert('Please enter at most 3 characters in the \OfficeAreaCode\ field.');
    theForm.OfficeAreaCode.focus();
    return (false);
  }

  var checkOK = '0123456789-';
  var checkStr = theForm.OfficeAreaCode.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum='' ;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert('Please enter only digit characters in the \OfficeAreaCode\ field.');
    theForm.OfficeAreaCode.focus();
    return (false);
  }

  if (theForm.OfficePrefixPhone.value =='' )
  {
    alert('Please enter a value for the \OfficePrefixPhone\ field.');
    theForm.OfficePrefixPhone.focus();
    return (false);
  }

  if (theForm.OfficePrefixPhone.value.length > 3)
  {
    alert('Please enter at most 3 characters in the \OfficePrefixPhone\ field.');
    theForm.OfficePrefixPhone.focus();
    return (false);
  }

  var checkOK = '0123456789-';
  var checkStr = theForm.OfficePrefixPhone.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum='' ;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert('Please enter only digit characters in the \OfficePrefixPhone\ field.');
    theForm.OfficePrefixPhone.focus();
    return (false);
  }

  if (theForm.OfficeLastFourPhone.value =='' )
  {
    alert('Please enter a value for the \OfficeLastFourPhone\ field.');
    theForm.OfficeLastFourPhone.focus();
    return (false);
  }

  if (theForm.OfficeLastFourPhone.value.length > 4)
  {
    alert('Please enter at most 4 characters in the \OfficeLastFourPhone\ field.');
    theForm.OfficeLastFourPhone.focus();
    return (false);
  }

  var checkOK = '0123456789-';
  var checkStr = theForm.OfficeLastFourPhone.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum='' ;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert('Please enter only digit characters in the \OfficeLastFourPhone\ field.');
    theForm.OfficeLastFourPhone.focus();
    return (false);
  }

  var checkOK = '0123456789-';
  var checkStr = theForm.Extension.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum='' ;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert('Please enter only digit characters in the \Extension\ field.');
    theForm.Extension.focus();
    return (false);
  }

  return (true);
}
function checkback()
{ 
return false;
if (document.cookie.indexOf('counts') > 0)
{
changepage('home');
return false;
}

}

