function getspaceseparated( arr ) {
	var res = "";
	for( var i = 0;i<arr.length;++i ) {
		var quote = "";
		if ( arr[i].indexOf(' ')!=-1 ) {
			quote = '&quot;';
		}
		res += quote + arr[i] + quote + ' ';
	}
	return res;
}

function exporttarget_email( source ) {
	document.location= "mailto:?subject="+"=?utf-8?q?"+encodeURIComponent(source.title).replace(/%/g,"=")+"?=&body=" + encodeURIComponent( source.url + "?" + source.urlParams() );
}

function exporttarget_fields( source, urlbase, fieldNames, separator ) {
	window.open( urlbase  + fieldNames.url + "=" + encodeURIComponent( source.url ) + "&"+fieldNames.title + "=" + encodeURIComponent( source.title) + "&" + fieldNames.tags +"=" + encodeURIComponent( source.tags.join( separator ) ), "delicious", "toolbar=no,width=800,height=600");
}

function exporttarget_standard( source, urlbase, separator ) {
	exporttarget_fields( source, urlbase, { url:"url",title:"title",tags:"tags" }, separator );
}

function exporttarget_delicious( source ) {
	exporttarget_standard( source, "http://del.icio.us/post?v=4&noui&jump=close&", " " );
}

function exporttarget_bobrdobr( source ) {
	exporttarget_standard( source, "http://bobrdobr.ru/addext.html?", "," );
}

function exporttarget_googlegadget( source ) {
	window.open( "http://fusion.google.com/add?source=atgs&moduleurl=" + encodeURIComponent( source.url )  + source.language + "/" + source.id + ".xml", "gadget", "toolbar=no,width=800,height=600");
}

function exporttarget_mrwong( source, urlbase ) {
	exporttarget_fields( source, "http://www.mister-wong.ru/index.php?action=addurl&", { url:"bm_url",title:"bm_description",tags:"bm_tags" }," ");
}

function exporttarget_yandex( source ) {
	exporttarget_fields( source, "http://zakladki.yandex.ru/userarea/links/addfromfav.asp?bAddLink_x=1&",{ url:"url",title:"name",tags:"tags" },"," );
}
function exporttarget_myscoop( source ) {
	exporttarget_standard( source, "http://myscoop.ru/add/?"," " );
}

function exporttarget_memori( source ) {
	exporttarget_fields( source, "http://memori.ru/link/?sm=1&",{ url:"u_data[url]",title:"u_data[name]",tags:"u_data[tags]" }," " );
}

function exporttarget_google( source ) {
	exporttarget_fields( source, "http://www.google.com/bookmarks/mark?op=add&", { url:"bkmk",title:"title",tags:"labels" },"," );
}
function exporttarget_furl( source ) {
	exporttarget_fields( source, "http://www.furl.net/storeIt.jsp?", { url:"u",title:"t",tags:"keywords" },"," );
}
function exporttarget_digg( source ) {
	exporttarget_fields( source, "http://digg.com/submit?phase=2&", { url:"url",title:"title",tags:"bodytext" },"," );
}
function exporttarget_tweetter( source ) {
	window.open( "http://twitter.com/intent/tweet?text=" + encodeURIComponent( source.title + ' ') + encodeURIComponent( source.url ) + "&lang=" + source.language , "tweetter", "toolbar=no,width=800,height=600");
}

