//超链接指向,str标题,href地址
function HrefTarget(str,href)
{   
  var str,href;
  var parentfrm=window.parent;
  parentfrm.run_item(str,href,-1);
}
function sqlchange()
{
	if(document.getElementById("SystemDatabaseTypePlus").value==1||document.getElementById("SystemDatabaseTypePlus").value==4)
	{
	document.getElementById("DbPathPlus").disabled=false;
	document.getElementById("DbNamePlus").disabled=false;
	document.getElementById("DbPasswordPlus").disabled=false;
	document.getElementById("DbPathPlus").style.backgroundColor="#FFF";
	document.getElementById("DbNamePlus").style.backgroundColor="#FFF";
	document.getElementById("DbPasswordPlus").style.backgroundColor="#FFF";
	
	document.getElementById("SqlHostIPPlus").disabled=true;
	document.getElementById("SqlUsernamePlus").disabled=true;
	document.getElementById("SqlPasswordPlus").disabled=true;
	document.getElementById("SqlHostIPPlus").style.backgroundColor="#e9e9e9";
	document.getElementById("SqlUsernamePlus").style.backgroundColor="#e9e9e9";
	document.getElementById("SqlPasswordPlus").style.backgroundColor="#e9e9e9";
	
	document.getElementById("SqlDatabaseNamePlus").disabled=true;
	document.getElementById("SqlDatabaseNamePlus").style.backgroundColor="#e9e9e9";
	document.getElementById("DbConnPlusStr").disabled=true;
	document.getElementById("DbConnPlusStr").style.backgroundColor="#e9e9e9";
	}else if(document.getElementById("SystemDatabaseTypePlus").value==100){
	document.getElementById("DbPathPlus").disabled=false;
	document.getElementById("DbNamePlus").disabled=false;
	document.getElementById("DbPasswordPlus").disabled=false;
	document.getElementById("DbPathPlus").style.backgroundColor="#e9e9e9";
	document.getElementById("DbNamePlus").style.backgroundColor="#e9e9e9";
	document.getElementById("DbPasswordPlus").style.backgroundColor="#e9e9e9";
	
	document.getElementById("SqlHostIPPlus").disabled=false;
	document.getElementById("SqlUsernamePlus").disabled=false;
	document.getElementById("SqlPasswordPlus").disabled=false;
	document.getElementById("SqlHostIPPlus").style.backgroundColor="#e9e9e9";
	document.getElementById("SqlUsernamePlus").style.backgroundColor="#e9e9e9";
	document.getElementById("SqlPasswordPlus").style.backgroundColor="#e9e9e9";
	
	document.getElementById("SqlDatabaseNamePlus").disabled=true;
	document.getElementById("SqlDatabaseNamePlus").style.backgroundColor="#e9e9e9";
	document.getElementById("DbConnPlusStr").disabled=false;
	document.getElementById("DbConnPlusStr").style.backgroundColor="#FFF";
	}else{
	document.getElementById("DbPathPlus").disabled=true;
	document.getElementById("DbNamePlus").disabled=true;
	document.getElementById("DbPasswordPlus").disabled=true;
	document.getElementById("DbPathPlus").style.backgroundColor="#e9e9e9";
	document.getElementById("DbNamePlus").style.backgroundColor="#e9e9e9";
	document.getElementById("DbPasswordPlus").style.backgroundColor="#e9e9e9";
	
	document.getElementById("SqlHostIPPlus").disabled=false;
	document.getElementById("SqlUsernamePlus").disabled=false;
	document.getElementById("SqlPasswordPlus").disabled=false;
	document.getElementById("SqlHostIPPlus").style.backgroundColor="#FFF";
	document.getElementById("SqlUsernamePlus").style.backgroundColor="#FFF";
	document.getElementById("SqlPasswordPlus").style.backgroundColor="#FFF";
	
	document.getElementById("SqlDatabaseNamePlus").disabled=false;
	document.getElementById("SqlDatabaseNamePlus").style.backgroundColor="#FFF";
	document.getElementById("DbConnPlusStr").disabled=true;
	document.getElementById("DbConnPlusStr").style.backgroundColor="#e9e9e9";
	}
}
function OutPutValue(outputname,val){
	if (val!=''){
		if (document.getElementById(outputname).value==''){
			document.getElementById(outputname).value = val;
		}
	}
}
//显示、隐藏菜单
function switchSysBar(obj){    
	if (document.all("Melyy_Left").style.display==""){
	 obj.src="../Images/ManageMain/goout.gif";
	 obj.title='显示菜单';
	 document.all("Melyy_Left").style.display="none";
	 }
	else{         
	 obj.src="../Images/ManageMain/goin.gif";
	 obj.title='隐藏菜单';
	 document.all("Melyy_Left").style.display="" ;
	}
}

//显示、隐藏菜单
function switchSysTop(obj){    
	if (document.all("Melyy_Top").style.display==""){
	 obj.src="../Images/ManageMain/Topgoout.gif";
	 obj.title='显示';
	 document.all("Melyy_Top").style.display="none";
	 }
	else{         
	 obj.src="../Images/ManageMain/Topgoin.gif";
	 obj.title='隐藏';
	 document.all("Melyy_Top").style.display="" ;
	}
}

//取得日期和星期
function initArray(){
	 this.length=initArray.arguments.length
	 for(var i=0;i<this.length;i++)
	 this[i+1]=initArray.arguments[i] 
}
 
function initTime(){
	today=new Date();
    var d=new initArray("星期日","星期一","星期二","星期三","星期四","星期五","星期六"); 
    document.write(today.getYear(),"年",today.getMonth()+1,"月",today.getDate(),"日 ",d[today.getDay()+1],"&nbsp;");  	
}

	
function settimes(){   
	  var time= new Date();   
	  hours  = time.getHours();   
	  mins  = time.getMinutes();   
	  secs  = time.getSeconds();   
	  if(hours<10)hours="0"+hours;   
	  if(mins<10)mins="0"+mins;   
	  if(secs<10)secs="0"+secs;	     
	  eval("document.all.timediv.innerHTML='时间："+hours+":"+mins+":"+secs+"'");   
	  setTimeout("settimes()",1000);   
}
function resizepic(ImgD,iWidth,iHeight){ 
 var image=new Image(); 
 image.src=ImgD.src; 
 if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>= iWidth/iHeight){ 
   if(image.width>iWidth){
    ImgD.width=iWidth; 
    ImgD.height=(image.height*iWidth)/image.width; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详细信息..."; 
  } 
  else{ 
   if(image.height>iHeight){
    ImgD.height=iHeight; 
    ImgD.width=(image.width*iHeight)/image.height; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详细信息..."; 
  } 
 }
}