<!-- Hide script from old browsers

// Make sure file is not hosted in a different frameset

if ( top.location.href != window.location.href )
  { top.location.href=window.location.href }

// *****************************************************
function checkAdminLogin(form)
{
	username = form.Username.value;
	if (username == "")
	{
		alert("Моля, въведете потребителско име.");
		form.Username.focus();
		return false;
	}
	
	pass = form.Password.value;
	if (pass == "")
	{
		alert("Моля, въведете парола.");
		form.Password.focus();
		return false;
	}
	else
	{
		return true;
	}	
}

// ************************************************************
function checkChangePassForm(form)
{
	oldpass = form.Oldpass.value;
	if (oldpass == "")
	{
		alert("Моля, въведете старата си парола.");
		form.Oldpass.focus();
		return false;
	}
	
	pass1 = form.Newpass1.value;
	if (pass1 == "")
	{
		alert("Моля, въведете новата парола.");
		form.Newpass1.focus();
		return false;
	}
	
	pass2 = form.Newpass2.value;
	if (pass2 == "")
	{
		alert("Моля, потвърдете новата парола.");
		form.Newpass2.focus();
		return false;
	}
	
	if (pass1.length < 6 || pass1.length > 15)
	{
		alert("Паролата трябва да бъде между 6 и 15 символа. Моля, въведете правилна парола.");
		form.Newpass1.focus();
		return false;
	}
	
	if (pass2 != pass1)
	{
		alert("Паролите въведени от вас не съвпадат. Моля, прнапишете ги.");
		form.Newpass1.focus();
		return false;
	}
}

<!-- Hide script from old browsers


// **************************************************************************************
// AJAX
// **************************************************************************************

function getHTTPObject() {

  var xmlhttp;

  /*@cc_on

  @if (@_jscript_version >= 5)

    try {

      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

    } catch (e) {

      try {

        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

      } catch (E) {

        xmlhttp = false;

      }

    }

  @else

  xmlhttp = false;

  @end @*/

  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {

    try {

      xmlhttp = new XMLHttpRequest();

    } catch (e) {

      xmlhttp = false;

    }

  }

  return xmlhttp;

}

var http = getHTTPObject(); // We create the HTTP Object

/*
function handleHttpResponse() {

	
	
	if (http.readyState == 4) {
		// loading finished
		//document.getElementById('Loading').style.display = "none";
		
		if (http.responseText.indexOf('invalid') == -1)
		{
		
		  // Split the comma delimited response into an array
		
		  results = http.responseText;
		  
		  //document.getElementById('city').value = results[0];
		
		  //document.getElementById('state').value = results[1];
		  		  
		  document.getElementById('requestDiv').innerHTML = results;
		
		  //isWorking = false;
		
		}	
	}
	else if (http.readyState == 1)
	{
		document.getElementById('Loading').style.display = "block";
	}
	else
	{
		document.getElementById('Loading').style.display = "none";
	}
}

function sendRequest(sURL) {

		
	if (http)
	{
	
		//var zipValue = document.getElementById("zip").value;
		
		http.open("GET", sURL, true);
		
		http.onreadystatechange = handleHttpResponse;
		
		//isWorking = true;
		
		http.send(null);
	
	}  
}
*/

// global variable for consultant ID
var divID = 0;

function requestData(sURL) {

		
	if (http)
	{
		//close all divs with clients
		/*
		divTags = document.getElementsByTagName('div');
		for (var i = 0; i < divTags.length; i++)
		{
			if (divTags[i].id.indexOf("showClients") != -1)
			{
				divTags[i].style.display = 'none';
			}
		} 
						
		divID = currentDivId;
		*/
		
		http.open("GET", sURL, true);
		
		http.onreadystatechange = handleClientsList;
		
		http.send(null);
	}
  
}

function handleClientsList() {
	
	/*
	if (http.readyState == 4) {
		// loading finished
		//document.getElementById('consultClients').style.display = "none";
		
		if (http.responseText.indexOf('invalid') == -1)
		{
		
		  // Split the comma delimited response into an array
		  results = http.responseText;
		  
		  document.getElementById('showClients' + divID).style.display = "block";
		  document.getElementById('showClients' + divID).innerHTML = results;
		}
	}
	else if (http.readyState == 1)
	{		
		document.getElementById('showClients' + divID).style.display = "block";
	}
	else
	{
		document.getElementById('showClients' + divID).style.display = "none";
	}
	*/
	if (http.readyState == 4) {
		// loading finished
		//document.getElementById('consultClients').style.display = "none";
		
		if (http.responseText.indexOf('invalid') == -1)
		{
		
		  // Split the comma delimited response into an array
		  results = http.responseText;
		  
		  document.getElementById('contentDiv').style.display = "block";
		  document.getElementById('contentDiv').innerHTML = results;
		}
	}
	else if (http.readyState == 1)
	{		
		document.getElementById('contentDiv').style.display = "block";
	}
	else
	{
		document.getElementById('contentDiv').style.display = "none";
	}
}

// End hiding script from old browsers -->

// End hiding script from old browsers -->