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 ";
}