function showZipForm(status)
{
	//alert('here');
	if(status == 1)
	{
		document.getElementById('zipForm').style.display = 'block';
	}
	else
	{
		document.getElementById('zipForm').style.display = 'none';
	}
	backgroundFilter();
}


function placeIt(objName)
{
	//alert('obj = ' + objName);
	obj = document.getElementById(objName);
	//if (document.documentElement)
	if(false)
	{
		//alert('documentElement');
		theLeft = document.documentElement.scrollLeft;
		theTop = document.documentElement.scrollTop;
	}
	else if (document.body)
	{
		//alert('document body');
		theLeft = document.body.scrollLeft;
		theTop = document.body.scrollTop;
	}
	theLeft += x;
	theTop += y;
	//alert('theleft = ' + theLeft + ' thetop = ' + theTop);
	obj.style.left = theLeft + 'px' ;
	obj.style.top = theTop + 'px' ;
	//alert('left = ' + obj.style.left + ' top = ' + obj.style.top);
	setTimeout("placeIt('zipForm')",500);
}

function backgroundFilter()

{

    var div;

    if(document.getElementById)

    // Standard way to get element

    div = document.getElementById('backgroundFilter');

    else if(document.all)

    // Get the element in old IE's

    div = document.all['backgroundFilter'];   

    // if the style.display value is blank we try to check it out here

    if(div.style.display== '' && div.offsetWidth != undefined&&div.offsetHeight != undefined)

    {

        div.style.display = (div.offsetWidth!=0 && div.offsetHeight!=0)?'block':'none';

    }

    // If the background is hidden ('none') then it will display it ('block').

    // If the background is displayed ('block') then it will hide it ('none').

    div.style.display = (div.style.display==''||div.style.display=='block')?'none':'block';

}

function validateZipForm()
{
	
	if(document.formZip.zip.value.length < 5)
	{
		alert('Please enter a valid Zipcode.');
	}
	else
	{
		xmlHttp_zip = getHttpRequestObject();
		if (xmlHttp_zip) 
		{			
			urlZip = 'http://dotschools.com/API/checkZipCodeExists.php?zip=' + document.formZip.zip.value;
			
			xmlHttp_zip.open('POST', urlZip, true);
			xmlHttp_zip.onreadystatechange = function() {
				if (xmlHttp_zip.readyState == 4)  
				{
					if (xmlHttp_zip.status == 200)
					{
						var result = xmlHttp_zip.responseText;
						
						if (result==0)
						{
							alert('Invalid ZipCode.');
							
						}
						else
						{
							document.formZip.submit();
						}
						xmlHttp_zip.abort();
						return false;
					}
				}
			}
			xmlHttp_zip.send(null);
		}
		
	}
}