function GetPics() {
var dir = location.href.substring(0,location.href.lastIndexOf('/')+1);
var url = location.href.substring(dir.length,location.href.length+1);
var mytype = getQueryVariable("iType");
var TitlePic = 'images/titles/hometitle.gif';

if (url == 'default.asp'){
    TitlePic = 'images/titles/hometitle.gif';
  }
else if (url == 'contactus.asp'){
    TitlePic = 'images/titles/contactitle.gif';
  }
else if (url == 'churchillheights.asp'){
    TitlePic = 'images/titles/churchilltitle.gif';
  }
else if (url == 'prairieview.asp'){
    TitlePic = 'images/titles/prairietitle.gif';
  }
else if (url == 'homestyles.asp'){
    TitlePic = 'images/titles/homestylestitle.gif';
  }
else if (url == 'interiors.asp'){
    TitlePic = 'images/titles/interiorstitle.gif';
  }
else if (url == 'about.asp'){
    TitlePic = 'images/titles/abouttitle.gif';
  }
else if (url == 'locations.asp'){
    TitlePic = 'images/titles/locationstitle.gif';
  }

document.write('<img border="0" src="' + TitlePic + '">'); 
 
}

function GetBGPics() {
var dir = location.href.substring(0,location.href.lastIndexOf('/')+1);
var url = location.href.substring(dir.length,location.href.length+1);
var BGPic = 'images/pageassets/bluehouse.gif';

if (url == 'churchillheights.asp'){
    BGPic = 'images/pageassets/bluesign.gif';
  }
else if (url == 'prairieview.asp'){
    BGPic = 'images/pageassets/bluearlington.gif';
  }
document.write('<td width="100%" valign="top" align="center" background="' + BGPic + '">'); 
 
}

function GetTopPic() {
var dir = location.href.substring(0,location.href.lastIndexOf('/')+1);
var url = location.href.substring(dir.length,location.href.length+1);
var BGPic = 'images/pageassets/houses.jpg';

if (url == 'prairieview.asp'){
    BGPic = 'images/pageassets/pvhouses.jpg';
  }
document.write('<td width="100%" background="' + BGPic + '" valign="bottom" align="center" >'); 
 
}

function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  }
} 


function randomnum() {
var random_num = (Math.round((Math.random()*7)+1));

document.write('<img border="0" src="images/header' + random_num + '.jpg">');
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=350,left = 312,top = 134');");
}


function changeTextBox(Fieldvalues, mybox1, mybox2){

var fields_array = Fieldvalues.split(" - ");

    mybox1.value=fields_array[0];
    mybox2.value=fields_array[1];

}
function openWindow (url,name,widgets) 
{
	popupWin = window.open (url,name,widgets);
	popupWin.opener.top.name="opener";
	popupWin.focus();
}
function escramble(name,dom,text){
 var a,b,c,d,e,f,g,h,i
 a='<a href=\"mai'
 b=name
 c='\">'
 a+='lto:'
 b+='@'
 e='</a>'
 f=text
 b+=dom
 g='<img src=\"'
 h=''
 i='\" alt=text border="0">'

 if (f) d=f
 else if (h) d=g+h+i
 else d=b

 document.write(a+b+c+d+e)

function VerifyData()
{
	if (isTitle() && isShortDescription() && isDescription())
	{	
	return true;
	}
	else
	return false;
}


	function isTitle()
{
	smut=" !";
	cmp="sex babes shit fuck damn porno < > cunt prick pecker ass "
	+"asshole pedophile man-boy man/boy dong twat ";
	txt=document.forms[1].txtTitle.value;
	tstx="";

		if (document.forms[1].txtTitle.value == '')
		{
		alert("I'm sorry. Title cannot be empty, as it is used to view your posting details");
		document.forms[1].txtTitle.focus();
		return false;
	}
		else
		for (var i=0;i<16;i++)
		{
		pos=cmp.indexOf(" ");
		wrd=cmp.substring(0,pos);
		wrdl=wrd.length
		cmp=cmp.substring(pos+1,cmp.length);
		while (txt.indexOf(wrd)>-1)
		{
		pos=txt.indexOf(wrd);
		txt=txt.substring(0,pos)+smut.substring(0,wrdl)
		+txt.substring((pos+wrdl),txt.length);
		  }
		}
		document.forms[1].txtTitle.value=txt;
		return true;
	
}

	function isShortDescription()
{
	smut=" !";
	cmp="sex babes shit fuck damn porno < > cunt prick pecker ass "
	+"asshole pedophile man-boy man/boy dong twat ";
	txt=document.forms[1].txtShortDescription.value;
	tstx="";

		if (document.forms[1].txtShortDescription.value == '')
		{
		alert("I'm sorry. The -Short Description- field cannot be empty");
		document.forms[1].txtShortDescription.focus();
		return false;
	}
		else
		for (var i=0;i<16;i++)
		{
		pos=cmp.indexOf(" ");
		wrd=cmp.substring(0,pos);
		wrdl=wrd.length
		cmp=cmp.substring(pos+1,cmp.length);
		while (txt.indexOf(wrd)>-1)
		{
		pos=txt.indexOf(wrd);
		txt=txt.substring(0,pos)+smut.substring(0,wrdl)
		+txt.substring((pos+wrdl),txt.length);
		  }
		}
		document.forms[1].txtShortDescription.value=txt;
		return true;
	
}
function isDescription()
{
	smut=" !";
	cmp="sex babes shit fuck damn porno < > cunt prick pecker ass "
	+"asshole pedophile man-boy man/boy dong twat ";
	txt=document.forms[1].txtDescription.value;
	tstx="";

		if (document.forms[1].txtDescription.value == '')
		{
		alert("I'm sorry. The -Description- field cannot be empty");
		document.forms[1].txtDescription.focus();
		return false;
	}
		else
		for (var i=0;i<16;i++)
		{
		pos=cmp.indexOf(" ");
		wrd=cmp.substring(0,pos);
		wrdl=wrd.length
		cmp=cmp.substring(pos+1,cmp.length);
		while (txt.indexOf(wrd)>-1)
		{
		pos=txt.indexOf(wrd);
		txt=txt.substring(0,pos)+smut.substring(0,wrdl)
		+txt.substring((pos+wrdl),txt.length);
		  }
		}
		document.forms[1].txtDescription.value=txt;
		return true;
	
}

}

function KeyCheck(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (((keycode>47) && (keycode<58) )  || (keycode==8)) { return true; }
else return false;
}


function openWindow (url,name,widgets) 
{
	popupWin = window.open (url,name,widgets);
	popupWin.opener.top.name="opener";
	popupWin.focus();
}

