function akst_share_escape(id, url, title) {

if (!(document.getElementById("akst_form"))){

var akst_form = document.createElement("div");

akst_form.setAttribute('id','akst_form');

akst_form.innerHTML = '<a href="javascript:void(document.getElementById(\'akst_form\').style.display=\'none\');" class="akst_close">Close</a>';
akst_form.innerHTML += '<ul class="tabs"><li id="akst_tab1" class="selected" onclick="akst_share_tab(\'1\');">Social Web</li></ul>';
akst_form.innerHTML += '<div class="clear"></div>';
akst_form.innerHTML += '<div id="akst_social"><ul><li><a href="#" id="akst_delicious">del.icio.us</a></li><li><a href="#" id="akst_digg">Digg</a></li><li><a href="#" id="akst_furl">Furl</a></li><li><a href="#" id="akst_facebook">Facebook</a></li><li><a href="#" id="akst_yahoo_myweb">Yahoo! My Web</a></li><li><a href="#" id="akst_stumbleupon">StumbleUpon</a></li><li><a href="#" id="akst_google_bmarks">Google Bookmarks</a></li><li><a href="#" id="akst_technorati">Technorati</a></li><li><a href="#" id="akst_blinklist">BlinkList</a></li><li><a href="#" id="akst_newsvine">Newsvine</a></li><li><a href="#" id="akst_magnolia">ma.gnolia</a></li><li><a href="#" id="akst_reddit">reddit</a></li><li><a href="#" id="akst_windows_live">Windows Live</a></li><li><a href="#" id="akst_tailrank">Tailrank</a></li></ul><div class="clear"></div></div>';

document.body.appendChild(akst_form);

}

fooscape = URLEncode(url);

akst_share(id, fooscape, title);

}

function anon_akst_share_escape() {

akst_share_escape(this.id,this.href,this.title);return false;

}


function akst_share(id, url, title) {
	var form = document.getElementById('akst_form');
	
	if (form.style.display == 'block') {
		form.style.display = 'none';
	}

	var concat_link = id;
	
	var link = document.getElementById(concat_link);
	var coors = findPos(link);

	document.getElementById('akst_delicious').href = akst_share_url("http://del.icio.us/post?url={url}&title={title}", url, title);
	document.getElementById('akst_digg').href = akst_share_url("http://digg.com/submit?phase=2&url={url}&title={title}", url, title);
	document.getElementById('akst_furl').href = akst_share_url("http://furl.net/storeIt.jsp?u={url}&t={title}", url, title);
	document.getElementById('akst_facebook').href = akst_share_url(" http://www.facebook.com/share.php?u={url}", url, title);
	document.getElementById('akst_yahoo_myweb').href = akst_share_url("http://myweb2.search.yahoo.com/myresults/bookmarklet?u={url}&t={title}", url, title);
	document.getElementById('akst_stumbleupon').href = akst_share_url("http://www.stumbleupon.com/submit?url={url}&title={title}", url, title);
	document.getElementById('akst_google_bmarks').href = akst_share_url("  http://www.google.com/bookmarks/mark?op=edit&bkmk={url}&title={title}", url, title);
	document.getElementById('akst_technorati').href = akst_share_url("http://www.technorati.com/faves?add={url}", url, title);
	document.getElementById('akst_blinklist').href = akst_share_url("http://blinklist.com/index.php?Action=Blink/addblink.php&Url={url}&Title={title}", url, title);
	document.getElementById('akst_newsvine').href = akst_share_url("http://www.newsvine.com/_wine/save?u={url}&h={title}", url, title);
	document.getElementById('akst_magnolia').href = akst_share_url("http://ma.gnolia.com/bookmarklet/add?url={url}&title={title}", url, title);
	document.getElementById('akst_reddit').href = akst_share_url("http://reddit.com/submit?url={url}&title={title}", url, title);
	document.getElementById('akst_windows_live').href = akst_share_url("https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url={url}&title={title}&top=1", url, title);
	document.getElementById('akst_tailrank').href = akst_share_url("http://tailrank.com/share/?link_href={url}&title={title}", url, title);



	form.style.left = coors[0] + 'px';
	form.style.top = (coors[1] + link.offsetHeight + 3) + 'px';
	form.style.display = 'block';
}

