BBS (PhP MySQL) Full Version (6)

Source: Internet
Author: User
Tags php mysql

+ Proto. menuborder;
VaR focusitem = body.doc ument. Layers [N];
Focusitem. Clip. width = body. Clip. width;
Focusitem. Menu = L. Menu;
Focusitem. Top =-30;
Focusitem. captureevents (event. mousedown );
Focusitem. onmousedown = onmenuitemdown;
Menu.doc ument. bgcolor = Proto. menuborderbgcolor;
VaR lite = menu.doc ument. Layers [0];
Lite.doc ument. bgcolor = Proto. menulitebgcolor;
Lite. Clip. width = body. Clip. Width + 1;
Lite. Clip. Height = body. Clip. height + 1;
Menu. Clip. width = body. Clip. Width + (PROTO. menuborder * 3 );
Menu. Clip. Height = body. Clip. height + (PROTO. menuborder * 3 );
}
} Else {
If ((! Document. All) & (container. haschildnodes )){
Container. innerhtml = content;
} Else {
Container.doc ument. Open ("text/html ");
Container.doc ument. writeln (content );
Container.doc ument. Close ();
}
If (! Find ("menulayer0") return;
VaR menucount = 0;
For (VAR x = 0; x <container. Menus. length; X ++ ){
VaR menulayer = find ("menulayer" + x );
Container. Menus [X]. menulayer = "menulayer" + X;
Menulayer. Menu = container. Menus [x];
Menulayer. Menu. Container = "menulayer" + X;
Menulayer. style. zindex = 1;
VaR S = menulayer. style;
S. Top = S. pixeltop =-300;
Seconds. Left = S. pixelleft =-300;

VaR menu = container. Menus [x];
Menu. menuitemwidth = menu. menuwidth | menu. menuiewidth | 140;
Menulayer. style. backgroundcolor = menu. menuborderbgcolor;
VaR Top = 0;
For (VAR I = 0; I <container. Menus [X]. Items. length; I ++ ){
VaR L = find ("menuitem" + menucount );
L. Menu = container. Menus [x];
If (L. addeventlistener) {// ns6
L. style. width = menu. menuitemwidth;
L. style. Height = menu. menuitemheight;
L. style. Top = top;
L. addeventlistener ("Mouseover", onmenuitemover, false );
L. addeventlistener ("click", onmenuitemaction, false );
L. addeventlistener ("mouseout", mouseoutmenu, false );
} Else {// IE
L. style. pixelwidth = menu. menuitemwidth;
L. style. pixelheight = menu. menuitemheight;
L. style. pixeltop = top;
}
Top = Top + menu. menuitemheight + menu. menuitemborder;
L. style. fontsize = menu. fontsize;
L. style. backgroundcolor = menu. menuitembgcolor;
L. style. Visibility = "inherit ";
L. savecolor = menu. menuitembgcolor;
L. menuhilitebgcolor = menu. menuhilitebgcolor;
L. Action = container. Menus [X]. Actions [I];
L. hilite = find ("menuitemhilite" + menucount );
L. focusitem = find ("focusitem" + x );
L. focusitem. style. pixeltop = L. focusitem. style. Top =-30;
VaR childitem = find ("childmenu" + menucount );
If (childitem ){
L. childmenu = container. Menus [X]. items [I]. menulayer;
Childitem. style. pixelleft = childitem. style. Left = menu. menuitemwidth-11;
Childitem. style. pixeltop = childitem. style. Top = (menu. menuitemheight/2)-4;
// Childitem. style. pixelwidth = 30 | 7;
// Childitem. style. Clip = "rect (0 7 7 3 )";
L. Menu. childmenus [L. Menu. childmenus. Length] = L. childmenu;
}
VaR Sep = find ("menuseparator" + menucount );
If (SEP ){
Sep. style. Clip = "rect (0" + (menu. menuitemwidth-3) + "1 0 )";
Sep. style. width = Sep. style. pixelwidth = menu. menuitemwidth;
Sep. style. backgroundcolor = menu. bgcolor;
SEP = find ("menuseparatorlite" + menucount );
Sep. style. Clip = "rect (1" + (menu. menuitemwidth-3) + "2 0 )";
Sep. style. width = Sep. style. pixelwidth = menu. menuitemwidth;
Sep. style. backgroundcolor = menu. menulitebgcolor;
L. style. Height = L. style. pixelheight = menu. menuitemheight/2;
L. isseparator = true
Top-= (menu. menuitemheight-L. style. pixelheight)
} Else {
L. style. cursor = "hand"
}
Menucount ++;
}
Menu. menuheight = Top-1;
VaR lite = find ("menulite" + x );
VaR S = Lite. style;
S. Height = S. pixelheight = menu. menuheight + (menu. menuborder * 2 );
S. width = S. pixelwidth = menu. menuitemwidth + (menu. menuborder * 2 );
S. backgroundcolor = menu. menulitebgcolor;

VaR body = find ("menufg" + x );
S = body. style;
S. Height = S. pixelheight = menu. menuheight + menu. menuborder;
S. width = S. pixelwidth = menu. menuitemwidth + menu. menuborder;
S. backgroundcolor = menu. bgcolor;

S = menulayer. style;
S. width = S. pixelwidth = menu. menuitemwidth + (menu. menuborder * 4 );
S. Height = S. pixelheight = menu. menuheight + (menu. menuborder * 4 );
}
}
If (document. captureevents ){
Document. captureevents (event. mouseup );
}
If (document. addeventlistener ){
Document. addeventlistener ("mouseup", onmenuitemover, false );
}
If (document. Layers & window. innerwidth ){
Window. onresize = ns4resize;
Window. ns4siw = Window. innerwidth;
Window. ns4sih = Window. innerheight;
}
Document. onmouseup = mouseupmenu;
Window. fwwrotemenu = true;
Status = "";
}

