//
//				JSON
//////////////////////////////////
//object <=> JSON text
var JSONHelper=(function(){
		var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        meta = {    // table of character substitutions
            '\b': '\\b',
            '\t': '\\t',
            '\n': '\\n',
            '\f': '\\f',
            '\r': '\\r',
            '"' : '\\"',
            '\\': '\\\\'
        };
	//"

    function quote(string) {
        escapable.lastIndex = 0;
        return escapable.test(string) ?
            '"' + string.replace(escapable, function (a) {
                var c = meta[a];
                return typeof c === 'string' ? c :
                    '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
            }) + '"' :
            '"' + string + '"';
    }

	return {
		ToText:function(object){
			if (object==null)return "null";
			switch (typeof(object)){
				case "string":
					return quote(object);
					break;
				case "object":
					var text=(typeof(object.length)=="number")?"[":"{";
					  for (var i in object){
						  if (typeof(object[i])!="undefined" && typeof(object[i])!="function"){
							  if (text!="{" && text!="[")
								text+=",";
								if (typeof(object.length)!="number")
									text+="'"+i+"':";
								text+=JSONHelper.ToText(object[i]);
						  }
					  }
					 text+=(typeof(object.length)=="number")?"]":"}";
					return text;
				break;
				case "boolean":
					return object?1:0;
				break;
				case "number":
					return object;
				break;
				case "undefined":
				default:
					return "null";
				break;
			}
			return "";
		},
		ToObject:function(text){
			if (text=="" || text==null)
				return null;
				try{
			return eval("("+text+")");
				}catch(e){return null;}
		}
	}
})();


if (typeof(ustart_id)=="undefined")ustart_id=0;
else ustart_id++;
if (typeof(widget_type)=="undefined")widget_type="liens";
if (typeof(widget_data)=="undefined")widget_data=null;
document.write('<iframe allowtransparency="true" id="iframed_bloc'+ustart_id+'" scrolling="no" width="100%" height="200" src="http://www.ustart.org/tool.php?op=standalone&type='+escape(widget_type)+'&location='+escape(location.href.substr(0,location.href.indexOf('#')>-1?location.href.indexOf('#'):location.href.length))+'&ldata='+escape(JSONHelper.ToText(widget_data))+'&id='+escape(ustart_id)+'" frameborder="0"></iframe>');



function updateuStartWidgetHeight(id){
	var _split=location.hash.split(":");
	if (_split.length==2 && parseInt(_split[0].replace("#",""))==id){
		var height=parseInt(_split[1]);
		if (height>0 && parseInt(document.getElementById("iframed_bloc"+id).style.height)!=(height+10))
			document.getElementById("iframed_bloc"+id).style.height=(height+10)+'px';
	}
}

window.setInterval("updateuStartWidgetHeight("+ustart_id+")",50);