Dim UserNum
Dim UserStatus
Dim Path
Dim strQQMailTip
Dim ShowStatus
Dim foldbottom
Dim bMsgInside
Dim CurrentWidth
Dim CurrentHeight
Dim PlugMngHeight
Dim PlugCloseState
Dim PetState
Dim ntopdistance
Dim nYellowBanner
Dim nSearchBanner
Dim bShowDNA
Dim strTenpayTip
Dim bShowSoso
Dim startDate,startHour,startMinute,startSecond,endDate,endHour,endMinute,endSecond
Dim sh

'注释

Sub Window_OnInit()
    Window.GetScriptVersion "1.0"
    UserStatus = "[离线]"
	Path = "NewSkins\\2006\\"
	ShowStatus = 1
	UserNum = "0"
	If 1 = ShowStatus Then
	    UserNum = UserNum + UserStatus
	End If
	strQQMailTip = ""
	bMsginside = 0
	PlugCloseState = 0
	PetState = 1
	bShowDNA = 0
	bShowSoso = 0
	strTenpayTip = ""
        startDate = Date
        startHour = Hour(Now)
        startMinute = Minute(Now)
        startSecond = Second(Now)
    ImSearchPlugin.bInside = FALSE
End Sub

Sub AdjustStatuePanelSize()
	QZoneMsgCenterButton.width = 16 + QZoneMsgCenterButton.textlength + 6
	
	MailButton.left = QZoneMsgCenterButton.left + QZoneMsgCenterButton.width
	MailButton.width = 16 + MailButton.textlength + 6
	
	PaymentButton.left = MailButton.left + MailButton.width
	If  PaymentButton.textlength > 0 Then 
		PaymentButton.width = 16 + PaymentButton.textlength + 6
	else 
		PaymentButton.width = 16 + 12
	End If
	
	SosoButton.left = PaymentButton.left + PaymentButton.width
	If  SosoButton.textlength > 0 Then 
		SosoButton.width = 16 + SosoButton.textlength + 6
	else 
		SosoButton.width = 16 + 12
	End If
End Sub

Sub Window_OnSize(cx,cy)
	Window.LockPaint()
	CurrentWidth = cx
	CurrentHeight = cy
	
	BackgroundRB.left  = cx - 12 
	BackgroundRB.top = cy - 110 
	BackgroundLB.top = cy - 110 
	BackgroundRT.left  = cx - 79 
	BackgroundRT2.left  = cx - 115 
	BackgroundL1.height = cy - 141 - 146
	BackgroundL2.top = BackgroundL1.top + BackgroundL1.height
	BackgroundL2.height = 146
	BackgroundR.left  = cx - 35 
	BackgroundR.height = cy - 64
	BackgroundT.width = cx - 143
	BackgroundT2.width = cx - 173 
	BackgroundB.top = cy - 110 
	BackgroundB.width = cx - 35 
	BackgroundC.width = cx - 19 
	BackgroundC.height = cy - 141 
		

	ntopdistance = 0
    nYellowBanner = 0
	QQPushMsgPlug.AdjustHeight(cx - 4)
	
	If nYellowBanner > 0 Then
		QQPushMsgPlug.width = cx - 4
		QQPushMsgPlug.Height = nYellowBanner
		QQPushMsgPic.width = cx - 6
		QQPushMsgPic.Visible = TRUE
		ntopdistance = nYellowBanner
	Else
		QQPushMsgPic.Visible = FALSE
	End If
	
    If ImSearchPlugin.bInside Then
        nSearchBanner = 0
        ImSearchPlugin.AdjustHeight(cx)
        ImSearchPlugin.left = 0
        ImSearchPlugin.width = cx
        ImSearchPlugin.Height = nSearchBanner
        If (nYellowBanner > 0) Then
              ImSearchPlugin.top = 89 + ntopdistance
        Else
              ImSearchPlugin.top = 88 + ntopdistance
        End If
        ntopdistance = ntopdistance + nSearchBanner
    Else
        ImSearchPlugin.left = 0
        ImSearchPlugin.width = 0
        ImSearchPlugin.Height = 0
        ImSearchPlugin.top = 88 + ntopdistance
    End If
	       	
	
	    If (nYellowBanner > 0) Then
		NewPanels.top = 89 + ntopdistance
	Else
		NewPanels.top = 88 + ntopdistance
	End If
	
	NewPanels.width = 35
	
	   If (nYellowBanner > 0) Then 
		Bar1.top = 93 + ntopdistance
	Else
		Bar1.top = 89 + ntopdistance
	End If


	StatusWeather.left = cx - 43
	Container_Up.top = 25
	Container_Up.left = StatusButton.left + StatusButton.width
	Container_Up.width = cx - Container_Up.left - StatusWeather.width - 10
	Container_Up.height = 68

	Container_Down.top = cy - 65
	Container_Down.left = 0
	Container_Down.width = cx
	Container_Down.height = 65



	

    	
	ToolBarBackgroundC.top = cy - 68 
	ToolBarBackgroundC.width = cx - 30 
	ToolBarBackgroundL.top = ToolBarBackgroundC.top 
	ToolBarBackgroundR.left = cx - 68 
	ToolBarBackgroundR.top = ToolBarBackgroundC.top 

	
	CloseButton.left = cx - 35 

	MinButton.left = cx - 96 

	QQCaption.width = MinButton.left - QQCaption.left - 2
	ColorButton.left = cx - 66 

	AdjustStatuePanelSize()
	GameButton.left = MobileMsgButton.left + 22
	TTButton.left = GameButton.left + 22
	ChatRoomButton.left = TTButton.left + 22
	petOpenBtn.left = ChatRoomButton.left + 22
	QQMusic.left = petOpenBtn.left + 22
	QQTV.left = QQMusic.left + 22
        PrivilegeButton.left = QQTV.left + 22
        if cx<show.width then
	   show.left = 0
        else
	   show.left = (cx - show.width)/2
        end if 
        hide.left = show.left
	MobileMsgButton.top = cy - 27 
	GameButton.top = cy - 27 
	TTButton.top = cy - 27 
	ChatRoomButton.top = cy - 27
	petOpenBtn.top = cy - 27 
	QQTV.top = cy - 27
        ContentsButton.top = cy - 34
	QQMusic.top = cy - 27
	show.top = cy - 40
        ArrowDown.top = show.top
	ArrowDown.left = (cx -6)/2	
        hide.top = cy - 40	
        ArrowUp.top = hide.top
	ArrowUp.left = (cx-6)/2
