function pageinit() {
	var hrf=window.location.href;
	if (hrf.indexOf('?')>0) { hrf=hrf.substr(0,hrf.indexOf('?')); }
	hrf=hrf.replace(/\.htm/gi,'');
	var y=hrf.lastIndexOf('\/');
	if (y<0) {y=hrf.lastIndexOf('\\'); }
	var pg=hrf.substr(y+1);
	if (pg=='') { pg='index'; }
	hrf='pics/'+pg+'.gif';

	var s='';
	switch (pg.toLowerCase()) {

	case '':
	case '/':
	case 'index': {
//		s='<IMG title=stilbaai height=37 alt=welcome.gif src="pics/welcome.gif" width=430><BR><IMG title=stillbay height=60 alt=home.jpg src="pics/home.jpg" width=430>';
//		s='<TABLE cellSpacing=0 cellPadding=0 align=center><TR><TD><IMG title="Properties in Stilbaai" height=50 alt=stilbaai_properties.jpg src="pics/stilbaai_properties.jpg" width=100><IMG title="Properties in Jongensfontein" height=50 alt=jongensfontein_sml_txt.jpg src="pics/jongensfontein_properties.jpg" width=100><IMG title="Riversdale properties" height=50 alt=riversdale_sml_txt.jpg src="pics/riversdale_properties.jpg" width=100><IMG title="Farms and Small Holdings for sale" height=50 alt=farms_properties.jpg src="pics/farms_properties.jpg" width=100></TD></TR><TR><TD align=middle><IMG title="Developments for sale" height=50 alt=developments_properties.jpg src="pics/developments_properties.jpg" width=100><IMG title="Commercial Properties" height=50 alt=commercial_properties.jpg src="pics/commercial_properties.jpg" width=100><IMG title="Beach properties and elsewhere" height=50 alt=beach_properties.jpg src="pics/beach_properties.jpg" width=100><IMG title="" height=50 alt=click_property.jpg src="pics/click_property.jpg" width=100></TD></TR></TABLE>';
		s='<A href="map.htm" target=_blank><img src=pics/map_index.jpg border=0 title="ZA Properties area - Click to enlarge" alt="ZA Properties map"></a>';
		break; }

	case 'about_us': {
		s='<img src=pics/about.jpg title="About ZA Properties" alt="About ZA Properties">';
		break; }

	case 'properties_display': {
//		s='<img src=pics/propertiestitle.gif title="Properties for sale by ZA Properties" alt="ZA Properties">';
//		var style=' onclick="sel.proptype.options(#).selected=true; showframe();" style="cursor: hand"';
		var purl="'properties_display.htm?type_#'";
		var style=' onclick="window.location.href='+purl+';" style="cursor: pointer"';
		s='<TABLE cellSpacing=0 cellPadding=0 align=center><TR><TD>';
		s+='<IMG title="Properties in Stilbaai" height=50 alt=stilbaai_properties.jpg src="pics/stilbaai_properties.jpg" width=100'+style.replace(/#/,'0')+'>';
		s+='<IMG title="Properties in Jongensfontein" height=50 alt=jongensfontein_sml_txt.jpg src="pics/jongensfontein_properties.jpg" width=100'+style.replace(/#/,'1')+'>';
		s+='<IMG title="Riversdale properties" height=50 alt=riversdale_sml_txt.jpg src="pics/riversdale_properties.jpg" width=100'+style.replace(/#/,'2')+'>';
		s+='<IMG title="Farms and Small Holdings for sale" height=50 alt=farms_properties.jpg src="pics/farms_properties.jpg" width=100'+style.replace(/#/,'3')+'>';
		s+='</TD></TR><TR><TD align=middle>';
		s+='<IMG title="Developments for sale" height=50 alt=developments_properties.jpg src="pics/developments_properties.jpg" width=100'+style.replace(/#/,'4')+'>';
		s+='<IMG title="Commercial Properties" height=50 alt=commercial_properties.jpg src="pics/commercial_properties.jpg" width=100'+style.replace(/#/,'5')+'>';
		s+='<IMG title="Beach properties and elsewhere" height=50 alt=beach_properties.jpg src="pics/beach_properties.jpg" width=100'+style.replace(/#/,'6')+'>';
		s+='<IMG title="" height=50 alt=click_property.jpg src="pics/click_property.jpg" width=100>';
		s+='</TD></TR></TABLE>';
		break; }

	case 'buyers': {
		s='<img src=pics/buyerstitle.gif title="Let ZA Properties find your dream property" alt="ZA Properties">';
		break; }

	case 'sellers': {
		s='<img src=pics/sellerstitle.gif title="Let ZA Properties find your dream property" alt="ZA Properties">';
		break; }

	case 'accommodation': {
		s='<img src=pics/accommodationtitle.gif title="Let ZA Properties find you accommodation" alt="ZA Properties">';
		break; }

	case 'contact': {
		s='<span class=style1 style="width: 98%"><center><IMG height=100 alt=bergert2.jpg src="pics/bergert2_79.jpg" width=79 align=right><b><br><br>Use the form below to send us an SMS message, to get our contact details sent via SMS to your phone, or to get our contact details emailed to you.</b></center></span>';
		break; }

	case 'thank_you': {
		s='<span class=style1><center><b>THANK YOU FOR CONTACTING ZA PROPERTIES<br>WE WILL RESPOND TO YOUR ENQUIRY ASAP</b></center></span>';
		break; }
		
	default: {
		s='<center><span class=details_heading>'+cell_title.innerHTML+'</span></center>';
		s+='<br><br><center><span class=details_price>'+cell_price.innerHTML+'</span></center>';
		hrf='pics/property_details.gif';
		}
	}
	titlepic.src=hrf;
	titletxt.innerHTML=s;
//alert(hrf);
}

