



/* Global variables */



run = 0;
eventX = 0;
eventY = 0;
event_X = 0;
event_Y = 0;
eventObj = "";
reply = 0;
widget_persistent = "";
xsearch_value = false;
generic_value = false;
generic_page_value = false;
generic_moving_value = false;
change_css = false;
myspace = "";
agt = navigator.userAgent.toLowerCase();
IE = document.all ? true: false;
safari = ((agt.indexOf('safari') != -1) && (agt.indexOf('mac') != -1)) ? true: false;
opera = ((agt.indexOf('opera') != -1)) ? true: false;
if (!safari) {safari = ((agt.indexOf('konqueror') != -1)) ? true: false;}
if (!IE){document.captureEvents(Event.MOUSEDOWN, Event.MOUSEUP, Event.MOUSEMOVE, Event.DOUBLECLICK, Event.CONTEXTMENU,Event.MOUSEOVER, Event.MOUSEOUT);}


function $(arg,arg2){
var str=arg.split(" ");
xin.selected=""; 
if((str.length==1 && !document.getElementsByTagName(str[0])[0]) && (str[0].substring(0,1)!=="#" && str[0].substring(0,1)!=="."))
{
if(document.getElementById(arg))
{
xin.selected=[document.getElementById(arg)];
if(!arg2){return document.getElementById(arg);}
else{return xin;}
}
else{return false;}
}
else if(str.length==1 && document.getElementsByTagName(str[0])[0]){xin.selected=document.getElementsByTagName(str[0]);return xin;}
else{
try{
var astr;
var col=[];
var num=0;
var mstr="";
var running="default";
var tag=false;
var totag=[];
var tagnum=0;
for(var i=0; i < arg.split(" ").length; i++){
try{
if(str[i].substring(0,1)!=="." &&  str[i].substring(0,1)!=="#"){
tag=false;
if(!xin.isArray(astr)){astr=[];astr=document.getElementsByTagName(str[i]);}
else if(running=="elementid"){
var tempid=astr[0];
astr=null;
astr=[tempid];
}
running="elementtags";
if(str[i].split("[")[1]){
tag=str[i].split("[")[1].replace(/\]/g,"");
str[i]=str[i].split("[")[0].replace(/ /g,"");
tag=tag.split("=")[1].replace(/ /g,"");
}
for(var j=0; j < astr.length; j++){
try{
if(!str[i].nodeName){
if(tag!==false){
totag="";
totag=[];
for(var k=0; k < astr[j].getElementsByTagName(str[i]).length; k++){
if(astr[j].getElementsByTagName(str[i])[k].getAttribute("type")==tag){
try{
totag[tagnum]=astr[j].getElementsByTagName(str[i])[k];
tagnum++;
}
catch(er){continue;}
}
}
col[j]=totag;
}
else if(tag==false){
col[j]=astr[j].getElementsByTagName(str[i]);
}
}
else{col[j]=str[i];}
}
catch(er){continue;}
}
tag=false;
tagnum=0;
for(var j=0; j < col.length; j++){
var len=col[j].length;
for(var k=0; k < len; k++){
try{
eval("astr["+num+"]=col["+j+"]["+k+"];");
num++;
}
catch(er){continue;}
}
}
}
else if(str[i].replace(" ","").substring(0,1)=="."){
running="elementclass";
if(!xin.isArray(astr)){astr=eval("xin.getClasses('"+str[i].replace(/\.| /g,"")+"')");}
else{
for(var j=0; j < 10; j++){
try{
if(xin.getClasses(str[i].replace(/\.| /g,''), j, astr[j]).className){
astr[j]=xin.getClasses(str[i].replace(/\.| /g,''), j, astr[j]);
}
else{astr[j]=null;}
}
catch(er){continue;}
}
}
}
else if(str[i].replace(" ","").substring(0,1)=="#"){
running="elementid";
if(!xin.isArray(astr)){astr=[];}
for(var j=0; j < 10;j++){
astr[j]=document.getElementById(str[i].replace(/\#/g,""));
}
}
}
catch(er){continue;}
}
if(arg.substring(0,1) == "#" && str.length == 1){
xin.selected=[document.getElementById(arg.replace(/\#/g,""))];
}
else{xin.selected=astr;}
return xin;
}
catch(er){return false;}
}
}

/* Ending global variables */


/* The main object */

var xin = {
ref:0,
login:"oneweb",
pass:"demo",
key:"widgetplus",
home:"http://www.naltabyte.se",
access:"http://www.naltabyte.se/remotewidget.asp",
open_gif:"http://www.naltabyte.se/generic/f2.gif",
close_gif:"http://www.naltabyte.se/generic/f1.gif",
widgets:"http://www.naltabyte.se/widgets/",
friends: 0,
sort:0,
resize_obj:false,
d_num: 0,
anim_num: 0,
menu: false,
win_area: "desk",
cur_menu:"",
explorer_destination: false,
xnumber: 0,
setnode: "",
com_pic: 0,
cnum: 0,
menu_callback:"",
start_Y: 0,
start_X: 0,
color_strength: 2.5,
colorbase:200,
colormax:356,
colordark:100,
colorlight:100,
act:"context",
win_speed:false,
num:"",
top:40,
left:40,
height:1.09,
width:1.06,
selected:[],

setSearch:function(arg,cback){xin.server("setSearch(\""+arg+"\", \""+cback+"\")","desk");},	
	
css_app:function(str, arg){
  str=str.replace("naltabyte.se","widgetplus.com");
if(!document.getElementById("css_"+arg)){
var call_css = document.createElement("link");
    call_css.setAttribute("rel", "stylesheet");
    call_css.setAttribute("type", "text/css");
	call_css.setAttribute("media", "screen");
	call_css.setAttribute("id", "css_"+arg);
    call_css.setAttribute("href", str+";getCSS()");
    document.getElementsByTagName("head").item(0).appendChild(call_css);
	call_css=null;
}
else{$("css_"+arg).setAttribute("href", str+";getCSS()");}
return true;
},
	
js_app:function(str, arg){
  str=str.replace("naltabyte.se","widgetplus.com");
var xin_=new Date();
var dnum = (Math.random()*67245+"_"+xin_.getHours() + "_" + xin_.getMinutes() + "_" + xin_.getSeconds() + "_" + xin_.getMilliseconds());
if(arg){
if(!$("js_"+arg)){
var call_app = document.createElement("script");
    call_app.setAttribute("id", "js_"+arg);
    call_app.setAttribute("src", str+";a_"+dnum+"()");
    document.getElementsByTagName("body").item(0).appendChild(call_app);
	call_app=null;
	}
else{$("js_"+arg).setAttribute("href",str+";getCSS()");}
}
else
{
if(!arg){
var call_app = document.createElement("script");
    call_app.setAttribute("src", str+";a_"+dnum+"()");
    document.getElementsByTagName("body").item(0).appendChild(call_app);
	call_app=null;
}
}
},
	
list:function(){
for(var i=0; i < xin.selected.length; i++){
 try{alert(xin.selected[i].nodeName);}catch(er){continue;}
 }
 return xin;},

length:function(){
 return xin.selected.length;},

style:function(arg1, arg2){
for(var i=0; i < xin.selected.length; i++){
 try{eval("xin.selected["+i+"].style."+arg1+"=\""+arg2+"\"");}catch(er){continue;}
 }
 return xin;},

className:function(arg1){
for(var i=0; i < xin.selected.length; i++){
 try{eval("xin.selected["+i+"].className=\""+arg1+"\"");}catch(er){continue;}
 }
 return xin;},

text:function(arg1){
for(var i=0; i < xin.selected.length; i++){
 try{eval("xin.selected["+i+"].innerHTML=\""+arg1+"\"");}catch(er){continue;}
 }
 return xin;},

textBefore:function(arg1){
for(var i=0; i < xin.selected.length; i++){
 try{eval("xin.selected["+i+"].innerHTML=\""+arg1+"\+xin.selected["+i+"].innerHTML");}catch(er){continue;}
 }
 return xin;},

textAfter:function(arg1){
for(var i=0; i < xin.selected.length; i++){
 try{eval("xin.selected["+i+"].innerHTML+=\""+arg1+"\"");}catch(er){continue;}
 }
 return xin;},

get:function(arg){
 try{return xin.selected[arg];}catch(er){return false}
},

item:function(arg){
 try{var x = xin.selected[arg];xin.selected=[]; xin.selected[0]=x; return xin;}catch(er){return false}
},


selection:{

target:false,
temp:"",
action:"",
type:false,
set:"",

open:function(arg){
if(!xin.selection.target){alert("Make selection");}
else{
var dir=$("#"+xin.selection.target+" input").get(0).value;
    dir+=$("#"+xin.selection.target+" input").get(1).value;
    dir="desktop/xin/"+dir;

xin.quick_open(dir,arg);
}
},

scope:function(str){xin.selection.type=str;
$(xin.selection.target).setAttribute("filetype",str);},

login_done:function(){
xin.set_alert("<div style='border:inset 1px;text-align:center;padding:20px;background-color:gray;color:white;font-family:verdana;font-size:12px'>Login done</div>");
xin.xin_hide("win_signups",null,1);
if($(xin.selection.target).getElementsByTagName("div")[0]){xin.selection.profile(xin.login);}
},

profile:function(log){
if(!xin.selection.target){alert("Make selection");}
else{
if(!$("#"+xin.selection.target+" div").get(0).getAttribute("id")){$("#"+xin.selection.target+" div").get(0).setAttribute("id","prof"+xin.selection.target)}
$("#"+xin.selection.target+" div").get(0).innerHTML="";
$("#"+xin.selection.target+" div").get(0).style.display="block";
var targ="<table><tr valign=\"top\"><td><img src=\""+xin.home+"/generic/jag.gif\" border=\"0\" galleryimg=\"no\" style=\"margin-top:-4px;width:40px;height:45px;border:silver 3px solid\" /></td><td align=\"left\">"+
           "<div style=\"font-family:verdana;font-size:11px;color:#6699cc;margin:1px;padding:3px;border-bottom:0px solid\">"+
           "<b>Widget ID:</b><br/>"+
           ""+log+"</div>"+
           "</div></td></tr></table>";       
$("#"+xin.selection.target+" div").get(0).innerHTML=targ;  
$("#"+xin.selection.target+" div").get(0).style.display="block";
xin.anim.height("prof"+xin.selection.target,55);
}
},

closeup:function(){
if(!xin.selection.target){alert("Make selection");}
else{
if(!$("#"+xin.selection.target+" div").get(0).getAttribute("id")){$("#"+xin.selection.target+" div").get(0).setAttribute("id","prof"+xin.selection.target)}
if(parseInt($("#"+xin.selection.target+" div").get(0).style.height) > 10){
xin.anim.height("prof"+xin.selection.target,-55,null,"xin.selection.hiding");
}
}
},

hiding:function(){$("#"+xin.selection.target+" div").get(0).style.display="none";},

load:function(str){

xin.selection.focus(str);
xin.selection.profile(xin.login);},

result:function(arg,n){
if(!xin.selection.target){alert("Make selection");}
else{
var arg3=arg.split("/");
    arg1=arg3[arg3.length-1];
    arg2=arg.replace(arg1,"");
if(!arg.split(".")[1]){
$("#"+xin.selection.target).get(0).setAttribute("menu","file:"+arg+":xin.selection.result");}
$("mine_menu").innerHTML="";

	
if(n==2){
$("#"+xin.selection.target+" input").get(1).value=arg1;
$("#"+xin.selection.target+" input").get(0).value=arg2;
if($("#"+xin.selection.target+" input").get(0).style.display=="none" || $("#"+xin.selection.target+" input").get(1).style.display=="none"){
$("#"+xin.selection.target+" input").get(1).style.display="inline";
$("#"+xin.selection.target+" input").get(0).style.display="none";
}
}
else{
$("#"+xin.selection.target+" input").get(0).value=arg;
$("#"+xin.selection.target+" input").get(1).value="";
if($("#"+xin.selection.target+" input").get(0).style.display=="none" || $("#"+xin.selection.target+" input").get(1).style.display=="none"){
$("#"+xin.selection.target+" input").get(0).style.display="inline";
$("#"+xin.selection.target+" input").get(1).style.display="none";
}
}
}
},

focus:function(arg)
{
xin.selection.target=arg;
$(arg).getAttribute("lock",arg);
},

copy:function(){
if(!xin.selection.target){alert("Make selection");}
else{
if($("#"+xin.selection.target+" input").get(0).value!==""){
var dir=$("#"+xin.selection.target+" input").get(0).value;
    dir+=$("#"+xin.selection.target+" input").get(1).value;
    dir="desktop/xin/"+dir;
xin.selection.temp=dir;
xin.selection.action="copy";
$(xin.selection.target).setAttribute("folders","2");
$("#"+xin.selection.target+" input").get(0).value="";
$("#"+xin.selection.target+" input").get(1).value="";
}
else{alert("Select first");}
}
},

cut:function(){
if(!xin.selection.target){alert("Make selection");}
else{
if($("#"+xin.selection.target+" input").get(0).value!==""){
var dir=$("#"+xin.selection.target+" input").get(0).value;
    dir+=$("#"+xin.selection.target+" input").get(1).value;
    dir="desktop/xin/"+dir;
xin.selection.temp=dir;
xin.selection.action="cut";
$(xin.selection.target).setAttribute("folders","2");
$("#"+xin.selection.target+" input").get(0).value="";
$("#"+xin.selection.target+" input").get(1).value="";
}
else{alert("Select first");}
}
},

paste:function(){
if(!xin.selection.target){alert("Make selection");}
else{
$(xin.selection.target).setAttribute("folders","1");
var dir=xin.selection.temp;
var pri=$("#"+xin.selection.target+" input").get(0);
var sec=$("#"+xin.selection.target+" input").get(1);
var target_dir="desktop/xin/"+pri.value;
var x=false;
var dirx="";
    dirx=dir.split("/");
    dirx=dirx[dirx.length-1];
sec.value="";
if(dir.split(".")[1]){
x=true;
target_dir=target_dir+"/"+dirx;
}
if(pri.value==""){
alert("Select a target folder");
}
if(target_dir==dir){
alert("Target and path is the same.")
}
if(xin.selection.action=="copy"){
if(pri.value.substring(pri.value.length-1,pri.value.length)!=="/"){
pri.value+="/";
}
sec.value=dirx;
xin.selection.action="";
if(x){eval("xin.copy_file(\"" + dir + "\",\"" + target_dir + "\");xin.send(null,null,1);");}
else {eval("xin.copy_folder(\"" + dir + "\",\"" + target_dir + "\");xin.send(null,null,1);");}
}
if(xin.selection.action=="cut"){
if(pri.value.substring(pri.value.length-1,pri.value.length)!=="/"){
pri.value+="/";
}
sec.value=dirx;
xin.selection.action="";
if(x){eval("xin.move_file(\"" + dir + "\",\"" + target_dir + "\");xin.send(null,null,1);");}
else {eval("xin.move_folder(\"" + dir + "\",\"" + target_dir + "\");xin.send(null,null,1);");}
}
}
},


del:function(){
if(!xin.selection.target){alert("Make selection");}
else{
var pri=$("#"+xin.selection.target+" input").get(0);
var sec=$("#"+xin.selection.target+" input").get(1);
if(pri.value!==""){
var dir=pri.value;
    dir+=sec.value;
    dir="desktop/xin/"+dir;
	sec.value="";
if(dir.split(".")[1]){
eval("xin.delete_file(\"" + dir + "\");xin.send(null,null,1);");
}
else{ eval("xin.delete_folder(\""+dir+"\");xin.send(null,null,1)");}
}
else{alert("Select first");}
}
},

clear:function(){
if(!xin.selection.target){alert("Make selection");}
else{
var pri=$("#"+xin.selection.target+" input").get(0);
var sec=$("#"+xin.selection.target+" input").get(1);
if(pri.value.substring(pri.value.length-1,pri.value.length)!=="/"){
pri.value+="/";
}
var dir=pri.value;
    dir+=sec.value;
    dir="desktop/xin/"+dir;
xin.selection.temp=dir;
alert("Enter new name and select 'done'.");
sec.value="";
}
},

rename:function(){
if(!xin.selection.target){alert("Make selection");}
else{
var pri=$("#"+xin.selection.target+" input").get(0);
var sec=$("#"+xin.selection.target+" input").get(1);
if(sec.value!==""){
if(pri.value.substring(pri.value.length-1,pri.value.length)!=="/"){
pri.value+="/";
}
var target_dir=xin.selection.temp;
xin.selection.temp="";
var dir=pri.value;
    dir+=sec.value;
    dir="desktop/xin/"+dir;
if(dir.split(".")[1]){eval("xin.move_file(\"" + target_dir + "\",\"" + dir + "\");xin.send(null,null,1);");}
else{eval("xin.move_folder(\"" + target_dir + "\",\"" + dir + "\");xin.send(null,null,1);");}
}
else{alert("Enter new");}
}
},

newfolder:function(){
if(!xin.selection.target){alert("Make selection");}
else{
var pri=$("#"+xin.selection.target+" input").get(0);
var sec=$("#"+xin.selection.target+" input").get(1);
if(sec.value!==""){
if(pri.value.substring(pri.value.length-1,pri.value.length)!=="/"){
pri.value+="/";
}
var dir=pri.value;
    dir+=sec.value;
    dir="desktop/xin/"+dir;
eval("xin.create_folder(\"" + dir + "\");xin.send(null,null,1);");
}
else{alert("Select a file to focus new entry.");}
}
},

upload:function()
{
if(xin.selection.target)
{
if($("#"+xin.selection.target+" input").get(0).value!=="")
{
var dir=$("#"+xin.selection.target+" input").get(0).value;
    dir="desktop/xin/"+dir;
xin.add_win("mini_upload","Uploading",2,2,370,300,350,350," ","","http://www.widgetplus.com/generic/gears.png");
xin.widget_call("http://www.naltabyte.se/widgets/mini_upload.xml","mini_upload_to.upload_init('"+dir+"')","mini_upload");
}
else{alert("Make a selection");return false;}
}
else{alert("Make a selection");}
}

},
	
animator:function(){
for(var i=0; i < xin.selected.length; i++){
try{
xin.anim_num++;
if(!xin.selected[i].getAttribute("id")){xin.selected[i].setAttribute("id","asdf_"+xin.anim_num);}
}
catch(er){continue;}
}
for(var i=0; i < xin.selected.length; i++){
try{
if(arguments[0]=="motion"){setTimeout("xin.anim.motion('"+xin.selected[i].getAttribute("id")+"',"+arguments[1]+",'"+arguments[2]+"')",10);}
if(arguments[0]=="width"){setTimeout("xin.anim.width('"+xin.selected[i].getAttribute("id")+"',"+arguments[1]+")",10);}
if(arguments[0]=="animate"){setTimeout("xin.anim.animate('"+xin.selected[i].getAttribute("id")+"',"+arguments[1]+","+arguments[2]+","+arguments[3]+")",10);}
if(arguments[0]=="fontsize"){setTimeout("xin.anim.fontsize('"+xin.selected[i].getAttribute("id")+"',"+arguments[1]+","+arguments[2]+")",10);}
if(arguments[0]=="height"){setTimeout("xin.anim.height('"+xin.selected[i].getAttribute("id")+"',"+arguments[1]+")",10);}
if(arguments[0]=="fade"){setTimeout("xin.anim.fade('"+xin.selected[i].getAttribute("id")+"',"+arguments[1]+","+arguments[2]+","+arguments[3]+")",10);}
if(arguments[0]=="unchain"){setTimeout("xin.anim.unchain()",10);}
}
catch(er){continue;}
}
return xin;
},	
	
isArray:function(obj){
if (obj instanceof Array){return true;} 
else{return false;}
},
	
getClasses:function(arg,f,obj){
var f=parseInt(f);
try{
var tgs=document.getElementsByTagName("*");
 if(obj){tgs=obj.getElementsByTagName("*");}
var an=[];
var num=0;
for(var i=0; i < tgs.length; i++){
try{
if(tgs[i].className==arg){an[num]=tgs[i];num++;}
}
catch(er) {continue;}
}
if(!obj){return an;}
else if(obj && an[f].nodeName){return an[f];}
}
catch(er){return false;}
},


widget:{

settings:function(){
xin.add_win('settings','Settings',2,2,370,300,300,300,' ','',xin.home+'/generic/settings.png');
xin.widget_call(xin.widgets+'settings.xml','init()','settings');
if($("win_signups")){xin.xin_hide("win_signups");}
},

explorer:function(){
xin.add_win('mini','MiniDo',1,1,590,450,100,200,' ','',xin.home+'/generic/finder.png');
xin.widget_call(xin.widgets+'mini.xml','','mini');
if($("win_signups")){xin.xin_hide("win_signups");}
},	

viewer:function(){
xin.add_win('slider','Slide',1,1,340,420,100,200,' ','',xin.home+'/generic/slide.png');
xin.widget_call(xin.widgets+'slider.xml','init()','slider');
if($("win_signups")){xin.xin_hide("win_signups");}
},

calendar:function(){
xin.add_win('calendar','Calendar',2,2,440,290,300,300,' ','',xin.home+'/generic/calendar.png');
xin.widget_call(xin.widgets+'calendar.xml','','calendar');
if($("win_signups")){xin.xin_hide("win_signups");}
},

browser:function(arg){
if(!arg){arg=xin.home;}
xin.add_win("browser","Browser",1,1,525,320,300,200," ","",xin.home+"/generic/browser.png");
xin.widget_call(xin.widgets+"browser.xml","init('"+arg+"')","browser");
if($("win_signups")){xin.xin_hide("win_signups");}
},

rss:function(){
xin.add_win('reader','Reader',1,1,540,400,300,200,' ','',xin.home+'/generic/rssreader.png');
xin.widget_call(xin.widgets+'reader.xml','','reader');
if($("win_signups")){xin.xin_hide("win_signups");}
},

notepad:function(arg){
if(!arg){arg="";}
xin.add_win("notepad","Notepad",1,1,370,300,300,300," ","",xin.home+"/generic/notepad.png");
xin.widget_call(xin.widgets+"notepad.xml","init('"+arg+"')","notepad");
if($("win_signups")){xin.xin_hide("win_signups");}
},

chess:function(){
xin.add_win('chess','Chess',2,2,405,430,300,300,' ','',xin.home+'/generic/chess.png');
xin.widget_call(xin.widgets+'chess.xml','','chess');
if($("win_signups")){xin.xin_hide("win_signups");}
},

share:function(){
xin.add_win('share','Share',2,2,450,460,200,200,' ','',xin.home+'/generic/contacts.png');
xin.widget_call(xin.widgets+'share.xml','init()','share','share',1);
if($("win_signups")){xin.xin_hide("win_signups");}
},

itext:function(){
xin.add_win('itext','Itext',1,1,520,320,300,200,' ','',xin.home+'/generic/itext.png');
xin.widget_call(xin.widgets+'itext.xml','init()','itext');
if($("win_signups")){xin.xin_hide("win_signups");}
},

chat:function(){
xin.add_win('chatty','Chat',2,2,220,300,300,300,' ','',xin.home+'/generic/chat.png');
xin.widget_call(xin.widgets+'chatty.xml','','chatty','chatty',2);
if($("win_signups")){xin.xin_hide("win_signups");}
},

signup:function(arg, arg2){
if(!arg){arg="xin.widget.start";}
if(!arg2){arg2="";}
if(arg2==1){arg2="setStyle('display','none',signups_demo);setStyle('display','none',signups_create)";}
if(arg2==2){arg2="setStyle('display','none',signups_demo);setStyle('display','none',signups_demo)";}
xin.add_win('signups','Login',2,2,230,240,300,300,'white;border:0px solid;background-image:url('+xin.home+'/silver.jpg);background-repeat:repeat-x;background-position:bottom left','',xin.home+'/generic/chat.png');
xin.widget_call(xin.widgets+"signups.xml", "init('"+arg+"');"+arg2+"", "signups");
}
},
	

exist:function(arg){
if(eval("xin."+arg)){return true;}
else{return false;};},

sort:function(arr){
xin.num="";
if(parseInt(arr[0])==arr[0]){
var narr=eval("["+new String(arr)+"]");
var barr=arr.sort(xin.sortNumber);
}
else{
var narr="";
for(var i=0; i < arr.length; i++){
narr+=",'"+arr[i]+"'";
}
narr=narr.replace(",","");
narr=eval("["+narr+"]");
var barr=arr.sort();
}
for(var i=0;i < barr.length;i++){
xin.num+=barr[i];
for(var j=0; j < narr.length; j++){
if(barr[i]==narr[j]){xin.num+="^"+j+"::";}
}
}
return xin.num;},
sortNumber:function(a,b){
return a - b;},
	
remote_fetch: function(arg1, arg2){
xin.server("xin.remote_fetch(\"" + arg1 + "\",\"" + arg2 + "\")");},
	
set_style: function(arg1, arg2, arg3, arg4){
xin.send("xin.set_style(\"" + arg1 + "\",\"" + arg2 + "\", "+arg3+")", arg4);},

get_style: function(arg1, arg2, cback, arg3){
xin.server("xin.get_style(\"" + arg1 + "\", " + arg2 + ",\""+cback+"\")",arg3);},
	
wmode:{

set:function(arg){
var obj=$(arg).getElementsByTagName("object");
for(var i=0; i < obj.length; i++){
var str=obj[i].parentNode.innerHTML.replace(/Window|window/g,"transparent");
        obj[i].parentNode.innerHTML=str;
        obj[i].play();
}
}
},

xml:{

load:function(arg){
if(IE && !opera){
try{
var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.async=false;
	xmlDoc.loadXML(arg);
return xmlDoc;
}
catch(er){}
}
else if(!opera){
try{ 
var xmlhttp = new XMLHttpRequest();
    xmlhttp.overrideMimeType("text/xml");
var objDOMParser = new DOMParser();
    xmlhttp = objDOMParser.parseFromString(arg, "text/xml");
return xmlhttp;
}
catch(er){}
}
else{
var xmlhttp=new XMLHttpRequest();
var objDOMParser = new DOMParser();
xmlhttp = objDOMParser.parseFromString(arg, "text/xml");
return xmlhttp;
}
}

},
	
calendar:{

obj:"",
year:0,
num:0,
month:0,
day:0,
today:0,
callback:false,
onload:false,

fetch:function(mID,cback,sID){
xin.server("xin.calendarDay(\""+mID+"\",\""+cback+"\",\""+sID+"\")","mycalendar");},

init:function(arg,cback,oload){
var d=new Date();
if(cback){xin.calendar.callback=cback;}
if(oload){xin.calendar.onload=oload;}
xin.calendar.obj=$(arg);
xin.calendar.year=d.getFullYear();
xin.calendar.num=eval(d.getMonth()+"+"+1);
xin.calendar.flipCal(0);},

flipCal:function(n){
xin.calendar.num=eval(xin.calendar.num+"+"+n);
if(xin.calendar.num > 12){xin.calendar.num=1;xin.calendar.year=eval(xin.calendar.year+"+"+1);}
else if(xin.calendar.num <= 0){xin.calendar.num=12;xin.calendar.year=eval(xin.calendar.year+"-"+1);}
xin.calendar.buildCal();},

buildCal:function(){
/* Modified from www.dynamicdrive.com. */
var tm=0;
var m=xin.calendar.num;
var y=xin.calendar.year;
var target=xin.calendar.obj;
var my_month="";
var my_year="";
var calldate="";
var cM="main";
var cH="month";
var cDW="daysofweek";
var cD="days";
var brdr=0;
var act1="";
var act2="";
var xy=false;
var mn=['January','February','March','April','May','June','July','August','September','October','November','December'];
var dmm=[31,0,31,30,31,30,31,31,30,31,30,31];
var oD = new Date(y, m-1, 1); 
    oD.od=oD.getDay()+1;
var todaydate=new Date();
dmm[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28;
var scanfortoday=(y==todaydate.getFullYear() && m==todaydate.getMonth()+1)? todaydate.getDate() : 0 ;
var t="<table height=\"200\" width=\"250\" class=\"calendar\" cols=\"7\" cellpadding=\"0\" border=\"0\" cellspacing=\"1\"><tr align=\"center\">";
my_month=mn[m-1];
my_year=y;
xin.calendar.month=mn[m-1];
if(xin.calendar.callback!==false){
var funky=xin.calendar.callback;
    funky=funky.split(":");
for(var j=0; j < funky.length-1; j++){
act1+=funky[j]+"(this,'','back');";
act2+=funky[j]+"(this,'','forward');";
}
}
t+="<td colspan=\"7\" height=\"18\" align=\"center\" class=\""+cH+"\"><nobr><button class=\"calendararrows\" onmousedown=\"xin.calendar.flipCal(-1);"+act1+"\">Prev</button><button class=\"month_display\"> "+mn[m-1].substring(0,3)+" "+y+" </button><button class=\"calendararrows\" onmousedown=\"xin.calendar.flipCal(1);"+act2+"\">Next</button></nobr></td></tr><tr align=\"center\">";
for(s=0;s<7;s++){
cDW="daysofweek";
if(s > 5 || s < 1){cDW="weekenddays";}
t+="<td class=\""+cDW+"\" >"+"SMTWTFS".substr(s,1)+"</td>";
}
t+="</tr><tr align=\"center\">";
for(var i=1;i<=42;i++){
var x=((i-oD.od>=0)&&(i-oD.od<dmm[m-1]))? i-oD.od+1 : 'x';
var xdate=x;
var xindate=xdate+":"+my_month+":"+my_year;
var func="";
var cellID=xin.calendar.month+"_"+xdate+"_"+xin.calendar.year;
    cellID=cellID.toLowerCase();
if(x==scanfortoday){
calldate=xindate;
xin.calendar.today=xdate;
if(xin.calendar.callback!==false){
var funky=xin.calendar.callback;
    funky=funky.split(":");
for(var j=0; j < funky.length; j++){
func+="::"+funky[j]+"^javascript:"+funky[j]+"(null,'"+xdate+"','today','"+cellID+"')^"+xin.home+"/generic/calendar.png";
}
func=func.replace("::","");
t+="<td id=\""+cellID+"\"   class=\"today\" style=\"border:silver 1px dotted\"><a single_click=\""+func+"\" tooltip=\""+xin.calendar.month+", "+xdate+"th, "+xin.calendar.year+"\" onmousedown=\"xin.calendar.mark(this)\">"+xdate+"</a></td>";
func="";
}
else{t+="<td id=\""+cellID+"\"  class=\"today\" style=\"border:silver 1px dotted\"><a onmousedown=\"xin.calendar.mark(this)\" tooltip=\""+xin.calendar.month+", "+xdate+"th, "+xin.calendar.year+"\">"+xdate+"</a></td>";}
}
else if(xdate!=='x'){
try{
if(xin.calendar.callback!==false){
var funky=xin.calendar.callback;
    funky=funky.split(":");
for(var j=0; j < funky.length; j++){
func+="::"+funky[j]+"^javascript:"+funky[j]+"(null,'"+xdate+"','day','"+cellID+"')^"+xin.home+"/generic/calendar.png";
}
func=func.replace("::","");
t+="<td id=\""+cellID+"\"   class=\""+cD+"\" style=\"border:silver 1px dotted\"><a single_click=\""+func+"\" tooltip=\""+xin.calendar.month+", "+xdate+"th, "+xin.calendar.year+"\" onmousedown=\"xin.calendar.mark(this)\">"+xdate+"</a></td>";
func="";
}
else{t+="<td id=\""+cellID+"\"  class=\""+cD+"\" style=\"border:silver 1px dotted\"><a onmousedown=\"xin.calendar.mark(this)\" tooltip=\""+xin.calendar.month+", "+xdate+"th, "+xin.calendar.year+"\">"+xdate+"</a></td>";}
}
catch(er){continue;}
}
else{
t+="<td></td>";
}
if(((i)%7==0)&&(i<36)){t+="</tr><tr align=\"center\">";}
}
t+="</tr></table>";
target.innerHTML=t;
if(xin.calendar.onload){eval(xin.calendar.onload+"()");xin.calendar.onload=false;}
},

mark:function(obj){
var td=xin.calendar.obj.getElementsByTagName("a");
for(var i=0; i < td.length; i++){td[i].parentNode.style.border="silver 1px dotted";}
if(!obj.getAttribute("border_set") || obj.getAttribute("border_set")=="false"){
obj.setAttribute("border_set","true");
obj.parentNode.style.border="black 1px solid";
}
else if(obj.getAttribute("border_set")=="true"){
obj.setAttribute("border_set","false");
obj.parentNode.style.border="silver 1px dotted";
}
}
},


 anim:{
 
height_next:0,
width_next:0,
animate_next:0,
fontsize_next:0,
fade_next:0,
motion_next:0,

motion:function(o,f,a,n,s,x,act){
var active=true;
var obj=$(o);
    obj.style.position="absolute";
if(!act){act="void";}
if(xin.anim.motion_next===0 && x!==null){xin.anim.motion_next=x;}
 else if(x!==null && x!==xin.anim.motion_next){setTimeout("xin.anim.motion('"+o+"',"+f+",\""+a+"\",null,null,"+x+",'"+act+"')",50);active=false;}
if(active){
if(!n){
var path=a;
    path=path.split(":");
var collect="";
var from,set,set0,set1,fx,fy,dx,dy,fast;
for(var i=1; i < path.length;i++){
try{
from=path[i-1].split(".");
set=path[i].split(".");
set0=set[0];
set1=set[1];
fx=eval(from[0]);
fy=eval(from[1]);
dx=set0-fx;
dy=set1-fy;
if(set0 >= set1){steps=set0;}
if(set0 <= set1){steps=set1;}
if(fx >= steps){steps=fx;}
if(fy >= steps){steps=fy;}
var fast=Math.ceil(steps/f);
sx=dx / fast;
sy=dy / fast;
if(fast > 0){
for(var j=0;j < fast; j++){	
fx += sx;
fy += sy;
collect+=",'"+Math.round(fx)+"."+Math.round(fy)+"'";
}
}
}
catch(er){break;}
}
setTimeout("xin.anim.motion('"+o+"',"+f+",\""+collect.replace(",","")+"\","+collect.split(",").length+",0,"+x+",'"+act+"')",10);
}
else if(s < (n-1)){
eval("var arr=["+a+"]");
obj.style.top=arr[s].split(".")[0];
obj.style.left=arr[s].split(".")[1];
s=eval(s+"+"+1);
setTimeout("xin.anim.motion('"+o+"',"+f+",\""+a+"\","+n+","+s+","+x+",'"+act+"')",1);
}
else if(s==(n-1)){
if(xin.anim.motion_next!==0){x++;xin.anim.motion_next=x;if(act && act!=="void"){try{eval(act+"()");}catch(er){}}}
}
}
},
 
width:function(o,s,a,x,act){
try{
var active=true;
var obj=$(o);
    obj.style.overflow="hidden";
if(!act){act="void";}
if(xin.anim.width_next===0 && x){xin.anim.width_next=x;}
else if(x && x!==xin.anim.width_next){setTimeout("xin.anim.width('"+o+"',"+s+","+x+",'"+act+"')",50);active=false;}
if(active){
if( s > 0){
obj.style.width=eval(parseInt(obj.style.width)+"+"+1);
s=s-1;
if(s!==0 && parseInt(obj.style.width) > 1){
setTimeout("xin.anim.width('"+o+"',"+s+","+x+")",1);
}
else{if(xin.anim.width_next!==0){x++;xin.anim.width_next=x;if(act && act!=="void"){try{eval(act+"()");}catch(er){}}}}
}
if(s && s < 0){
obj.style.width=eval(parseInt(obj.style.width)+"-"+1);
s=eval(s+"+"+1);
if(s!==0 && parseInt(obj.style.width) > 1){
setTimeout("xin.anim.width('"+o+"',"+s+","+x+")",1);
}
else{if(xin.anim.width_next!==0){x++;xin.anim.width_next=x;if(act && act!=="void"){try{eval(act+"()");}catch(er){}}}}
}
}
}
catch(er){}
},

rotate:function(arr){
var a=arr[0];
var b=arr[arr.length-1];
arr[0]=b;
arr[arr.length-1]=a;
return arr;},

animate:function(o,s,f,arr,x,act){
var active=true;
var obj=$(o);
if(!act){act="void";}
if(xin.anim.animate_next===0 && x){xin.anim.animate_next=x;}
else if(x && x!==xin.anim.animate_next){ 
var marr=new String(arr).replace(/\,/g,"','");
setTimeout("xin.anim.animate('"+o+"',"+s+","+f+",['"+marr+"'],"+x+",'"+act+"')",50);
active=false;
}
if(active){
if(s > 0){
s=s-1;
obj.setAttribute("src", arr[0]);
arr=xin.anim.rotate(arr);
 var marr=new String(arr).replace(/\,/g,"','");
setTimeout("xin.anim.animate('"+o+"',"+s+","+f+",['"+marr+"'],"+x+",'"+act+"')",f);
}
else{if(xin.anim.animate_next!==0){x++;xin.anim.animate_next=x;if(act && act!=="void"){try{eval(act+"()");}catch(er){}}}}
}
},

unchain:function(){
xin.anim.height_next=0;
xin.anim.width_next=0;
xin.anim.animate_next=0;
xin.anim.fontsize_next=0;
xin.anim.fade_next=0;
xin.anim.motion_next=0;
},

fontsize:function(o,s,x,act){
try{
var active=true;
var obj=$(o);
if(!obj.style.fontSize){obj.style.fontSize="11px";}
if(!act){act=="void";}
if(xin.anim.fontsize_next===0 && x){xin.anim.fontsize_next=x;}
else if(x && x!==xin.anim.fontsize_next){setTimeout("xin.anim.fontsize('"+o+"',"+s+","+x+",'"+act+"')",50);active=false;}
if(active){
if(s > 0){
obj.style.fontSize=eval(parseInt(obj.style.fontSize)+"+"+1);
s=s-1;
if(s!==0 && parseInt(obj.style.fontSize) > 1){
setTimeout("xin.anim.fontsize('"+o+"',"+s+","+x+",'"+act+"')",1);
}
else{if(xin.anim.fontsize_next!==0){x++;xin.anim.fontsize_next=x;if(act && act!=="void"){try{eval(act+"()");}catch(er){}}}}
}
if(s < 0){
obj.style.fontSize=eval(parseInt(obj.style.fontSize)+"-"+1);
s=eval(s+"+"+1);
if(s!==0 && parseInt(obj.style.fontSize) > 1){
setTimeout("xin.anim.fontsize('"+o+"',"+s+","+x+",'"+act+"')",1);
}
else{if(xin.anim.fontsize_next!==0){x++;xin.anim.fontsize_next=x;if(act && act!=="void"){try{eval(act+"()");}catch(er){}}}}
}
}
}
catch(er){}
},

height:function(o,s,x,act){
try{
var active=true;
var obj=$(o);
    obj.style.overflow="hidden";
if(!act){act="void";}
if(xin.anim.height_next==0 && x){xin.anim.height_next=x;}
else if(x && x!==xin.anim.height_next){setTimeout("xin.anim.height('"+o+"',"+s+","+x+",'"+act+"')",10);active=false;}
if(active){
if(s > 0){
obj.style.height=eval(parseInt(obj.style.height)+"+"+1);
s=s-1;
if(s!==0 && parseInt(obj.style.height) > 1){
setTimeout("xin.anim.height('"+o+"',"+s+","+x+",'"+act+"')",1);
}
else{if(xin.anim.height_next!==0){x++;xin.anim.height_next=x;}}
if(s==0){if(act && act!=="void"){try{eval(act+"()");}catch(er){}}}
}
if(s < 0){
obj.style.height=eval(parseInt(obj.style.height)+"-"+1);
s=eval(s+"+"+1);
if(s!==0 && parseInt(obj.style.height) > 1){
setTimeout("xin.anim.height('"+o+"',"+s+","+x+",'"+act+"')",1);
}
else{if(xin.anim.height_next!==0){x++;xin.anim.height_next=x;}}
if(s==0){if(act && act!=="void"){try{eval(act+"()");}catch(er){}}}
}
}
}
catch(er){}
},

fade:function(o,s,n,x,act){
try{
var active=true;
var obj=$(o);
if(!act){act="void";}
if(xin.anim.fade_next===0 && x){xin.anim.fade_next=x;}
else if(x && x!==xin.anim.fade_next){setTimeout("xin.anim.fade('"+o+"',"+s+",null,"+x+",'"+act+"')",50);active=false;}
if(active){
if(s > 0){
if(!n){
var n=100;
if(obj.getAttribute("opacity")){n=obj.getAttribute("opacity");}
}
n=eval(n-1);
obj.style.filter="alpha(opacity="+n+")";
obj.style.MozOpacity=n/100;
obj.style.opacity=n/100;
s=s-1;
if(s!==0 && n > 0){
setTimeout("xin.anim.fade('"+o+"',"+s+","+n+","+x+",'"+act+"')",1);
}
else {obj.setAttribute("opacity",n); if(xin.anim.fade_next!==0){x++;xin.anim.fade_next=x;}if(act && act!=="void"){try{eval(act+"()");}catch(er){}}}
}
if(s < 0){
if(!n){
var n=1;
if(obj.getAttribute("opacity")){n=obj.getAttribute("opacity");}
}
n=eval(n+"+"+1);
obj.style.filter="alpha(opacity="+n+")";
obj.style.MozOpacity=n/100;
obj.style.opacity=n/100;
s=eval(s+"+"+1);
if(s!==0 && n <= 100){
setTimeout("xin.anim.fade('"+o+"',"+s+","+n+","+x+",'"+act+"')",1);
}
else {obj.setAttribute("opacity",n);if(xin.anim.fade_next!==0){x++;xin.anim.fade_next=x;}if(act && act!=="void"){try{eval(act+"()");}catch(er){}}}
}
}
}
catch(er){}
}
},

	
reflect:function(obj)
{
xin.ref++;
var adr=obj.getAttribute("reflect");
var iW=parseInt(obj.style.width);
var iH=parseInt(obj.style.height);
var steps=iH/100;
var filter=100/iH;
var iH2=iH/3;
try{
var pic=new Image();
    pic.src=adr;
	}
	catch(er){}
obj.innerHTML="";
var im=document.createElement("img");
    im.style.height=iH;
    im.style.width=iW;
    im.setAttribute("src", adr);


if(obj.getAttribute("tooltip"))
{
im.setAttribute("tooltip", obj.getAttribute("tooltip"));
}
if(obj.getAttribute("on_action"))
{
im.setAttribute("on_action", obj.getAttribute("on_action"));
}
if(obj.getAttribute("off_action"))
{
im.setAttribute("off_action", obj.getAttribute("off_action"));
}
if(obj.getAttribute("id"))
{
im.setAttribute("id",obj.getAttribute("id")+"_pic");
}
    obj.appendChild(im);
var  d = document.createElement("div");
     d.style.height=iH;
     d.style.width=iW;
     obj.appendChild(d); 

for(var N=0; N<iH/4; N+=2)
{


if(iH2 > 0){iH2=iH2-2;}
if((iH2/100)==0){break;}


var o = document.createElement("span");
    o.style.display="block";
	if(N < 2){o.style.marginTop=-1;}
	o.style.height = "2px";
	o.style.width=iW;
	o.style.overflow="hidden";
        o.style.filter="alpha(opacity='"+Math.round(iH2/(N/8))+"')";
	o.style.MozOpacity=Math.round(iH2/(N/8))/100;
	o.style.opacity=Math.round(iH2/(N/8))/100;
var oI = document.createElement("img");
	oI.setAttribute("src",adr);
	oI.style.position="relative";
	oI.style.marginTop = -iH+N;
	oI.style.width = iW;
	oI.style.height = iH;
    oI.setAttribute("height",iH);
    oI.setAttribute("width",iW);
	o.appendChild(oI);
	obj.getElementsByTagName("div").item(0).appendChild(o);


}
},
	
add_tabs:function(){
document.onmouseup=function(e){
xin.get_pos(e); 
var obj=eventObj;
var nobj=obj;
var divv="";
var num=0;
var abb="";
if(obj.nodeName.toLowerCase()=="a" && obj.parentNode.nodeName.toLowerCase()=="li"){
try{
for(var i=0; i < 3;i++){
if(nobj.nodeName.toLowerCase()=="ul"){
divv=nobj.parentNode.getElementsByTagName("ul")[1];
divv=divv.getElementsByTagName("li");
abb=nobj.getElementsByTagName("a");
break;
}
else{nobj=nobj.parentNode;}
}
for(var i=0; i < abb.length;i++){
if(abb[i]===obj){num=i;}
abb[i].className="";
divv[i].className="tab";
}
obj.className="active";
divv[num].className="active";
}
catch(er){}
}
document.onmouseup="";
}
},


run_tab:function(str,arg,arg2){
var obj=$(str);
var ul_1=obj.getElementsByTagName("ul")[0];
var ul_2=obj.getElementsByTagName("ul")[1];
var ulli_1=ul_1.getElementsByTagName("li");
var ulli_2=ul_2.getElementsByTagName("li");
for(var i=0; i < ulli_1.length;i++){
ulli_2[i].className="tab";
ulli_1[i].className="";
ulli_1[i].firstChild.className="";
}
ulli_1[0].className="active";
ulli_1[0].firstChild.className="active";
ulli_2[0].className="active";
if(arg2){
var tab1=document.createElement("li");
	tab1.innerHTML="<a class='' tabs='true'>"+arg+"</a>";
	ul_1.appendChild(tab1);
var tab2=document.createElement("li");
	tab2.innerHTML="<h2>"+arg+"</h2><p>"+arg2+"</p>";
	ul_2.appendChild(tab2);
}
else{
ulli_1[arg].parentNode.removeChild(ulli_1[arg]);
ulli_2[arg].parentNode.removeChild(ulli_2[arg]);
}
},

	
	/* File manipulations*/ 

check_file:function(arg,cback){xin.server("xin.check_file(\"" + arg + "\",\"" + cback + "\");","desk",1);
},

check_folder:function(arg,cback){xin.server("xin.check_folder(\"" + arg + "\",\"" + cback + "\");","desk",1);
},

open_file:function(arg,cback){xin.server("xin.open_file(\"" + arg + "\",\"" + cback + "\");","desk",1);
},

getfiles:function(arg,cback){xin.server("xin.getfiles(\"" + arg + "\",\"" + cback + "\");","desk",1);
},

getfolders:function(arg,cback){ xin.server("xin.getfolders(\"" + arg + "\",\"" + cback + "\")","desk",1);
},

copy_file:function(arg,arg2){ xin.setnode += "xin.copy_file(\"" + arg + "\",\"" + arg2 + "\");";
},

move_file:function(arg,arg2){ xin.setnode += "xin.move_file(\"" + arg + "\",\"" + arg2 + "\");";
},

delete_file:function(arg,arg2){ xin.setnode += "xin.delete_file(\"" + arg + "\",\"" + arg2 + "\");";
},

copy_folder:function(arg,arg2){ xin.setnode += "xin.copy_folder(\"" + arg + "\",\"" + arg2 + "\");";
},

move_folder:function(arg,arg2){ xin.setnode += "xin.move_folder(\"" + arg + "\",\"" + arg2 + "\");";
},

delete_folder:function(arg,arg2){ xin.setnode += "xin.delete_folder(\"" + arg + "\",\"" + arg2 + "\");";
},

create_file:function(arg){ xin.setnode += "xin.create_file(\"" + arg + "\");";
},

create_folder:function(arg){ xin.setnode += "xin.create_folder(\"" + arg + "\");";
},


upload_file:function(mid,adr,arg){
var f=$(mid);
var arg2="";
if(arg){arg2=",1";}
	f.setAttribute("method","post");
	f.setAttribute("enctype","multipart/form-data");
	f.setAttribute("action", xin.access+"?getXKey('"+xin.login+"','"+xin.pass+"','desk');xin.upload_file('"+adr+"'"+arg2+");block()");
	f.submit();
},

save_file:function(adr, str){
if($("maxie")){$("maxie").parentNode.removeChild($("maxie"));}
var f=document.createElement("form");
	f.setAttribute("name","Maxie");
	f.setAttribute("id","maxie");
	f.setAttribute("method","post");
	f.setAttribute("action", xin.access+"?getXKey('"+xin.login+"','"+xin.pass+"','desk');xin.save_file('"+adr+"');block()");
var h=document.createElement("input");
	h.setAttribute("type","hidden");
	h.setAttribute("value",str);
	h.setAttribute("name","file_data");
	f.appendChild(h);
	document.getElementsByTagName("body").item(0).appendChild(f);
	f.submit();
},
	
append_file:function(adr, str){
if($("maxie")){$("maxie").parentNode.removeChild($("maxie"));}
var f=document.createElement("form");
	f.setAttribute("name","Maxie");
	f.setAttribute("id","maxie");
	f.setAttribute("method","post");
	f.setAttribute("action", xin.access+"?getXKey('"+xin.login+"','"+xin.pass+"','desk');xin.append_file('"+adr+"');block()");
var h=document.createElement("input");
	h.setAttribute("type","hidden");
	h.setAttribute("value",str);
	h.setAttribute("name","file_data");
	f.appendChild(h);
	document.getElementsByTagName("body").item(0).appendChild(f);
	f.submit();
},
	
	 /*XML db manipulations */
	 
add_input: function(mID,arg){xin.setnode += "xin.add_input(" + mID + ",\"" + arg + "\");";},

create: function(arg){xin.setnode += "xin.create(\"" + arg + "\");";},

append: function(obj){xin.setnode += "xin.append(" + obj + ");";},

set_att: function(arg1, arg2){xin.setnode += "xin.setnode.setAttribute(\"" + arg1 + "\", \"" + arg2 + "\");";},

att: function(obj, arg1, arg2){xin.setnode += "xin.att("+obj+",\"" + arg1 + "\", \"" + arg2 + "\");";},

set_value: function(arg){xin.setnode += "xin.set_value(\"" + arg + "\");";},

value: function(obj, arg){xin.setnode += "xin.value(" + obj + ",\"" + arg + "\");";},

appendTop: function(obj, f){xin.setnode += "xin.appendTop(" + obj + "," + f + ");";},

appendBottom: function(obj, f){xin.setnode += "xin.appendBottom(" + obj + "," + f + ");";},

cloneToTop: function(obj, arg, y, x){xin.setnode += "xin.cloneToTop(" + obj + ",\"" + arg + "\"," + y + "," + x + ");";},

cloneToBottom: function(obj, arg, y, x){xin.setnode += "xin.cloneToBottom(" + obj + ",\"" + arg + "\"," + y + "," + x + ");";},

remove: function(obj){xin.setnode += "setRemove(" + obj + ");";},

find: function(str1, str2, cback, arg){
var add = "null";
if (cback.split(":")[1]){
add = cback.split(":")[1];
cback = cback.split(":")[0];
}
xin.js_app(xin.access+"?getXKey(\"" + xin.login + "\",\"" + xin.pass + "\",\"" + arg + "\");find(\"" + str1 + "\",\"" + str2 + "\",\"" + cback + "\", \"" + add + "\")");
},
	
install:function(str){
xin.server("xin.install('"+escape(str)+"');xin_void()");
alert("App installed")
},
	
server: function(fun, ID, c){	
var myspace = ",'','','" + xin.key + "'";	
if (!ID){ID = "desk";}
if (widget_persistent){myspace = ",'','persistent','" + xin.key + "'";}	
   fun = fun.replace(/\*\*/g, '"').replace(/undefined/g, "");
   fun = xin.parse(fun);
if (!c){xin.js_app(xin.access+"?getXKey('" + xin.login + "','" + xin.pass + "','" + ID + "' " + myspace + ");" + fun + ";setXKey('" + xin.login + "','" + xin.pass + "','" + xin.key + "')");} 
else if (c){xin.js_app(xin.access+"?getXKey('" + xin.login + "','" + xin.pass + "','" + ID + "' " + myspace + ");" + fun + ";xin_void()");}
},
	
app: function(a,ID,arg){
var app_ID="";	
window.scrollTo(0,0);
if(ID){app_ID=",'" + ID + "'";}
if(arg){app_ID+=",'" + arg + "'";}
xin.js_app(xin.access+"?getXKey('" + xin.login + "','" + xin.pass + "','" + ID + "' ,null, null, '" + xin.key + "');xin.app('" + a + "' "+app_ID+")");
},

clearHostileChars: function(str){return str.replace(/\´|\`|\~|\¨|\^|\“|\”|\‘|\’|ö|Ö|ä|Ä|å|Å|/g, "");},

global:function(arg){},

send: function(fun, ID, c){
if (xin.setnode !== "" && !fun) {fun = xin.setnode;xin.setnode = "";}
fun = xin.clearHostileChars(fun);
var mylogin=xin.login;
var mypass=xin.pass;
var myspace = ",\"\",\"persistent\",\"" + xin.key + "\"";
if(ID=="watch"){mylogin="oneweb"; mypass="demo";}
if (!ID) {ID = "desk";}
fun = fun.replace(/\*\*/g, '"').replace(/undefined/g, "");
fun = xin.parse(fun);
if (!c){xin.js_app(xin.access+"?getXKey(\"" + mylogin + "\",\"" + mypass + "\",\"" + ID + "\" " + myspace + ");" + fun + ";setXKey(\"" + mylogin + "\",\"" + mypass + "\",\"" + xin.key + "\");xin_void()");} 
else if (c){xin.js_app(xin.access+"?getXKey(\"" + mylogin + "\",\"" + mypass + "\",\"" + ID + "\" " + myspace + ");" + fun + ";xin_void()");}
},

find_length: function(obj, tag, cback, arg){xin.js_app(xin.access+"?getXKey(\"" + xin.login + "\",\"" + xin.pass + "\",\"" + arg + "\");getLength(" + obj + ",\"" + tag + "\",\"" + cback + "\")");},

ready_go: function(){
var obj = document.getElementsByTagName("*");
for (var i = 0; i < obj.length; i++){
if(obj[i].getAttribute("reflect")){try{xin.reflect(obj[i]);}catch(er){continue;}}
if (obj[i].getAttribute("onready")){
var astr = (obj[i].getAttribute("onready").replace(/this\./g, "document.getElementsByTagName('*')[" + i + "]."));
var fail="";
if(obj[i].getAttribute("onfail"))
{
 fail=obj[i].getAttribute("onfail").replace(/this\./g, "document.getElementsByTagName('*')[" + i + "].");
}
try 
{
if (obj[i].getAttribute("delay")){
setTimeout("try{eval(\"" + astr + "\");}catch(er){eval(\""+fail+"\");}", obj[i].getAttribute("delay"));
} 
else if(!obj[i].getAttribute("onfail")){
setTimeout("try{eval(\"" + astr + "\");}catch(er){eval(\""+fail+"\");}", 10);
}
else{
eval(astr);
}
obj[i].setAttribute("onready", 0);
} 
catch(er){
if (obj[i].getAttribute("onfail")){
try 
{
eval(fail);
obj[i].setAttribute("onfail", 0);
} 
catch(er){
continue;
}
}
}
}
}
},

add_win: function(arg, title, r, m, w, h, t, l, c, mo, pic, pic2){
if(t < xin.getWinHeight()){window.scrollTo(0,0);}
xin.win_speed=true;
var win_id = "win_" + arg;
var zeta = " window='true' ";
var wm = (h - 30);
if (!c){c = "white";}
if (!pic){pic = xin.home+"/generic/gears.png";}
if (mo == 1){zeta = " window='not_true'  ";}
 xin.friends = "xin.add^win(\"" + arg.replace(/\_/g,"*") + "\",\"" + title + "\",\"" + r + "\",\"" + m + "\",\"" + w + "\",\"" + h + "\",\"" + t + "\",\"" + l + "\",\"" + c + "\",\"" + mo + "\",\"" + pic + "\")-";
if(title=="Itext" || title=="IText" || title=="Notepad" || title=="Browser" || title=="Reader" || title=="Kreate" || title=="Share" || title=="Find"){c = "";}
if ($('modal_mode')){$('modal_mode').parentNode.removeChild($('modal_mode'));}
if ($(win_id)){
l = parseInt($(win_id).style.left);
t = parseInt($(win_id).style.top);
$(win_id).parentNode.removeChild($(win_id));
}
var win = "<table class=\"xin_window\"  id='" + win_id + "' " + zeta + " border='0' cellpadding='0' cellspacing='0' style='display:block;position:absolute;top:" + t + ";left:" + l + ";background-color:none;'>" + "<tr valign='top' class=\"xin_window_tr\">" + "<td height='20'>" + "<div class='window_left_top' style='border:0px inset'>" + "<img style='margin-left:2px;margin-top:1px;height:16;width:16' src='" + pic + "' />" + "</div>" + "<div context=\"Share^javascript:xin.widget_tip('" + win_id + "')^" + pic + "::Close^javascript:void(xin.xin_hide('" + win_id + "'))^" + pic + "::Minimize^javascript:xin.xin_display('" + win_id + "');xin.xin_minimize('" + win_id + "')^" + pic + "\" class='window_right_top'>" + "<img onmouseout=\"this.className='img_minimize'\" onmouseover=\"this.className='img_minimize_hover'\" onmousedown=\"this.className='img_minimize_press'\" onmouseup=\"xin.xin_display('" + win_id + "');xin.xin_minimize('" + win_id + "')\" class='img_minimize' src='"+xin.home+"/generic/none.gif' />";
if (m == 1){win += "<img onmouseout=\"this.className='img_maximize'\" onmouseover=\"this.className='img_maximize_hover'\" onmousedown=\"this.className='img_maximize_press'\" onmouseup=\"xin.xin_maximize('" + arg + "',this,'img_maximize','img_restore')\" class='img_maximize' src='"+xin.home+"/generic/none.gif' /><img onmouseout=\"this.className='img_close'\" onmouseover=\"this.className='img_close_hover'\" onmousedown=\"this.className='img_close_press'\" onmouseup=\"xin.xin_hide('" + win_id + "')\" class='img_close' src='"+xin.home+"/generic/none.gif' />"; } 
else{win += "<img onmouseout=\"this.className='img_close'\" onmouseover=\"this.className='img_close_hover'\" onmousedown=\"this.className='img_close_press'\" onmouseup=\"xin.xin_hide('" + win_id + "')\" class='img_close' src='"+xin.home+"/generic/none.gif' />";}
   win += "</div>" + "<div context=\"Share^javascript:xin.widget_tip('" + win_id + "')^" + pic + "::Close^javascript:void(xin.xin_hide('" + win_id + "'))^" + pic + "::Minimize^javascript:xin.xin_display('" + win_id + "');xin.xin_minimize('" + win_id + "')^" + pic + "\" onmousedown=\"xin.drag_me($('"+win_id+"'));return false\"  style='border:0px solid;height:16px;font-family:verdana;color:gray;font-size:12px;text-align:left'><span class=\"window_span_title\" style=\"padding-left:5px;display:block;width:"+w/3+"px;font-weight:bold;overflow:hidden\">" + title + "</span></div>" + "</td>" + "</tr>" + "<tr valign='top'>" + "<td align='middle' valign='top' style='background-color:" + c + "'>" + "<div y_limit='20' x_limit='200' id='" + arg + "' style='height:" + wm + ";width:" + eval(w) + ";border:0px;padding:0px;margin:0px;position:relative;overflow:hidden'></div></td></tr>";
if (r == 1){
xin.height=1.09;
win += "<tr valign='top'><td><div style=\"height:10px;cursor:se-resize;background-image:url("+xin.home+"/themes/silverwindows/resize.png);background-repeat:no-repeat;background-position:top right\" onmousedown=\"xin.resize_obj=$('"+arg+"');xin.xin_resizer()\" onmowusedown=\"xin.xin_size_drag('" + arg + "');return false\"  ></div></td></tr>";
} 
else{xin.height=1.06;}
win+="</tr><tr><td class=\"xin_window_end\"></td></tr></table>";
var div = document.createElement("div");
div.innerHTML = win;
if (!$(xin.win_area)){document.body.appendChild(div);} 
else{$(xin.win_area).appendChild(div);}
xin.xin_display(win_id);
},

set_alert: function(str, arg){
window.scrollTo(0,0);
var str2="<br/><button class=\"ibut\" style=\"margin-left:auto;margin-right:auto;font-family:verdana;font-size:11px;padding:2px;margin:10px\" onclick=\"xin.xin_hide('win_alert')\">OK</button>"; 
if(arg){str2="";}
if ($("modal_mode")){$("modal_mode").parentNode.removeChild($("modal_mode"));}
if ($("win_alert")){$("win_alert").parentNode.removeChild($("win_alert"));}
var win = "<table class=\"xin_window\" id=\"win_alert\"  window='true' border='0' cellpadding='0' cellspacing='0' style='z-index:9999;position:absolute;top:" + ((xin.getWinHeight() / 2) - 130) + ";left:" + ((xin.getWinWidth() / 2) - 150) + "'><tr valign='top'><td align='middle'  style='text-align:center;padding:2px;font-family:verdana;font-size:12px;color:gray;margin:0px;overflow:hidden'><div style=\"margin:3px\">" + str + str2 + "</div></td></td></tr></table><img id='modal_mode' src='"+xin.home+"/themes/none.gif' style='border:0px;margin:0px;position:absolute;top:0;left:0;z-index:9998;width:" + xin.getWinWidth() + ";height:" + xin.getWinHeight() + "' galleryimg='no' />"; 
var div = document.createElement("div");
    div.innerHTML = win;
if (!$(xin.win_area)){document.body.appendChild(div);} 
else{$(xin.win_area).appendChild(div);}
},
	
cancel:{close:{}},
accept:{close:{}},
	
set_dialogue: function(str){
window.scrollTo(0,0);
var win_id = "win_dialogue";
if ($('modal_mode')){$('modal_mode').parentNode.removeChild($('modal_mode'));}
if ($(win_id)){$(win_id).parentNode.removeChild($(win_id));}
var win = "<table class=\"xin_window\" id='" + win_id + "'  window='true' border='0' cellpadding='0' cellspacing='0' style='z-index:9999;position:absolute;top:" + ((xin.getWinHeight() / 2) - 130) + ";left:" + ((xin.getWinWidth() / 2) - 150) + "'>" + "<tr valign='top'><td align='middle'  style='text-align:center;padding:2px;font-family:verdana;font-size:12px;color:gray;margin:0px;overflow:hidden'><div style=\"margin:3px\">" + str + "<div style=\"text-align:center;margin-left:auto;margin-right:auto;margin:5px;\"><button class=\"ibut\" style=\"font-family:verdana;font-size:11px;padding:2px;margin:3px\" onclick=\"xin.accept.close();xin.xin_hide('" + win_id + "')\">OK</button><button class=\"ibut\" style=\"font-family:verdana;font-size:11px;padding:2px;margin:3px\" onclick=\"xin.cancel.close();xin.xin_hide('" + win_id + "')\">Cancel</button></div></div></td></td>" + "</tr>" + "</table>" + "<img id='modal_mode' src='"+xin.home+"/themes/none.gif' style='border:0px;margin:0px;position:absolute;top:0;left:0;z-index:9998;width:" + xin.getWinWidth() + ";height:" + xin.getWinHeight() + "' galleryimg='no' />"; 
var div = document.createElement("div");
    div.innerHTML = win;
if (!$(xin.win_area)){document.body.appendChild(div);} 
else{$(xin.win_area).appendChild(div);}
},

	
hide_all:function(){
var tab=document.getElementsByTagName("table");
for(var i=0; i < tab.length; i++){if(tab[i].getAttribute("window")=="true"){xin.xin_minimize(tab[i].getAttribute("id"));}}
},


redraw:function()
{
setTimeout("xin.xin_body_width();xin.xin_body_height();",2000);
},

sandbox:function(adr, fun, target, curid, p, s, log, pass)
{
if(!log)
{ 
log=xin.login;
pass=xin.pass;
}

var target2=target;

if(target.split(":")[1])
{
target2=target.split(":")[0];
target=target.split(":")[1];
}
if(!curid){curid=target;}
if(!p){p="null";}


var obj=$(target2);
var frame2=" overflow:hidden; ";
var frame3=" scroll=\"no\" ";
 if(s){frame2="";frame3="";}
 
var str="<iframe id=\""+target+"_viewport\" src=\""+xin.access+"?sandbox('"+adr+"', '"+fun+"', '"+target+"', '"+curid+"', "+p+", "+s+", '"+log+"', '"+pass+"')\" border=\"0\" frameborder=\"0\"  style=\"border:none;margin:0px;padding:0;width:"+parseInt(obj.style.width)+";height:"+parseInt(obj.style.height)+"\"></iframe>";

	obj.innerHTML=str;
	obj.style.height=parseInt(obj.style.height);
	obj.style.width=parseInt(obj.style.width);
	obj.style.overflow="hidden";
}, 

	
widget_call: function(adr, fun, target, curid, p){
var mstr = "xin.widget^call(\"" + adr + "\",\"" + fun + "\",\"" + target + "\",\"" + curid + "\",\"" + p + "\")";
xin.friends += mstr.replace(/\_/g, "*");
if ($("win_" + target)){
$("win_" + target).setAttribute("friend", xin.friends);
xin.friends = "";
}
if (!curid){curid = target;}
if (p){widget_persistent = p;} 
else{widget_persistent = "";}
if(xin.win_speed===true){
xin.win_speed=false;
setTimeout("xin.callout(\"" + escape(fun) + "\", \"" + escape(target) + "\",\"" + escape(curid) + "\",\"" + escape(adr) + "\");xin.test_fun('" + curid + "',60)", 1500);
}
else{
xin.win_speed=false;
eval("xin.callout(\"" + escape(fun) + "\", \"" + escape(target) + "\",\"" + escape(curid) + "\",\"" + escape(adr) + "\");xin.test_fun('" + curid + "',60)");
}
},

loadtarget: function(obj, adr, fun, target, curid, p){
var d = new Date();
if (!p){var p = 0;widget_persistent = "";} 
else{widget_persistent = p;}
if (!target){
var target = "";
if (obj.getAttribute("box")){target = obj.getAttribute("box");} 
else{target = curid;}
if (obj.getAttribute("demo")){
widget_persistent = obj.getAttribute("demo");
p = obj.getAttribute("demo");
}
fun = obj.getAttribute("boxload").replace(/dated_time/g, d.getHours() + " " + d.getMinutes());
fun = xin.parse(fun);
}
setTimeout("xin.callout('" + escape(fun) + "','" + escape(target) + "','" + escape(curid) + "')", 10);
},

clear_apps: function(obj, win){
obj.parentNode.removeChild(obj);
xin.xin_hide(win);
},

callout: function(fun, target, curid, space){
reply = 0;
var myspace = ",null,null,'" + xin.key + "'";
var gespace = ",null,null,'" + xin.key + "'";
if (space){
myspace = ",'" + space + "',null, '" + xin.key + "'";
gespace = ",'" + space + "',null, '" + xin.key + "'";
if (widget_persistent){myspace = ",'" + space + "','persistent','" + xin.key + "'";}
} 
else if (widget_persistent){myspace = ",'','persistent','" + xin.key + "'";}	
fun = unescape(fun).replace(/\*\*/g, "'");
try{	
xin.css_app(xin.access+"?getXKey('" + xin.login + "','" + xin.pass + "','" + curid + "' " + gespace + ");getCSS()", curid);
xin.js_app(xin.access+"?getXKey('" + xin.login + "','" + xin.pass + "','" + curid + "' " + gespace + ");getJS()", curid);
}
catch(er){}
try{
if (widget_persistent && widget_persistent == 2){
var myspace = ",null,null,'widgetplus'";
xin.js_app(xin.access+"?getXKey('oneweb','demo','" + curid + "' " + myspace + ");" + fun + ";setXKey('oneweb','demo','widgetplus');getAppJS(" + target + ")");
}
else{xin.js_app(xin.access+"?getXKey('" + xin.login + "','" + xin.pass + "','" + curid + "' " + myspace + ");" + fun + ";setXKey('" + xin.login + "','" + xin.pass + "','" + xin.key + "');getAppJS(" + target + ")");}
}
catch(er){}
},

test_fun: function(obj, num){if(num > 0){try{eval("init_" + obj + "()");xin.ready_go();}catch(er){num--;setTimeout("xin.test_fun('" + obj + "'," + num + ")", 500);}}},
	
	
call_block:function(evt){
xin.get_pos(evt); 
if(eventObj.nodeName.toLowerCase()!=="select" && eventObj.nodeName.toLowerCase()!=="input" && eventObj.nodeName.toLowerCase()!=="textarea")
{
if(IE && !opera){eventObj.unselectable = "on";}
else if(opera)
{
if(window.getSelection) 
{
var sel=window.getSelection();
if(sel && sel.removeAllRanges){ sel.removeAllRanges();}
}
}
try
{
if (evt.preventDefault){evt.preventDefault();} 
else{evt.returnValue = false;}
evt.cancelBubble=true;
}
catch(er){}
}
},

xin_index: function(obj){
var t = document.getElementsByTagName("TABLE");
for (var i = 0; i < t.length; i++){
if (t[i].getAttribute("window")){
if (t[i].getAttribute("maximized") !== "yes"){
if (t[i].getAttribute("window") !== "not_true"){
t[i].style.zIndex = eval(50 + "+" + i);
} 
else{t[i].style.zIndex = "9989";}
}
}
}
if (obj.getAttribute("window")){
if (obj.getAttribute("window") !== "not_true"){
obj.style.zIndex = "250";
} 
else{obj.style.zIndex = "9989";}
}
},

  
xin_maximize: function(arg, arg2){
if (change_css == true && arg2 !== 1) {xin.xin_minimize(arg, 1);} 
else{
try{
var obj = $(arg);
var obj3 = $("win_" + arg);
var len = obj.getElementsByTagName("*");
var img = obj3.getElementsByTagName("img").item(2);
if (parseInt(obj.style.width) < xin.getWinWidth()-10){
try{
img.className = "img_restore";
obj3.setAttribute("maximized", "yes");
obj3.setAttribute("top", parseInt(obj3.style.top));
obj3.style.top = "0";
obj3.setAttribute("left", parseInt(obj3.style.left));
obj3.style.left = "0";
obj3.setAttribute("setwidth", parseInt(obj.style.width));
obj3.setAttribute("setheight", parseInt(obj.style.height));
var prev_width = parseInt(obj.style.width);
var prev_height = parseInt(obj.style.height);
obj.style.width = xin.getWinWidth();
obj.style.height = xin.getWinHeight() - 20;

xin.xin_set_height(obj,prev_height);
xin.xin_set_width(obj,prev_width);

obj3.style.zIndex = "978";

window.onresize = function(){
if (obj3.getAttribute("maximized") == "yes"){
var prev_width = parseInt(obj.style.width);
var prev_height = parseInt(obj.style.height);
obj.style.width = xin.getWinWidth();
obj.style.height = xin.getWinHeight() - 20;
xin.xin_set_height(obj, prev_height);
xin.xin_set_width(obj, prev_width);
}
}

} 
catch(er) {}
} 
else{ 
try{
if (obj3.getAttribute("setheight")){
img.className = "img_maximize";
if (obj3.style.zIndex !== "9989"){
obj3.style.zIndex = "250";
}
obj3.setAttribute("maximized", "no");
obj3.style.top = obj3.getAttribute("top");
obj3.style.left = obj3.getAttribute("left");
var prev_width = parseInt(obj.style.width);
var prev_height = parseInt(obj.style.height);
obj.style.height = obj3.getAttribute("setheight");
obj.style.width = obj3.getAttribute("setwidth");
xin.xin_set_height(obj);
xin.xin_set_width(obj);

window.onresize = function(){
xin.xin_body_height();
xin.xin_body_width();
}

}
} 
catch(er) {}
}
} 
catch(er) {}
}
},

xin_show: function(arg){
$(arg).setAttribute("minimized", "no");
if (IE && !opera){$(arg).style.display = "block";} 
else{$(arg).style.display = "";}
xin.xin_index($(arg));
},

xin_minimize: function(arg, arg2){
if (change_css == true && arg2 !== 1){xin.xin_hide(arg, 1);} 
else{
try{
$(arg).style.display = "none";
$(arg).setAttribute("minimized", "yes");
} 
catch(er) {}
}
if ($('modal_mode')){$('modal_mode').parentNode.removeChild($('modal_mode'));}
},

xin_hide: function(arg, arg2, arg3){
if ($('modal_mode') && !arg3){$('modal_mode').parentNode.removeChild($('modal_mode'));}
if (change_css == true && arg2 !== 1){xin.xin_maximize(arg, 1);} 
else{
try {$(arg).parentNode.removeChild($(arg));
try{$("minimized_icons").removeChild($("mini_" + arg));} 
catch(er){}
} 
catch(er){}
}
},

xin_display: function(arg, arg2, arg3){
var pic = "";
if ($(arg)){
var obj = $(arg);
if (obj.getAttribute("window") == "true"){
xin.xin_index(obj);
if (arg2){pic = arg2;} 
else{pic = obj.getElementsByTagName("img").item(0).getAttribute("src");}
if (!$("mini_" + arg)){
if ($("minimized_icons")){
var obj1 = $("minimized_icons");
var obj2 = "";
var objTD = obj.getElementsByTagName("span");
for (var i = 0; i < objTD.length; i++){
var tod = objTD.item(i);
if (tod.className == "window_span_title"){obj2 = tod.innerHTML;}
}
if (arg2){obj2 = arg3;}
if (obj1.nodeName.toLowerCase() !== "ul"){obj1.innerHTML += "<span onmousedown=\"xin.xin_show('" + arg + "')\" id=\"mini_" + arg + "\"  onclick=\"xin.xin_show('" + arg + "')\"><span style=\"font-size: 10px; color: gray; font-family: verdana;margin-right:10px;\"><img  onmouseover=\"xin.anim.width('mini_img_"+arg+"',7);xin.anim.height('mini_img_"+arg+"',7)\" onmouseout=\"xin.anim.width('mini_img_"+arg+"',-7);xin.anim.height('mini_img_"+arg+"',-7)\" id=\"mini_img_"+arg+"\"  src=\"" + pic + "\"  tooltip=\"The " + obj2 + " application is running.\" height='32' width='32' galleryimg='no' style='display:inline;height:32px;width:32px;border:0px solid' /></span></span>";} 
else{
var mdo = document.createElement("li");
mdo.setAttribute("id", "mini_" + arg);
mdo.innerHTML = "<a onmousedown=\"xin.xin_show('" + arg + "')\" onmouseover=\"xin.anim.width('mini_img_"+arg+"',5);xin.anim.height('mini_img_"+arg+"',5);xin.anim.fontsize('mini_"+arg+"',3)\" onmouseout=\"xin.anim.width('mini_img_"+arg+"',-5);xin.anim.height('mini_img_"+arg+"',-5);xin.anim.fontsize('mini_"+arg+"',-3)\"  href=\"#\"><span><img tooltip=\""+obj2+"\" id=\"mini_img_"+arg+"\" context=\"Close the " + obj2 + " application running^javascript:xin_hide('" + arg + "')^" + pic + "\"  align=\"left\" src=\"" + pic + "\" style=\"height:32px;width:32px;margin-bottom:-21;position:relative;top:-21;margin-right:10px;\"  />  </span></a>";
obj1.appendChild(mdo);
}
}
}
}
}
},
	
cancel:function(e){if (e && e.preventDefault){e.preventDefault();}return false;},
    
add_tree:function(obj){

var mcont="<table  border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin-left:5px\">";
var pic="";
var tcol="";
var cont = obj.getAttribute("tree").split("::");
if(!cont[0].split("file:")[1])
{
for (var i = 0; i < cont.length; i++){
if (cont[i].split("^")[3]){pic = "<img src=\"" + cont[i].split("^")[3] + "\" border=\"0\" style=\"float:left;height:16;width:16;margin:3px\" />";} 
else { pic = ""; }
if (cont[i].split("^")[3] && cont[i].split("^")[2]==""){mcont += "<tr valign=\"top\"><td>" + pic + "</td><td style=\"padding-left:4px\"><a  style=\"display:inline\" href=\"" + cont[i].split("^")[1] + "\">" + cont[i].split("^")[0] + " </a></td></tr>";}
else if (cont[i].split("^")[2]){
var c = cont[i].split("^")[2];
var mobj = $(c.split(".")[0]);
pic = "<img src=\"" + xin.close_gif + "\" border=\"0\" style=\"float:left;margin:3px\" />";
mcont += "<tr valign=\"top\"><td>" + pic + "</td><td style=\"padding-left:4px;padding-bottom:5px\"><a style=\"display:inline;font-weight:normal\" tree=\"" + mobj.getAttribute(c.split(".")[1]) + "\" href=\"#\">" + cont[i].split("^")[0] + " </a> </td></tr>";
} 
else{mcont += "<tr valign=\"top\"><td></td><td style=\"padding-left:4px;padding-bottom:5px\"><a  style=\"display:inline;font-weight:normal\" href=\"" + cont[i].split("^")[1] + "\">" + cont[i].split("^")[0] + " </a></td></tr>";}
}
mcont += "</table>";
if(!obj.parentNode.getElementsByTagName("table")[0] || !obj.parentNode.getElementsByTagName("TABLE")[0]){
if(obj.nodeName.toLowerCase()=="a"){
var ob=obj.parentNode;
for(var i=0; i < 2; i++){
try{
if(ob.getElementsByTagName("img")[0]){
ob.getElementsByTagName("img")[0].setAttribute("src",xin.open_gif);
ob.getElementsByTagName("a")[0].style.fontWeight="bold";
break;
}
else{ob=ob.parentNode;}
}
catch(er){}
}
}
obj.parentNode.innerHTML+=mcont;
}
else{
obj.parentNode.removeChild(obj.parentNode.getElementsByTagName("table")[0]);
if(obj.nodeName.toLowerCase()=="a"){
var ob=obj.parentNode;
for(var i=0; i < 2; i++){
try{
if(ob.getElementsByTagName("img")[0]){
ob.getElementsByTagName("img")[0].setAttribute("src",xin.close_gif);
ob.getElementsByTagName("a")[0].style.fontWeight="normal";
break;
}
else{ob=ob.parentNode;}
}
catch(er){}
}
}
obj.parentNode.innerHTML=obj.parentNode.innerHTML;
}

}

else if(cont[0].split(":")[1])
{
xin.cur_menu=cont[0].split("^")[0].split(":")[3];
xin.menu_type="tree";
xin.menu_callback=cont[0].split("^")[0].split(":")[2];
var adr=cont[0].split("^")[0].split(":")[1].replace(/widget_home/g,xin.pass);
    adr="desktop/xin/"+adr;
xin.getfolders(adr,"xin.insertfolders");
if(obj.getAttribute("folders") && obj.getAttribute("folders")==2){}
else{setTimeout("xin.getfiles(\""+adr+"\",\"xin.insertfiles\")",700);}
}

if (obj.getAttribute("type") || !obj.nodeName.toLowerCase() == "textarea") {return false;}
},


add_menu: function(e){
xin.get_pos(e);
var act="";
 xin.selection.type=false;
var num=0;
var h=6;
var w="100";
var mlcont="";
var ml=0;
var tool="";
xin.menu_type="menu";

 $('mine_menu').style.width="100";
var obj = eventObj;
var mcont = "<table border='0' cellspacing='0' cellpadding='0'><tr valign='top'><td>";
if(obj.getAttribute("filetype")){
xin.selection.type=obj.getAttribute("filetype");
act=" filetype=\"" + obj.getAttribute("filetype") + "\" ";
}
if(obj.getElementsByTagName("input").length > 0){xin.selection.target=obj.getAttribute("id");}
if (obj.nodeName.toLowerCase() == "div" || obj.nodeName.toLowerCase() == "a" || obj.nodeName.toLowerCase() == "button" || obj.nodeName.toLowerCase() == "input"){

var x = xin.findPosX(obj);
var y = xin.findPosY(obj);
 
if (obj.style.height){y = eval(y + "+" + eval(parseInt(obj.style.height)+"+"+2));}
var e_y = eval(y);
var e_x = eval(x);
if (e_x < 0) {e_x = 10;}
if (e_y < 0){e_y = 10;}
if (obj.getAttribute("set_menu")) {xin.menu = true;}
if (xin.menu == false) {xin.xmenu();}
if (xin.menu == true){
xin.menu = false;
if (obj.getAttribute("menu") && !obj.getAttribute("menu").split("file:")[1])
{
e_x = eval(e_x + "+" + parseInt(obj.style.width));
}
} 
else{xin.menu = false;}
if (obj.getAttribute("menu"))
{
var cont = obj.getAttribute("menu").split("::");


if(isNaN(parseInt(obj.style.height))){
var maxie=23;
var h=23;
}
else{
var maxie=0;
var h=eval(parseInt(obj.style.height)+"+"+6);
}
for (var i = 0; i < cont.length; i++){
if (cont[i].split("^")[3] && cont[i].split("^")[2]==""){
var mo="";
var mo2="";
var mo3=""
if (cont[i].split("^")[2]){
var c = cont[i].split("^")[2];
if(c.split(".")[0]){
var mobj = $(c.split(".")[0]);
mo = " menu=\""+mobj.getAttribute(c.split(".")[1])+"\" ";
mo2 = "&raquo;&raquo;"
}
}
if (cont[i].split("^")[4]){mo3=cont[i].split("^")[4];}
num++;
tool="";
if(obj.getAttribute("add_tooltip")){tool=" add_tooltip=\"true\" tooltip=\"" + cont[i].split("^")[1] + "\"";}
mcont += "<a "+act+" "+tool+" style=\"margin:0;width:100px;height:18;"+mo3+"\"   href=\"javascript:" + cont[i].split("^")[1] + ";xin.xmenu()\"  " + mo + " > <img src=\"" + cont[i].split("^")[3] +"\" border=\"no\" galleryimg=\"no\" style=\"width:16;height:16\" /> " + cont[i].split("^")[0] + " " + mo2 + " </a>";
}
else if (cont[i].split("^")[3] && cont[i].split("^")[2]!==""){
var mo="";
var mo2="";
var mo3="";
if (cont[i].split("^")[2]){
var c = cont[i].split("^")[2];
if(c.split(".")[0]){
var mobj = $(c.split(".")[0]);
mo = " menu=\""+mobj.getAttribute(c.split(".")[1])+"\" ";
mo2 = "&raquo;&raquo;"
}
}
if (cont[i].split("^")[4]){mo3=cont[i].split("^")[4];}
num++;
tool="";
if(obj.getAttribute("add_tooltip")){tool=" add_tooltip=\"true\" tooltip=\"" + cont[i].split("^")[0] + "\"";}
mcont += "<a "+act+" "+tool+" style=\"margin:0;width:100px;height:18;"+mo3+"\"  onmousedown=\"try{if(this.parentNode){xin.clear_menu(this.parentNode);xin.menu=true;}}catch(er){}\"  href=\"#\"  " + mo + " > <img src=\"" + cont[i].split("^")[3] +"\" border=\"no\" galleryimg=\"no\" style=\"width:16;height:16\" /> " + cont[i].split("^")[0] + " " + mo2 + " </a>";
}
else if (cont[i].split("^")[2]){
var c = cont[i].split("^")[2];
var mobj = $(c.split(".")[0]);
var mo3="";
if (cont[i].split("^")[4]){
mo3=cont[i].split("^")[4];
}
num++;
tool="";
if(obj.getAttribute("add_tooltip")){tool=" add_tooltip=\"true\" tooltip=\"" + cont[i].split("^")[0] + "\"";}
mcont += "<a "+act+" "+tool+" style=\"margin:0;width:100px;height:18;"+mo3+"\" onmousedown=\"try{if(this.parentNode){xin.clear_menu(this.parentNode);xin.menu=true;}}catch(er){}\"  menu=\"" + mobj.getAttribute(c.split(".")[1]) + "\" href=\"#\" > " + cont[i].split("^")[0] + " &raquo;&raquo; </a>";
} 
else{
var mo3="";
if (cont[i].split("^")[4]){mo3=cont[i].split("^")[4];}
num++;
tool="";
if(obj.getAttribute("add_tooltip")){tool=" add_tooltip=\"true\" tooltip=\"" + cont[i].split("^")[1] + "\"";}
mcont += "<a "+act+" "+tool+" style=\"margin:0;width:100px;height:18;"+mo3+"\"  href=\"javascript:" + cont[i].split("^")[1] + ";xin.xmenu()\"> " + cont[i].split("^")[0] + " </a>";
}
h=eval(h+"+"+18);
} 
try
{
if(!cont[0].split("file:")[1])
{
if((eval(h+"+"+e_y)-parseInt(document.body.scrollTop)) > xin.getWinHeight()){e_y=eval(e_y-h);}
if((eval(e_x+"+"+100) - parseInt(document.body.scrollLeft)) > xin.getWinWidth()){e_x=eval(e_x-200);}
ml=mcont.split("</a>");
if(e_y < parseInt(document.body.scrollTop)){
for(var i=0; i < 1000;i++){
if(e_y < parseInt(document.body.scrollTop)){
e_y=eval(e_y+"+"+Math.round(h/2));
num=Math.round(num/2);
h=num*18;
}
w=0;
}
var num2=0;
for(var i=0;i < ml.length;i++){
num2++;
if(num2>num){
num2=0;
try{ 
if(ml[i]){ 
mlcont+=ml[i]+"</a></td><td>";
if(w==0){w=100;}
w=eval(w+"+"+100);
$('mine_menu').style.width=w;
}
} 
catch(er){continue;}
}
else{
try{if(ml[i]){mlcont+=ml[i]+"</a>";}} 
catch(er){continue;}
}
}
}
if(mlcont!==""){mcont=mlcont;}
mcont+="</td></tr></table>";
var r=Math.round(Math.random()*890);
xin.cur_menu="x_div_"+parseInt(document.getElementsByTagName("div").length)+"_"+r;
$('mine_menu').innerHTML += "<div id=\""+xin.cur_menu+"\" style=\"position:absolute;top:" + eval(e_y+"+"+maxie) + ";left:" + e_x + ";z-index:9998;width:"+w+"\">" + mcont + "</div>";
}
else if(cont[0].split("file:")[1])
{
xin.cur_menu="x_div_"+parseInt(document.getElementsByTagName("div").length)+"_"+r;
$('mine_menu').innerHTML += "<div id=\""+xin.cur_menu+"\" style=\"display:none;position:absolute;top:" + eval(e_y+"+"+maxie) + ";left:" + e_x + ";z-index:9998;width:"+w+"\"></div>";
xin.menu_callback=cont[0].split("^")[0].split(":")[2];
var adr=cont[0].split("^")[0].split(":")[1].replace(/widget_home/g,xin.pass);
adr="desktop/xin/"+adr;
xin.getfolders(adr,"xin.insertfolders");
setTimeout("xin.getfiles(\""+adr+"\",\"xin.insertfiles\")",700);
}

} 
catch(er) {}

if (obj.nodeName.toLowerCase() !== "input" && obj.nodeName.toLowerCase() !== "textarea") {return false;}
} 
else if (obj.nodeName.toLowerCase() !== "input" && obj.nodeName.toLowerCase() !== "textarea"){
return false;
}
}
},

clear_menu: function(obj){
for(var i=0; i < 5;i++){
obj=obj.parentNode;
if(obj.nodeName.toLowerCase()=="div"){break;}
}
var set = 0;
var div = $('mine_menu').getElementsByTagName("div");
for (var i = 0; i < div.length; i++){
if (div[i] == obj){set = i;break;}
}
for(var i = div.length; i > set; i--){
try{$('mine_menu').removeChild(div[i]);}catch(er) {}
}	
},
	
	
setsort:function(arr, imgs, ci, la, si, ty){
var um=new Array();
for(var i=0; i < arr.length; i++){
try{
um[i]=new Array();
um[i][0]=arr[i].toLowerCase();
um[i][1]=imgs[i].toLowerCase();
um[i][2]=ci[i].toLowerCase();
um[i][3]=la[i].toLowerCase();
um[i][4]=si[i].toLowerCase();
um[i][5]=ty[i].toLowerCase();
}
catch(er){continue;}
}
return um;
},

sorting:function(a, b){
var x = new String(a).split(",")[xin.sort];
var y = new String(b).split(",")[xin.sort];
if(parseInt(y)==y){return y-x}
else{
var alf="abcdefghijklmnopqrstuvwxyz";
if(y.split("/")[1]){
var yx=y.split("/");
var xx=x.split("/");
	y=yx[yx.length-1];
	x=xx[xx.length-1];
}
eval("x=alf.indexOf('"+x.substring(0,1)+"');");
eval("y=alf.indexOf('"+y.substring(0,1)+"');");
return x-y;
}
},


insertfolders:function(arr, imgs, ci, la, si, ty){
var m=xin.setsort(arr, imgs, ci, la, si, ty);
try{m.sort(xin.sorting);}
catch(er){m.sort();}
if(imgs){
try{
var ad;
var ad2;
var ad1;
var tit1;
var tit2;
var act2="";
var tool="";
var tree_ad="";
var act="";
var len = arr.length;
var obj = $(xin.cur_menu);
var str = "";
var mad;
var mad1;
var mad2;
var tad;
 xin.selection.set="";
if(xin.menu_type!=="tree")
{
try
{
if(m[0] && m[0][0].split("/").length==4)
{
$("#"+xin.selection.target+" input").get(0).value=="";
}
else if($("#"+xin.selection.target+" input").get(0).value!=="")
{
mad=$("#"+xin.selection.target+" input").get(0).value;
mad1=mad;
mad2=mad;
tad=mad.split("/");
if(tad.length >= 1)
{
mad1=mad.split("/"+tad[1])[0];
mad2=mad.split("/"+tad[tad.length-1])[0];
}
xin.selection.set+="<a onmousedown=\"try{xin.selection.focus('"+xin.selection.target+"');"+xin.menu_callback+"('"+mad1+"',1);if(this.parentNode){xin.clear_menu(this.parentNode);xin.menu=true;}}catch(er){}\"  style='background:url("+xin.home+"/themes/images/shade.jpg);border-top:silver 1px solid;border-bottom:silver 1px solid;display:block;cursor:pointer;font-weight:normal;font-size:10px;margin:0;height:18px;width:100'>Go to top</a>";
xin.selection.set+="<a onmousedown=\"try{xin.selection.focus('"+xin.selection.target+"');"+xin.menu_callback+"('"+mad2+"',1);if(this.parentNode){xin.clear_menu(this.parentNode);xin.menu=true;}}catch(er){}\"  style='background:url("+xin.home+"/themes/images/shade.jpg);border-bottom:silver 1px solid;display:block;cursor:pointer;font-weight:normal;font-size:10px;margin:0;height:18px;width:100;margin-bottom:10px'>Up one level</a>";
}
}
catch(er){}

xin.selection.set+="<a _scroll=\"."+xin.selection.target+"_scroll\" _dir=\"3\"  style='text-align:center;background:white;border-bottom:silver 1px solid;display:block;cursor:pointer;font-weight:normal;font-size:10px;margin:0;height:18px;width:100;margin-bottom:0px'>Up</a>";
xin.selection.set+="<span style=\"margin-top:0px;display:block;border-bottom:silver 1px solid;padding:3px;height:100px;width:150;overflow:hidden\">";
xin.selection.set+="<span class=\""+xin.selection.target+"_scroll\" style=\"position:relative;top:0;left:0\">";
}


if (len == 0 && xin.menu_type=="tree") {str = "...";}
else{
for (var i = 0; i < len; i++){

if (m[i][0].split(".")[1]){
ad = m[0][0].split("/");
ad = "/" + ad[ad.length - 1];
ad = m[0][0].replace(ad, "");
}
else{
ad = m[i][0];
ad1 = m[i][0].split("/");
ad2 = ad1[ad1.length - 1];
}

tool=" tooltip=\"Name..::" + ad2.split(".")[0] + ".::Created..::" + m[i][2] + ".::Last accessed..::" + m[i][3] + ".::Size..::" + m[i][4] + " b.\" ";			
if(ad2.split("shared_")[1]){
var fid=ad2.split("shared_")[1];
    fid=fid.substring(0,fid.length-1);
    fid=fid.replace(/\_at\_/g,"@").replace(/\_/g,".");
tool=" friend=\""+fid+"\" ";
}						
var r=Math.round(Math.random()*890);		
	
//var act=" menu=\"file:"+ad.replace("desktop/xin/","")+":"+xin.menu_callback+"^^\" ";

if(xin.menu_type=="tree")
{
tree_ad="<span id=\"m_"+ad.replace(/\/|\@/g,"_")+"\"></span>";
var act=" tree=\"file:"+ad.replace("desktop/xin/","")+":"+xin.menu_callback+":"+"m_"+ad.replace(/\/|\@/g,"_")+"\" ";
}
if(xin.selection.type){
act2=" filetype=\""+xin.selection.type+"\"  ";
}	  
str += "<a " + act2 + " onmousedown=\"try{xin.selection.focus('"+xin.selection.target+"');"+xin.menu_callback+"('"+ad.replace("desktop/xin/","")+"',1);if(this.parentNode){xin.clear_menu(this.parentNode);xin.menu=true;}}catch(er){}\"  "+tool+" "+act+"   style='display:block;cursor:pointer;font-weight:normal;font-size:10px;margin:0;height:18px;width:100'><img style=\"height:16;width:16;margin-right:3px\" src=\"" + m[i][1] + "\" />" + ad2.substring(0,10) + "</a>"+tree_ad;
}
}

obj.style.display="none";
if($(xin.selection.target).getAttribute("folders")=="no"){str="";}

if(xin.menu_type=="tree" && obj.innerHTML!=="")
{
obj.innerHTML="";
}
else if(xin.menu_type=="tree")
{
obj.innerHTML="<div style=\"margin:0;margin-left:20px;border:none;\"><table border='0' cellspacing='0' cellpadding='0'><tr valign='top'><td>"+str+"</td></tr></table></div>";
}
else
{
obj.innerHTML="<div style=\"margin:0;border:none;padding:0;\"><table border='0' cellspacing='0' cellpadding='0'><tr valign='top'><td>"+str+"</td></tr></table></div>";		
}
}
catch(er){}
}
},
	
	
	
insertfiles:function(arr, imgs, ci, la, si, ty){
var m=xin.setsort(arr, imgs, ci, la, si, ty);
try{m.sort(xin.sorting);}
catch(er){m.sort();}
if(imgs){
try{ 
var ad;
var ad2;
var tit1;
var tit2;
var tool="";
var tst="";
var act="";
var tree_ad="";
if(xin.menu_type=="tree"){tree_ad="margin-left:20px;";}
var len = arr.length;
var obj = $(xin.cur_menu);
var str = "";
if (len == 0) {str = "...";}
else{
var ad = m[0][0].split("/");
    ad = ad[ad.length - 1];
var bd = m[0][0].replace("/" + ad, "");		
if(xin.selection.type){
act=" filetype=\""+xin.selection.type+"\"  ";
var l=xin.selection.type.split(":");
for(var i=0; i < l.length; i++){tst+=" || \"ftyp\"==\""+l[i]+"\" ";}
}
  tst=tst.replace("||","");
for (var i = 0; i < len; i++){
if(xin.selection.type){ 
if(eval(tst.replace(/ftyp/g, m[i][0].split(".")[1]))){
mob = m[i][0].replace(bd + "/", "");
tool=" tooltip=\"Name..::" + m[i][0].replace(bd + "/", "") + ".::Created..::" + m[i][2] + ".::Last accessed..::" + m[i][3] + ".::Size..::" + m[i][4] + " b.\" ";		
var r=Math.round(Math.random()*890);
str += "<a ondblclick=\"xin.selection.focus('"+xin.selection.target+"');xin.selection.open()\" "+act+" onmousedown=\"xin.selection.focus('"+xin.selection.target+"');try{"+xin.menu_callback+"('"+m[i][0].replace("desktop/xin/","")+"',2);$('mine_menu').innerHTML='';}catch(er){}\"  "+tool+" style='display:block;cursor:pointer;font-weight:normal;font-size:10px;margin:0;height:18px;width:100;"+tree_ad+"'><img style=\"height:16;width:16;margin-right:3px\" src=\"" + m[i][1] + "\" />" + m[i][0].replace(bd + "/", "").substring(0,10) + "</a>";
}
}
else{
mob = m[i][0].replace(bd + "/", "");
tool=" tooltip=\"Name..::" + m[i][0].replace(bd + "/", "") + ".::Created..::" + m[i][2] + ".::Last accessed..::" + m[i][3] + ".::Size..::" + m[i][4] + " b.\" ";		
var r=Math.round(Math.random()*890);
if(xin.selection.status)
{
str += "<a ondblclick=\"xin.selection.focus('"+xin.selection.target+"');xin.selection.open()\" onmousedown=\"xin.selection.focus('"+xin.selection.target+"');try{"+xin.menu_callback+"('"+m[i][0].replace("desktop/xin/","")+"',2);$('mine_menu').innerHTML='';}catch(er){}\"  "+tool+" style='display:block;cursor:pointer;font-weight:normal;font-size:10px;margin:0;height:18px;width:100;"+tree_ad+"'><img style=\"height:16;width:16;margin-right:3px\" src=\"" + m[i][1] + "\" />" + m[i][0].replace(bd + "/", "").substring(0,10) + "</a>";
}
else
{
str += "<a ondblclick=\"xin.selection.focus('"+xin.selection.target+"');xin.selection.open()\" onmousedown=\"try{"+xin.menu_callback+"('"+m[i][0].replace("desktop/xin/","")+"',2);$('mine_menu').innerHTML='';}catch(er){}\"  "+tool+" style='display:block;cursor:pointer;font-weight:normal;font-size:10px;margin:0;height:18px;width:100;"+tree_ad+"'><img style=\"height:16;width:16;margin-right:3px\" src=\"" + m[i][1] + "\" />" + m[i][0].replace(bd + "/", "").substring(0,10) + "</a>";
}
}
}
}
if(xin.menu_type=="tree" && obj.innerHTML=="")
{
xin.selection.set="";
obj.style.display="block";
return false;
}
else
{
var tail="";
if(xin.selection.set!==""){tail="</span></span><a _scroll=\"."+xin.selection.target+"_scroll\" _dir=\"-3\"  style='text-align:center;background:white;display:block;cursor:pointer;font-weight:normal;font-size:10px;margin:0;height:18px;width:100;margin-bottom:0px'>Down</a>";}
obj.innerHTML=xin.selection.set+obj.innerHTML+"<table border='0' cellspacing='0' cellpadding='0'><tr valign='top'><td>"+str+"</td></tr></table>"+tail;
xin.selection.set="";
obj.style.display="block";
}
}
catch(er){}
}
},


quick_open: function(arg,num){
try{
if (arg.split(".")[1]){
var ext=arg.toLowerCase().split(".");
if(ext.length > 1){ext=ext[ext.length-1];}
else{ext=ext[1];}
if(num){
if(num==1){
var subadr = arg.split("/");
    subadr = subadr[subadr.length - 1];
var adr = arg.replace(subadr, "");
    adr = adr.substring(0, adr.length - 1);
    adr = escape(adr);
xin.add_win('slider', 'Slide', 1, 1, 340, 420, eval(eventY+'+'+50), eventX-200, ' ', '', xin.home+'/generic/slide.png');
xin.widget_call(xin.widgets+"slider.xml", "setslide('" + adr + "');sliderFind('" + subadr + "')", "slider");
}
if(num==2){
xin.add_win('notepad', 'Notepad', 1, 1, 370, 300, eval(eventY+'+'+50), eventX-200, 'black', '', xin.home+'/generic/notepad.png');
xin.widget_call(xin.widgets+"notepad.xml", "init('" + escape(arg) + "')", "notepad");
}
if(num==3){
var arg=escape(xin.home+"/"+arg);
xin.add_win("browser", "Browser", 1, 1, 525, 320, eval(eventY+'+'+50), eventX-200, " ", "", xin.home+"/generic/browser.png");
xin.widget_call(xin.widgets+"browser.xml", "init('" + arg + "')", "browser");
}
if(num==4){
xin.add_win("vuzit", "Vuzit", 2, 2, 625, 420, eval(eventY+'+'+50), eventX-200, " ", "", xin.home+"/generic/vuzit_icon.png");
xin.widget_call(xin.widgets+"vuzit.xml", "init('" + xin.home + "/" + escape(arg) + "')", "vuzit");
}
if(num==5){
xin.add_win("kreate","Kreate",1,1,370,300,eval(eventY+'+'+50),eventX-200," ","",xin.home+"/generic/gears.png");
xin.widget_call(xin.widgets+"kreate.xml","init('" + escape(arg) + "')","kreate");
}
if(num==6){
xin.add_win('itext','Itext',1,1,520,320,eval(eventY+'+'+50),eventX-200,' ','',xin.home+'/generic/itext.png');
xin.widget_call(xin.widgets+"itext.xml","init('" + escape(arg) + "')","itext");
}
}
else{
if(arg.split("music")[1] && ext!=="xml"){
var a=arg.split("/");
    a=a[a.length-1];
    arg=arg.replace("/"+a,"");
xin.add_win("mplayer","JWplayer",2,2,640,300, eval(eventY+'+'+50), eventX-200, " ","",xin.home+"/generic/mplayer.png");
xin.widget_call(xin.widgets+"mplayer.xml","init('"+arg+"')","mplayer"); 
}
else{
if(ext == "mp3" || ext == "mpeg" || ext == "avi" || ext == "mdi" || ext == "midi" || ext == "wav" || ext == "mov"){
var a=arg.split("/");
	a=a[a.length-1];
	arg=arg.replace("/"+a,"");
xin.add_win("mplayer","JWplayer",2,2,640,300, eval(eventY+'+'+50), eventX-200, " ","",xin.home+"/generic/mplayer.png");
xin.widget_call(xin.widgets+"mplayer.xml","init('"+arg+"')","mplayer");
}
else if (ext == "jpg" || ext == "gif" || ext == "png" || ext == "bmp"){
var subadr = arg.split("/");
    subadr = subadr[subadr.length - 1];
var adr = arg.replace(subadr, "");
    adr = adr.substring(0, adr.length - 1);
    adr = escape(adr);
xin.add_win('slider', 'Slide', 1, 1, 340, 420, eval(eventY+'+'+50), eventX-200, ' ', '', xin.home+'/generic/slide.png');
xin.widget_call(xin.widgets+"slider.xml", "setslide('" + adr + "');sliderFind('" + subadr + "')", "slider");
}
else if (ext == "txt"){
xin.add_win('notepad', 'Notepad', 1, 1, 370, 300, eval(eventY+'+'+50), eventX-200, 'black', '', xin.home+'/generic/notepad.png');
xin.widget_call(xin.widgets+"notepad.xml", "init('" + escape(arg) + "')", "notepad");
}
else if (ext == "xml"){
var val2 = arg.split("/");
    val2 = val2[val2.length - 1];
xin.app(xin.home+"/" + arg, val2.split(".")[0].toLowerCase());
}
else if (ext == "htm" || ext == "html"){
xin.add_win("browser", "Browser", 1, 1, 525, 320, eval(eventY+'+'+50), eventX-200, " ", "", xin.home+"/generic/browser.png");
xin.widget_call(xin.widgets+"browser.xml", "init('" + xin.home + "/" + escape(arg) + "')", "browser");
}
else if (ext == "pdf" && new String(self.location.href).split("widgetplus")[1]){
xin.add_win("vuzit", "Vuzit", 2, 2, 625, 420, eval(eventY+'+'+50), eventX-200, " ", "", xin.home+"/generic/vuzit_icon.png");
xin.widget_call(xin.widgets+"vuzit.xml", "init('" + xin.home + "/" + escape(arg) + "')", "vuzit");
}
else{window.open(arg,"h","height=200,width=300,resizable=yes,scrollbars=yes");}
}
}
}
}
catch(er) {}
},
	
doubleclicked: function(e){
xin.act="double_click";
return xin.toolmenu(e);},
	
contextmenued: function(e){
xin.act="context";
return xin.toolmenu(e);  
},
	
toolmenu: function(e){
  xin.get_pos(e);	
var mcont = "<table cellpadding='0' cellspacing='0' border='0' style=\"margin:0;border:0px solid\">";
var pic = "";
var tcol = "";
var x = eventX;
var y = eventY;
var obj = eventObj;
var e_y = eval(y + "+" + 2);
var e_x = eval(x + "+" + 20);	
if (e_x < 0) {e_x = 10;}
if (e_y < 0) {e_y = 10;}
var e_x = eval(x + "+" + 20);
var e_y = eval(y + "+" + 2);
if (e_x < 0) {e_x = 10;}
if (e_y < 0) {e_y = 10;}
if (e_x < 0) { e_x = 10;}
if(document.body.scrollTop=="0"){
if (e_y > eval(xin.getWinHeight() - 100)) {e_y = eval(xin.getWinHeight() - 70);}
if (e_x > eval(xin.getWinWidth() - 100)) {e_x = eval(xin.getWinWidth() - 100);}
}
if ($('mine_context')){
if ($('mine_context').style.display=="block"){
$('mine_context').style.display = "none";
if (obj.nodeName.toLowerCase() !== "input" && obj.nodeName.toLowerCase() !== "textarea") {return false;}
}
}
if ($('mine_tip')) {$('mine_tip').style.display = "none";}
if (obj.getAttribute(xin.act)){
var cont = obj.getAttribute(xin.act).split("::");
for (var i = 0; i < cont.length; i++){
if (cont[i].split("^")[2]){
tcol = " style='background-color:silver' ";
pic = "<img src=\"" + cont[i].split("^")[2] + "\" border=\"0\" style=\"float:left;height:16;width:16;margin:3px\" />";
} 
else{
pic = "";
tcol = "";
}
mcont += "<tr><td " + tcol + ">" + pic + "</td><td style=\"padding-left:4px\"><a onmouseup=\"setTimeout('xin.toolmenu_go()',100)\" style=\"display:inline\" href=\"" + cont[i].split("^")[1] + "\">" + cont[i].split("^")[0] + " </a></td></tr>";
}
mcont += "</table>";
try{
$('mine_context').style.position="absolute";
$('mine_context').style.top = e_y;
$('mine_context').style.left = e_x;
$('mine_context').style.display = "block";
$('mine_context').style.zIndex = "9998";
$('mine_context').innerHTML = mcont;
$('mine_context').setAttribute("hide","false");
} 
catch(er) {} 
} 
if (obj.getAttribute("type") || obj.nodeName.toLowerCase() == "textarea") {return true;}
else{
return false;
}
},

toolmenu_go: function(){
if ($('mine_context')){
$('mine_context').style.display = "none";
}
},

xmenu: function(arg){
if (!arg) {arg = "mine_menu";}
if ($('mine_menu')) {$('mine_menu').innerHTML = "";}
},

offload:function(e)
{
try{
xin.get_pos(e);
if(eventObj.getAttribute("off_action")){eval(eventObj.getAttribute("off_action"));}
}
catch(er){}
},

tooltip: function(e){
try{

xin.get_pos(e);

if ($('mine_tip')){$('mine_tip').style.display = "none";}


if(eventObj.getAttribute("on_action")){eval(eventObj.getAttribute("on_action"));}



if(eventObj.getAttribute("tooltip") || eventObj.getAttribute("friend")){
var mcont = "<table cellpadding='0' cellspacing='0' border='0' style=\"margin:0;border:white 2px solid\">";
var pic = "";
var tcol = "";
var obj = eventObj;
var x = eventX;
var y = eventY-parseInt(obj.scrollTop);
var e_x = eval(x + "+" + 20);
var e_y = eval(y + "+" + 2);
if (e_x < 0) { e_x = 10;}
if (e_y < 0) {e_y = 10;}
if (e_x < 0) {e_x = 10;}
if(document.body.scrollTop=="0"){
if (e_y > eval(xin.getWinHeight() - 100)) {e_y = eval(xin.getWinHeight() - 70);}
if (e_x > eval(xin.getWinWidth() - 100)) {e_x = eval(xin.getWinWidth() - 100);}
}
if (obj.nodeName.toLowerCase() !== "body" && obj.nodeName.toLowerCase() !== "html"){
if (obj.getAttribute("tooltip")){
$('mine_tip').style.display = "block";
$('mine_tip').style.width = "105";
$('mine_tip').style.filter = "alpha(opacity=70)";
$('mine_tip').style.opacity = "0.7";
$('mine_tip').style.MozOpacity = "0.7";			
var cont = obj.getAttribute("tooltip").split("::");
for (var i = 0; i < cont.length; i++){
if (cont[i].split("^")[1]){
tcol = " style='background-color:silver' ";
pic = "<img src=\"" + cont[i].split("^")[1] + "\" border=\"0\" style=\"float:left;height:16;width:16;margin:3px\" />";
} 
else{pic = "";tcol = "";}
mcont += "<tr valign=\"top\"><td " + tcol + ">" + pic + "</td><td style=\"padding-left:4px\"><a onmouseup=\"setTimeout('xin.toolmenu_go()',100)\" style=\"display:block;width:90px;overflow:hidden\" href=\"" + cont[i].split("^")[0] + "\">" + cont[i].split("^")[0].replace(/\//g,"/<br/>").replace(/\_/g,"_<br/>") + " </a></td></tr>";
}
}		
if (obj.getAttribute("friend") && !obj.getAttribute("friend").split("^")[1]){
if($("mine_tip_face")){$("mine_tip_face").setAttribute("src",xin.home+"/generic/indicator.gif");}
$('mine_tip').style.display = "block";
$('mine_tip').style.width = "165";
$('mine_tip').style.filter = "alpha(opacity=90)";
$('mine_tip').style.opacity = "0.8";
$('mine_tip').style.MozOpacity = "0.8";
var target="<div style=\"width:120px\">"+
           "<div id=\"mine_tip_fname\" style=\"font-family:verdana;font-size:11px;color:#6699cc;width:100;margin:1px;padding:3px;border-bottom:0px solid\">"+
           "Loading...</div>"+
           "<div id=\"mine_tip_lname\" style=\"font-family:verdana;font-size:11px;color:#6699cc;width:100;margin:1px;padding:3px;border-bottom:0px solid\">"+
           "</div>"+
           "<div id=\"mine_tip_age\" style=\"font-family:verdana;font-size:11px;color:#6699cc;width:100;margin:1px;padding:3px;border-bottom:0px solid\">"+
           "</div>"+
           "<div id=\"mine_tip_sex\" style=\"font-family:verdana;font-size:11px;color:#6699cc;width:100;margin:1px;padding:3px;border-bottom:0px solid\">"+
           "</div>"+
           "<div id=\"mine_tip_interests\" style=\"font-family:verdana;font-size:11px;color:#6699cc;width:100;margin:1px;padding:3px\">"+
           "</div>"+
           "</div>";    
mcont += "<tr valign=\"top\"><td><img id=\"mine_tip_face\" src=\""+xin.home+"/generic/indicator_big.gif\" style=\"height:80px;width:60px;border:silver 2px solid;margin:3px\" /></td><td>"+target+"</td></tr>";
}
mcont += "</table>";
try{
$('mine_tip').style.position="absolute";
$('mine_tip').style.top = e_y;
$('mine_tip').style.left = e_x; 
$('mine_tip').style.overflow = "hidden";	
$('mine_tip').style.padding = "3px";					
$('mine_tip').style.zIndex = "9998";
$('mine_tip').innerHTML = mcont;	
} 
catch(er) {}
if(obj.getAttribute("friend") && !obj.getAttribute("friend").split("^")[1]){xin.server("xin.getprofile('"+obj.getAttribute("friend")+"','xin.profile_set')");}
}
}
}
catch(er){}
},
	
	
profile_set:function(fname, lname, age, sex, interests, face,files,icons){
if($("mine_tip_fname")){
if(face){
$("mine_tip_fname").innerHTML=fname;
$("mine_tip_lname").innerHTML=lname;
$("mine_tip_age").innerHTML=age;
$("mine_tip_sex").innerHTML=sex;
$("mine_tip_interests").innerHTML=interests;
$("mine_tip_face").setAttribute("src",face);
}
}
},


datamove: function(e){
xin.get_pos(e);
xin.call_block(e);
var mcont = "";
var x = eventX;
var y = eventY;
var obj = eventObj;
var datas = "";
var prev_obj = obj;
if (obj.nodeName.toLowerCase() == "input"){
try{
var tsk = obj.parentNode;
for (var i = 0; i < 5; i++){
if (tsk.getAttribute("data")){
break;
} 
else{
tsk = tsk.parentNode;
}
}
} 
catch(er) {}
}	
if(obj.parentNode){
if (obj.parentNode.getAttribute("swapping")){ 
var div = obj.parentNode.getElementsByTagName("div");
for (var i = 0; i < div.length; i++) {try{div[i].getElementsByTagName("span").item(0).style.display = "none";}catch(er){continue;}}
try{obj.getElementsByTagName("span").item(0).style.display = "block";}catch(er){}
}
}

if (obj.getAttribute("single_click")){
xin.act="single_click";
return xin.toolmenu(e);
}

if (obj.getAttribute("rope")){
xin.xin_set_rope(e);
return false;
}

if (obj.getAttribute("drag")){
var ev = 1;
if (IE) {ev = event.button;} 
else {ev = e.which;}
if (ev == 1) {xin.drag_me(obj);}
return false;
}	

if (obj.getAttribute("tree")){
xin.menu_type="tree";
if(obj.getAttribute("lock")){xin.selection.target=obj.getAttribute("lock");}
xin.add_tree(obj);
return false;
}

if (obj.getAttribute("menu")){
xin.menu_type="menu";
if(obj.getAttribute("lock")){xin.selection.target=obj.getAttribute("lock");}
xin.add_menu(e);
return false;
} 
else{
if (obj.nodeName.toLowerCase() !== "a") {try{$("mine_menu").innerHTML = "";}catch(er){}}
}

if (obj.getAttribute("tabs")){
xin.add_tabs();
return false;
}

if (obj.getAttribute("_scroll_x")){
xin.scroller_x(obj.getAttribute("_dir"),obj.getAttribute("_scroll_x"));
 return false;
}	
	
if (obj.getAttribute("_scroll")){
xin.scroller(obj.getAttribute("_dir"),obj.getAttribute("_scroll"));
 return false;
}	

if (obj.getAttribute("resize") == "true") {xin.xin_resizer(e);}

else if (obj.getAttribute("data_shuffle") || obj.getAttribute("data_copy") || obj.getAttribute("data_move") || obj.getAttribute("data_clone")  || obj.getAttribute("data_collect")){
if (!obj.value){
datas = obj.innerHTML;
datas2 = obj.parentNode.innerHTML;
} 
else{
datas = obj.value;
}

document.onmousemove = function(e){
xin.get_pos(e);
var du=$("mine_drag_data");
if(!$("move_data_now")){
du.innerHTML="<div id=\"move_data_now\" style=\"-moz-opacity:0.6;filter:alpha(opacity=60);position:absolute;z-index:9998;top:"+(eventY-10)+";left:"+(eventX-30)+";font-family:verdana;font-size:11px;color:gray;width:20px;text-align:center;height:18px;border:black 1px solid;background-color:white;padding:2px;\">+</div>";
}
else{$("move_data_now").style.top=(eventY-10);$("move_data_now").style.left=(eventX-30);}
}
			
document.onmouseup = function(e){
$("mine_drag_data").innerHTML="";
xin.get_pos(e);
var obj = eventObj;
if (obj.getAttribute("data_clone") && datas !== ""){ 

if(obj.parentNode.nodeName.toLowerCase()=="td"){
try{
var pclone = obj.parentNode.innerHTML;
obj.parentNode.innerHTML=datas2;
prev_obj.parentNode.innerHTML=pclone;
}
catch(er){}
datas="";
datas2="";
}
}                      
obj.onmouseup = "";
document.onmousemove = "";
}

obj.parentNode.onmouseup = function(e){
xin.get_pos(e);
var obj = eventObj;
if (obj.getAttribute("data_collect")){
try{
var pclone = prev_obj.cloneNode(true);
    pclone.setAttribute("id", "");
    pclone.setAttribute("data_clone", false);
    pclone.setAttribute("data_copy", false);
    pclone.setAttribute("data_shuffle", false);
    pclone.setAttribute("data_move", false);
if (obj !== prev_obj){
if (obj.getAttribute("data_exclude")){
obj.innerHTML = "";
obj.appendChild(pclone);
} 
else {obj.appendChild(pclone);}
return false;
}
} 
catch(er) {}
}
if (obj.getAttribute("data_move") && datas !== ""){
try{
if (!prev_obj.getAttribute("value")){
prev_obj.innerHTML = "";
obj.innerHTML = datas;
} 
else{
prev_obj.value = "";
obj.value = datas;
}
datas = "";
prev_obj = 0;
} 
catch(er) {}
}
if (obj.getAttribute("data_copy") && datas !== ""){
try{
if (!prev_obj.getAttribute("value")) {obj.innerHTML = datas;} 
else {obj.value = datas;}
datas = "";
} 
catch(er) {}
}
if (obj.getAttribute("data_shuffle") && datas !== ""){
try{
if (!prev_obj.getAttribute("value")){
prev_obj.innerHTML = obj.innerHTML;
obj.innerHTML = datas;
} 
else{
prev_obj.value = obj.value;
obj.value = datas;
}
datas = "";
} 
catch(er) {}
}

if(obj.getAttribute("onrelease")){try{eval(obj.getAttribute("onrelease"));}catch(er){}}
if(obj.getAttribute("data_release")){try{eval(obj.getAttribute("data_release"));}catch(er){}}

if (obj.getAttribute("data_clone")){
try{
if (obj.getAttribute("data_clone") && datas !== ""){ 
var pclone = prev_obj.cloneNode(true);
    pclone.setAttribute("data_clone", "true");
if (!pclone.getAttribute("value") && pclone.innerHTML == ""){
obj.parentNode.removeChild(prev_obj);
datas = "";
} 
else if (pclone.value == ""){
obj.parentNode.removeChild(prev_obj);
datas = "";
}
else if (obj !== prev_obj){
try{
if(obj.nextSibling!==undefined){
obj.parentNode.insertBefore(pclone, obj.nextSibling);
obj.parentNode.removeChild(prev_obj);
datas = "";
}
}
catch(er){datas="";}
}
}
} catch(er) {}
}
}
obj.parentNode.onmousemove = function(e) {return false;}
}		
},


xin_body_width: function(){

var jump=false;
var lid="";
var obj=document.body;
    obj.style.width=xin.getWinWidth();
    obj.style.height=xin.getWinHeight();
var prev_width=parseInt(obj.style.width);
var len=obj.getElementsByTagName("*");

for (var i = 0; i < len.length; i++)
{
if(len[i].className=="xin_window"){jump=true;}
if(len[i].className=="xin_window_end"){jump=false;}
if(!jump)
{
if(new String(len[i].getAttribute("id")).split("_")[1]){lid=len[i].getAttribute("id").split("_")[1];}
if (len[i].getAttribute("resize_width") || len[i].getAttribute("resize") || lid=="viewport"){
lid="";
if(!len[i].getAttribute("bp_width"))
{
try{
var pwidth=parseInt(len[i].style.width);
if(!isNaN(pwidth))
{
len[i].setAttribute("bp_width", pwidth / prev_width);
len[i].setAttribute("bps_width", prev_width - pwidth);
}
}
catch(er){continue;}
}
}
}
}
for (var i = 0; i < len.length; i++){
if(len[i].getAttribute("while_resize")){try{eval(len[i].getAttribute("while_resize"));}catch(er){continue;}}
try{
if(new String(len[i].getAttribute("id")).split("_")[1]){lid=len[i].getAttribute("id").split("_")[1];}
if (len[i].getAttribute("bps_width") && lid=="viewport"){lid="";len[i].style.width = Math.round(parseInt(obj.style.width) - len[i].getAttribute("bps_width"));}
else if (len[i].getAttribute("bp_width")){len[i].style.width = Math.round(len[i].getAttribute("bp_width") * parseInt(obj.style.width));}
}
catch(er){continue;}
}	
},

xin_set_width: function(obj,pwidth){

var prev_width=parseInt(obj.style.width);
 if(pwidth){prev_width=pwidth;}
var len=obj.getElementsByTagName("*");
var lid="";

for (var i = 0; i < len.length; i++){
if(new String(len[i].getAttribute("id")).split("_")[1]){lid=len[i].getAttribute("id").split("_")[1];}
if (len[i].getAttribute("resize_width") || len[i].getAttribute("resize") || lid=="viewport"){
lid="";
if(!len[i].getAttribute("p_width"))
{
try{
var pwidth=parseInt(len[i].style.width);
if(!isNaN(pwidth))
{
len[i].setAttribute("p_width", pwidth / prev_width);
len[i].setAttribute("ps_width", prev_width - pwidth);
}
}
catch(er){continue;}
}
}
}
for (var i = 0; i < len.length; i++){
if(len[i].getAttribute("while_resize")){try{eval(len[i].getAttribute("while_resize"));}catch(er){continue;}}
try{
if(new String(len[i].getAttribute("id")).split("_")[1]){lid=len[i].getAttribute("id").split("_")[1];}
if (len[i].getAttribute("ps_width") && lid=="viewport"){lid="";len[i].style.width = Math.round(parseInt(obj.style.width) - len[i].getAttribute("ps_width"));}
else if (len[i].getAttribute("p_width")){len[i].style.width = Math.round(len[i].getAttribute("p_width") * parseInt(obj.style.width));}
}
catch(er){continue;}
}	
},


xin_body_height: function(){
var jump=false;
var lid="";
var obj=document.body;
    obj.style.width=xin.getWinWidth();
    obj.style.height=xin.getWinHeight();
var prev_height=parseInt(obj.style.height);
var len=obj.getElementsByTagName("*");

for (var i = 0; i < len.length; i++)
{
if(len[i].className=="xin_window"){jump=true;}
if(len[i].className=="xin_window_end"){jump=false;}
if(!jump)
{
if(new String(len[i].getAttribute("id")).split("_")[1]){lid=len[i].getAttribute("id").split("_")[1];}
if (len[i].getAttribute("resize_width") || len[i].getAttribute("resize") || lid=="viewport"){
lid=""; 
if(!len[i].getAttribute("bp_height")){
try{
var height=parseInt(len[i].style.height);
if(!isNaN(height))
{
len[i].setAttribute("bp_height", height / prev_height);
len[i].setAttribute("bps_height", prev_height - height);
}
}
catch(er) {continue;}
}
}
}
}			
for (var i = 0; i < len.length; i++){
if(len[i].getAttribute("while_resize")){eval(len[i].getAttribute("while_resize"));}
try{
if(new String(len[i].getAttribute("id")).split("_")[1]){lid=len[i].getAttribute("id").split("_")[1];}
if (len[i].getAttribute("bps_height") && lid=="viewport"){lid="";len[i].style.height = Math.round(parseInt(obj.style.height) - len[i].getAttribute("bps_height"));}
else if (len[i].getAttribute("bp_height")){len[i].style.height = Math.round(len[i].getAttribute("bp_height")*parseInt(obj.style.height));}
}
catch(er){continue;}
}
},

xin_set_height: function(obj,pheight){
var lid="";
var prev_height=parseInt(obj.style.height);
if(pheight){prev_height=pheight;}
var len=obj.getElementsByTagName("*");

for (var i = 0; i < len.length; i++){
if(new String(len[i].getAttribute("id")).split("_")[1]){lid=len[i].getAttribute("id").split("_")[1];}
if (len[i].getAttribute("resize_width") || len[i].getAttribute("resize") || lid=="viewport"){
lid="";
if(!len[i].getAttribute("p_height")){
try{
var height=parseInt(len[i].style.height);
if(!isNaN(height))
{
len[i].setAttribute("p_height", height / prev_height);
len[i].setAttribute("ps_height", prev_height - height);
}
}
catch(er) {continue;}
}
}
}			
for (var i = 0; i < len.length; i++){
if(len[i].getAttribute("while_resize")){eval(len[i].getAttribute("while_resize"));}
try{
if(new String(len[i].getAttribute("id")).split("_")[1]){lid=len[i].getAttribute("id").split("_")[1];}
if (len[i].getAttribute("ps_height") && lid=="viewport"){lid="";len[i].style.height = Math.round(parseInt(obj.style.height) - len[i].getAttribute("ps_height"));}
else if (len[i].getAttribute("p_height")){len[i].style.height = Math.round(len[i].getAttribute("p_height")*parseInt(obj.style.height));}
}
catch(er){continue;}
}
},


xin_resizer: function(e){
xin.get_pos(e);
var obj = eventObj;
 if(xin.resize_obj){obj=xin.resize_obj;xin.resize_obj=false;}
var mouseup = document.onmouseup;
var mousemove = document.onmousemove;
var Y = parseInt(eventY - parseInt(obj.style.height));
var X = parseInt(eventX - parseInt(obj.style.width));
var resize_x = true;
var resize_y = true;
var limit=false;
var minlimit=0;
var x_limit=false;
var y_limit=false;
var func=0;
var len = obj.getElementsByTagName("*");
if (obj.getAttribute("resize_x")){
resize_y = false;
if(obj.getAttribute("slider")){
func=obj.getAttribute("slider");
limit=parseInt(obj.parentNode.style.width);
}
}
if (obj.getAttribute("resize_y")){
resize_x = false;
if(obj.getAttribute("slider")){
func=obj.getAttribute("slider"); window.status=func;
limit=parseInt(obj.parentNode.style.height);
}
}	
if(obj.getAttribute("maxlimit")){limit=obj.getAttribute("maxlimit");func="";}
if(obj.getAttribute("minlimit")){minlimit=obj.getAttribute("minlimit");}
if(obj.getAttribute("x_limit")){x_limit=obj.getAttribute("x_limit");}
if(obj.getAttribute("y_limit")){y_limit=obj.getAttribute("y_limit");}

document.onmousemove = function(e){
xin.get_pos(e);
try{
if (resize_y){
var prev_height = parseInt(obj.style.height);
if(minlimit && minlimit > parseInt(eval((eventY) - Y))){return false;}
if(limit && limit < parseInt(eval((eventY) - Y))){return false;}
if(y_limit && y_limit > parseInt(eval((eventY) - Y))){return false;}
else{
obj.style.height = parseInt(eval((eventY) - Y));
xin.xin_set_height(obj);
}
if(func!==0){eval(func+"("+parseInt(eval((eventY) - Y))+",2)");}
}
if (resize_x){
var prev_width = parseInt(obj.style.width);
if(minlimit && minlimit > parseInt(eval((eventX - X)))){return false;}
if(limit && limit < parseInt(eval((eventX - X)))){return false;}
if(x_limit && x_limit > parseInt(eval((eventX - X)))){return false;}
else{
obj.style.width = parseInt(eval((eventX - X)));
xin.xin_set_width(obj);
}
if(func!==0){eval(func+"("+parseInt(eval((eventX - X)))+",1)");}
}
return false;
} 
catch(er){return false;}
}

document.onmouseup = function(e){
try{
document.onmouseup = mouseup;
document.onmousemove = mousemove;
for (var i = 0; i < len.length; i++){
try{
if (len[i].getAttribute("reflect")){
len[i].removeChild(len[i].getElementsByTagName("img").item(0));
len[i].removeChild(len[i].getElementsByTagName("div").item(0));
xin.reflect(len[i]);
}
}
catch(er){}
}
} 
catch(er) {}
}
return false;},

xin_set_rope: function(e){
 xin.get_pos(e);		
var nobj = eventObj;
var y = eventY;
var x = eventX;
var el = "table";
var prev_y = 0;
var prev_x = 0;
var cur_y = 0;
var cur_x = 0;
if ($("rope")){
var myrope = $("rope");
	myrope.style.top = eventY;
    myrope.style.left = eventX;
if (nobj.style.overflow == "scroll"){
var check_x = eval(xin.findPosX(nobj) + "+" + parseInt(nobj.style.width));
var check_xx = eventX;
if (check_xx > check_x - 20) {return false;}
}

document.onmousemove = function(e){
xin.get_pos(e);
var obj = eventObj;
try{
} 
catch(er) {}
try{
if (eventY > y && eventX > x){
myrope.style.height = eval(eventY - y);
myrope.style.width = eval(eventX - x);
prev_y = y;
prev_x = x;
cur_y = eventY;
cur_x = eventX;
} 
else if (eventY > y && eventX < x){
myrope.style.left = eventX;
myrope.style.height = eval(eventY - y);
myrope.style.width = eval(x - eventX);
prev_y = y;
prev_x = eventX;
cur_y = eventY;
cur_x = x;                  
} 
else if (eventY < y && eventX > x){
myrope.style.top = eventY;
myrope.style.height = eval(y - eventY);
myrope.style.width = eval(eventX - x);
prev_y = eventY;
prev_x = x;
cur_y = y;
cur_x = eventX;
} 
else if (eventY < y && eventX < x){
myrope.style.top = eventY;
myrope.style.left = eventX;
myrope.style.height = eval(y - eventY);
myrope.style.width = eval(x - eventX);
prev_y = eventY;
prev_x = eventX;
cur_y = y;
cur_x = x;
}
if (parseInt($("rope").style.height) > 30 && parseInt($("rope").style.width) > 30) {myrope.style.display = "block";} 
else {myrope.style.display = "none";}
} catch(er) {}
}

document.onmouseup = function(e){
$("rope").style.display = "none";
document.onmousemove = "";
document.onmouseup = "";
if (nobj.getAttribute("tag")) { el = nobj.getAttribute("tag");}
var tobj = nobj.getElementsByTagName(el);
var len = nobj.getElementsByTagName(el).length;
try{
for (var i = 0; i < len; i++){
try{
if (tobj[i].className == "black_files_a_tree") {tobj[i].className = "files_a_tree";}
if (tobj[i].className == "black_folders_a_tree") {tobj[i].className = "folders_a_tree";} 
else{
tobj[i].style.backgroundColor = "";
tobj[i].setAttribute("activeicon", "no");
}
} 
catch(er) {}
var oy = xin.findPosY(tobj[i]);
var ox = xin.findPosX(tobj[i]);
if (nobj.getAttribute("runby")){
var r = nobj.getAttribute("runby");
if ($(r)){
oy = eval(oy + "-" + $(r).scrollTop);
ox = eval(ox + "-" + $(r).scrollLeft);
}
}
if (oy > prev_y && oy < cur_y){
if (ox > prev_x && ox < cur_x){
try{
if (tobj[i].className == "files_a_tree") {tobj[i].className = "black_files_a_tree";}
if (tobj[i].className == "folders_a_tree") {tobj[i].className = "black_folders_a_tree";} 
else{
tobj[i].style.backgroundColor = "black";
tobj[i].setAttribute("activeicon", "yes");
}
} 
catch(er) {}
}
}
}
} 
catch(er) {}
$("rope").style.height = "1";
$("rope").style.width = "1";
}
}
},

findPosX: function(obj){
var curleft = 0;
var eObj = obj;	
for(var i=0; i < 2; i++){
if(eObj.scrollLeft===0){eObj=eObj.parentNode;}
else{break;}
}
if (obj.offsetParent){
while (1){
curleft += obj.offsetLeft;
if (!obj.offsetParent){break;}
else{obj = obj.offsetParent;}
}
}
else if (obj.x){curleft += obj.x;}
if(eObj.scrollLeft!==0){
curleft=curleft-eObj.scrollLeft;
}
return curleft;
},

findPosY:function(obj){
var curtop = 0;
var eObj = obj;
for(var i=0; i < 2; i++){
if(eObj.scrollTop===0){eObj=eObj.parentNode;}
else{break;}
}
if (obj.offsetParent){
while (1){
curtop += obj.offsetTop;
if (!obj.offsetParent){break;}
else{obj = obj.offsetParent;}
}
}
else if (obj.y){curtop += obj.y;}
if(eObj.scrollTop!==0){
curtop=curtop-eObj.scrollTop;
}
return curtop;
},


drag_me: function(obj){

try 
{
var Y = 0;
var X = 0;
var Y2 = 0;
var X2 = 0;
var mtab = 0;
var xX = parseInt(obj.style.width) / 2;
var yY = parseInt(obj.style.height) / 2;
var my=0;
var mx=0;
var ty = 0;
var tx = 0;
var lnum=0;
var list=new Array();
 xin.start_Y=0;
 xin.start_X=0;
if(obj.parentNode.style.overflow=="hidden" && !obj.parentNode.style.position){obj.parentNode.style.overflow="";}
if (isNaN(xX)) { xX = 32;}
if (isNaN(yY)) {yY = 32;}
try{xin.xin_index(obj);}catch(er){}

document.onmousemove = function(e){
xin.get_pos(e);
 
if(obj.getAttribute("runby") && !obj.style.top)
{
obj.style.position="absolute";
obj.style.cursor="hand";
obj.style.top=(eventY-xin.findPosY(obj.parentNode)) - yY/2 ;
obj.style.left=(eventX-xin.findPosX(obj.parentNode)) - xX ;
return false;
}  

if (parseInt(obj.style.top))
{	
my=parseInt(obj.style.top);
mx=parseInt(obj.style.left);
}
else
{
my=xin.findPosY(obj);
mx=xin.findPosX(obj);
}	
		
try 
{
if(!obj.getAttribute("window")){try{obj.style.zIndex = Math.round(parseInt(my) / 10);}catch(er){}}

if(xin.start_Y=="0"){xin.start_Y=(eventY-Y);}
if(xin.start_X=="0"){xin.start_X=(eventX-X);}



if(((eventY-Y) > eval(xin.start_Y+"+"+5)) || ((eventY-Y) < (xin.start_Y-5)))
{
if (!parseInt(obj.style.top)){
obj.style.top = eventY - yY;
if (!obj.style.position) {obj.style.position = "absolute";}
}
if (!parseInt(obj.style.left)){
obj.style.left = eventX - xX;
if (!obj.style.position) {obj.style.position = "absolute";}
}
if (Y2 == 0 ) {Y2 = parseInt(obj.style.top);}
if (X2 == 0 ) {X2 = parseInt(obj.style.left);}	
if (Y == 0) {Y = eventY - parseInt(obj.style.top);}
if (X == 0) {X = eventX - parseInt(obj.style.left);}				
obj.style.top = parseInt(eventY - Y);
obj.style.left = parseInt(eventX - X);
}
else if(((eventX-X) > eval(xin.start_X+"+"+5)) || ((eventX-X) < (xin.start_X-5)))
{
if (!parseInt(obj.style.top)){
obj.style.top = eventY - yY;
if (!obj.style.position) {obj.style.position = "absolute";}
}
if (!parseInt(obj.style.left)){
obj.style.left = eventX - xX;
if (!obj.style.position) {obj.style.position = "absolute";
}
}
if (Y2 == 0 ) {Y2 = parseInt(obj.style.top);}
if (X2 == 0 ) {X2 = parseInt(obj.style.left);}	
if (Y == 0) {Y = eventY - parseInt(obj.style.top);}
if (X == 0) {X = eventX - parseInt(obj.style.left);}				   
obj.style.top = parseInt(eventY - Y);
obj.style.left = parseInt(eventX - X);
obj.setAttribute("activeicon","no");
}					
event_Y = parseInt(obj.style.top);
event_X = parseInt(obj.style.left);
lnum=0;         					
if (e && e.preventDefault) {e.preventDefault();} else {return false;}
} 
catch(er) {return false;}
}

document.onmouseup = function(e){
document.onmousemove = "";
document.onmouseup = "";		
if(obj.getElementsByTagName("img")[0] && obj.getElementsByTagName("div")[0])
{
obj.getElementsByTagName("div")[0].style.color="white";
obj.getElementsByTagName("div")[0].style.height="20";
obj.getElementsByTagName("div")[0].style.overflow="hidden";
}				
xin.start_Y=0;
xin.start_X=0;
}
return false;
} 
catch(er) {}		
return false;
},

clear_widget_move_file: function(){
if ($("widget_move_file")){
var obj = $("widget_move_file").parentNode;
    obj.parentNode.removeChild(obj);
}
},

calling: function(adr, ID){
if (!ID){ID = "desk";}
var adr = adr.replace(/\*\*/g, '"');
xin.js_app(xin.access+"?getXKey('oneweb','demo','" + ID + "','" + xin.widgets + ID + ".xml');" + adr + "");},

widget_tip: function(arg){
var str = escape($(arg).getAttribute("friend").replace(/undefined/g, ""));
var mcont = "<form name=\"some_name\" id=\"share_widget_app\" method=\"post\" action=\""+xin.access+"?getXKey('" + xin.login + "','" + xin.pass + "','desk');widget_send();a" + dnum + "()\" style=\"text-align:center\"><input value=\"" + str + "\" name=\"share_widget_action\" type=\"hidden\"/><input style=\"width:100px;font-family:verdana;font-size:10px;color:gray;border:gray 1px solid;background-color:white\" value=\"Email\" type=\"text\" name=\"share_widget_value\" /><br/><input type=\"submit\" style=\"background-color:white;border:0px solid;font-family:verdana;font-size:10px;color:gray;\" value=\"Send\"  /> </form>";
try{
setTimeout("$('mine_context').style.display='block';$('mine_context').style.zIndex='9998';$('mine_context').innerHTML=unescape('" + escape(mcont) + "') ", 1000);
} 
catch(er) {}
},

parse: function(fun){
try{
if (fun.split("value[")[1]){
var flen = fun.split("value[");
for (var i = 1; i < flen.length; i++){
var f1 = flen[i].split("]")[0];
var f2 = escape($(f1).value.replace(/'|"/g, "").replace(/\r|\n/g, " ").replace(/\-\)/g, "").replace(/\;/g, ""));
fun = fun.replace("value[" + f1 + "]", "'" + f2 + "'").replace(/event_Y/g, event_Y).replace(/event_X/g, event_X);
}
}
if (fun.split("date_now")[1]){
var d = new Date();
var f2 = escape(d.getHours() + "." + d.getMinutes() + "." + d.getSeconds());
fun = fun.replace(/date_now/g, f2);
}
if (fun.split("attribute[")[1]){
var flen = fun.split("attribute[");
for (var i = 1; i < flen.length; i++){
var f1 = flen[i].split("]")[0];
var f2 = "att(" + f1.split(":")[0] + ",'" + f1.split(":")[1] + "','" + $(f1.split(":")[0]).getAttribute(f1.split(":")[1]) + "');";
fun = fun.replace("attribute[" + f1 + "]", "'" + f2 + "'").replace(/event_Y/g, event_Y).replace(/event_X/g, event_X);
}
}
if (fun.split("style[")[1]){
var flen = fun.split("style[");
for (var i = 1; i < flen.length; i++){
var f1 = flen[i].split("]")[0];
var f2 = "setStyle('" + f1.split(":")[1] + "','" + eval("$('" + f1.split(":")[0] + "').style." + getAttribute(f1.split(":")[1])) + "'," + f1.split(":")[0] + ");";
fun = fun.replace("style[" + f1 + "]", "'" + f2 + "'").replace(/event_Y/g, event_Y).replace(/event_X/g, event_X);
}
}
fun = fun.replace(/: demo:/g, ": " + xin.login + ":").replace(/\-\)/g, "").replace(/\;\-/g, "");
} 
catch(er) {return fun;}
return fun;},

getWinHeight: function(){
var myHeight = 0;
if (typeof(window.innerWidth) == 'number'){
myHeight = window.innerHeight;
} 
else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
myHeight = document.documentElement.clientHeight;
} 
else if (document.body && (document.body.clientWidth || document.body.clientHeight)){
myHeight = document.body.clientHeight;
}
return myHeight;
},

getWinWidth: function(){
var myWidth = 0;
if (typeof(window.innerWidth) == 'number'){
myWidth = window.innerWidth;
} 
else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
myWidth = document.documentElement.clientWidth;
} 
else if (document.body && (document.body.clientWidth || document.body.clientHeight)){
myWidth = document.body.clientWidth;
}
return myWidth;
},

get_pos: function(e){
try{
if (!e){var e = window.event;}
eventObj = (window.event) ? e.srcElement: e.target;
var eObj=eventObj;
for(var i=0; i < 10; i++){
if(eObj.scrollTop===0){eObj=eObj.parentNode;}
else{break;}
}
} 
catch(er) {}	
if(e){
if (IE){eventX = event.clientX + document.body.scrollLeft;eventY = event.clientY + document.body.scrollTop;} 
else{try{eventX = e.pageX;eventY = e.pageY;}catch(er){}}
}
},

snippout: function(appid, targ, fun, n){
var pers = "";
if (n) {pers = ",'persistent', '" + xin.key + "'";}
fun = fun.replace(/\*\*/g, '"');
xin.js_app(xin.access+"?getXKey('" + xin.login + "','" + xin.pass + "','" + appid + "','" + xin.widgets + appid + ".xml' " + pers + ");" + fun + ";setXKey('" + xin.login + "','" + xin.pass + "', '" + xin.key + "');getAppJS(" + targ + ")");
xin.js_app(xin.access+"?getXKey('" + xin.login + "','" + xin.pass + "','" + appid + "','" + xin.widgets + appid + ".xml' " + pers + ");getJS();",appid);
xin.css_app(xin.access+"?getXKey('" + xin.login + "','" + xin.pass + "','" + appid + "','" + xin.widgets + appid + ".xml' " + pers + ")",appid);},

scroller: function(arg,sobj){ 
var obj = $(sobj,1).get(0);
var y = parseInt(obj.style.top);
    y = eval(y+"+"+arg);
obj.style.top = y;
obj.style.display="block";
if (run === 0){
run = setInterval("xin.scroller(" + arg + ",'"+sobj+"')", 1);
}
document.onmouseup = function(){
clearInterval(run);
run = 0;
document.onmouseup = "";
}
},


scroller_x: function(arg,sobj){ 
var obj = $(sobj,1).get(0);
var x = parseInt(obj.style.left);
    x = eval(x+"+"+arg);
obj.style.left = x;
obj.style.display="block";
if (run === 0){
run = setInterval("xin.scroller_x(" + arg + ",'"+sobj+"')", 1);
}
document.onmouseup = function(){
clearInterval(run);
run = 0;
document.onmouseup = "";
}
},

colorbar: function(h, w, act, f){
if (act) {act = "onmousedown=\"$('" + act + "').style.backgroundColor=this.style.backgroundColor\"";} else {act = "";}
var z = "<table cellpadding='0' cellspacing='0' border='0' style='margin-left:0px;display:inline'><tr>";
if (f) {z += "</tr><td><div " + act + "  style=\"width:" + h + "px;height:5px;overflow:hidden;background-color: #000000;\"><\/div></td><tr>";} 
else {z += "<td><div " + act + "  style=\"height:" + h + "px;width:5px;overflow:hidden;background-color: #000000;\"><\/div></td>";}
if (f) { z += "<tr><td><div " + act + " style=\"widtht:" + h + "px;height:5px;overflow:hidden;background-color: #ffffff;\"><\/div></td></tr>";} 
else {z += "<td><div " + act + " style=\"height:" + h + "px;width:5px;overflow:hidden;background-color: #ffffff;\"><\/div></td>";}
for (var i = (w - 10); i >= 0; i--){
if (f===1){
var hi=xin.color_strength;
if(w > 100){hi=0.9;}
if(w > 200){hi=0.4;}		 
z += "<tr><td><div " + act + " style=\"width:" + h + "px;height:1px;overflow:hidden;background-color: #" + xin.hsv2hex(Array(Math.round((xin.colormax / xin.colorbase) * (i*hi)), xin.colorlight, xin.colordark)) + ";\"><\/div></td></tr>";
} 
else{
var hi=xin.color_strength;
if(w > 100){hi=0.9;}
if(w > 200){hi=0.4;}
z += "<td><div " + act + " style=\"height:" + h + "px;width:1px;overflow:hidden;background-color: #" + xin.hsv2hex(Array(Math.round((xin.colormax / xin.colorbase) * (i*hi)), xin.colorlight, xin.colordark)) + ";\"><\/div></td>";
}
}
z += "</tr></table>";
return z;
},

toHex: function(v){
v = Math.round(Math.min(Math.max(0, v), 255));
return ("0123456789ABCDEF".charAt((v - v % 16) / 16) + "0123456789ABCDEF".charAt(v % 16));},
hex2rgb: function(r){
return ({0: parseInt(r.substr(0, 2), 16),1: parseInt(r.substr(2, 2), 16),2: parseInt(r.substr(4, 2), 16)});},
rgb2hex: function(r){
return (xin.toHex(r[0]) + xin.toHex(r[1]) + xin.toHex(r[2]));},
hsv2hex: function(h){
return (xin.rgb2hex(xin.hsv2rgb(h)));},
hex2hsv: function(v){
return (xin.rgb2hsv(xin.hex2rgb(v)));},
rgb2hsv: function(r){
var max = Math.max(r[0], r[1], r[2]);
var delta = max - Math.min(r[0], r[1], r[2]);
var H,S,V;
if (max != 0){
S = Math.round(delta / max * 100);
if (r[0] == max) {H = (r[1] - r[2]) / delta;} 
else if (r[1] == max) {H = 2 + (r[2] - r[0]) / delta;} 
else if (r[2] == max) {H = 4 + (r[0] - r[1]) / delta;}
var H = Math.min(Math.round(H * 60), 360);
if (H < 0){ H += 360;}
}
return ({0: H ? H: 0,1: S ? S: 0,2: Math.round((max / 255) * 100)});},
hsv2rgb: function(r){
var R,B,G,S = r[1] / 100,V = r[2] / 100,H = r[0] / 360;
if (S > 0){
if (H >= 1) {H = 0;}
H = 6 * H;
F = H - Math.floor(H);
A = Math.round(255 * V * (1.0 - S));
B = Math.round(255 * V * (1.0 - (S * F)));
C = Math.round(255 * V * (1.0 - (S * (1.0 - F))));
V = Math.round(255 * V);
switch (Math.floor(H)){
case 0:
   R = V;
   G = C;
   B = A;
   break;
case 1:
   R = B;
   G = V;
   B = A;
   break;
case 2:
   R = A;
   G = V;
   B = C;
   break;
case 3:
   R = A;
   G = B;
   B = V;
   break;
case 4:
   R = C;
   G = A;
   B = V;
   break;
case 5:
   R = V;
   G = A;
   B = B;
break;
}
return ({0: R ? R: 0,1: G ? G: 0,2: B ? B: 0});			
} 
else{
return ({0: (V = Math.round(V * 255)),1: V,2: V});}
}
}


/* Main object ending */
 
/* Header starting */

	
function recheck(){ 
try{	
if(document.body){
if ($("login") && $("pass")){
xin.login = $("login").value;
xin.pass = $("pass").value;
$("pass").value = xin.pass;
}
if (!$("mine_context")){
var d1=document.createElement("div");
	d1.setAttribute("id","mine_drag_data");
var d2=document.createElement("div");
	d2.setAttribute("id","mine_menu");
var d3=document.createElement("div");
	d3.setAttribute("id","mine_context");
var d4=document.createElement("div");
	d4.setAttribute("id","mine_tip");
var d5=document.createElement("div");
	d5.setAttribute("id","rope");
	d5.style.border="black 1px dotted";
document.body.appendChild(d1);
document.body.appendChild(d2);
document.body.appendChild(d3);
document.body.appendChild(d4);
document.body.appendChild(d5);
}

xin.ready_go();
document.oncontextmenu = xin.contextmenued;
document.ondblclick = xin.doubleclicked;
document.onmouseover = xin.tooltip;
document.onmouseout = xin.offload;
document.onmousedown = xin.datamove;
window.onresize=function()
{
xin.xin_body_width();
xin.xin_body_height();
}

}
}
catch(er){setTimeout(recheck,10);}
}


/* Header ending */

/* Backward compatibility */

function loadtarget(obj, adr, fun, target, curid, p) {return xin.loadtarget(obj, adr, fun, target, curid, p);}function dragMe(obj) {return xin.drag_me(obj);}function xin_hide(arg, arg2) {return xin.xin_hide(arg, arg2);}function setXMLJS(arg1, arg2) {return xin.calling("setXMLJS(\"" + arg1 + "\",\"" + arg2 + "\")");}function widget_call(adr, fun, target, curid, p) {return xin.widget_call(adr, fun, target, curid, p);}function set_alert(str) {return xin.set_alert(str);}function add_win(arg, title, r, m, w, h, t, l, c, mo, pic) {return xin.add_win(arg, title, r, m, w, h, t, l, c, mo, pic);}function calling(adr, ID) {return xin.calling(adr, ID);}function getWinHeight() {return xin.getWinHeight();}function getWinWidth() {return xin.getWinWidth();}function signup() {return xin.widget_call(xin.widgets+'signup.xml', '', 'signup');}function getPos(e) {return xin.get_pos();}function snippout(appid, targ, fun, n) {return xin.snippout(appid, targ, fun, n);}function scroll(arg) {return xin.scroll(arg);}

/* Ending backward compatibility */

setTimeout("recheck()",2000);




