// MENUFR.JS
//menus and their positions by x
var menu_coords = {
"popup1" : 50, "popup2" : 150, "popup3" : 250
};
function menu_act (name, mode)
{
var fr = top.frames.cont; //get the lower frame object
if (name && (!fr || !fr[name] || !fr[name]._op)) return;
if (mode == 1) {
var x = fr.CodeThat.getScrollX() + menu_coords[name];
var y = fr.CodeThat.getScrollY() + 1;
for (var i in menu_coords)
{
fr[i].clearTimer();
fr[i].hide();
}
fr[name].popupAt(x, y)
}
else if (!mode) {
fr[name].clearTimer();
fr[name].setTimer();
}
}
var MenuDef = {
"style" : {
"css" : "box",
"align" : "center",
"bgcolor" : "#CCCCCC",
"size" : [100, 25],
"border" : {
"color" : "black", "width" : 1
},
"direction" : "h"
},
"itemover" : {
"bgcolor" : "#EEEEEE", "css" : "boxover"
},
"position" : {
"absolute" : true, "pos" : [50, 0]
},
"items" : [
{
"text" : "Search", "action" : {
"over" : "menu_act('popup1', 1)", "out" : "menu_act('popup1', 0)"
}
},
{
"text" : "OS", "action" : {
"over" : "menu_act('popup2', 1)", "out" : "menu_act('popup2', 0)"
}
},
{
"text" : "CodeThat", "action" : {
"over" : "menu_act('popup3', 1)", "out" : "menu_act('popup3', 0)"
}
} ]
};
// SUBFR.JS
var style = {
"css" : "box",
"align" : "center",
"bgcolor" : "#CCCCCC",
"size" : [130, 25],
"shadow" : {
"color" : "#AAAAAA", "width" : 5
},
"border" : {
"color" : "black", "width" : 1
},
"imgspace" : 5,
"imgendon" : {
"src" : "img/arr_down.gif", "width" : 16, "height" : 16
},
"imgendoff" : {
"src" : "img/arr_right.gif", "width" : 16, "height" : 16
},
"direction" : "v"
};
var Popup1 = {
"type" : "popup",
"style" : style,
"itemover" : {
"bgcolor" : "#DDDDDD"
},
"position" : {
"anchor_side" : "nw", "pos" : [50, 1]
},
"items" : [
{
"text" : "Yahoo!", "action" : {
"url" : "http://yahoo.com", "target" : "_blank"
}
},
{
"text" : "More...",
"menu" : {
"items" : [
{
"text" : "Google", "action" : {
"url" : "http://www.google.com"
}
},
{
"text" : "Altavista", "action" : {
"url" : "http://altavista.com"
}
} ]
}
} ]
};
var Popup2 = {
"type" : "popup",
"style" : style,
"itemover" : {
"bgcolor" : "#DDDDDD"
},
"position" : {
"anchor" : "nw", "pos" : [150, 1]
},
"items" : [
{
"text" : "FreeBSD", "action" : {
"url" : "http://www.freebsd.org", "title" : "FreeBSD site"
}
},
{
"text" : "Linux", "action" : {
"url" : "http://linux.org", "target" : "_blank"
}
},
{
"text" : "Windows", "action" : {
"url" : "http://microsoft.com/windows"
}
} ]
};
var Popup3 = {
"type" : "popup",
"style" : style,
"itemover" : {
"bgcolor" : "#DDDDDD"
},
"position" : {
"anchor_side" : "nw", "pos" : [251, 1]
},
"items" : [
{
"text" : "CodeThat.Com", "action" : {
"url" : "http://www.codethat.com", "target" : "_blank"
}
},
{
"text" : "CodeThatMenu", "action" : {
"url" : "http://www.codethat.com/javascript-menu.html"
}
} ]
};
|