if(window._2space_socialbar || document.getElementById('_2space_socialbar')) {
		
		load = function() {
		   		load.getScript("http://code.jquery.com/jquery-latest.pack.js");
		   		load.tryReady(0);
		}
		
		load.getScript = function(filename) {
   				var script = document.createElement('script')
   				script.setAttribute("type","text/javascript")
   				script.setAttribute("src", filename)
   				if (typeof script!="undefined")
   				document.getElementsByTagName("head")[0].appendChild(script)
 		}
		
		load.tryReady = function(time_elapsed) {
		   		// Continually polls to see if jQuery is loaded.
		  		 if (typeof $ == "undefined") { // if jQuery isn't loaded yet...
			 			if (time_elapsed <= 5000) { // and we havn't given up trying...
			   					setTimeout("load.tryReady(" + (time_elapsed + 200) + ")", 200); // set a timer to check again in 200 ms.
			 			} /*else {
			   					alert("Timed out while loading jQuery.")
			 			}*/
		   		} else {
			 			//--> code to run after jQuery loads
								
								//> Controleer verplichte velden
									var member_id = $('#_2space_socialbar').attr('class');
									var href      = $('#_2space_socialbar a._2space_socialbar_class').attr('href');
									var ticker_id = $('#_2space_socialbar a._2space_socialbar_class').attr('id');
									var tekst     = $('#_2space_socialbar a._2space_socialbar_class').html();
									
									if(member_id.substr(0, 5) != 'PAS-2' || member_id.length != 24 ||
									   href != 'http://www.2space.net' || tekst != '2SPACE.NET' ||
									   Number(ticker_id) < 1000) {
											$('#_2space_socialbar').attr('style', 'color: #F00; background-color: #FF0; border: #333 1px solid; width: 95%; height: 32px; padding: 4px; font-family: Trebuchet MS, Arial, Helvetica, sans-serif; font-size: 10px;');
											$('#_2space_socialbar').html('2SPACE TOOL ALERT ! <br>The script you use contains errors. Please import the right source code.');
									}
									else {
											//** SETTINGS
													
													// CORRECTE POSITIE GARANDEREN
													
															var newcode = '<div id="_2space_socialbar" class="' + member_id + '"><a href="http://www.2space.net" target="_blank" class="_2space_socialbar_class" id="' + ticker_id + '">2SPACE.NET</a></div>'
															$('#_2space_socialbar').remove();
															$('body').append(newcode);
															
													// BASIS-SETTINGS UIT DB
															
																	var set_theme = ' ';
																	var set_twitter_tweet_at  = ' ';
																	var set_twitter_follow_at = ' ';
																	$.getJSON('http://xchange.2space.net/tools/socialbar/_inc/socialbar_settings.inc.php?tool_id=' + ticker_id + '&tool_member_id=' + member_id + '&rand=' + Math.floor(Math.random()*1000000) + '&callback=?', 
																			  function(data) {
																				  
																					//UIT DB
																					if(data.set_twitter_tweet_at != null) { set_twitter_tweet_at = 'data-via="' + data.set_twitter_tweet_at + '"'; }
																					
																					// BASIS-SETTINGS ALG.
																					var curl    = window.location.href;
																					var domain;
																					
																					var versie = '1.0 - Jan. 24, 2012'
																					var txt_vraagteken = '<p style="font-size: 18px; font-weight: bold;">FREE SOCIAL WEB TOOLBAR<br /><span style="color: #666; font-size: 10px;">Version ' + versie + '</span></p><p><strong>The 2Space&reg; Social Bar is a simple way to enhance your website with social features,... for FREE.</strong></p><p>Our Socialbar will tremendously increase the number of page views of your website and the new interactive experience will encourage the involvement of your visitors.</p><p>Visitors will be able to promote your website on the most important social websites like<br /><img src="http://www.2space.net/images/passport/socialbar/intro/icon_Twitter.png" width="40" alt="Twitter" /> <img src="http://www.2space.net/images/passport/socialbar/intro/icon_Facebook.png" width="40" alt="Facebook" /> <img src="http://www.2space.net/images/passport/socialbar/intro/icon_Digg.png" width="40" alt="Digg" /> <img src="http://www.2space.net/images/passport/socialbar/intro/icon_LinkedIn.png" width="40" alt="LinkedIn" /> <img src="http://www.2space.net/images/passport/socialbar/intro/icon_Google.png" width="40" alt="Google+" /></p>';
																					
																					if(data.set_theme == '2space blue') {
																							var style_A  = 'width: 100%; height: 22px; background-color: #069; background-image: url(http://www.2space.net/_test/images/006699_bgbasis_Center.png); background-repeat: repeat-x; color: #FFF; text-align: center;font-family: Trebuchet MS, Arial, Helvetica, sans-serif; font-size: 12px; padding: 2px; padding-bottom: 0px; padding-top: 4px;';
																							var style_B  = 'width: 10px; background-image: url(http://www.2space.net/_test/images/006699_bgbasis_Left.png); background-repeat: no-repeat;';
																							var style_C  = 'width: 10px; background-image: url(http://www.2space.net/_test/images/006699_bgbasis_Right.png); background-repeat: no-repeat;';
																							var style_td = 'padding: 0px; padding-left: 5px; padding-right: 5px; vertical-align: top;';
																					}
																					if(data.set_theme == 'matte black') {
																							var style_A  = 'width: 100%; height: 22px; background-color: #333; background-image: url(http://xchange.2space.net/tools/socialbar/_img/theme_matte_black_center.png); background-repeat: repeat-x; color: #FFF; text-align: center;font-family: Trebuchet MS, Arial, Helvetica, sans-serif; font-size: 12px; padding: 2px; padding-bottom: 0px; padding-top: 4px;';
																							var style_B  = 'width: 10px; background-image: url(http://xchange.2space.net/tools/socialbar/_img/theme_matte_black_left.png); background-repeat: no-repeat;';
																							var style_C  = 'width: 10px; background-image: url(http://xchange.2space.net/tools/socialbar/_img/theme_matte_black_right.png); background-repeat: no-repeat;';
																							var style_td = 'padding: 0px; padding-left: 5px; padding-right: 5px; vertical-align: top;';
																					}
																					var style_XX = 'width: 100%; height: 100%; background-image: url(http://www.2space.net/images/advertise/adzone/bg.png); position: fixed; top: 0; left: 0; color: #FFF; z-index: 9999995;';
																			
																			//** BASIS
																			
																					
																					$('#_2space_socialbar').hide();
																					
																					var img_loader = 'http://www2.2space.net/images/tools/loading/ajax-loader.gif';
																					$('#_2space_socialbar').attr('style', 'bottom: 0px; position:fixed !important; z-index: 9999999; width: 100%; display: none;');
																					$('#_2space_socialbar').html('<center><table cellpadding="0" cellspacing="0" border="0" style="width: 94%;"><tr><td style="' + style_B + '">&nbsp;</td><td><div id="_2space_socialbar_content"></div></td><td style="' + style_C + '">&nbsp;</td></table></center>');
																					$('#_2space_socialbar #_2space_socialbar_content').attr('style', style_A);
																					$('#_2space_socialbar #_2space_socialbar_content').html('<img src="' + img_loader + '">');
																					$('#_2space_socialbar').fadeIn('slow');
																					
																					$('#_2space_socialbar_content').html('<table cellpadding="0" cellspacing="0" border="0" style="width: 100%;"><tr><td id="locL1" width="20">&nbsp;</td><td id="locL2" width="0"></td><td id="locL3" width="0"></td><td id="locL4" width="0"></td><td id="locL5" width="0"></td><td id="locL6" width="0"></td><td id="locL7" width="0"></td><td id="locL8" width="0"></td><td id="locL9" width="0"></td><td id="locL10" width="0"></td><td id="_2space_socialbar_content_text"><center><img src="' + img_loader + '"></center></td><td id="locR10" width="0"></td><td id="locR9" width="0"></td><td id="locR8" width="0"></td><td id="locR7" width="0"></td><td id="locR6" width="0"></td><td id="locR5" width="0"></td><td id="locR4" width="0"></td><td id="locR3" width="0"></td><td id="locR2" width="0"></td><td width="100" id="_2space_socialbar_content_vraagteken" style="vertical-align: top;"><a href="http://www.2space.net" target="_blank" id="_2space_socialbar_content_vraagteken_link"><img id="_2space_socialbar_content_vraagteken_img" src="http://xchange.2space.net/tools/socialbar/_img/006699_vraagteken.png" border="0"></a></td></tr></table>');
																					
																					
																				
																			
																			//** BASIS EVENTS
																					
																					//--> Vraagteken Events
																							
																							$('#_2space_socialbar_content_vraagteken_link').click(function(event) {  
																									event.preventDefault();
																									$('#_2space_socialbar').append('<div id="_2space_socialbar_content_vraagteken_inhoud" style="background-image: url(http://www.2space.net/images/advertise/adzone/bg.png); position: fixed; top: 0; left: 0; width: 100%; height: 100%;"><center><table cellpadding="0" cellspacing=0" border=0 style="width: 300px; margin:0px; margin-top: 150px; border: #006699 4px solid; background-color: #FFFFFF;"><tr><td  style="text-align: left; padding: 10px; font-family: Trebuchet MS, Arial, Helvetica, sans-serif; font-size: 12px;">' + txt_vraagteken + '<p style="text-align: center;"><a href="http://www.2space.net/passport/socialbar/" target="_blank" style="font-size: 16px; font-weight: bold; color: #069">Read More</a> &nbsp;&nbsp;<a id="_2space_socialbar_content_vraagteken_inhoud_close" href="close"style="color: #006699; font-weight: bold;">No thanks<a></p></td></tr></table></center></div>');
																									$.getJSON('http://xchange.2space.net/tools/socialbar/_inc/socialbar_clicks.inc.php?jsoncallback=?', {'jsoncallback' : '?', 'callback' : '?', 'rand' : Math.floor(Math.random()*1000000), 'tool_id' : ticker_id, 'tool_member_id' : member_id, 'what' : 'info', 'page' : curl}, function(data) {});
																									$('#_2space_socialbar_content_vraagteken_inhoud_close').click(function(event) {
																											event.preventDefault();
																											$('#_2space_socialbar_content_vraagteken_inhoud').remove();
																									});
																							});
																			
																			//** TICKER INHOUD
																					
																					var regel = new Array();
																					var sectie = '';
																					lengte = 1;
																					regel[0] = '&nbsp;';
																					//regel[0] = '2Space Social Bar (pre-beta) [<a href="http://www.2space.net" style="color: #CCCCCC;">2Space.net</a>]';
																					//regel[1] = 'A 2Space Social Bar (pre-beta) on your website ? <a href="http://www.2space.net/info/contact/" style="color: #CCCCCC;">Contact 2Space&reg;</a>';
																					//regel[2] = '*_' + set_twitter_tweet_at + '_*';
																					
																					var i = 0;
																					
																					interval = setInterval(function() {
																							if(!regel[i]) { i=0;}
																							$('#_2space_socialbar_content_text').html('<center>' + regel[i] + '</center>');
																							i++;
																					}, 7000);
																					
																				
																				//** Twitter
																				
																						$('#locL1').attr('width', '10'); //'120');
																						$('#locL1').html('<center><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" ' + set_twitter_tweet_at + ' target="_blank">Tweet</a></center>');
																						load.getScript("http://platform.twitter.com/widgets.js");
																						$('#locL1').attr('style', style_td);
																						$('#locL1').focusin(function() {
																								$.getJSON('http://xchange.2space.net/tools/socialbar/_inc/socialbar_clicks.inc.php?jsoncallback=?', {'jsoncallback' : '?', 'callback' : '?', 'rand' : Math.floor(Math.random()*1000000), 'tool_id' : ticker_id, 'tool_member_id' : member_id, 'what' : 'twitter', 'page' : curl}, function(data) {});
																						});
																						
																						
																				//** FB LIKE
																				
																						$('#locL2').attr('width', '90');
																						$('#locL2').html('<div id="fb-root"></div>');
																						load.getScript('http://connect.facebook.net/en_US/all.js#xfbml=1');
																						$('#locL2').html('<div id="fb-root"></div><fb:like send="true" width="90" show_faces="false" action="like" layout="button_count" font="trebuchet ms"></fb:like>');
																						$('#locL2').attr('style', style_td);
																						$('#locL2').focusin(function() {
																								$.getJSON('http://xchange.2space.net/tools/socialbar/_inc/socialbar_clicks.inc.php?jsoncallback=?', {'jsoncallback' : '?', 'callback' : '?', 'rand' : Math.floor(Math.random()*1000000), 'tool_id' : ticker_id, 'tool_member_id' : member_id, 'what' : 'facebook', 'page' : curl}, function(data) {});
																						});
																	
																				
																				//** DIGG
																						
																						$('#locL3').attr('width', '100');
																						(function() {
																							var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
																							s.type = 'text/javascript';
																							s.async = true;
																							s.src = 'http://widgets.digg.com/buttons.js';
																							s1.parentNode.insertBefore(s, s1);
																						})();
																						$('#locL3').html('<a class="DiggThisButton DiggCompact"></a>');
																						$('#locL3').attr('style', style_td);
																						$('#locL3').bind('click', function(event) {
																								$.getJSON('http://xchange.2space.net/tools/socialbar/_inc/socialbar_clicks.inc.php?jsoncallback=?', {'jsoncallback' : '?', 'callback' : '?', 'rand' : Math.floor(Math.random()*1000000), 'tool_id' : ticker_id, 'tool_member_id' : member_id, 'what' : 'digg', 'page' : curl}, function(data) {});
																						});
																				
																				//** LINKEDIN
																				
																						$('#locL4').attr('width', '110');	
																						load.getScript("http://platform.linkedin.com/in.js");
																						$('#locL4').html('<center><script type="IN/Share" data-counter="right"></script></center>');
																						$('#locL4').attr('style', style_td);
																						$('#locL4').bind('click', function(event) {
																								$.getJSON('http://xchange.2space.net/tools/socialbar/_inc/socialbar_clicks.inc.php?jsoncallback=?', {'jsoncallback' : '?', 'callback' : '?', 'rand' : Math.floor(Math.random()*1000000), 'tool_id' : ticker_id, 'tool_member_id' : member_id, 'what' : 'linkedin', 'page' : curl}, function(data) {});
																						});
																				
																				//** Google +1 button
																				
																						$('#locL5').attr('width', '10'); //'100');
																						load.getScript("https://apis.google.com/js/plusone.js");
																						$('#locL5').html('<center><link rel="canonical" href="' + curl + '" /><g:plusone size="small"></g:plusone></center>');
																						$('#locL5').attr('style', style_td);
																						$('#locL5 link').bind('mouseover', function(event) {$('#locL5').html('ok')});
																						$('#locL5').focusin(function() {
																								$.getJSON('http://xchange.2space.net/tools/socialbar/_inc/socialbar_clicks.inc.php?jsoncallback=?', {'jsoncallback' : '?', 'callback' : '?', 'rand' : Math.floor(Math.random()*1000000), 'tool_id' : ticker_id, 'tool_member_id' : member_id, 'what' : 'google+', 'page' : curl}, function(data) {});
																						});
																				
																				//** ONLINE
																						
																						$('#locR2').attr('width', '57');
																						$('#locR2').attr('style', 'background-image: url(http://xchange.2space.net/tools/socialbar/_img/006699_online.png); background-repeat: no-repeat; padding: 0px; padding-left: 45px; vertical-align: top;');
																						$('#locR2').html('<img src="http://www2.2space.net/images/tools/loading/ajax-loader.gif" />');
																						$('#locR2').html('<iframe id="whoisonline_loader" name="whoisonline_loader" allowtransparency="true" frameborder="0" scrolling="no" src="http://xchange.2space.net/tools/whoisonline/_inc/record.inc.php?rand=' + Math.floor(Math.random()*1000000)+'&tool=socialbar&tool_id='+ticker_id+'&tool_member_id='+member_id+'&page='+curl+'" style="width:70px; height:22px; background-color: transparent;">');
																						
																				
																				//** TWITTER FOLLOW
																						if(data.set_twitter_follow_at != null && data.set_twitter_follow_at != 'disabled') {
																								$('#locR3').attr('width', '50');
																								$('#locR3').html('<iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/follow_button.html?screen_name=' + data.set_twitter_follow_at + '&show_screen_name=false&show_count=false&text_color=FFFFFF&link_color=CCCCCC" style="width:70px; height:20px;"></iframe>');//'<a href="https://twitter.com/twitterapi" class="twitter-follow-button">Follow @2space</a>');
																								$('#locR3').attr('style', style_td);
																						}
																						
																				
																				//** LINKED IN CONNECT
																						//$('#locR4').attr('width', '22');
																						/*$('#locR4').html('<script type="IN/MemberProfile" data-id="http://www.linkedin.com/in/erwindelaat" data-format="click"></script>');
																						*/
																			  }
																	);
													
											
									}
		   		}
		 }
		 load();
}
else {  }
