if(document.domain == 'www.unbiased.co.uk')
	subfolder = '/find-a-solicitor';
else
	subfolder = '';

function show_tabs(id)
{
	document.getElementById("tab_form").style.display = "block";
	document.getElementById("form_form1_bottom").style.display = "block";
}


function show_help(id)
{
	document.getElementById("helpbox_"+id).style.display = "block";
	return false;
}

function hide_help(id)
{
	document.getElementById("helpbox_"+id).style.display = "none";
	return false;
}

function toggle_help(id)
{
	if(document.getElementById("helpbox_"+id).style.display == "none")
		return show_help(id);
	else
		return hide_help(id);
}

function show_solicitor_extra(id)
{
	document.getElementById("sol_block_"+id+"_extra").style.display = "block";
	document.getElementById("sol_toggle_"+id).src = subfolder+"/search/images/hide.gif";
	document.getElementById("sol_toggle_"+id).alt = "hide";
	return false;
}

function hide_solicitor_extra(id)
{
	document.getElementById("sol_block_"+id+"_extra").style.display = "none";
	document.getElementById("sol_toggle_"+id).src = subfolder+"/search/images/show.gif";
	document.getElementById("sol_toggle_"+id).alt = "expand";
	return false;
}

function toggle_solicitor_extra(id)
{
	if(document.getElementById("sol_block_"+id+"_extra").style.display == "none")
		return show_solicitor_extra(id);
	else
		return hide_solicitor_extra(id);
}

function set_value(id, val)
{
	document.getElementById(id).value=val;
}

function trigger(trigger_id, to_toggle_id, trigger_value)
{
	
	trigger_select = document.getElementById(trigger_id);
	
	if(trigger_select.options[trigger_select.selectedIndex].value != trigger_value)
		document.getElementById(to_toggle_id).style.display = "none";
	else
		document.getElementById(to_toggle_id).style.display = "block";			
}

function show_form2()
{
	form1 = document.getElementById("form_form1");
	form1.style.display = "none";
	document.getElementById("tab_form1").setAttribute("class", "ifa_search_inactive ifa_search_tab"); 
	document.getElementById("tab_form1").setAttribute("className", "ifa_search_inactive ifa_search_tab");

	form2 = document.getElementById("form_form2");
	form2.style.display = "block";
	document.getElementById("tab_form2").setAttribute("class", "ifa_search_active ifa_search_tab"); 
	document.getElementById("tab_form2").setAttribute("className", "ifa_search_active ifa_search_tab");
}

function show_form1()
{
	form2 = document.getElementById("form_form2");
	form2.style.display = "none";
	document.getElementById("tab_form2").setAttribute("class", "ifa_search_inactive ifa_search_tab"); 
	document.getElementById("tab_form2").setAttribute("className", "ifa_search_inactive ifa_search_tab");
	
	form1 = document.getElementById("form_form1");
	form1.style.display = "block";
	document.getElementById("tab_form1").setAttribute("class", "ifa_search_active ifa_search_tab"); 
	document.getElementById("tab_form1").setAttribute("className", "ifa_search_active ifa_search_tab");
}

function open_callme(id, path)
{
	window.open(path+'id/'+id+'/','callme'+id, 'width=450, height=500, resizable="no", scrollbars="no", toolbar="no", location="no", directories="no", status="no", menubar="no"');
	return false;	
}

function createMarker(point, html) {
	var marker = new GMarker(point);
	GEvent.addListener(marker, 'click', function() {
	  marker.openInfoWindowHtml(html);
 	 });
  return marker;
}

function gmap_load(html, lat, lng) {
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("mapcon"));
    var point = new GLatLng(lat, lng);
	map.setCenter(point, 15);
	marker = createMarker(point, html);
    map.addOverlay(marker);
  	marker.openInfoWindowHtml(html);
  	map.addControl(new GLargeMapControl())
  	map.addControl(new GMapTypeControl()); 

  }
}

function toggle_qual_level($show)
{
	if($show)
		document.getElementById('show_levels').style.display = 'block';	
	else
		document.getElementById('show_levels').style.display = 'none';
}


function popup(url) {
	newwindow=window.open(url,'name','height=800,width=1000');
	if (window.focus) {newwindow.focus()}
	return false;
}