ToolMenuBtn.top=cy-26
	MenuButton.top = cy - 34
	SearchButton.top = cy - 27
	MsgManagerButton.top = cy - 27
        if  sh = 1 then



           If cx >= QQTV.left + QQTV.width Then
              QQTV.Visible = true
           else
	      QQTV.Visible = false              
           End If
           If cx >= QQMusic.left + QQMusic.width Then
	     QQMusic.Visible = true
           else
      	     QQMusic.Visible = false              
           End If
           If cx >= petOpenBtn.left + petOpenBtn.width  Then
	      petOpenBtn.Visible = true
           else
	      petOpenBtn.Visible = false              
           End If
        else 
           If cx > SearchButton.left + 17 Then
	      SearchButton.Visible = true
           else
	      SearchButton.Visible = false              
           End If
	   ' PrivilegeButton.visible = "true" 
           If cx > PrivilegeButton.left + 20 Then
	      PrivilegeButton.Visible = true
           else
	      PrivilegeButton.Visible = false              
           End If
        end if

	CalcStatusPos cx, cy
	
	Bar1.width = cx - 6
	Bar1.LockPaint()
	Bar1.height = cy - 130 - ImSearchPlugin.height	   
     	NewPanels.height = Bar1.height
        Bar1.UnLockPaint()
	
	
	MailButton.label = strQQMailTip
	Window.UnLockPaint()	 
End Sub

Function TimeDiff(ByVal sBegin_Hour,ByVal sBegin_Minute,ByVal sBegin_Second,ByVal sBegin_Date,ByVal sEnd_Hour,ByVal sEnd_Minute,ByVal sEnd_Second,ByVal sEnd_Date)
  Dim iHourB,iMinuteB,iSecondB
  Dim iHourE,iMinuteE,iSecondE
  Dim dTimeB,dTimeE,dTimeDiff
  Dim iHour,iMinute,iSecond
  Dim Diff
  iHourB = clng(sBegin_Hour)
  iMinuteB = clng(sBegin_Minute)
  iSecondB = clng(sBegin_Second)
  iHourE = clng(sEnd_Hour)
  iMinuteE = clng(sEnd_Minute)
  iSecondE = clng(sEnd_Second)
  Diff = DateDiff("d",sBegin_Date,sEnd_Date)
  iHourE = iHourE + 24 * Diff
  dTimeB = iHourB * 3600 + iMinuteB * 60 + iSecondB
  dTimeE = iHourE * 3600 + iMinuteE * 60 + iSecondE
  dTimeDiff = dTimeE - dTimeB
  iHour = Int(dTimeDiff / 3600)
  dTimeDiff = dTimeDiff - iHour * 3600
  iMinute = Int(dTimeDiff / 60)
  dTimeDiff = dTimeDiff - iMinute * 60
  iSecond = Int(dTimeDiff)
  dTimeDiff = dTimeDiff - Int(dTimeDiff)
  iMiniSecond = dTimeDiff
  TimeDiff = iHour & ":" & iMinute & ":" & iSecond
