	function openWindow(u,w,h)
		{
	
		var winWidth = w;
		var winHeight = h;
		var leftPos = 0;
		var topPos = 0;
				
		if(screen){leftPos = (screen.availWidth - winWidth)/2}
		if(screen){topPos = (screen.availHeight - winHeight)/2}
			
		var newWindow = window.open(u,"details","width="+winWidth+",height="+winHeight+",left="+leftPos+",top="+topPos+",scrollbars=yes,location=no,status=no,resizable=yes");			
		newWindow.focus();
		}
	
	function showMap()
		{
	
		var winWidth = 670;
		var winHeight = 508;
		var leftPos = 0;
		var topPos = 0;
				
		if(screen){leftPos = (screen.availWidth - winWidth)/2}
		if(screen){topPos = (screen.availHeight - winHeight)/2}
			
		var newWindow = window.open("map.asp","map","width="+winWidth+",height="+winHeight+",left="+leftPos+",top="+topPos+",scrollbars=no,location=no,status=no,resizable=yes");			
		newWindow.focus();

		}
	
		
	function showAmenities(i)
		{
		var winWidth = 640;
		var winHeight = 540;
		var leftPos = 0;
		var topPos = 0;
				
		if(screen){leftPos = (screen.availWidth - winWidth)/2}
		if(screen){topPos = (screen.availHeight - winHeight)/2}
			
		var newWindow = window.open("amenities.asp?pid="+i,"amenities","width="+winWidth+",height="+winHeight+",left="+leftPos+",top="+topPos+",scrollbars=no,location=no,status=no,resizable=yes");			
		newWindow.focus();
		}
		
	function showCreditApp(i)
		{
		var winWidth = 656;
		var winHeight = 540;
		var leftPos = 0;
		var topPos = 0;
				
		if(screen){leftPos = (screen.availWidth - winWidth)/2}
		if(screen){topPos = (screen.availHeight - winHeight)/2}

		//alert("We are sorry this application is not currently available. Please try again later.");
			
		//var newWindow = window.open("https://www.warrenproperties.com/apps/credit_app.aspx?pid="+i,"credit","width="+winWidth+",height="+winHeight+",left="+leftPos+",top="+topPos+",scrollbars=yes,location=no,status=yes,resizable=yes");
		var newWindow = window.open("https://www.warrenproperties.com/apps/credit_app.aspx?pid="+i,"credit","width="+winWidth+",height="+winHeight+",left="+leftPos+",top="+topPos+",scrollbars=yes,location=no,status=yes,resizable=yes");										
		newWindow.focus();
		}
		
	function showEmploymentApp()
		{
		var winWidth = 820;
		var winHeight = 540;
		var leftPos = 0;
		var topPos = 0;
				
		if(screen){leftPos = (screen.availWidth - winWidth)/2}
		if(screen){topPos = (screen.availHeight - winHeight)/2}

		//alert("We are sorry this application is not currently available. Please try again later.");
			
		//var newWindow = window.open("https://www.danasg.com/warrenproperties/employment_appv1.aspx","employment","width="+winWidth+",height="+winHeight+",left="+leftPos+",top="+topPos+",scrollbars=yes,location=no,status=yes,resizable=yes");
		var newWindow = window.open("https://www.warrenproperties.com/apps/employment_app.aspx","employment","width="+winWidth+",height="+winHeight+",left="+leftPos+",top="+topPos+",scrollbars=yes,location=no,status=yes,resizable=yes");						
		newWindow.focus();
		}
		
		
	function showPictures(p,n)
		{
		var winWidth = 640;
		var winHeight = 480;
		var leftPos = 0;
		var topPos = 0;
				
		if(screen){leftPos = (screen.availWidth - winWidth)/2}
		if(screen){topPos = (screen.availHeight - winHeight)/2}
			
		var newWindow = window.open("pictures.asp?p="+p+"&n="+n,"winPic","width="+winWidth+",height="+winHeight+",left="+leftPos+",top="+topPos+",scrollbars=no,location=no,status=no,resizable=no");			
		newWindow.focus();
		}
		
	function showLocations()
		{
		if(document.quicksearch.states.value != "")
			{
			window.location="property_locations.asp?state="+document.quicksearch.states.value;
			}
		}
		
	function showAdministrator()
		{
		var winWidth = 770;
		var winHeight = 540;
		var leftPos = 0;
		var topPos = 0;
			
		var newWindow = window.open("admin/default.asp","admin","width="+winWidth+",height="+winHeight+",left="+leftPos+",top="+topPos+",scrollbars=yes,location=no,status=no,resizable=no");			
		newWindow.focus();
		}
		
		
	function stripCharsNotInBag (s, bag)
		{   
		var i;
		var returnString = "";

		// Search through string's characters one by one.
		// If character is in bag, append to returnString.

		for (i = 0; i < s.length; i++)
			{   
		   // Check that current character isn't whitespace.
		   var c = s.charAt(i);
		   if (bag.indexOf(c) != -1) returnString += c;
			}

		return returnString;
		}