function init(advancedsearch)
{

	var stretchers = document.getElementsByClassName('stretcher');
	var toggles = document.getElementsByClassName('display');

//	var myAccordion = new fx.Accordion(
//		toggles, stretchers, {opacity: false, duration: 400}
//	);

	document.getElementById('easy_search_for_what').focus();

  if(advancedsearch == 'yes'){
    //myAccordion.showThisHideOpen(stretchers[1]);
    getAdvancedSearch('1920181289039182413');
  }
}

function dynamiccontent(iElementID,sContent)
{

	if (document.getElementById && !document.all)
	{
	rng = document.createRange();
	el = document.getElementById(iElementID);
	rng.setStartBefore(el);
	htmlFrag = rng.createContextualFragment(sContent);

	while (el.hasChildNodes())
		el.removeChild(el.lastChild);
		el.appendChild(htmlFrag);
	}

}

function getWords(sLetter)
{
  document.getElementById('stretchercityhead').style.display = 'none';
  document.getElementById('stretcheradvancedhead').style.display = 'none';
  document.getElementById('stretcherprovincehead').style.display = 'none';
  document.getElementById('stretcherwordhead').style.display = 'block';
	dynamiccontent('provincecontent','&nbsp;');
	new ajax ('/site/retrieve/search_words.php?sLetter=' + sLetter, { update: $('searchwordwindow'), method: 'get'});
	document.getElementById('searchwordwindow').scrollTop = 0;
}

function getCities(sLetter)
{
  document.getElementById('stretcheradvancedhead').style.display = 'none';
  document.getElementById('stretcherprovincehead').style.display = 'none';
  document.getElementById('stretcherwordhead').style.display = 'none';
  document.getElementById('stretchercityhead').style.display = 'block';
	dynamiccontent('provincecontent','&nbsp;');
	new ajax ('/site/retrieve/cities.php?sLetter=' + sLetter, { update: $('searchcitywindow'), method: 'get'});
	document.getElementById('searchcitywindow').scrollTop = 0;
}

function getAdvancedSearch(sSession)
{
  document.getElementById('stretchercityhead').style.display = 'none';
  document.getElementById('stretcherprovincehead').style.display = 'none';
  document.getElementById('stretcherwordhead').style.display = 'none';
  document.getElementById('stretcheradvancedhead').style.display = 'block';
	dynamiccontent('provincecontent','&nbsp;');
//	new ajax ('../site/retrieve/advanced_search.php?PHPSESSID=' + sSession, { update: $('advancedcontainer'), method: 'get'});
	new ajax ('/site/retrieve/asearch.php', { update: $('advancedcontainer'), method: 'get'});
}

function getProvince()
{
  document.getElementById('stretchercityhead').style.display = 'none';
  document.getElementById('stretcheradvancedhead').style.display = 'none';
  document.getElementById('stretcherwordhead').style.display = 'none';
  document.getElementById('stretcherprovincehead').style.display = 'block';
  var so = new SWFObject('/site/swf/province.swf', 'province', '500', '300', '6', '#FFFFFF');
  so.write('provincecontent');
}

function SetWhat($sValue)
{
	document.easysearch.easy_search_for_what.value = $sValue;
}

function SetWhere($sValue)
{
	document.easysearch.easy_search_for_where.value = $sValue;
}