End Function

Sub CalcStatusPos(cx, cy)
	StatusEdit.Left = QQNumber.left
	IF bShowDNA = 1 Then
		DNAButton.visible = True
		QQNumber.width = QQNumber.textlength
		DNAButton.Left = QQNumber.Left + QQNumber.width
		QQStatus.Left = DNAButton.Left + DNAButton.width + 1
		QQStatus.width = QQStatusText.textlength + 3
	Else
		DNAButton.visible = False
		QQNumber.width = QQNumber.textlength
		QQStatus.Left = QQNumber.Left + QQNumber.width + 1
		QQStatus.width = QQStatusText.textlength + 3
	End If

	If QQStatus.Left > cx - 15 Then
		QQStatus.Left = cx - 15
		QQStatus.width = 0
		QQStatus.visible = False
	ElseIf QQStatus.Left + QQStatus.width > cx - 15 Then
		QQStatus.visible = true
		QQStatus.width = cx - 15 - QQStatus.Left
	Else
		QQStatus.visible = True
	End If
	
	StatusEdit.width = cx - StatusEdit.left - 5
End Sub

'上面的三个按钮
Sub MinButton_onClick()
	Window.ExeCommand 1,2
End Sub

Sub CloseButton_onClick()
	Window.ExeCommand 1,3
End Sub

Sub ColorButton_onClick()
        Window.ExeCommand 4,7
End Sub


'六个Bar按钮
Sub Window_onClick(code, Name)
	Window.LockPaint()
	Window.DisableBar CStr(Name)
	Window.ExeCommand code,CStr(Name)
	Window.UnLockPaint()
End Sub

'顶部的按钮组 
Sub QQStatus_onClick()
	s = QQStatus.left
	Window.ExeCommand 63,s
End Sub

Sub StatusButton_onClick()
	s = CStr(StatusButton.Left + StatusButton.width - 10)&"."&CStr(StatusButton.Top + StatusButton.height - 8)
	Window.ExeCommand 6,s
End Sub

sub StatusPic_onMouseMove(nX,nY)
 s = CStr(StatusPic.Left) & "." & CStr(StatusPic.Top) & "." & CStr(StatusPic.width) & "." & CStr(StatusPic.height)
 Window.ExeCommand 20,s
        endDate = Date
        endHour = Hour(Now)
        endtMinute = Minute(Now)
        endSecond = Second(Now)
        OnlineTime.value = "在线计时 " & CStr(TimeDiff(startHour,startMinute,startSecond,startDate,endHour,endtMinute,endSecond,endDate))
        MailButton.visible=false
        PaymentButton.visible=false
        QZoneMsgCenterButton.visible=false
        SosoButton.visible=false
        OnlineTime.visible=true
end Sub

sub StatusPic_onMouseLeave()
 s = CStr(StatusPic.Left) & "." & CStr(StatusPic.Top) & "." & CStr(StatusPic.width) & "." & CStr(StatusPic.height)
 Window.ExeCommand 21,s
        OnlineTime.visible=false
        MailButton.visible=true
        PaymentButton.visible=true
        QZoneMsgCenterButton.visible=true
        SosoButton.visible=true
end Sub

Sub StatusPic_onClick()
	Window.ExeCommand 60,2
End Sub


sub StatusWeather_onMouseMove(nX,nY)
	s = CStr(StatusWeather.Left) & "." & CStr(StatusWeather.Top) & "." & CStr(StatusWeather.width) & "." & CStr(StatusWeather.height)
	Window.ExeCommand 31,s
end Sub

sub StatusWeather_onMouseLeave()
	s = CStr(StatusWeather.Left) & "." & CStr(StatusWeather.Top) & "." & CStr(StatusWeather.width) & "." & CStr(StatusWeather.height)
	Window.ExeCommand 30,s
end Sub

Sub StatusWeather_onClick()
	Window.ExeCommand 61,0