Function ns4resize (){
If (ns4siw <window. innerwidth |
Ns4siw> window. innerwidth |
Ns4sih> window. innerheight |
Ns4sih <window. innerheight)
{
Window. Location. Reload ();
}
}

Function onmenuitemover (E, L ){
Fw_cleartimeout ();
L = L | this;
A = Window. activemenuitem;
If (document. layers ){
If (){
A.doc ument. bgcolor = A. savecolor;
If (A. hilite) A. hilite. Visibility = "hidden ";
If (A. Menu. bgimageover ){
A. Background. src = A. Menu. bgimageup;
}
A. focusitem. Top =-100;
A. clicked = false;
}
If (L. hilite ){
L.doc ument. bgcolor = L. menuhilitebgcolor;
L. zindex = 1;
L. hilite. Visibility = "inherit ";
L. hilite. zindex = 2;
L.doc ument. Layers [1]. zindex = 1;
L. focusitem. zindex = This. zindex + 2;
}
If (L. Menu. bgimageover ){
L. Background. src = L. Menu. bgimageover;
}
L. focusitem. Top = This. Top;
L. Menu. hidechildmenu (L );
} Else if (L. Style & L. Menu ){
If (){
A. style. backgroundcolor = A. savecolor;
If (A. hilite) A. hilite. style. Visibility = "hidden ";
If (A. Menu. bgimageup ){
A. style. Background = "URL (" + A. Menu. bgimageup + ")";;
}
}
If (L. isseparator) return;
L. style. backgroundcolor = L. menuhilitebgcolor;
L. zindex = 1; // magic Internet Explorer 4.5 Mac happy doohicky. JBA
If (L. Menu. bgimageover ){
L. style. Background = "URL (" + L. Menu. bgimageover + ")";
}
If (L. hilite ){
L. style. backgroundcolor = L. menuhilitebgcolor;
L. hilite. style. Visibility = "inherit ";
}
L. focusitem. style. Top = L. focusitem. style. pixeltop = L. style. pixeltop;
L. focusitem. style. zindex = L. zindex + 1;
L. Menu. hidechildmenu (L );
} Else {
Return; // not a menu-magic ie 4.5 Mac happy doohicky. JBA
}
Window. activemenuitem = L;
}

Function onmenuitemaction (E, L ){
L = Window. activemenuitem;
If (! L) return;
Hideactivemenus ();
If (L. Action ){
Eval ("" + L. action );
}
Window. activemenuitem = 0;
}

