var apihost='http://social.singlethrow.com/';

//////////////////////////////////////////  
//
//
//	spyka Webmaster social bookmark script
//	(c) 2008 spyka Web Group
//  http://www.spyka.net
//
//	http://www.spyka.net/scripts/easy-social-bookmarks
//
//
/////////////////////////////////////////
var buttons = new Array();

buttons.prototype = new Array();
buttons.prototype.ArrayPush=buttons.prototype.push;
buttons.prototype.push = function(btn)
{
	if(typeof btn == 'button')
	{
		this.ArrayPush(btn);
	}
};
buttons.add = function(Url, Alt, Image) {
    buttons[buttons.length] = new button(Url, Alt, Image);
}
buttons.clear = function() {
    if (this.length > 0) {
        this.pop();
    }
    if (this.length > 0) {
        this.clear();
    }
}



//////////////////////////////////////////  
//
//			START EDITS HERE               
//
//////////////////////////////////////////   

//	html (or any other content) before each bookmark link. e.g. &nbsp; for space or <li> for start of list item
var html_before = '';

//	html (or any other content) after each bookmark link. e.g. &nbsp; for space or </li> to end list item
var html_after = '';

//	imagepath to icons.	set to 0 to disable icons, e.g. var imagepath = '0';
var imagepath = apihost + 'images/socialicons/';

var url;
var title;
var width;
var size;
//	bookmarks: 
//				syntax: (be sure to increase x)
//				buttons[x] = new Array(Bookmark URL, Bookmark name, Icon URL);
//
//				use {url} in bookmark URL to insert current url
//				use {title} in bookmark URL to insert current page title
//

function button(url, alt, image) {
    this.image = image;
    this.alt= alt;
    this.url = url;

}
/*
buttons[0] = new button('http://del.icio.us/post?url={url}&title={title}', '', imagepath + 'delicious40.png');
buttons[1] = new button('http://digg.com/submit?phase=2&url={url}', '', imagepath + 'digg40.png');
buttons[2] = new button('http://www.facebook.com/sharer.php?u={url}', '', imagepath + 'facebook40.png');
buttons[3] = new button('http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk={url}&title={title}', '', imagepath + 'google40.png');
buttons[4] = new button('http://reddit.com/submit?url={url}&title={title}', '', imagepath + 'reddit40.png');
buttons[5] = new button('http://www.stumbleupon.com/submit?url={url}', '', imagepath + 'stumbleupon40.png');
buttons[6] = new button('http://www.technorati.com/faves?add={url}', '', imagepath + 'technorati40.png');
buttons[7] = new button(host +'sendtotwitter.ashx?comment={title}&url={url}', '', imagepath + 'twitter40.png');
*/






//////////////////////////////////////////  
//
//			END EDITS HERE               
//
//////////////////////////////////////////
function printbuttons() {
    if (url) {
        url = escape(url);
    }
    else {
        url = escape(window.location.href);
    }
    if (title) {
        title = escape(title);
    }
    else {
        title = escape(window.document.title);
    }
    if (size) {

    }
    else {
        size="40";
    }
    for (i = 0; i < buttons.length; i++) {
        try {
            var btn = buttons[i];
            var u = btn.url;
            u = u.replace('{url}', url);
            //u = u.replace('{url}',path);
            u = u.replace('{title}', title);
            //u = u.replace('{title}',title);
            u = u.replace('{apihost}', apihost);
            var imageTag = (imagepath == '0') ? '' : '<img src="' + btn.image + '" alt="' + btn.alt + '" title="' + btn.alt + '" width="' + size + '"  />';
            var linkTag = '<a href="' + u + '" target="_blank">' + imageTag + '</a>&nbsp;';
            window.document.write(html_before + linkTag + html_after);
        }
        catch (ex) {

        } 
      
       
    }
}buttons[0] = new button('http://del.icio.us/post?url={url}&title={title}', 'Save to Delicious', imagepath + 'delicious40.png');
buttons[1] = new button('http://digg.com/submit?phase=2&url={url}', 'Submit To Digg', imagepath + 'digg40.png');
buttons[2] = new button('http://www.facebook.com/sharer.php?u={url}', 'Share on FaceBook', imagepath + 'facebook40.png');
buttons[3] = new button('http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk={url}&title={title}', 'Post to Google', imagepath + 'google40.png');
buttons[4] = new button('http://reddit.com/submit?url={url}&title={title}', 'Submit To Reddit', imagepath + 'reddit40.png');
buttons[5] = new button('http://www.stumbleupon.com/submit?url={url}', 'Submit To StumbleUpon', imagepath + 'stumbleupon40.png');
buttons[6] = new button('http://www.technorati.com/faves?add={url}', 'Submit To Technorati', imagepath + 'technorati40.png');
buttons[7] = new button('{apihost}sendtotwitter.ashx?comment={title}&url={url}', 'Submit To Twitter', imagepath + 'twitter40.png');