End Sub

sub PaymentButton_onClick()
	Window.ExeCommand 4,8
end Sub

Sub QZoneMsgCenterButton_onClick()
	QZoneMsgCenterButton.label = "0"
	Window.ExeCommand 66,0
End Sub	
Sub MailButton_onClick()
	Window.ExeCommand 7,1		
End Sub

Sub DNAButton_onClick()
	Window.ExeCommand 27,1
End Sub
Sub SosoButton_onClick()
	Window.ExeCommand 4,14
End Sub
'Sub HostingButton_onClick()
'	Window.ExeCommand 15,1	
'End Sub

Sub SecurityButton_onClick()
	Window.ExeCommand 15,1	
End Sub

Sub MyQQButton_onClick()
	Window.ExeCommand 4,13	
End Sub

'下面的按钮组 
Sub MobileMsgButton_onClick()
	Window.ExeCommand 4,2
End Sub

Sub GameButton_onClick()
	Window.ExeCommand 4,5

End Sub

Sub TTButton_onClick()
	Window.ExeCommand 4,4
End Sub

Sub ChatRoomButton_onClick()
	Window.ExeCommand 4,1
End Sub

Sub MenuButton_onClick()
	'Dim a As Integer
	'a = MenuButton.Left - 3
	's = CStr(Left)&"."&CStr(MenuButton.Top)
	s = CStr(Int(MenuButton.Left))&"."&CStr(MenuButton.Top)
	Window.ExeCommand 5,s
End Sub

Sub MsgManagerButton_onClick()
	Window.ExeCommand 4,6
End Sub

Sub SearchButton_onClick()
	Window.ExeCommand 4,3
End Sub

Sub PrivilegeButton_onClick()
	Window.ExeCommand 4,15
End Sub
'Sub QQHome_onClick()
'	Window.ExeCommand 16,1	
'End Sub


Sub PanelMngButton_OnClick()
	Window.ExeCommand 19,1
End Sub
Sub QQMusic_OnClick()
	Window.ExeCommand 25,1
End Sub
Sub QQTV_onClick()
	Window.ExeCommand 26,1
End Sub

sub petOpenBtn_onClick()
	Window.ExeCommand 40,12
end Sub

Sub ToolMenuBtn_onClick()
	Window.ExeCommand 4,9
End Sub




