    
   	if (document.images) {


	homeplanson = new Image();          
	homeplanson.src = "http://www.homesaledirectory.com/siteimages/homeplans_on.gif";  
	homeplansoff = new Image();          
	homeplansoff.src = "http://www.homesaledirectory.com/siteimages/homeplans_off.gif"; 
	
	yellowpageson = new Image();          
	yellowpageson.src = "http://www.homesaledirectory.com/siteimages/yellowpages_on.jpg";  
	yellowpagesoff = new Image();          
	yellowpagesoff.src = "http://www.homesaledirectory.com/siteimages/yellowpages_off.jpg"; 
   	
	findhomeon = new Image();          
	findhomeon.src = "http://www.homesaledirectory.com/siteimages/findhome_on.gif";  
	findhomeoff = new Image();          
	findhomeoff.src = "http://www.homesaledirectory.com/siteimages/findhome_off.gif"; 


	sellhomeon = new Image();          
	sellhomeon.src = "http://www.homesaledirectory.com/siteimages/sellhome_on.gif";  
	sellhomeoff = new Image();          
	sellhomeoff.src = "http://www.homesaledirectory.com/siteimages/sellhome_off.gif"; 


	loghomebuilderson = new Image();          
	loghomebuilderson.src = "http://www.homesaledirectory.com/siteimages/loghomebuilders_on.gif";  
	loghomebuildersoff = new Image();          
	loghomebuildersoff.src = "http://www.homesaledirectory.com/siteimages/loghomebuilders_off.gif";
	
	findloghomeon = new Image();          
	findloghomeon.src = "http://www.homesaledirectory.com/siteimages/findloghomes_on.gif";  
	findloghomeoff = new Image();          
	findloghomeoff.src = "http://www.homesaledirectory.com/siteimages/findloghomes_off.gif";
	
	buildhomeon = new Image();          
	buildhomeon.src = "http://www.homesaledirectory.com/siteimages/buildhome_on.gif";  
	buildhomeoff = new Image();          
	buildhomeoff.src = "http://www.homesaledirectory.com/siteimages/buildhome_off.gif";


	findmortgageon = new Image();          
	findmortgageon.src = "http://www.homesaledirectory.com/siteimages/findmortgage_on.gif";  
	findmortgageoff = new Image();          
	findmortgageoff.src = "http://www.homesaledirectory.com/siteimages/findmortgage_off.gif";
	
	findmoveron = new Image();          
	findmoveron.src = "http://www.homesaledirectory.com/siteimages/findmover_on.gif";  
	findmoveroff = new Image();          
	findmoveroff.src = "http://www.homesaledirectory.com/siteimages/findmover_off.gif"; 


	findcontractoron = new Image();          
	findcontractoron.src = "http://www.homesaledirectory.com/siteimages/findcontractor_on.gif";  
	findcontractoroff = new Image();          
	findcontractoroff.src = "http://www.homesaledirectory.com/siteimages/findcontractor_off.gif"; 


	}
	function img_act(imgName) {


              if (document.images) {
               imgOn = eval(imgName+"on.src");
               document [imgName].src = imgOn;
               }
	}
	function img_inact(imgName) {
            if (document.images) {
               imgOff = eval(imgName + "off.src");
               document [imgName].src = imgOff;
           		}
           	}


function ChangeText(blnChecked, divName){
	//alert(divName);
	if(blnChecked){
		document.getElementById(divName).className = 'cbHighlight';
	}
	else{
		document.getElementById(divName).className = 'lightText';
	}
}


function change_form(){ site_search_form.change.value = 1; if(site_search_form.c.options[site_search_form.c.selectedIndex].value != '') site_search_form.submit(); }


            function subm() {
            el1=document.getElementById("by_city");
            if (el1.value == " - Enter a City - ")
            {
            el1.value = '0';
            }
            el2=document.getElementById("by_zip_code");
            if (el2.value == "- Enter Zip Code -")
            {
            el2.value = '0';
            }
            return true;
            //document.site_search_form.submit();
            }
			
