   //--------------------------------------
   //文件路径中 加一个时间 来避免缓存出现的问题
   //--------------------------------------
   
    var operateFile = ""; //保存点击所选中的文件
    var pasteType = "";   //操作的动作
	var actionFile = "";  //复制或者剪切的文件
	var loadFileName = "FileExplorer_Inner";//FileExplorer_Inner
	var muluPath = "";  //目录路径  
	var openFilePath = ""; //打开文件路径
	var openFileIds = "";  //打开文件的id
	var openFileImage = "";  //打开文件图标
	var fileIsExist = false; //标识文件是否存在
	var wifiCoding = ""; //wifi编码
	var ii = 0;
    
    /*设置cookie  cookie保存值是通过键值对的方式*/
    function addCookie(key,value){
         document.cookie = key+"="+ escape(value);
    }
    
    /*获得cookie中的某个值  返回值*/
    function getCookieValue(key){
         var documentCookie = document.cookie;
		var cookieValue = documentCookie.split(";");
		var returnCookieValue = "";
		
		for(var i = 0;i<cookieValue.length;i++){
		    var tempCookie = cookieValue[i].split("=");
		   if(key == tempCookie[0].replace(/(^\s*)|(\s*$)/g, '')){
              returnCookieValue = unescape(tempCookie[1]);
           }
		}
        return returnCookieValue;
    }

    /*删除cookie   即将cookie的生命值设成过去时间*/
    function deleteCookieValue(key,value){
	    var date = new Date();
	    date.setTime(date.getTime() - 10000);
	    document.cookie = key+"="+value+";expire="+(date.toGMTString());
    }
    
	//地址栏确定
	function fileSrcEnter(path){
		pathInputOpenFile(path,'mime_folder.png');
	}
	
    /*打开菜单所触发的事件*/
    function clickOpenFileMenu(){ 
         openFile(openFilePath,openFileIds,openFileImage,openFileSize);
    }
        
	//下载文件
	function downloadFile(){
		var request = "";
		request = openFilePath;	
		window.location = request;
	}
	
		
    /*右键、双击打开文件*/
	function openFile(filePath,fileId,fileImage,openFileSize) {
		
	     var fileName = filePath.substring(filePath.lastIndexOf("/") + 1);	 
		 var fileSize = openFileSize;
		 var suffix = filePath.substring(filePath.lastIndexOf(".") + 1);
		 
		 $("div[title]").filter(".changeDivStyle").toggleClass("changeDivStyle");   //过滤有changeDivStyle类型的将class更改
		 var request = ""
		 
		 switch(suffix){
		 	case "xml":	
			request = filePath;	
			window.open(request);
			break;
			case "html":
			request = filePath;	
			window.open(request);
			break;
			case "txt":
			request = filePath;	
			window.open(request);
			break;
			case "log":
			request = filePath;	
			window.open(request);
			break;
			default:
			switch(fileImage){
				case "mime_folder.png":
					request = "/"+loadFileName+"?timeInfo="+(new Date()).getTime()+"&action=brower&path="+filePath;		
					if(filePath == actionFile){ //如果打开的文件和要粘贴的文件路径是一样的
						clearPasteFileValue();
					}
					clickMuluHref(request);  //设置目录
					break;
				case "mime_picture.png":
					request = filePath; 
					addCookie("fileExplorer_imgSrc",request);
					addCookie("fileExplorer_imgSize1",fileSize);
					if(navigator.language!=null&&navigator.language!=""){
						if(navigator.language.substring(0,2)=="zh"){
							tipsWindown("图片浏览","url:get?fileExplorer_showPicture.html","600","420","true","","false","text");
						}else{
							tipsWindown("View","url:get?fileExplorer_showPicture.html","600","420","true","","false","text");
						}
					}else{
						if(navigator.browserLanguage.substring(0,2)=="zh"){
							tipsWindown("图片浏览","url:get?fileExplorer_showPicture.html","600","420","true","","false","text");
						}else{
							tipsWindown("View","url:get?fileExplorer_showPicture.html","600","420","true","","false","text");
						}
					}		
				    break;
				case "mime_music.png":
					request = filePath; 
//					addCookie("fileExplorer_musicSrc",request);
//					tipsWindown("音乐播放","url:get?fileExplorer_musicPlay.html","480","50","true","","false","text");      
					window.location = request;	
					break;	
				case "mime_apk.png":
					request = filePath;        
					window.location = request;			
					break;
				case "mime_flash.png":
					request = filePath;        
					window.location = request;				
					break;
				case "mime_media.png":
					request = filePath;
					window.location = request;		
					break;	
				default: 
					request = filePath;        
					window.location = request;
			 }
		 }

		     clearOpenFileValue();
     }
	 
	 /*home按钮返回sdcard路径*/
	 function homePath() {
		 var request = "";
			 request = "/"+loadFileName+"?timeInfo="+(new Date()).getTime()+"&action=brower&path="+"/sdcard/";	
		     clearPasteFileValue();
			 pathUrl(request);  //设置目录
			 clearOpenFileValue();
     }
	 
	 /*地址栏打开文件*/
	 function pathInputOpenFile(filePath,fileImage) {
	  //   var fileName = filePath.substring(filePath.lastIndexOf("/") + 1);
		 var checkPath=filePath.charAt(filePath.length - 1);//判断文件名后是否有/
		 $("div[title]").filter(".changeDivStyle").toggleClass("changeDivStyle");   //过滤有changeDivStyle类型的将class更改
		 var request = "";
		 if(fileImage == "mime_folder.png"){  //判断是否是文件夹图标
		     request = "/"+loadFileName+"?timeInfo="+(new Date()).getTime()+"&action=brower&path="+filePath;
			 
			 //读条
			 $("#loadInfo").html("<font color='#334760' size='2px'><div class='fileExplorer_firstLoading_font' onLoad='overTime()'>Loading...</div><img src='images/fileExplorer_img/loading.gif' 	class='fileExplorer_firstLoading_img'/>");
		     $("#loadInfo").show();

	      	 $("#openFile").ajaxStart(function(){
	       	 	$("#openFileLoading").show("<font color='#334760' size='2px'><div class='fileExplorer_firstLoading_font' onLoad='overTime()'>Loading...</div><img src='images/fileExplorer_img/loading.gif' class='fileExplorer_firstLoading_img'/>");
		   		$("#openFileLoading").html("");
	       		$("#fileList").hide();
		   		$("#fileList").html("");
	     	 });
			 
			 pathUrl(request);//设置目录
			 
			 if(checkPath=='/'){
			 	if(filePath == actionFile){ //如果打开的文件和要粘贴的文件路径是一样的
		          clearPasteFileValue();
		     	}
			 }else{
				$("#fileExplorer_fileSrc_repeat").val(filePath+"/");
				request = "/"+loadFileName+"?timeInfo="+(new Date()).getTime()+"&action=brower&path="+filePath+"/"; 
				if(filePath == actionFile){ //如果打开的文件和要粘贴的文件路径是一样的
		          clearPasteFileValue();
		     	}
				
				$("#openFile").ajaxComplete(function(){
	          		$("#openFileLoading").hide();
	           		$("#fileList").show();
	     		});
			  }
		     
		 }else{                    //下载文件  http://ip:port/sdcard/QQ
		     request = filePath;        
		     window.location = request;
		 }
		     clearOpenFileValue();
     }
     
     /*单击事件*/
     function singleClick(filePath,fileId,fileImage,fileSize){
          openFileValue(filePath,fileId,fileImage,fileSize);
		  operateFile = filePath;  //操作的文件
          $("div[title]").filter(".changeDivStyle").toggleClass("changeDivStyle");   //过滤有changeDivStyle类型的将class更改
		  $("#"+fileId).addClass("changeDivStyle");
		  fileId = "";
		  addOperatFileMenu();
     }
     
     /*单击选中文件 添加菜单项*/
     function addOperatFileMenu(){		  
		  $("#liHide").html("");
		  $("#liHide").append("<li><a href=\"#\" onClick = \"clickOpenFileMenu()\" onMouseDown=\"this.style.backgroundImage='url(./images2/menuLeftDown.png)';this.style.color='#fff';this.style.width='200px'\" 	onmouseup=\"this.style.backgroundImage='';this.style.color='#184d80';this.style.width='200px'\"><b>打开</b></a></li>");
		  $("#liHide").append("<li><a href=\"#\" onClick=\"actionCopy()\" onMouseDown=\"this.style.backgroundImage='url(./images2/menuLeftDown.png)';this.style.color='#fff';this.style.width='200px'\" onmouseup=\"this.style.backgroundImage='';this.style.color='#184d80';this.style.width='230px'\"><b>复制</b></a></li>");
		  $("#liHide").append("<li><a href=\"#\" onClick=\"actionCut()\" onMouseDown=\"this.style.backgroundImage='url(./images2/menuLeftDown.png)';this.style.color='#fff';this.style.width='200px'\" onmouseup=\"this.style.backgroundImage='';this.style.color='#184d80';this.style.width='200px'\"><b>剪切</b></a></li>");

		  $("#liHide").append("<li><a href=\"#\" onclick=\"actionRename()\" onMouseDown=\"this.style.backgroundImage='url(./images2/menuLeftDown.png)';this.style.color='#fff';this.style.width='200px'\" onmouseup=\"this.style.backgroundImage='';this.style.color='#184d80';this.style.width='200px'\"><b>重命名</b></a></li> ");
		  $("#liHide").append("<li><a href=\"#\" onClick=\"actionDelete()\" onMouseDown=\"this.style.backgroundImage='url(./images2/menuLeftDown.png)';this.style.color='#fff';this.style.width='200px'\" onmouseup=\"this.style.backgroundImage='';this.style.color='#184d80';this.style.width='230px'\"><b>删除</b></a></li>");
     }
     
     /*为右键和菜单中 '打开' 传递值*/
     function openFileValue(filePath,fileId,fileImage,fileSize){ 
          openFilePath = filePath;
          openFileIds = fileId;
          openFileImage = fileImage;
		  openFileSize = fileSize;
     }
     
     /*清空打开文件所传递的值*/
     function clearOpenFileValue(){ //
          operateFile = "";     //将单击或者是右键选中的文件清空
          openFilePath = "";
          openFileIds = "";
		  openFileSize = "";
          $("#liHide").html("");
     }
     
     /*清空粘贴时传递的参数*/
     function clearPasteFileValue(){ 
         pasteType = "";  
	     actionFile = ""; 
	     $("#showPasteMenu").html(""); 
	     $("#showPaste").html("");  
     }
     
     /*右键事件*/
     function operatClick(filePath,fileId,fileImage,fileSize){
	     var e=window.event;  
		 document.onmousedown = function(e){    
			 var e = e || window.event;  
			 if(e.button==2){ //右键
			      openFileValue(filePath,fileId,fileImage,fileSize);    //为在菜单栏中打开文件传递值         
				  operateFile = filePath;  //操作的文件
			      $("div[title]").filter(".changeDivStyle").toggleClass("changeDivStyle");   //过滤有changeDivStyle类型的将class更改
				  $("#"+fileId).addClass("changeDivStyle");
				  fileId = "";//将样式改变之后就将id值注销
			 }   
	    }
     }
	
	/*重命名*/
	function actionRenameSubmit() {
	     var oldName =  getCookieValue("oldName"); //原来的文件名字
	     var newName = document.getElementById("fileExplorer_newName").value; //新的文件名字
		 var language = navigator.language; 
	     if(newName != oldName && newName != null && newName !=''){
	         var fileNameValues = document.getElementsByName("fileName"); //当前目录所有文件
			 for(var i = 0;i< fileNameValues.length;i++){  //判断是否有重名
			     if(newName == fileNameValues[i].value){
					if(navigator.language!=null&&navigator.language!=""){
						if(navigator.language.substring(0,2)=="zh"){
							$("#reNameTishi").html("该名字已经存在！");
					   	 return;
						}else{
							$("#reNameTishi").html("The name already exists!");
					  		return;	
						}
					}else{
						if(navigator.browserLanguage.substring(0,2)=="zh"){
							$("#reNameTishi").html("该名字已经存在！");
					    	return;
						}else{
							$("#reNameTishi").html("The name already exists!");
					  		return;		
						}
					}	
				 }else{
				     $("#reNameTishi").html("");
				 }
			 }
			  var request = "/"+loadFileName+"?action=rename&oldName="+oldName+"&newName="+newName +"&timeInfo="+(new Date()).getTime();
			  request = encodeURI(request);
			  $("#fileExplorer_showFile").load(request,"",function(){
					 $("#reNameTishi").html("");
					 closeTipsWindown();
					 clearOpenFileValue();//清空数据
			  });//发送请求
		    
		}else{
			if(language.substring(0,2)=="zh"){
				$("#reNameTishi").html("请输入新的文件名字");
			}else{
				$("#reNameTishi").html("Please input new name");
			}		
		     
		}
	}
	
	/*设置文件个数*/
	function setFileCount(){ 
	    var directoryCount = $("#directoryCount").val();
	    var fileCount = $("#fileCount").val();
	    $("#showDirectoryCount").html(directoryCount);
	    $("#showFileCount").html(fileCount);
	}
	
	/*右键菜单，双击打开目录文件。*/
	function clickMuluHref(fileHref){ 
	     //路径是:innerFileInfo.html?timeInfo=1111111&action=brower&path=/sdcard/Tencent/QQ/log
	     var fileHrefArr = fileHref.split("=");
	     var file_Path =fileHrefArr[fileHrefArr.length - 1];           //要访问的文件路径
	  addCookie("nowPath",file_Path);                                      //当前路径
	     
	     var filePathArr = file_Path.split("/");                   //将路径按照/分割
	     var filePath = "";                                     //各个目录中文件的路径
	     var openFileName = fileHref.substring(fileHref.lastIndexOf("/") + 1);
	     fileHref = encodeURI(fileHref);                     //将请求的路径编码格式化


		   $("#loadInfo").html("<font color='#334760' size='2px'><div class='fileExplorer_firstLoading_font'>Loading...</div><img src='images/fileExplorer_img/loading.gif' 	class='fileExplorer_firstLoading_img'/>");
		    $("#loadInfo").show();

	      $("#openFile").ajaxStart(function(){
	       $("#openFileLoading").show("<font color='#334760' size='2px'><div class='fileExplorer_firstLoading_font'>Loading...</div><img src='images/fileExplorer_img/loading.gif' class='fileExplorer_firstLoading_img'/>");
		   $("#openFileLoading").html("");
	       $("#fileList").hide();
		   $("#fileList").html("");
	     });
	      $("#openFile").ajaxComplete(function(){
	          $("#openFileLoading").hide();
	           $("#fileList").show();
	     });
		 $.ajax({
				error:function(){
					goBack_beforePath(); 
				}
			}); 
	
	     $("#fileExplorer_showFile").load(fileHref,"",function(){
	                                                  setFileCount();
	                                                  clearOpenFileValue();//清空数据
	                                                  });
	     for(var i = 1;i<filePathArr.length;i++){
	         filePath += "/"+filePathArr[i];
	         var fileName = filePath.substring(filePath.lastIndexOf("/") + 1);
			 muluPath3=fileName+"/";
	         if(i == 1){  //如果是第一个目录那么就覆盖原来的目录路径
			 	var show1=$("#fileExplorer_fileSrc_repeat").val();
	         }else{      //就在原来基础上追加
				$("#fileExplorer_fileSrc_repeat").val(muluPath3);
				var show2=$("#fileExplorer_fileSrc_repeat").val();
				var show3=show1+show2;
				$("#fileExplorer_fileSrc_repeat").val(show3);
	         }
	     }  
	}   
	
	
	/*点击目录超链接追加目录*/
	function pathUrl(fileHref){ 
	     //路径是:innerFileInfo.html?timeInfo=1111111&action=brower&path=/sdcard/Tencent/QQ/log
	     var fileHrefArr = fileHref.split("=");
	     var file_Path =fileHrefArr[fileHrefArr.length - 1];           //要访问的文件路径
	  addCookie("nowPath",file_Path);                                      //当前路径
	     
	     var filePathArr = file_Path.split("/");                   //将路径按照/分割
	     var filePath = "";                                     //各个目录中文件的路径
	     var openFileName = fileHref.substring(fileHref.lastIndexOf("/") + 1);
	     fileHref = encodeURI(fileHref);                     //将请求的路径编码格式化
	     
	      $("#openFile").ajaxStart(function(){
	       $("#fileList").hide();
	     });
	      $("#openFile").ajaxComplete(function(){
	          $("#openFileLoading").html("");
	           $("#fileList").show();
	     });
	     /*   发送错误的请求	返回到上一级目录 */
		 $.ajax({
				error:function(){
					goBack_beforePath();
				}
			}); 
	
	     $("#fileExplorer_showFile").load(fileHref,"",function(){
		 	setFileCount();
		 	clearOpenFileValue();//清空数据
		 });
	     for(var i = 1;i<filePathArr.length;i++){
	         filePath += "/"+filePathArr[i];
	         var fileName = filePath.substring(filePath.lastIndexOf("/") + 1);
	         muluPath = "<input type=\"button\" name=\"showFilePath\" alt=\"" + loadFileName + "?timeInfo="+(new Date()).getTime()+"&action=brower&path="+filePath+"\" onclick =\" clickMuluHref(this.alt)\" title='"+fileName+"' value='"+fileName+"' class=\"pathbutton_style\" />";
	         if(i == 1){  //如果是第一个目录那么就覆盖原来的目录路径

	         }else{      //就在原来基础上追加

	         }
	     }
	}   
	
	/*复制*/ 
	function actionCopy(){
	     document.getElementById("menu3").style.visibility='hidden';  
	     if(operateFile != null && operateFile != ""){
	         pasteType = "copyPaste";
	         addOperateMenu();
	     }
	}
	
	/*剪切*/
	function actionCut(){
	    document.getElementById("menu3").style.visibility='hidden';  
	    if(operateFile != null && operateFile != ""){
	         pasteType = "cutPaste";
	         addOperateMenu();
	    }
	}
	
	/*复制和剪切之后添加粘贴菜单*/
	function addOperateMenu(){ 
		addCookie("pasteType",pasteType);//对文件的操作方式
		addCookie("actionFile",operateFile);  //操作的文件路径
		addCookie("openFileImage",openFileImage);//操作的文件类型[文件 || 文件夹..]
		if(navigator.language!=null&&navigator.language!=""){
			if(navigator.language.substring(0,2)=="zh"){
				$("#showPaste").html("<a href=\"#\" onclick=\"actionPaste()\">粘贴</a>");		
			}else{
				$("#showPaste").html("<a href=\"#\" onclick=\"actionPaste()\">Paste</a>");		
			}
		}else{
			if(navigator.browserLanguage.substring(0,2)=="zh"){
				$("#showPaste").html("<a href=\"#\" onclick=\"actionPaste()\">粘贴</a>");
			}else{
				$("#showPaste").html("<a href=\"#\" onclick=\"actionPaste()\">Paste</a>");	
			}
		}			
	}
	
	/*粘贴动作*/
	function actionPaste(){  
	   pasteType = getCookieValue("pasteType");
	   actionFile = getCookieValue("actionFile");
	   var nowPath = getCookieValue("nowPath");
	   var containtIndex = nowPath.indexOf(actionFile);  //判断粘贴的路径是否包含的有复制文件的路径
	    document.getElementById("menu3").style.visibility='hidden';  
//	    if(containtIndex < 0){
			if(actionFile!=null&&pasteType!=null &&actionFile !="NaN" && pasteType !="NaN"){ 
				if(pasteType.length > 0 && pasteType != ""){				
					var fileName = actionFile.substring(actionFile.lastIndexOf("/") + 1);
					var fileNameValues = document.getElementsByName("fileName"); //当前目录所有文件
					for(var i = 0;i<fileNameValues.length;i++){  //判断是否有重名
					  if(fileName ==  fileNameValues[i].value){
						fileIsExist = true;
						break;
					  }
					}
					if(navigator.language!=null&&navigator.language!=""){
						if(navigator.language.substring(0,2)=="zh"){
							if(fileIsExist){
								tipsWindown("粘贴文件/文件夹","url:get?fileExplorer_pasteFile.html","290","120","true","","false","text");
							}else{
								tipsWindown("粘贴文件/文件夹","url:get?fileExplorer_pasteFile2.html","290","120","true","","false","text");
								confirmReplace();
							}	
						}else{
							if(fileIsExist){
								tipsWindown("Paste","url:get?fileExplorer_pasteFile.html","290","120","true","","false","text");
							}else{
								tipsWindown("Paste","url:get?fileExplorer_pasteFile2.html","290","120","true","","false","text");
								confirmReplace();
							}	
						}
					}else{
						if(navigator.browserLanguage.substring(0,2)=="zh"){
							if(fileIsExist){
								tipsWindown("粘贴文件/文件夹","url:get?fileExplorer_pasteFile.html","290","120","true","","false","text");
							}else{
								tipsWindown("粘贴文件/文件夹","url:get?fileExplorer_pasteFile2.html","290","120","true","","false","text");
								confirmReplace();
							}	
						}else{
							if(fileIsExist){
								tipsWindown("Paste","url:get?fileExplorer_pasteFile.html","290","120","true","","false","text");
							}else{
								tipsWindown("Paste","url:get?fileExplorer_pasteFile2.html","290","120","true","","false","text");
								confirmReplace();
							}	
						}
					}							
//					var language = navigator.language;
//					if(language.substring(0,2)=="zh"){
//						if(fileIsExist){
//				        	tipsWindown("粘贴文件/文件夹","url:get?fileExplorer_pasteFile.html","290","120","true","","false","text");
//				    	}else{
//							tipsWindown("粘贴文件/文件夹","url:get?fileExplorer_pasteFile2.html","290","120","true","","false","text");
//							confirmReplace();
//						}
//					}else{
//						if(fileIsExist){
//				        	tipsWindown("Paste","url:get?fileExplorer_pasteFile.html","290","120","true","","false","text");
//				    	}else{
//							tipsWindown("Paste","url:get?fileExplorer_pasteFile2.html","290","120","true","","false","text");
//							confirmReplace();
//						}
//					}						
			    }else return;		    
			}
	}
	
	/*粘贴文件确定替代*/
	function confirmReplace(){  //
		if(navigator.language!=null&&navigator.language!=""){
			if(navigator.language.substring(0,2)=="zh"){
				$("#fileExplorer_pasteName").html("正在粘贴文件...");
				$("#fileExplorer_pasteResult").html("<img width='180px' height='12px' src='images/tipsWindown_img/progressBar.gif'/>");
				$("#button_area").html("<input type='button' value='取消' class='fileExplorer_tipsWindown_buttonStyle2' onClick=cancelPaste();'>");		
			}else{
				$("#fileExplorer_pasteName").html("Pasting...");
				$("#fileExplorer_pasteResult").html("<img width='180px' height='12px' src='images/tipsWindown_img/progressBar.gif'/>");
				$("#button_area").html("<input type='button' value='Cancel' class='fileExplorer_tipsWindown_buttonStyle2' onClick=cancelPaste();'>");	
			}
		}else{
			if(navigator.browserLanguage.substring(0,2)=="zh"){
				$("#fileExplorer_pasteName").html("正在粘贴文件...");
				$("#fileExplorer_pasteResult").html("<img width='180px' height='12px' src='images/tipsWindown_img/progressBar.gif'/>");
				$("#button_area").html("<input type='button' value='取消' class='fileExplorer_tipsWindown_buttonStyle2' onClick=cancelPaste();'>");	
			}else{
				$("#fileExplorer_pasteName").html("Pasting...");
				$("#fileExplorer_pasteResult").html("<img width='180px' height='12px' src='images/tipsWindown_img/progressBar.gif'/>");
				$("#button_area").html("<input type='button' value='Cancel' class='fileExplorer_tipsWindown_buttonStyle2' onClick=cancelPaste();'>");	
			}
		}						

		var request = "/"+loadFileName+"?action="+pasteType+"&actionFile="+actionFile +"&timeInfo="+(new Date()).getTime();
		request = encodeURI(request);
		 
		$("#fileExplorer_showFile").load(request,"",function(){
			 fileIsExist = false;
			 setFileCount();
			 clearPasteFileValue();
			 closeTipsWindown();
			 clearOpenFileValue();
		 });  //发送请求
	}
	
	/*取消粘贴*/
	function cancelPaste(){
		fileIsExist = false;
        $("#cancelButton").html("<img src=\"images/tipsWindown/cancelButton_2.gif\" />");
	    closeTipsWindown();
	}
	
	/*删除文件      删除之后就将数据数据清空*/
	function actionDelete(){         
	   document.getElementById("menu3").style.visibility='hidden';    
		var fileName = operateFile.substring(operateFile.lastIndexOf("/") + 1);
		  addCookie("deleteFileName",fileName);  //删除的文件名
		  addCookie("openFileImage",openFileImage);//操作的文件类型[文件 || 文件夹..]
		  addCookie("operateFile",operateFile); //操作的文件
		if(fileName != null && fileName != ""){  
			if(navigator.language!=null&&navigator.language!=""){
				if(navigator.language.substring(0,2)=="zh"){
					tipsWindown("删除文件","url:get?fileExplorer_deleteFile.html","290","120","true","","false","text");		
				}else{
					tipsWindown("Delete","url:get?fileExplorer_deleteFile.html","290","120","true","","false","text"); 
				}
			}else{
				if(navigator.browserLanguage.substring(0,2)=="zh"){
					tipsWindown("删除文件","url:get?fileExplorer_deleteFile.html","290","120","true","","false","text");		
				}else{
					tipsWindown("Delete","url:get?fileExplorer_deleteFile.html","290","120","true","","false","text"); 	
				}
			}						
		}
	}
	
	/*确定删除*/
	function confirmDelete(){
		var deleteFileName = getCookieValue("deleteFileName");  //删除的文件名字
		operateFile = getCookieValue("operateFile");  //操作的文件
		actionFile = getCookieValue("actionFile");  //复制或者剪切文件
		var request = "/"+loadFileName+"?action=delete&fileName="+deleteFileName +"&timeInfo="+(new Date()).getTime();
		if(navigator.language!=null&&navigator.language!=""){
			if(navigator.language.substring(0,2)=="zh"){
				$("#windown-title h2").html("正在删除文件...");		
			}else{
				$("#windown-title h2").html("Deleting...");
			}
		}else{
			if(navigator.browserLanguage.substring(0,2)=="zh"){
				$("#windown-title h2").html("正在删除文件...");
			}else{
				$("#windown-title h2").html("Deleting...");
			}
		}						

		$("#deleteResult").html("<img width='180px' height='12px' src='images/tipsWindown_img/progressBar.gif'/>");
		$("#deleteButton").html("<div style=\"margin-top:5px;\" onclick=\"cancelDelete()\" id=\"cancelButton\"><img src=\"images/tipsWindown_img/cancelButton.gif\" /></div>");
		request = encodeURI(request);
		if(operateFile == actionFile){ //如果先复制(剪切)然后删除 那么就将复制的信息清空
			clearPasteFileValue();  
		}
		 
		$("#fileExplorer_showFile").load(request,"",function(responseText, textStatus, XMLHttpRequest){
			if(navigator.language!=null&&navigator.language!=""){
				if(navigator.language.substring(0,2)=="zh"){
					$("#button_area").html("<input type='button' value='完成' class='fileExplorer_tipsWindown_buttonStyle2' onClick='confirmClolseDelete();'>");	
				}else{
					$("#button_area").html("<input type='button' value='OK' class='fileExplorer_tipsWindown_buttonStyle2' onClick='confirmClolseDelete();'>");
				}
			}else{
				if(navigator.browserLanguage.substring(0,2)=="zh"){
					$("#button_area").html("<input type='button' value='完成' class='fileExplorer_tipsWindown_buttonStyle2' onClick='confirmClolseDelete();'>");		
				}else{
					$("#button_area").html("<input type='button' value='OK' class='fileExplorer_tipsWindown_buttonStyle2' onClick='confirmClolseDelete();'>");
				}
			}														 							 											 				
			if(textStatus == "success"){
				if(navigator.language!=null&&navigator.language!=""){
					if(navigator.language.substring(0,2)=="zh"){
						$("#deleteResult").html("");
						$("#windown-title h2").html("文件删除成功");
						$("#deleteResult").append("<div style='float:left;padding-top:4px; height:23px;'>该文件删除成功！</div>");
						setFileCount();
						clearOpenFileValue();//清空数据			
					}else{
						$("#deleteResult").html("");
						$("#windown-title h2").html("Succeed");
						$("#deleteResult").append("<div style='float:left;padding-top:4px; height:23px;'>Delete succeed!</div>");
						setFileCount();
						clearOpenFileValue();//清空数据		
					}
				}else{
					if(navigator.browserLanguage.substring(0,2)=="zh"){
						$("#deleteResult").html("");
						$("#windown-title h2").html("文件删除成功");
						$("#deleteResult").append("<div style='float:left;padding-top:4px; height:23px;'>该文件删除成功！</div>");
						setFileCount();
						clearOpenFileValue();//清空数据	
					}else{
						$("#deleteResult").html("");
						$("#windown-title h2").html("Succeed");
						$("#deleteResult").append("<div style='float:left;padding-top:4px; height:23px;'>Delete succeed!</div>");
						setFileCount();
						clearOpenFileValue();//清空数据	
					}
				}					
			}else{
				if(navigator.language!=null&&navigator.language!=""){
					if(navigator.language.substring(0,2)=="zh"){
						$("#deleteResult").html("");
						$("#windown-title h2").html("文件删除失败");
						$("#deleteResult").html("<div style=' float:left;padding-top:5px;'>该文件删除失败！</div>");
					}else{
						$("#deleteResult").html("");
						$("#windown-title h2").html("Failed");
						$("#deleteResult").html("<div style=' float:left;padding-top:5px;'>Delete Failed!</div>");
					}
				}else{
					if(navigator.browserLanguage.substring(0,2)=="zh"){
						$("#deleteResult").html("");
						$("#windown-title h2").html("文件删除失败");
						$("#deleteResult").html("<div style=' float:left;padding-top:5px;'>该文件删除失败！</div>");
					}else{
						$("#deleteResult").html("");
						$("#windown-title h2").html("Failed");
						$("#deleteResult").html("<div style=' float:left;padding-top:5px;'>Delete Failed!</div>");
					}
				}									
			}
		});
	}
	
	/*删除成功之后关闭对话框*/
	function confirmClolseDelete(){
		$("#confirmCloseDelete").html("<img src=\"images/tipsWindown/confirmButton_2.gif\" />");
		closeTipsWindown();
		}
	
	/*取消删除*/
	function cancelDelete(){
		$("#cancelButton").html("<img src=\"images/tipsWindwon/cancelButton_2.gif\" />");
		closeTipsWindown();
    }
	
	/*新建文件夹*/
	function actionCreate(){ 
		var folderName = document.getElementById("fileExplorer_floderName").value;
		var fileExist = false;
		var language = navigator.language;
		if(folderName != null){
		    var fileNameValues = document.getElementsByName("fileName"); //当前目录所有文件
		    for(var i = 0;i< fileNameValues.length;i++){  //判断是否有重名
		         if(folderName == fileNameValues[i].value){
					if(navigator.language!=null&&navigator.language!=""){
						if(navigator.language.substring(0,2)=="zh"){
							$("#newFloderTishi").html("该名字在当前目录已经存在！");
						}else{
							$("#newFloderTishi").html("The name already exists!");		
						}
					}else{
						if(navigator.browserLanguage.substring(0,2)=="zh"){
							$("#newFloderTishi").html("该名字在当前目录已经存在！");
						}else{
							$("#newFloderTishi").html("The name already exists!");		
						}
					}										
					return;
			     }
		    }
			var request = "/"+loadFileName+"?action=create&type=folder&folderName="+folderName + "&timeInfo="+(new Date()).getTime();
		    request = encodeURI(request);
	        $("#fileExplorer_showFile").load(request,"",function(){closeTipsWindown();});
		}
	}
	
	/*关闭自定义的窗口*/
	function closeTipsWindown(){ 
	    setFileCount();
	    $("#windownbg").remove();
	    $("#windown-box").fadeOut("slow",function(){$(this).remove();});
	}
	
	/*返回上级目录*/
	function goBack_beforePath(){  
	    var beforePath = "";
	    var nowPath = getCookieValue("nowPath");		
	    if(nowPath == "/sdcard"){ //如果是sdcard就将其设置为上级目录
	        beforePath =nowPath;
	    }else{
	         beforePath = nowPath.substring(0,nowPath.lastIndexOf("/")); //从第一个开始截取当前目录到最后一个"/"位置
	    }
	    var request = "/"+loadFileName+"?timeInfo="+(new Date()).getTime()+"&action=brower&path=" + beforePath;
	    clickMuluHref(request);//实际跳转的路径，与显示无关
		$("#fileExplorer_fileSrc_repeat").val(beforePath+"/");//最后地址栏显示路径
	}
	
	/*刷新当前页*/
	function refreshIndex(){
//		history.go(0);
	fileSrcEnter($("#fileExplorer_fileSrc_repeat").val());
	}
	
	/*刷新页面*/
	function refreshNowPath(){
         hideAndChangeStyle();
        nowPath = getCookieValue("nowPath");
	     var refleshPath = loadFileName + "?timeInfo="+(new Date()).getTime()+"&action=brower&path="+nowPath; //刷新的路径
	     $("#fileExplorer_showFile").load(encodeURI(refleshPath));
    }
	
	/*隐藏和将div以选中的样式去除,弹出安装、上传等操作时候会用到，需要设置个隐藏id*/
	function hideAndChangeStyle(){ //
        clearOpenFileValue(); //清空打开文件所传递的值
        $("div[title]").filter(".changeDivStyle").toggleClass("changeDivStyle");   //将单击或者是右键选中的文件去掉背景阴影
		document.getElementById("controlHidden").style.visibility='hidden';  //隐藏菜单 
    }	
	
	
	/*国际编码*/
	function defaultTranslation(){
		if((localStorage.coding=="en"&&ii%2==0)){
			$('.translation_style').html("Chinese");
			$('.index_coding_fileExplorer').html("Documents");
			$('.index_coding_contacts').html("Contacts");
			$('.index_coding_sms').html("Messages");
			$('.index_coding_calllog').html("Logs");
			$('.fileExplorer_controlButton').html("install");	
		ii++;
		}else if(localStorage.coding==null||localStorage.coding==""){
			localStorage.coding="zh"
			$('.translation_style').html("English");
			$('.index_coding_fileExplorer').html("文件管理");
			$('.index_coding_contacts').html("通讯录");
			$('.index_coding_sms').html("短信");
			$('.index_coding_calllog').html("通话记录");
		}else if(localStorage.coding=="zh"){
			document.getElementById("index_iframe_area").src="./fileExplorer.html";
			localStorage.coding="zh";
			$('.translation_style').html("English");
			$('.index_coding_fileExplorer').html("文件管理");
			$('.index_coding_contacts').html("通讯录");
			$('.index_coding_sms').html("短信");
			$('.index_coding_calllog').html("通话记录");
		}else if(localStorage.coding=="en"){
			document.getElementById("index_iframe_area").src="./fileExplorer.html";
			$('.translation_style').html("Chinese");
			localStorage.coding="en";
			$('.index_coding_fileExplorer').html("Documents");
			$('.index_coding_contacts').html("Contacts");
			$('.index_coding_sms').html("Messages");
			$('.index_coding_calllog').html("Logs");
			$('.fileExplorer_controlButton').html("install");

		}
		
	}
	
	function codingTranslation(){
		
		if(ii%2==0){
			alert("ii%2==0");
			localStorage.coding="en";
			ii++;
		}else{
			alert("ii%2!=0");
			localStorage.coding="zh";
			ii++;
		}
		defaultTranslation();
		
	}
	
	function localTranslation(){
		if(navigator.language!=null&&navigator.language!=""){
			if(navigator.language.substring(0,2)!="zh"){
				$('.index_coding_fileExplorer').html("Documents");
				$('.index_coding_contacts').html("Contacts");
				$('.index_coding_sms').html("Messages");
				$('.index_coding_calllog').html("Logs");
				$('.fileExplorer_controlButton').html("Install");
				$("#tips").html("<h3>O(∩_∩)O~，Recommened to use other browsers!</h3>");
			}
		}else{
			if(navigator.browserLanguage.substring(0,2)!="zh"){
				$('.index_coding_contacts').html("Contacts");
				$('.index_coding_sms').html("Messages");
				$('.index_coding_calllog').html("Logs");
				$('.fileExplorer_controlButton').html("Install");
				$("#tips").html("<h3>O(∩_∩)O~，Recommened to use other browsers!</h3>");
			}
		}		
	}
	
	/*判断浏览器&&捕抓火狐控制字符输出*/
	$(document).ready(function(){
		if($.browser.msie){

		} 
		else if($.browser.safari){
		
		}
		else if($.browser.mozilla){

		}
		else if($.browser.opera) {
		}
		else {
		}
	});
	
	
	  