function gettitleinfo() {
	return a_textresults;
}
function getaddressinfo() {
	return a_addressresults;
}
function getlinkinfo() {
	return a_maplinkresults;
}
function getlonginfo() {
	return a_longresults;
}
function getlatinfo() {
	return a_latresults;
}

function fn_rp_init_additional() {
	document.getElementById('content_address').style.display='none';
	h_h4s=document.getElementById('inthisarea').getElementsByTagName('h4'); s_html='';
	for (i=0;i<h_h4s.length;i++) {
		h_h4s[i].style.display='none';
		if (i==0) s_class=' class=selected';
		else s_class='';
		s_id=h_h4s[i].innerHTML.toLowerCase();
		s_html+='<a id=tab_'+s_id+' href="javascript:fn_rp_tab(\''+s_id+'\');"'+s_class+'>'+h_h4s[i].innerHTML+'</a> ';
	}
	o_h4=fn_element_create(document.getElementById('inthisarea').getElementsByTagName('h3')[0],'h4','rp_tabbar','before');
	o_h4.className='tab_bar';
	o_h4.innerHTML=s_html;
}

function fn_rp_tab(s_mode) {
	document.getElementById('content_map').style.display='none';
	document.getElementById('content_address').style.display='none';
	document.getElementById('tab_map').className='';
	document.getElementById('tab_address').className='';
	document.getElementById('content_'+s_mode).style.display='block';
	document.getElementById('tab_'+s_mode).className='selected';
	fn_anim_rejig_ads();
}

function fn_rp_expand(i_lon,i_lat) {
	window.frames['map'].document.getElementById('map').className='map_wide';
	document.getElementById('rp_expand').style.display='none';
	fn_rp_expand_anim(302,500,0,new Array(i_lon,i_lat));
}
function fn_rp_expand_anim(i_start,i_total,i_pos,a_pos) {
	var o_map=document.getElementById('map');
	var i_width=fn_get_pos(o_map,'Width');
	var i_offset=i_width+i_pos;
	if (i_total>i_offset) {
		o_map.style.width=(i_offset-4)+'px';
		var iPos=0-parseInt(i_offset-i_start+4);
		o_map.style.marginLeft=iPos+'px';
		i_pos++;
		setTimeout('fn_rp_expand_anim('+i_start+','+i_total+','+i_pos+',new Array('+a_pos[1]+','+a_pos[0]+'));',1);
	} else {
		o_map.style.width=(i_total-6)+'px';
		o_map.style.marginLeft='-'+(i_total-i_start+2)+'px';
		document.getElementById('rp_compact').style.display='block';
		window.frames['map'].map.panTo(new window.frames['map'].GLatLng(a_pos[1],a_pos[0]));
	}
}

function fn_rp_compact(i_lon,i_lat) {
	var o_map=document.getElementById('map');
	o_map.style.width='292px';
	o_map.style.marginLeft='2px';
	document.getElementById('rp_compact').style.display='none';
	document.getElementById('rp_expand').style.display='block';
	window.frames['map'].document.getElementById('map').className='';
	window.frames['map'].map.panTo(new window.frames['map'].GLatLng(i_lat,i_lon));
}

function fn_rp_init_gallery(i_total) {
	
	if (i_total>5) {
		o_element=document.getElementById('rp_dest_photosbase');
		o_element.innerHTML='<span id=rp_gallery_showall><a href="javascript:fn_rp_gallery_show();">Show all photos <img width=11 height=11 border=0 class=icon_arrow alt="Icon: Arrow" src="http://i.'+SITE_DOMAIN+'/images/arrow.png"></a> - </span>'+o_element.innerHTML;
		document.getElementById('rp_gallery_extra').style.display='none';
	}
}
function fn_rp_gallery_show() {
	fn_anim_fadein('rp_gallery_extra',0);
	document.getElementById('rp_gallery_showall').style.display='none';
}

function fn_rp_artists_init(i_total) {
	document.getElementById('rp_extraartists').style.display='none';
	document.write('<div class=outlineboxbase id=rp_extraartists_base><a href="javascript:fn_rp_artists_show();">See all '+(i_total-1)+' artists <img width=11 height=11 border=0 class=icon_arrow alt="Icon: Arrow" src="http://i.'+SITE_DOMAIN+'/images/arrow.png"></a></div>');
}
function fn_rp_artists_show() {
	fn_anim_fadein('rp_extraartists',0);
	document.getElementById('rp_extraartists_base').style.display='none';
	fn_anim_rejig_ads();
}


function fn_destination_init() {
	o_rpdest=document.getElementById('tabs');
	o_h4s=o_rpdest.nextSibling.getElementsByTagName('h4');
	for (i=0;i<o_h4s.length;i++) o_h4s[i].style.display='none';
	o_h4=fn_element_create(o_rpdest,'h4','rp_dest_h4_','before');
	o_h4.className='mTop tab_bar';
	o_h4.innerHTML='<a id=rp_dest_link_comments href="javascript:fn_destination_tabs(\'comments\');" class=selected>Comments</a> <a id=rp_dest_link_loves href="javascript:fn_destination_tabs(\'loves\');">Loves</a>';
	fn_destination_tabs('comments');
}

function fn_destination_tabs(s_mode) {
	document.getElementById('rp_dest_comments').style.display='none';
	document.getElementById('rp_dest_loves').style.display='none';
	document.getElementById('rp_dest_link_comments').className='';
	document.getElementById('rp_dest_link_loves').className='';
	document.getElementById('rp_dest_link_'+s_mode).className='selected';
	document.getElementById('rp_dest_'+s_mode).style.display='block';
}

glb_s_html='';
function fn_rp_init_front() {
	o_element=document.getElementById('whatsrp');
	glb_s_html=o_element.innerHTML;
	o_element.style.display='none';
	o_tip=fn_element_create(document.getElementById('map'),'div','rp_tip','before');
	o_tip.innerHTML='<div id=rp_tip_background></div><div id=rp_tip_foreground>'+glb_s_html+'</div>';
	fn_anim_opacity('rp_tip_background',90);
}

function fn_rp_showfront(s_title,s_desc,i_lat,i_lon) {
	document.getElementById('rp_tip_foreground').innerHTML='<strong class=rp_fronttitle>'+s_title+'</strong><br><span class=small_text>'+s_desc+'</span>';
	//console.log(fn_get_pos(o_element,'Left'));
	//var polyline = new window.frames['map'].GPolyline([new window.frames['map'].GLatLng(37.4519, -122.1519),new window.frames['map'].GLatLng(i_lat,i_lon)], "#FFFFFF", 10);
	//window.frames['map'].map.addOverlay(polyline);
}
function fn_rp_showfront_restore() {
	document.getElementById('rp_tip_foreground').innerHTML=glb_s_html;
}