Function fw_cleartimeout ()
{
If (fwhidemenutimer) cleartimeout (fwhidemenutimer );
Fwhidemenutimer = NULL;
Fwdhflag = false;
}
Function fw_starttimeout ()
{
Fwstart = new date ();
Fwdhflag = true;
Fwhidemenutimer = setTimeout ("fwdohide ()", 1000 );
}

Function fwdohide ()
{
If (! Fwdhflag) return;
VaR elapsed = new date ()-fwstart;
If (elapsed <1000 ){
Fwhidemenutimer = setTimeout ("fwdohide ()", 1100-elapsed );
Return;
}
Fwdhflag = false;
Hideactivemenus ();
Window. activemenuitem = 0;
}

Function fw_showmenu (menu, X, Y, child ){
If (! Window. fwwrotemenu) return;
Fw_cleartimeout ();
If (document. layers ){
If (menu ){
VaR L = menu. menulayer | menu;
L. Left = 1;
L. Top = 1;
Hideactivemenus ();
If (this. Visibility) L = this;
Window. activemenu = L;
} Else {
VaR L = child;
}
If (! L) return;
For (VAR I = 0; I <L. layers. length; I ++ ){
If (! L. Layers [I]. ishilite)
L. Layers [I]. Visibility = "inherit ";
If (l.layerspolici2.16.doc ument. layers. length> 0)
Fw_showmenu (null, "relative", "relative", L. Layers [I]);
}
If (L. parentlayer ){
If (X! = "Relative ")
L. parentlayer. Left = x | window. pagex | 0;
If (L. parentlayer. Left + L. Clip. width> window. innerwidth)
L. parentlayer. Left-= (L. parentlayer. Left + L. Clip. Width-window. innerwidth );
If (y! = "Relative ")
L. parentlayer. Top = Y | window. Pagey | 0;
If (L. parentlayer. iscontainer ){
L. Menu. xoffset = Window. pagexoffset;
L. Menu. yoffset = Window. pageyoffset;
L. parentlayer. Clip. width = Window. activemenu. Clip. Width + 2;
L. parentlayer. Clip. Height = Window. activemenu. Clip. height + 2;
If (L. parentlayer. menucontainerbgcolor) l.parentlayer.doc ument. bgcolor = L. parentlayer. menucontainerbgcolor;
}
}
L. Visibility = "inherit ";
If (L. Menu) L. Menu. Container. Visibility = "inherit ";
} Else if (find ("menuitem0 ")){
VaR L = menu. menulayer | menu;
Hideactivemenus ();
If (typeof (L) = "string "){
L = find (L );
}
Window. activemenu = L;
VaR S = L. style;
S. Visibility = "inherit ";
If (X! = "Relative ")
S. Left = S. pixelleft = x | (window. pagex + document. Body. scrollleft) | 0;
If (y! = "Relative ")
S. Top = S. pixeltop = Y | (window. Pagey + document. Body. scrolltop) | 0;
L. Menu. xoffset = Document. Body. scrollleft;
L. Menu. yoffset = Document. Body. scrolltop;
}
If (menu ){
Window. activemenus [window. activemenus. Length] = L;
}
}

Function onmenuitemdown (E, L ){
VaR A = Window. activemenuitem;
If (document. layers ){
If (){
A. Ex = E. pagex;
A. Ey = E. Pagey;
A. clicked = true;
}
}
}

Function mouseupmenu (E)
{
Hidemenu (true, e );
Hideactivemenus ();
Return true;
}

Function mouseoutmenu ()
{
Hidemenu (false, false );
Return true;
}

Function hidemenu (mouseup, e ){
VaR A = Window. activemenuitem;
If (A & document. layers ){
A.doc ument. bgcolor = A. savecolor;
A. focusitem. Top =-30;
If (A. hilite) A. hilite. Visibility = "hidden ";
If (mouseup & A. Action & A. clicked & window. activemenu ){
If (. ex <= E. pagex + 15 &. ex> = E. pageX-15 &. ey <= E. pagey + 10 &. ey> = E. pageY-10 ){
SetTimeout ('window. activemenu. Menu. onmenuitemaction (); ', 2 );
}
}
A. clicked = false;
If (A. Menu. bgimageover ){
A. Background. src = A. Menu. bgimageup;
}
} Else if (window. activemenu & find ("menuitem0 ")){
If (){
A. style. backgroundcolor = A. savecolor;
If (A. hilite) A. hilite. style. Visibility = "hidden ";
If (A. Menu. bgimageup ){
A. style. Background = "URL (" + A. Menu. bgimageup + ")";;
}
}
}
If (! Mouseup & window. activemenu ){
If (window. activemenu. Menu ){
If (window. activemenu. Menu. hideonmouseout ){
Fw_starttimeout ();
}
Return (true );
}
}
Return (true );
}