function akst_share_url(base, url, title) {
	base = base.replace('{url}', url);
	return base.replace('{title}', title);
}

function akst_share_tab(tab) {
	var tab1 = document.getElementById('akst_tab1');
	var tab2 = document.getElementById('akst_tab2');
	var body1 = document.getElementById('akst_social');
	var body2 = document.getElementById('akst_email');
	
	switch (tab) {
		case '1':
			tab2.className = '';
			tab1.className = 'selected';
			body2.style.display = 'none';
			body1.style.display = 'block';
			break;
		case '2':
			tab1.className = '';
			tab2.className = 'selected';
			body1.style.display = 'none';
			body2.style.display = 'block';
			break;
	}
}

function akst_xy(id) {

	var element = document.getElementById(id);
	var x = 0;
	var y = 0;
}

     
addCaption = function() {
var allAnchors = getElementsByClassName(document, 'akst_share_link', 'a');

a = 20;

for ( var i=0; i < allAnchors.length; i++) {

var concat_link = 'akst_link_' + a;

allAnchors[i].id = concat_link;

allAnchors[i].onclick = function(){

akst_share_escape(this.id,this.href,this.title);return false;

};


a = ++a;

}



}

addCaption();

registerOnLoad(addCaption);

registerOnAjax(addCaption);

function create_Address_string(ThoroughfareName,LocalityName,AdministrativeAreaName){

var Address_string = ThoroughfareName + ', ' + LocalityName + ', ' + AdministrativeAreaName + ', Australia';


return Address_string;

}

addAddressActions = function() {

if (document.getElementById("find_address")){
document.getElementById("find_address").onclick = function(){

document.getElementById("search_type_add").setAttribute('checked','checked');

document.getElementById("direction_inputs").style.display = 'none';

document.getElementById("search_address_div").style.display = 'block';

};
}

if (document.getElementById("get_directions")){
document.getElementById("get_directions").onclick = function(){

document.getElementById("search_address_div").style.display = 'block';

document.getElementById("direction_inputs").style.display = 'block';

document.getElementById("search_type_dir").setAttribute('checked','checked');

};
}


if (document.getElementById("search_type_dir")){
document.getElementById("search_type_dir").onclick = function(){

document.getElementById("direction_inputs").style.display = 'block';

};
}

if (document.getElementById("search_type_add")){
document.getElementById("search_type_add").onclick = function(){

document.getElementById("direction_inputs").style.display = 'none';

};
}

if (document.getElementById("search_address")){
document.getElementById("search_address").onsubmit = function(){

var elm = this.AdministrativeAreaName;

var address = create_Address_string(this.ThoroughfareName.value, this.LocalityName.value, elm.options[elm.selectedIndex].value);

geocoder = new google.maps.ClientGeocoder();

if (geocoder) {

geocoder.getLatLng(address,function(point) {

if (!point) {

alert(address + " not found");
            
} else {


var icon = new google.maps.Icon();
icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
icon.iconSize = new google.maps.Size(12, 20);
icon.shadowSize = new google.maps.Size(22, 20);
icon.iconAnchor = new google.maps.Point(6, 20);
icon.infoWindowAnchor = new google.maps.Point(5, 1);


mainmap.panTo(point);

var marker = new google.maps.Marker(point, {title: address, icon: icon});

mainmap.addOverlay(marker);
	      
newpoint = point.lat() + ',' + point.lng();

var html = address + 'blah';

marker.openInfoWindowHtml(html);

}


});



} 

	
return false;
};
}

}

registerOnAjax(addAddressActions);
