userdataLoad(function(xml){shortcutsXML(xml);},username,new Date().getTime(),"shortcuts.xml","xml");

//localRequest('userdata/shortcuts.xml?sid=' + new Date().getTime(),function(xml){shortcutsXML(xml)},"xml");

userdataLoad(function(xml){prefs(xml);},username,new Date().getTime(),"prefs.xml","xml");

//localRequest('userdata/prefs.xml?sid=' + new Date().getTime(),function(xml){prefs(xml)},"xml");


function prefs(xml)
{

var xmldata=xml;

if(xmldata.documentElement.childNodes.length===0){alert("err!");}
else
{
this.feeditems=xmldata.documentElement;
var wallpaper="";
wallpaper = this.feeditems.childNodes[0].getAttribute("wallpaper");
var avatar="";
avatar = this.feeditems.childNodes[0].getAttribute("avatar");
var outlinedrag="";
outlinedrag = this.feeditems.childNodes[0].getAttribute("outlinedrag");
var trans="";
trans = this.feeditems.childNodes[0].getAttribute("transitions");
var skintemp="";
skintemp = this.feeditems.childNodes[0].getAttribute("skin");

changeSkin(skins[skintemp]);
document.body.style.backgroundImage="url("+wallpaper+")";
document.getElementById("icon0").src=avatar;
if (outlinedrag=="true"){outlineDrag=true;}else{outlineDrag=false;}
if (trans=="true"){transitions=true;}else{transitions=false;}
}
}


function shortcutsXML(xml)
{

var xmldata=xml;

if(xmldata.documentElement.childNodes.length===0){alert("err!");}
else
{
this.feeditems=xmldata.documentElement;
var temp="",c=0,title2="";
for (var i=0; i<this.feeditems.childNodes.length; i++)
{
title = this.feeditems.childNodes[i].getAttribute("title");
icon = this.feeditems.childNodes[i].getAttribute("icon");
x = this.feeditems.childNodes[i].getAttribute("x");
y = this.feeditems.childNodes[i].getAttribute("y");
z = this.feeditems.childNodes[i].getAttribute("z");
id = this.feeditems.childNodes[i].getAttribute("id");
appid = this.feeditems.childNodes[i].getAttribute("appid");
parameters = this.feeditems.childNodes[i].getAttribute("parameters");
height=28;if (safari){height=24;}


c=0;title2="";
for (j=0;j<title.length;j++)
{
if (title.charCodeAt(j)!=32){c++;}else{c=0;}
title2+=title.charAt(j);
if (c==12){title2+="<BR>";c=0;}
}

testtt=document.createElement("DIV");

temp="<div id=$$shortcut$$"+id+" ondblclick='loadApp(\""+appid+"\")' onmousedown='shortcutDragInit(event,"+id+")' style='position:absolute;left:"+x+";top:"+y+";z-index:"+z+";width:84px;text-align:center;'><img height=48 width=48 src='"+icon+"'><div title='"+title+"' id=caption"+id+" style='position:absolute;left:1px;top:56px;cursor:default;padding:0px 2px 0px 2px;font-family:arial;font-size:11px;font-weight:bold;background:transparent;width:84px;height:"+height+"px;overflow:hidden;'>"+title2+"<div id=blah"+id+" style='position:absolute;left:-1px;top:-1px;cursor:default;padding:0px 2px 0px 2px;font-family:arial;font-size:11px;font-weight:bold;background:transparent;color:white;width:84px;overflow:hidden;'>"+title2+"</div></div></div>";

testtt.innerHTML=temp;
//testtt.id="$$shortcut$$"+id;
desktop.appendChild(testtt);

}

}

//loadApp("yaplet");
drawDock();
}


function deleteShortcut(id)
{
shortcut=document.getElementById("$$shortcut$$"+id);
if (shortcut){
desktop.removeChild(shortcut.parentNode);
}

}
