// JavaScript Document
window.document.write("<div id='socialLinks' style='font-size:14px; padding:5px; text-align:center; color:#ffffff;'></div>");
var smd = window.document.getElementById('socialLinks');
var target = "_blank";
var title = window.document.getElementsByTagName('title')[0].innerHTML;

if(typeof $ == 'undefined'){
	includeScript('http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js');
	includeStyle('http://www.optimizex.com/sm_images/pv_socialBar.css');
	var jCheck = setInterval(jLoaded,800);
}else{
	includeStyle('http://www.optimizex.com/sm_images/pv_socialBar.css');
	jLoaded();
}







function jLoaded(){
	if(typeof $ == 'undefined'){
		//var msg = document.createTextNode("Loading...");
		smd.innerHTML = "Loading ....";
		//alert("testing");
	}
	else{
		smd.innerHTML = '<a href="http://delicious.com/save?url='+ window.location+'&amp;title='+title+'" title="Bookmark '+ title +' on del.icio.us" target="_blank"><img src="http://www.optimizex.com/sm_images/delicious.png" alt="Share this on del.icio.us" width="24" height="24" border="0" /></a><a href="http://digg.com/submit?url'+ window.location +'&title='+ title +'" rel="nofollow" title="Submit '+ title +' to Digg" target="_blank"><img src="http://www.optimizex.com/sm_images/digg.png" alt="Share this on Digg" border="0" /></a><a href="http://www.facebook.com/share.php?u='+window.location+'" rel="nofollow" title="Share '+title+' on Facebook" target="_blank"><img src="http://www.optimizex.com/sm_images/facebook.png" alt="Share this on Facebook" border="0" /></a><a href="http://www.linkedin.com/shareArticle?mini=true&url='+ window.location +'&title='+ title +'&summary='+ title +'&source='+ top.location.host +'" title="Share '+ title +' on LinkedIn" target="_blank"><img src="http://www.optimizex.com/sm_images/linkedin.png" alt="Share this on LinkedIn" border="0" /></a><a title="Tweet About '+ title +'!"  id="twtlnk" href="http://twitter.com/home?status=' + window.location + '" target="_blank"><img alt="Share This on Twitter" src="http://www.optimizex.com/sm_images/twitter.png" border="0" alt="Share This on Twitter" /></a>';
		clearInterval(jCheck);
	}
}

//window.document.write("<span style='font-size:12px; color:#ff0000';>Test</span>");
function includeScript(filename)
{
	var head = document.getElementsByTagName('head')[0];
	script = document.createElement('script');
	script.src = filename;
	script.type = 'text/javascript';
	head.appendChild(script);
}
function includeStyle(filename){
	var head = document.getElementsByTagName('head')[0];
	style = document.createElement('link');
	style.href = filename;
	style.rel = 'stylesheet';
	style.type = 'text/css';
	style.media = 'screen';
	head.appendChild(style);
}
function urlencode(str) {
return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
}
