// declare variables var tagurself_widget_index = (typeof tagurself_widget_index == 'undefined' ? 0 : tagurself_widget_index+1); var widget_id = 'tagurself_widget_id_'+tagurself_widget_index; var bg_color = (typeof bg_color == 'undefined' ? false : bg_color); var font_color = (typeof font_color == 'undefined' ? false : font_color); var tagurself_widget_id_array = (typeof tagurself_widget_id_array == 'undefined' ? new Array() : tagurself_widget_id_array); tagurself_widget_id_array[tagurself_widget_index] = {url:url, widget_id:widget_id, bg_color:bg_color, font_color:font_color}; // add css to page function tagurself_add_css() { var css = document.getElementById("tagurself_widget_css"); if (!css) { var css = document.createElement("link"); css.setAttribute("id", "tagurself_widget_css"); css.setAttribute("type", "text/css"); css.setAttribute("rel", "stylesheet"); css.setAttribute("href", "http://tagurself.com/css/widget.css"); document.getElementsByTagName('head')[0].appendChild(css); } css = null; } tagurself_add_css(); // write widget to page document.write('
'); function tagurself_load_script( widget_id, url, bg_color, font_color ) { var script_url = "http://www.tagurself.com/api/" + "?format=widget" + "&widget_id="+widget_id+ "&url="+encodeURIComponent(url)+ "&bg_color="+encodeURIComponent(bg_color)+ "&font_color="+encodeURIComponent(font_color); var script = document.createElement("script"); script.setAttribute("type", "text/javascript"); script.setAttribute("defer", "true"); script.setAttribute("src", script_url); document.getElementById(widget_id).appendChild(script); } // ie browser detect function isIE() { return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent); } function isSafari() { return /safari/i.test(navigator.userAgent); } // dom loder script function tagurself_domLoader(){ if(arguments.callee.done){ return; } // for each widget for(i=0; i