Function pxtonum (pxstr)
{// Pxstr = 27px, we want 27.
If (pxstr. length> 2 ){
N = number (pxstr. substr (0, pxstr. Length-2 ));
Return (N );
}
Return (0 );
}

Function hidechildmenu (hcmlayer ){
Fw_cleartimeout ();
VaR L = hcmlayer;
For (VAR I = 0; I <L. Menu. childmenus. length; I ++ ){
VaR thelayer = L. Menu. childmenus [I];
If (document. layers ){
Thelayer. Visibility = "hidden ";
} Else {
Thelayer = find (thelayer );
Thelayer. style. Visibility = "hidden ";
}
Thelayer. Menu. hidechildmenu (thelayer );
}

If (L. childmenu ){
VaR childmenu = L. childmenu;
If (document. layers ){
L. Menu. fw_showmenu (null, childmenu. Layers [0]);
Childmenu. zindex = L. parentlayer. zindex + 1;
Childmenu. Top = L. Top + L. parentlayer. Top + L. Menu. menulayer. Top + L. Menu. menuitemheight/3;
If (childmenu. Left + childmenu. Clip. width> window. innerwidth ){
Childmenu. Left = L. parentlayer. Left-childmenu. Clip. Width + L. Menu. menulayer. Left + 15;
L. Menu. Container. Clip. Left-= childmenu. Clip. width;
} Else {
Childmenu. Left = L. parentlayer. Left + L. parentlayer. Clip. Width + L. Menu. menulayer. Left-5;
}
VaR W = childmenu. Clip. Width + childmenu. left-l.Menu.container.clip.left;
If (W> L. Menu. Container. Clip. width)
L. Menu. Container. Clip. width = W;
VaR H = childmenu. Clip. height + childmenu. top-l.Menu.container.clip.top;
If (h> L. Menu. Container. Clip. Height) L. Menu. Container. Clip. Height = h;
L.doc ument. Layers [1]. zindex = 0;
Childmenu. Visibility = "inherit ";
} Else if (find ("menuitem0 ")){
Childmenu = find (L. childmenu );
VaR menulayer = find (L. Menu. menulayer );
VaR S = childmenu. style;
S. zindex = menulayer. style. zindex + 1;
If (document. All) {// ie case.
S. pixeltop = L. style. pixeltop + menulayer. style. pixeltop + L. Menu. menuitemheight/3;
S. Left = S. pixelleft = (menulayer. style. pixelwidth) + menulayer. style. pixelleft-5;
} Else {// Zilla case
VaR Top = pxtonum (L. style. Top) + pxtonum (menulayer. style. Top) + L. Menu. menuitemheight/3;
VaR left = (pxtonum (menulayer. style. width) + pxtonum (menulayer. style. Left)-5;
S. Top = top;
S. Left = left;
}
Childmenu. style. Visibility = "inherit ";
} Else {
Return;
}
Window. activemenus [window. activemenus. Length] = childmenu;
}
}

function hideactivemenus () {
If (! Window. activemenus) return;
for (VAR I = 0; I If (! Activemenus [I]) continue;
If (activemenus [I]. visibility & activemenus [I]. menu) {
activemenus [I]. visibility = "hidden";
activemenus [I]. menu. container. visibility = "hidden";
activemenus [I]. menu. container. clip. left = 0;
}else if (activemenus [I]. style) {
var S = activemenus [I]. style;
S. visibility = "hidden";
S. left =-200;
S. top =-200;
}< BR >}< br> If (window. activemenuitem) {
hidemenu (false, false);
}< br> window. activemenus. length = 0;
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.