'处理QQ程序发来的事件
Sub Window_OnNotify(code ,var)
	If code = 1 Then 
	    '设置当前的Uin
	    UserNum = var
	    If 0 = ShowStatus Then
			QQNumber.value = UserNum
		Else
		   	QQNumber.value = UserNum
			QQStatusText.value = UserStatus
			QQStatus.label = UserStatus
		End If	
		CalcStatusPos CurrentWidth, CurrentHeight
	ElseIf code = 2 Then
		'闪系统消息按钮 var 为1是开始闪。为2是停止
		If(var = 1) Then
			MsgManagerButton.StopFlash
			MsgManagerButton.Flash 30
		Else
			MsgManagerButton.StopFlash
		End If
	ElseIf code = 3 then
		'闪状态按钮 var 为0,1,2,3是对应的ico。为4表示停止
		If var = 0 Then
			StatusPic.ico = "Online.ico"		
		ElseIf var = 1 Then
			StatusPic.ico = "leave.ico"		
		ElseIf var = 2 Then
			StatusPic.ico = "invisible.ico"		
		ElseIf var = 3 Then
			StatusPic.ico = "Offline.ico"		
		ElseIf var = 4 Then
			StatusPic.Ico = StatusIco	
		End If
	ElseIf code = 4 Then
		'设置那个Bar在最前
		Window_onClick 2,Var
	ElseIf code = 5 Then
		'设置当前的状态。
		QQStatus.Disabled=0
		If var = 10 Then	
			UserStatus = "[在线]"		
			StatusIco = "online.ico"
		ElseIf var = 20 Then
			UserStatus = "[离线]"	
			QQStatus.Disabled=1		
			StatusIco = "exit.ico"
		ElseIf var = 30 Then	
			UserStatus = "[离开]"		
			StatusIco = "leave.ico"
		ElseIf var = 40 Then	
			UserStatus = "[隐身]"		
			StatusIco = "hide.ico"
		ElseIf var = 50 Then
			UserStatus = "[忙碌]"
			StatusIco = "busy.ico"
		ElseIf var = 60 Then
			UserStatus = "[Q我吧]"
			StatusIco = "qme.ico"
		ElseIf var = 70 Then
			UserStatus = "[静音]"
			StatusIco = "nobother.ico"
		End If
		StatusButton.ico = StatusIco
		If 0 = ShowStatus Then
			QQNumber.value = UserNum
		Else
		   	QQNumber.value = UserNum
			QQStatusText.value = UserStatus
			QQStatus.label = UserStatus
		End If
	ElseIf code  = 6 Then
		'设置Skin的起始路径
		Path = Var	
	ElseIf code = 10 Then
		If(var = 1) Then
			PaymentButton.SetLighting(true)
		Else
			PaymentButton.SetLighting(false)
		End If
	ElseIf code = 15 Then
		If(Var = 1) Then
			SecurityButton.SetLighting(true)
		Else 
		    SecurityButton.SetLighting(false)
		End If
	ElseIf code = 17 Then
		If(Var = 1) Then
		   SecurityButton.ico = "security_alert.ico"
		ElseIf (Var = 2) Then
		   SecurityButton.ico = "security_import.ico"
		ElseIf (Var = 3) Then
		   SecurityButton.ico = "security_infor.ico"
		ElseIf (Var = 4) Then
		   SecurityButton.ico = "security_help.ico"
		ElseIf (Var = 5) Then
		   SecurityButton.ico = "security_normal.ico"
		Else
		   SecurityButton.ico = "security_normal.ico"		
		End If
	ElseIf code = 19 Then
		If(Var = 1) Then
		   SecurityButton.visible = true
		   'MyQQButton.visible = false
		ElseIf(Var = 0)Then
		   SecurityButton.visible = false
		   'MyQQButton.visible = false
		ElseIf(Var = 2)Then
		   SecurityButton.visible = false
		   'MyQQButton.visible = true
		End If
	ElseIf code = 20 Then
		If(Var = 1) Then
			bShowDNA = 1			
		ElseIf(Var = 0) Then
			bShowDNA = 0
		End If
		CalcStatusPos CurrentWidth, CurrentHeight
	ElseIf code = 25 Then
		' 皮肤推送
		if(var = 1) then
			ColorButton.SetLighting(true)
		else
			ColorButton.SetLighting(false)
		end If	
	
	
	ElseIf code = 51 Then
		iVarLen = Len(var) - 2
		StrCaption = Mid(var, 3, iVarLen)
		QQCaption.value = StrCaption	