function win(fileName) {
	myFloater = window.open('','myWindow','scrollbars=yes,status=no,width=300,height=300')
	myFloater.location.href = fileName;
}
function winimage(fileName,width,height) {
	myFloater = window.open('','myWindow','scrollbars=yes,resizable=yes,status=no,width=' + width + ',height=' + height)

	myFloater.location.href = fileName;
}


function getCookie( name ) {
  var start = document.cookie.indexOf( name + "=" );
  var len = start + name.length + 1;
  if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
    return null;
  }
  if ( start == -1 ) return null;
  var end = document.cookie.indexOf( ";", len );
  if ( end == -1 ) end = document.cookie.length;
  return unescape( document.cookie.substring( len, end ) );
}


function setCookie( name, value, expires, path, domain, secure ) {
  var today = new Date();
  today.setTime( today.getTime() );
  if ( expires ) {
    expires = expires * 1000 * 60 * 60 * 24;
  }
  var expires_date = new Date( today.getTime() + (expires) );
  document.cookie = name+"="+escape( value ) +
    ( ( expires ) ? ";expires="+expires_date.toGMTString() : "" ) + //expires.toGMTString()
    ( ( path ) ? ";path=" + path : "" ) +
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ( ( secure ) ? ";secure" : "" );
}


function deleteCookie( name, path, domain ) {
  if ( getCookie( name ) ) document.cookie = name + "=" +
    ( ( path ) ? ";path=" + path : "") +
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}


var theImages = new Array()
theImages[0] = "http://www.homesaledirectory.com/images/misc/pic1.jpg";
theImages[1] = "http://www.homesaledirectory.com/images/misc/pic_a.jpg";
theImages[2] = "http://www.homesaledirectory.com/images/misc/pic_b.jpg";
theImages[3] = "http://www.homesaledirectory.com/images/misc/greystokes.jpg";
theImages[4] = "http://www.homesaledirectory.com/images/misc/applog2.jpg";
theImages[5] = "http://www.homesaledirectory.com/images/misc/pic2.jpg";
theImages[6] = "http://www.homesaledirectory.com/images/misc/pic3.jpg";
theImages[7] = "http://www.homesaledirectory.com/images/misc/applog3.jpg";
theImages[8] = "http://www.homesaledirectory.com/images/misc/pic4.jpg";
theImages[9] = "http://www.homesaledirectory.com/images/misc/pic6.jpg";


//deleteCookie("imagenumber", "/", ".homesaledirectory.com");
if (getCookie("imagenumber")==null){
	setCookie( "imagenumber", 0, "", "/", ".homesaledirectory.com", 0 );
	var whichImage = 0;
} else {
	var thisimage = getCookie("imagenumber");
	var nextimage = parseFloat(thisimage)+1;
	if (nextimage==8){nextimage="0";}
	setCookie( "imagenumber", nextimage, "", "/", ".homesaledirectory.com", 0 );
	var whichImage = nextimage;
}
   preBuffer = new Image();
   preBuffer.src = theImages[whichImage];
function showImage(){
	if (whichImage=="0"){
		document.write('<a href="http://www.srloghomes.com/contactus.php" target="_blank">');
	}
	if (whichImage=="1" || whichImage=="4" || whichImage=="7"){

		document.write('<a href="http://www.applog.com/index.htm" target="_blank">');
	}
	if (whichImage=="2"){
		document.write('<a href="http://www.kodiaksteelhomes.com/" target="_blank">');
	}
	if (whichImage=="3"){
		document.write('<a href="http://www.greystokes.com/" target="_blank">');
	}
	document.write('<img src="'+theImages[whichImage]+'" border="0">');
	if (whichImage=="0" || whichImage=="1" || whichImage=="2" || whichImage=="3"){
		document.write('</a>');
	}
}


function checkrequired(which) {
var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if (tempobj.name.substring(0,8)=="required") {
if (((tempobj.type=="text"||tempobj.type=="textarea")&&
tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
tempobj.selectedIndex==0)) {
pass=false;
break;
         }
      }
   }
}
if (!pass) {
shortFieldName=tempobj.name.substring(8,30).toUpperCase();
alert("Please provide some information for: "+shortFieldName+" before submitting this form.");
return false;
}
else
return true;
}