function getScript(url, success) {
	var head = document.getElementsByTagName('head')[0];
	var done = false;

	var script = document.createElement('script');
	script.src = url;

	// Attach handlers for all browsers
	script.onload = script.onreadystatechange = function() {
		if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {
			done = true;
			success();
			script.onload = script.onreadystatechange = null;
			head.removeChild(script);
		}
	};
	head.appendChild(script);
}



function Effectix_SocialLink_Load(options) {
	var $jq = jQuery;
	$jq(function() {
		var defaults = {
			href: location.href,
			css: '',
			position: 'left'
		};
		var positions = {
			left: '<style>#sociallink { position: fixed; top: 100px; left: 0; }</style>',
			right: '<style>#sociallink { position: fixed; top: 100px; right: 0; }</style>'
		};

		options = $jq.extend(defaults, options);

		$jq('body').append('<iframe id="sociallink" src="http://sociallink.tester.effectix.com/sociallink.php?href='+encodeURIComponent(options.href)+'&css='+encodeURIComponent(options.css)+'" width="102" height="227" frameborder="0" scrolling="no"></iframe>');
		$jq('body').append(positions[options.position]);
	});
}



if (typeof(jQuery) == "undefined") {
	getScript('https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', function() {
		Effectix_SocialLink_Load(typeof(Effectix_SocialLink) != 'undefined' ? Effectix_SocialLink : {});
	});
} else {
	Effectix_SocialLink_Load(typeof(Effectix_SocialLink) != 'undefined' ? Effectix_SocialLink : {});
}