'改变QQMail的提示,旧版本皮肤的逻辑，QQ2007Beta2后使用102			
'   ElseIf code = 100 Then
'		If( var = 0 ) Then
'		    strQQMailTip = "(" + "0" + ")"
'		Else
'		    strQQMailTip = "(" + CStr(var) + ")"
'		End If
'		MailButton.label = strQQMailTip		
'	ElseIf code = 101 Then	    
'	    If( var = 0 ) Then
'	        HostingButton.label = "(" + "0" + ")"
'	    Else
'		   HostingButton.label = "(" + CStr(var) + ")"
'		End If
	ElseIf code = 102 Then
	    '改变QQMail的提示，QQ2007Beta2后使用102
		strQQMailTip = CStr(var)
		MailButton.label = strQQMailTip			
		AdjustStatuePanelSize()		
	ElseIf code = 103 then
		if(var > 0) then
			MailButton.StartGif(var)			
		Else
			MailButton.EndGif()						
		End If
	ElseIf code = 104 Then
		If(Var = 1) Then
			MailButton.ico = "MailButtonGray.ico"
		Else
			MailButton.ico = "MailButton.ico"	
		End If		
	ElseIf code = 105 Then
		MailButton.toolTip = CStr(var)
	ElseIf code = 106 Then
		if (var = -1) then
		PaymentButton.label = 0
		PaymentButton.width = 18
		PaymentButton.toolTip = "进入我的钱包"
		ElseIf (var = 0) then
		PaymentButton.label = 0
		PaymentButton.width = 43
		PaymentButton.toolTip = "进入我的钱包"
		else
		PaymentButton.width = 43
		PaymentButton.label = CStr(var)
		PaymentButton.toolTip = "您有" + CStr(var) + "笔未处理交易"
		end if
		AdjustStatuePanelSize()
	ElseIf code = 107 Then
		UserStatus = "[" + CStr(var) + "]"
		QQStatusText.value = UserStatus
		QQStatus.label = UserStatus
		CalcStatusPos CurrentWidth, CurrentHeight
	ElseIf code = 108 then
		if(var = 1) then
			StatusEdit.bInside = TRUE
		else
			StatusEdit.bInside = FALSE
		end If	
	ElseIf code = 500 Then
		nYellowBanner = Var
	ElseIf code = 109 Then
		pos = QQStatus.left - QQNumber.left
		if(var = 0) then
			Window.ExeCommand 65,pos
		Else
			Window.ExeCommand 64,pos
		end If
	ElseIf code = 110 Then		
		SosoButton.toolTip = CStr(var)	
	ElseIf code = 111 Then		
	  if(var = 0) then
	  	MsgManagerButton.left = 69
	    SearchButton.left = 95
	    PrivilegeButton.visible = "false"
	  elseif(var = 1) Then
	    PrivilegeButton.ToolTip="会员俱乐部"
	    PrivilegeButton.left = MenuButton.left + MenuButton.width + 9
	    MsgManagerButton.left = PrivilegeButton.left + PrivilegeButton.width + 7
	    SearchButton.left = MsgManagerButton.left + MsgManagerButton.width + 7
	    PrivilegeButton.visible = "true"
	  elseif(var = 2) Then
	    PrivilegeButton.ToolTip="免费体验QQ高级功能"
	    PrivilegeButton.left = MenuButton.left + MenuButton.width + 9
	    MsgManagerButton.left = PrivilegeButton.left + PrivilegeButton.width + 7
	    SearchButton.left = MsgManagerButton.left + MsgManagerButton.width + 7
	    PrivilegeButton.visible = "true"
	  end If
	 ElseIf code = 112 then
		If (var = -1) Then
			SosoButton.width = 18
			SosoButton.label = ""
			SosoButton.toolTip = "进入问问首页"
		ElseIf(var = 0)Then
			SosoButton.visible = "true"
			SosoButton.width = 43
			SosoButton.label = CStr(var)
			SosoButton.toolTip = "进入问问首页"
		Else
			SosoButton.visible = "true"
			SosoButton.width = 43
			SosoButton.label = CStr(var)
		end if	
		AdjustStatuePanelSize()
	
		AdjustStatuePanelSize()
        ElseIf code = 114 Then 
             If (var = 1) Then
                 ImSearchPlugin.bInside = TRUE
               Else 
                  ImSearchPlugin.bInside = FALSE
               End If
        ElseIf code = 115 Then
          nSearchBanner = var
	ElseIf code = 116 then
		If (var = -1) Then
			QZoneMsgCenterButton.label = ""
		Else
			QZoneMsgCenterButton.label = CStr(var)
		end If
		AdjustStatuePanelSize()
	ElseIf code = 117 Then	
		MailButton.toolTip = ""
	End If	
End Sub

Sub MailButton_onGifStop()
	Window.ExeCommand 62,0
End Sub

Sub MailButton_onMouseMove(nX,nY)
	s = CStr(MailButton.Left) & "." & CStr(MailButton.Top) & "." & CStr(MailButton.width) & "." & CStr(MailButton.height)
	Window.ExeCommand 67,s
End Sub
Sub MailButton_onMouseLeave()
	Window.ExeCommand 68,0
End Sub

Sub show_onClick()
        sh=1
        show.visible = false
        hide.visible = true
        ArrowDown.Visible = False
	ArrowUp.Visible = True
        MobileMsgButton.visible="true"
	GameButton.visible="true"
	TTButton.visible="true" 
	ChatRoomButton.visible="true"
	petOpenBtn.Visible = TRUE
        QQMusic.visible="true" 
        QQTV.visible="true"
        ContentsButton.visible=FALSE 
        MenuButton.Visible = true   
        MsgManagerButton.Visible = FALSE
        SearchButton.Visible = FALSE
        ToolMenuBtn.visible=FALSE
	Window.UnLockPaint()
End Sub

Sub hide_onClick()
        sh=0
	hide.visible = false
	show.visible = true
        ArrowDown.Visible = True
	ArrowUp.Visible = False
        MobileMsgButton.visible="false"
	GameButton.visible="false"
	TTButton.visible="false" 
	ChatRoomButton.visible="false"
	petOpenBtn.visible=false
        QQMusic.visible="false"
        QQTV.visible="false"
        ContentsButton.visible="false"
        MenuButton.Visible = TRUE
        MsgManagerButton.Visible = TRUE
        SearchButton.Visible = TRUE
        ToolMenuBtn.visible=TRUE
	Window.UnLockPaint()
End Sub

Sub ContentsButton_onClick()
	Window.ExeCommand 4,9
End Sub

