VaR indexnum = 10;
VaR COUNT = 0;
Function getmap (sfilename, Sid ){
VaR uploadpic = "../filetype/unknown.gif ";
VaR sexten = sfilename. substring (sfilename. lastindexof (".") + 1, sfilename. Length );
VaR creatediv = Document. createelement ("Div ");
Creatediv. setattribute ("ID", "myfile _" + Sid );
Creatediv. style. Height = "17px ";
Creatediv. classname = "file_div ";
Strhtml = "<Table border = '0' cellpadding = '0' cellspacing = '0' width = '000000' style = 'table-layout: fixed'>"
Strhtml + = "<tr> <TD width = '000000' style = 'word-break: break-all'> </> <font size = 2> "+ sfilename +" </font> </TD>"
Strhtml + = "<TD width = '26'> </TD> </tr> </table>"
Creatediv. innerhtml = strhtml;
Document. getelementbyid ("myfilesarea"). appendchild (creatediv );
Document. getelementbyid (SID). style. Display = "NONE"
Count ++;
Checkexist (sexten, Sid );
}
Function checkexist (xext, Xid ){
VaR picurl = "../filetype/" + xext + ". GIF ";
VaR url = "checkexist. asp? PIC = "+ xext +" & pid = "+ math. Random ();
XMLHTTP. Open ("get", URL, false );
XMLHTTP. onreadystatechange = function sendinfo (){
If (XMLHTTP. readystate = 4 ){
If (XMLHTTP. Status = 200 ){
VaR response = XMLHTTP. responsetext;
If (response = "yes "){
Document. getelementbyid ('fileext _ '+ Xid). src = picurl;
}
}
}
}
XMLHTTP. Send (null );
}
Function clearfiles (Xid ){
Document. getelementbyid ("myfile _" + Xid). removenode (true );
Document. getelementbyid (Xid). style. Display = "Block ";
Count --;
}
Function Step1 (){
Document. getelementbyid ("step01 "). innerhtml = "<font size = 2> Step 1: update files and folders </font>"
VaR url = ".../listall. asp? PID = "+ math. Random ();
XMLHTTP. Open ("get", URL, true );
XMLHTTP. onreadystatechange = step1ok;
XMLHTTP. Send (null );
}
Function step1ok (){
If (XMLHTTP. readystate = 4 ){
Document. getelementbyid ("step01 "). innerhtml = "<font size = 2> Step 1: update files and folders </font> Document. getelementbyid ("step02 "). innerhtml = "<font size = 2> Step 2: delete invalid files </font>"
SetTimeout ("step2 ()", 1000 );
}
}
Function step2 (){
VaR url = "../delall. asp? PID = "+ math. Random ();
XMLHTTP. Open ("get", URL, true );
XMLHTTP. onreadystatechange = step2ok;
XMLHTTP. Send (null );
}
Function step2ok (){
If (XMLHTTP. readystate = 4 ){
Document. getelementbyid ("step02 "). innerhtml = "<font size = 2> Step 2: delete invalid files </font> Document. getelementbyid ("step03 "). innerhtml = "<font size = 2> Step 3: Set FTP space synchronization </font>"
SetTimeout ("Step3 ()", 1000 );
}
}
Function Step3 (){
VaR url = "ftpformate. asp? PID = "+ math. Random ();
XMLHTTP. Open ("get", URL, true );
XMLHTTP. onreadystatechange = step3ok;
XMLHTTP. Send (null );
}
Function step3ok (){
If (XMLHTTP. readystate = 4 ){
Document. getelementbyid ("step03 "). innerhtml = "<font size = 2> Step 3: Configure ftp space synchronization </font> SetTimeout ("step4 ()", 1000 );
}
}
Function step4 (){
Document. getelementbyid ("filemanage_update"). style. Display = "NONE"
Document. getelementbyid ("filemanage_all"). style. Display = "Block ";
Showfiles ();
}
VaR tagstate;
Tagstate = "no"
Function showtag (){
If (tagstate = "no "){
Document. getelementbyid ("arror_01"). src = 'images/arror2.gif'
Document. getelementbyid ("Intro"). style. Display = "Block ";
Tagstate = "yes ";
} Else {
Document. getelementbyid ("arror_01"). src = 'images/arror.gif'
Document. getelementbyid ("Intro"). style. Display = "NONE ";
Tagstate = "no ";
}
}
Function showtips (){
Document. getelementbyid ("layer_tips"). innerhtml =
Document. getelementbyid ("layer_tips"). style. Display = "Block ";
Document. getelementbyid ("layer_tips"). style. pixeltop = Window. event. Y + 18;
Document. getelementbyid ("layer_tips"). style. pixelleft = Window. event. x + 12;
}
Function notips (){
Document. getelementbyid ("layer_tips"). style. Display = "NONE ";
}
Function showfileintro (a, B, c, d, e, f ){
VaR count
If (F = ''){
Count = 0
} Else {
Count = f
}
VaR htmlstr = "file name:" + A + "<br>" + "Directory:" + B + "<br>" + "file size: "+ C +" <br> "+" Upload time: "+ D +" <br> "+" file introduction: "+ E +" <br> "+" file downloads: "+ Count +" <br>"
Document. getelementbyid ("layer_fileintro"). innerhtml = htmlstr
Document. getelementbyid ("layer_fileintro"). style. Display = "Block ";
Document. getelementbyid ("layer_fileintro"). style. pixeltop = Window. event. Y + 18;
Document. getelementbyid ("layer_fileintro"). style. pixelleft = Window. event. x + 12;
}
Function nofileintro (){
Document. getelementbyid ("layer_fileintro"). style. Display = "NONE ";
}