
var xmlHttp
function showCustomer(str1, str2)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

if(document.frmlogin.txtlogin.value == "")
{
alert("Please insert username!");
document.frmlogin.txtlogin.focus();
return;
}

if(document.frmlogin.txtpwd.value == "")
{
alert("Please insert password!");
document.frmlogin.txtpwd.focus();
return;
}

var url="getmember.asp";
url=url+"?l="+str1+"&p="+str2;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);


document.frmlogin.txtpwd.value = "";
document.frmlogin.txtlogin.value = "";
document.frmlogin.txtlogin.focus();

}

function stateChanged() 
{ 
	if (xmlHttp.readyState==4)
	{ 
	document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
	}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

function ChangeBoxes()
{
	if (document.form2.selpart.value == "Equipments")
	{
		document.form2.pno.disabled = true;
		document.form2.pno.value = "Disabled";
	}
	else
	{
		document.form2.pno.disabled = false;
		document.form2.pno.value = "";
	}
}


function ChangeBoxes1()
{
	if (document.formu.selpart2.value == "Equipments")
	{
		document.formu.pno2.disabled = true;
		document.formu.pno2.value = "Disabled";
	}
	else
	{
		document.formu.pno2.disabled = false;
		document.formu.pno2.value = "";
	}
}



function ValidateForm2(){
	
		// Part Number
		if(document.form2.pno.value == "")
		{
		alert("Please Enter Parts Number");
		document.form2.pno.focus();
		return false;
		}
		
		//Make
		if(document.form2.txtmake.value == "")
		{
		alert("Please Enter Make");
		document.form2.txtmake.focus();
		return false;
		}
		
		//Model
		if(document.form2.txtmodel.value == "")
		{
		alert("Please Enter Model");
		document.form2.txtmodel.focus();
		return false;
		}
		
		//Description
		if(document.form2.txtdes.value == "")
		{
		alert("Please Enter  the Descriptions");
		document.form2.txtdes.focus();
		return false;
		}
		
		//Quantity
		if(document.form2.txtq.value == "")
		{
		alert("Please Enter Quantity");
		document.form2.txtq.focus();
		return false;
		}
	
		//Quantity
		if(document.form2.txtmsg.value == "")
		{
		alert("Please Enter Message");
		document.form2.txtmsg.focus();
		return false;
		}

return true
}



function showform()
{
			if(document.formu.pno2.value == "")
			{
			document.form2.selpart.value = document.formu.selpart2.value;
			document.form2.pno.value = "Unknown Number";
			document.getElementById('c1').style.display = ""; 
			document.getElementById('dform').style.display='none';
			document.getElementById('uform').style.display = "";
			document.form2.txtmake.focus();
			}
			else
			{
			document.getElementById('c1').style.display = ""; 
			document.getElementById('dform').style.display='none';
			document.getElementById('uform').style.display = "";
			document.form2.selpart.value = document.formu.selpart2.value;
			document.form2.pno.value = document.formu.pno2.value;
			document.form2.txtdes.focus();
			}
}


function hideform()
{
document.getElementById('dform').style.display = ""; 
document.getElementById('c1').style.display='none';
document.getElementById('uform').style.display='none';
}


function sizee()
	{
	var txtbos;
	txtbos = document.myform.keyword.value;
	window.open('http://www.digimap.pk/SearchEngine/resultpagepost.aspx?keyword="' + txtbos + '"','Fasial','toolbar=no,location=no,status=no');
	document.myform.submit();
	}



function ValidateForm1(){
		
		
		// Area Size
		if(document.form3.txtlogin.value == "")
		{
		alert("Please Enter Login ID");
		document.form3.txtlogin.focus();
		return false;
		}
		
		//CAddress
		if(document.form3.txtpwd.value == "")
		{
		alert("Please Enter  the Password");
		document.form3.txtpwd.focus();
		return false;
		}
	

return true
}

// calculate the ASCII code of the given character
//========================================================================
function CalcKeyCode(aChar) {
  var character = aChar.substring(0,1);
  var code = aChar.charCodeAt(0);
  return code;
}

function checkNumber(val) {
  var strPass = val.value;
  var strLength = strPass.length;
  var lchar = val.value.charAt((strLength) - 1);
  var cCode = CalcKeyCode(lchar);

  /* Check if the keyed in character is a number
     do you want alphabetic UPPERCASE only ?
     or lower case only just check their respective
     codes and replace the 48 and 57 */

  if (cCode < 48 || cCode > 57 ) {
    var myNumber = val.value.substring(0, (strLength) - 1);
    val.value = myNumber;
  }
  return false;
}

//===============================================================

function removePreloader1()
{
		var elem1 = document.getElementById('sform_preloader');
		elem1.style.display = 'none';
		elem1.style.visibility = 'hidden';
		elem1 = document.getElementById('sform_container');
		elem1.style.visibility='visible';
		elem1.style.display = 'block';
				
}

function removePreloader2()
{
		
		var elem2 = document.getElementById('wform_preloader');
		elem2.style.display = 'none';
		elem2.style.visibility = 'hidden';
		elem2 = document.getElementById('wform_container');
		elem2.style.visibility='visible';
		elem2.style.display = 'block';
				
}

function removePreloader3()
{
		var elem3 = document.getElementById('rform_preloader');
		elem3.style.display = 'none';
		elem3.style.visibility = 'hidden';
		elem3 = document.getElementById('rform_container');
		elem3.style.visibility='visible';
		elem3.style.display = 'block';
		
}

function removePreloader4()
{
		var elem4 = document.getElementById('spform_preloader');
		elem4.style.display = 'none';
		elem4.style.visibility = 'hidden';
		elem4 = document.getElementById('spform_container');
		elem4.style.visibility='visible';
		elem4.style.display = 'block';
		
}

function removePreloader5()
{
		var elem5 = document.getElementById('rpform_preloader');
		elem5.style.display = 'none';
		elem5.style.visibility = 'hidden';
		elem5 = document.getElementById('rpform_container');
		elem5.style.visibility='visible';
		elem5.style.display = 'block';
		
}

function removePreloader6()
{
		var elem6 = document.getElementById('aform_preloader');
		elem6.style.display = 'none';
		elem6.style.visibility = 'hidden';
		elem6 = document.getElementById('aform_container');
		elem6.style.visibility='visible';
		elem6.style.display = 'block';
		
}


function start() 
{
  removePreloader1();
 // removePreloader2();
 // removePreloader3();
  removePreloader4();
  removePreloader5();
  removePreloader6();
  }
window.onload = start;

function showwebdir()
{

	document.getElementById('showwd').style.display = "";
	document.getElementById('webdir').style.display='none';
	webdir.location.href = "WebDir/mainCat.aspx?vloader=1";
}

function showre()
{
	document.getElementById('showre').style.display = "";
	document.getElementById('Reclick').style.display='none';
	RE.location.href = "RealEstate/PropertyByAreaasp.asp?vloader=1";
}