navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

'as' is null or not an object

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> 'as' is null or not an object
Page: [1]
 
jackie26

 

Posts: 24
Joined: 10/27/2005
Status: offline

 
'as' is null or not an object - 10/27/2005 14:45:40   
I used a dynamic drop down menu from this site http://simplythebest.net/scripts/DHTML_scripts/dhtml_script_105.html and customized it for my own. Once I added the 2nd sub-level links in a started receiving this error ...

'as' is null or not an object
line 54

If I click ok it will still open my page, but I don't know what to do to make this go away.

Here is my website http://www.westar.com/test/index.asp

Here is the JavaScript code that the menu is using:
function init(){
if(!window.standards) return;
if(window.inited) return;
//////////////////////////////////  GLOBAL OFFSET VARIABLES //////////////////////////////	
	if(bw.wIE || bw.ns){
		menuOffsetTop = 3; // first level menu. smaller number is more up
		menuOffsetLeft = 2; // first level menu. smaller number is more right.
	}
	else if(bw.mIE){
		menuOffsetTop = -1; // first level menu. smaller number is more right
		menuOffsetLeft = -6; // first level menu. smaller number is more right
	}
	submenuOffsetTop = -14 ;// smaller number is closer to top

	if(bw.wIE) submenuOffsetLeft = -12; // left-side menu. smaller number is closer to menu
	else if(bw.mIE) submenuOffsetLeft = -4; // left-side menu. smaller number is closer to menu

	submenuOffsetRight = 0;// right-side menu.  smaller number is closer to menu.
//////////////////////////////////  GLOBAL OFFSET VARIABLES //////////////////////////////	


	var uiMenubar = new Menubar();

	var hmMenu = new Menu('Westar Online Home');
	uiMenubar.add(hmMenu);
	hmMenu.add(new MenuItem('Home','http://199.217.163.45/intranet/index.asp'));
	
	uiMenubar.add(hrMenu = new Menu('HR & Staffing'));
		
	hrMenu.addSeparator("#000388");
	hrProdMenu = new Menu('Staffing & Development');
	hrProdMenu.help="Windows, Menus, Tabs, Scrollers";//appears in statusbar

	hrProdMenu.add(new MenuItem('Staffing Flow Diagram','http://199.217.163.45/intranet/HR_Staffing/Staff_Develp/flow_frame.htm'));
	hrProdMenu.add(new MenuItem('Performance Development Report (PDR)','http://199.217.163.45/intranet/HR_Staffing/Staff_Develp/pdrform.doc'));
	hrProdMenu.add(new MenuItem('90 Day Review Guideline','http://199.217.163.45/intranet/HR_Staffing/Staff_Develp/90dayGuideline.doc'));
	hrProdMenu.add(new MenuItem('90 Day Review','http://199.217.163.45/intranet/HR_Staffing/Staff_Develp/90-dayReview.doc'));
	hrProdMenu.add(new MenuItem('Alternate Performance Appraisal Form','http://199.217.163.45/intranet/HR_Staffing/Staff_Develp/Alternate_Performance_Appraisal_Form.doc'));
	hrProdMenu.add(new MenuItem('Position Description','http://199.217.163.45/intranet/HR_Staffing/Staff_Develp/Position Description Format.doc'));
	hrProdMenu.add(new MenuItem('Standard Rejection Letter','http://199.217.163.45/intranet/HR_Staffing/Staff_Develp/Standard_Reject_ltr.doc'));
	hrProdMenu.add(new MenuItem('Pre-Employment Applications','http://199.217.163.45/intranet/PreEmploy_Apps.asp'));

	hrMenu.add(hrProdMenu);
	hrMenu.addSeparator("#000388");
	
	hrMenu.addSeparator("#000388");
	hrProdMenu = new Menu('Benefit Forms');
	hrProdMenu.help="Windows, Menus, Tabs, Scrollers";//appears in statusbar

	hrProdMenu.add(new MenuItem('FSA Reimbursement Form','http://199.217.163.45/intranet/HR_Staffing/Benefit_Forms/FSA_Reimbursement_Form.pdf'));
	hrProdMenu.add(new MenuItem('FSA Change in Family Status Form','http://199.217.163.45/intranet/HR_Staffing/Benefit_Forms/FSA Change in Family Status Form.pdf'));
	hrProdMenu.add(new MenuItem('401k Beneficiary Form','http://199.217.163.45/intranet/HR_Staffing/Benefit_Forms/401k_Beneficiary_Form.pdf'));
	hrProdMenu.add(new MenuItem('Delta Dental Claim Form','http://199.217.163.45/intranet/HR_Staffing/Benefit_Forms/Delta_Dental_Claim_Form.pdf'));
	hrProdMenu.add(new MenuItem('Life Insurance Beneficiary Form','http://199.217.163.45/intranet/HR_Staffing/Benefit_Forms/Life_Insurance_Beneficiary_Designation_Form.pdf'));
	hrMenu.add(hrProdMenu);
	hrMenu.addSeparator("#000388");
	
	hrMenu.addSeparator("#000388");
	hrProdMenu = new Menu('Relocation Forms');
	hrProdMenu.help="Windows, Menus, Tabs, Scrollers";//appears in statusbar
	
	hrProdMenu.add(new MenuItem('Westar Relocation Agreement','http://199.217.163.45/intranet/HR_Staffing/Relocation/Westar_Relocation_Agreement.doc'));
	hrProdMenu.add(new MenuItem('Westar Relocation Processing Report','http://199.217.163.45/intranet/HR_Staffing/Relocation/Westar_Relocation_Processing_Report.doc'));
	hrMenu.add(hrProdMenu);
	hrMenu.addSeparator("#000388");
	
	hrMenu.addSeparator("#000388");
	hrProdMenu = new Menu('Education');
	hrProdMenu.help="Windows, Menus, Tabs, Scrollers";//appears in statusbar
	
	hrProdMenu.add(new MenuItem('Tuition Reimbursement','http://199.217.163.45/intranet/Tuition.asp'));
	hrProdMenu.add(new MenuItem('Training & Development Policy','http://199.217.163.45/intranet/HR_Staffing/Education/Training_and_Development.doc'));
	hrMenu.add(hrProdMenu);
	hrMenu.addSeparator("#000388");
	
	hrMenu.addSeparator("#000388");
	hrProdMenu = new Menu('Payroll');
	hrProdMenu.help="Windows, Menus, Tabs, Scrollers";//appears in statusbar

	hrProdMenu.add(new MenuItem('Time Keeping Instructions','http://199.217.163.45/intranet/HR_Staffing/Payroll/Electronic_Timekeeping_Instructions.doc'));
	hrProdMenu.add(new MenuItem('Time Sheet Template (MS Excel Document)','http://199.217.163.45/intranet/HR_Staffing/Payroll/Time_Sheet_Template.xls'));
	hrProdMenu.add(new MenuItem('Personnel Action Notice','http://199.217.163.45/intranet/HR_Staffing/Payroll/2005_Personnel_Action_Notice.doc'));
	hrProdMenu.add(new MenuItem('Personnel Action Notice Guidelines','http://199.217.163.45/intranet/HR_Staffing/Payroll/Personnel_Action_Notice_Guidelines.doc'));
	hrProdMenu.add(new MenuItem('Location Codes (MS Excel Document)','http://199.217.163.45/intranet/HR_Staffing/Payroll/Location_Codes.xls'));
	hrProdMenu.add(new MenuItem('Direct Deposit Form','http://199.217.163.45/intranet/HR_Staffing/Payroll/Direct_Deposit_Form.doc'));
	hrProdMenu.add(new MenuItem('Leave of Absense Request Form','http://199.217.163.45/intranet/HR_Staffing/Payroll/Family_Medical_Leave_Form.doc'));
	hrProdMenu.add(new MenuItem('401k Change Request Form','http://199.217.163.45/intranet/HR_Staffing/Payroll/401k_Change_Request_Form.doc'));
	hrProdMenu.add(new MenuItem('Bonus Request Form','http://199.217.163.45/intranet/HR_Staffing/Payroll/Bonus_Request_Form.doc'));
	hrProdMenu.add(new MenuItem('Employee Information Change Form','http://199.217.163.45/intranet/HR_Staffing/Payroll/Employee_Information_Change_2005.doc'));
	hrProdMenu.add(new MenuItem('Pay Schedule (MS Excel Document)','http://199.217.163.45/intranet/HR_Staffing/Payroll/2005_pay_schedule.xls'));
	hrMenu.add(hrProdMenu);
	hrMenu.addSeparator("#000388");

	hrMenu.add(new MenuItem('Contact us','mailto:HR@westar.com'));
	
	uiMenubar.add(conMenu = new Menu('Contracts'));
	conMenu.add(new MenuItem('Bid Approval Form','http://199.217.163.45/intranet/contracts/Bid_Approval_Form .xls'));
	
	conMenu.addSeparator("#000388");
	conProdMenu = new Menu('Proprietary Information');
	conProdMenu.help="Windows, Menus, Tabs, Scrollers";//appears in statusbar

	conProdMenu.add(new MenuItem('Proprietary Information Document','http://199.217.163.45/intranet/'));
	conProdMenu.add(new MenuItem('Disclosure to Westar','http://199.217.163.45/intranet/'));
	conMenu.add(conProdMenu);
	conMenu.addSeparator("#000388");
	
	conMenu.addSeparator("#000388");
	conProdMenu = new Menu('General Provisions Fixed Price Contracts');
	conProdMenu.help="Windows, Menus, Tabs, Scrollers";//appears in statusbar

	conProdMenu.add(new MenuItem('Fixed Price Contract','http://199.217.163.45/intranet/Contracts/SF TC-001.3 (6-01)1.doc'));
	conProdMenu.add(new MenuItem('Fixed Price Services Contract','http://199.217.163.45/intranet/Contracts/SF TC-002.1 (6-01)1.doc'));
	conMenu.add(conProdMenu);
	conMenu.addSeparator("#000388");

	conMenu.add(new MenuItem('Annual Representation & Certification','http://199.217.163.45/intranet/Contracts/SF TC-005.0 (8-00)1.DOC'));
	conMenu.add(new MenuItem('Teaming Agreements','http://199.217.163.45/intranet/teaming_agreements/index.asp'));
	conMenu.add(new MenuItem('Proposal Management','http://199.217.163.45/intranet/Proposal_Mng.asp'));

	
	formsMenu = new Menu('Forms');
	formsMenu.add(new MenuItem('Business Expense Report','http://199.217.163.45/intranet/Forms/WestarBER.xlt'));
	formsMenu.add(new MenuItem('Office Supply Request Form','http://199.217.163.45/intranet/Forms/Office_Supply_Request_Form.xls'));
	
	formsMenu.addSeparator("#000388");
	formsProdMenu = new Menu('PIA');
	formsProdMenu.help="Windows, Menus, Tabs, Scrollers";//appears in statusbar

	formsProdMenu.add(new MenuItem('PIA Agreement Log','http://199.217.163.45/intranet/Forms/pia.htm'));
	formsProdMenu.add(new MenuItem('PIA Form','http://199.217.163.45/intranet/Forms/PIA_form.doc'));
	formsProdMenu.add(new MenuItem('PIA Directives','http://199.217.163.45/intranet/Forms/PIADirectives.doc'));
	formsMenu.add(formsProdMenu);
	formsMenu.addSeparator("#000388");
	uiMenubar.add(formsMenu);
	
	uiMenubar.add(coinfoMenu = new Menu('Company Info/Tools'));
	coinfoMenu.add(new MenuItem('Company Calendar','http://199.217.163.45/intranet/Calendar/calendar_view.asp?calendar_id=8'));
	coinfoMenu.add(new MenuItem('Company Holidays','http://199.217.163.45/intranet/Company_info/Westar_Holiday_2005.pdf'));
	coinfoMenu.add(new MenuItem('Org Chart','http://199.217.163.45/intranet/'));
	
	coinfoMenu.addSeparator("#000388");
	coinfoProdMenu = new Menu('Westar Maps');
	coinfoProdMenu.help="Windows, Menus, Tabs, Scrollers";//appears in statusbar

	coinfoProdMenu.add(new MenuItem('SLEC Map','http://199.217.163.45/intranet/Company_info/map_slec.pdf'));
	coinfoProdMenu.add(new MenuItem('Huntsville Map','http://199.217.163.45/intranet/Company_info/map_hsv.pdf'));
	coinfoMenu.add(coinfoProdMenu);
	coinfoMenu.addSeparator("#000388");

	coinfoMenu.add(new MenuItem('Conference Room Scheduler','http://199.217.163.45/intranet/_new_conference_scheduler/New Westar Conference Room Scheduler.htm'));
	coinfoMenu.add(new MenuItem('FCA Points of Contact','http://199.217.163.45/intranet/Company_info/Finance_Contacts.doc'));
	coinfoMenu.add(new MenuItem('Safety','http://199.217.163.45/intranet/Safety.asp'));
	
	uiMenubar.add(newsMenu = new Menu('News'));
	newsMenu.add(new MenuItem('Our News','http://199.217.163.45/intranet/News/OurNews.pdf'));
	newsMenu.add(new MenuItem('Press Releases','http://199.217.163.45/intranet/Press_Releases.asp'));
		
	newsMenu.addSeparator("#000388");
	newsProdMenu = new Menu('Archives');
	newsProdMenu.help="Windows, Menus, Tabs, Scrollers";//appears in statusbar

	newsProdMenu.add(new MenuItem('Our News Archives','http://199.217.163.45/intranet/'));
	newsProdMenu.add(new MenuItem('Press Release Archives','http://199.217.163.45/intranet/Press_Archives.asp'));
	newsMenu.add(newsProdMenu);
	newsMenu.addSeparator("#000388");
	
	
	
	
	uiMenubar.add(logoMenu = new Menu('Stationary & Logos'));
	logoMenu.add(new MenuItem('Westar Corporate Identity Guidelines','http://199.217.163.45/intranet/'));
	logoMenu.add(new MenuItem('Stationary Templates','http://199.217.163.45/intranet/'));
	logoMenu.add(new MenuItem('Fax Cover Sheet Templates','http://199.217.163.45/intranet/'));
		
	logoMenu.addSeparator("#000388");
	logoProdMenu = new Menu('Logo Downloads');
	logoProdMenu.help="Windows, Menus, Tabs, Scrollers";//appears in statusbar

	logoProdMenu.add(new MenuItem('Westar Logos','http://199.217.163.45/intranet/'));
	logoProdMenu.add(new MenuItem('WTD Logs','http://199.217.163.45/intranet/'));
	logoProdMenu.add(new MenuItem('AFS Logs','http://199.217.163.45/intranet/'));
	logoMenu.add(logoProdMenu);
	logoMenu.addSeparator("#000388");

	
	
	uiMenubar.useMouseOver();
	document.body.appendChild(uiMenubar);
	
	// setWidth method added april 2, 2002.
	uiMenubar.setWidth("745px",0);
	
	window.inited = true;
}


Please let me know if you need anything else as there is another js menu the menu uses as well.

Thanks,

Jackie

< Message edited by Spooky -- 10/27/2005 20:58:19 >
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: 'as' is null or not an object - 10/27/2005 16:09:29   
Hi and Welcome to OutFront.

I see no place for that error in that script but that's just me.

What happens if you completely remove that particular script from the page? Does the error go away?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to jackie26)
dpf

 

Posts: 7126
Joined: 11/12/2003
From: India-napolis
Status: offline

 
RE: 'as' is null or not an object - 10/27/2005 16:10:22   
quote:

I see no place for that error in that script but that's just me.
i looked and didnt see it either - i loaded the page and didnt get the error

_____________________________

Dan

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: 'as' is null or not an object - 10/27/2005 16:14:49   
It may actually be in menubarAPI4.js the externam JavaScript file.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to dpf)
jackie26

 

Posts: 24
Joined: 10/27/2005
Status: offline

 
RE: 'as' is null or not an object - 10/27/2005 16:25:48   
Yes I believe you are right... the error is coming from the file "menuAPI4.js". If I remove the code from line 54

function itemOver(e){if(this.om.as){rsm(this.om.as);this.om.as=null;}}

I receive a new error stating...
Error: 'itemOver' is underdefined on line 28

Here is the code on the "menuAPI4.js"

/**
* menubarAPI4.js
* Copyright©2001 Garrett S. Smith
* modified: Apr. 22, 2002
* This code may be used without permission, for free. This copyright
* Must remain in the code. See http://dhtmlkitchen.com for usage instructions and terms of use.*/
var menuOffsetTop=menuOffsetLeft=submenuOffsetTop=submenuOffsetLeft=submenuOffsetRight=0;
var Doc=this.document;var standards=Doc.createElement&&Doc.createTextNode?1:0;
function Browser(){var n=navigator.userAgent,d=Doc;this.ie6=(n.indexOf("MSIE 6")>0);this.ie=(n.indexOf("MSIE 5")>0||this.ie6);this.ie50=(n.indexOf("MSIE 5.0")>0);this.m=(n.indexOf("Mac")>0);this.mIE=(this.m&&this.ie);this.wIE=(this.ie&&!this.m);this.ns=(n.indexOf("Gecko")>0);this.css1=(!d.compatMode&&!this.mIE||d.doctype&&d.doctype.name.indexOf("/TR/")>-1||"CSS1Compat"==d.compatMode);if(this.wIE&&!this.ie6)this.css1=0;this.moz=this.ns&&!(n.indexOf("Netscape")>0);this.minNS61=(this.moz||this.ns&&n.indexOf("6.")!=-1&&parseInt(n.substr(n.indexOf("6.")+2,1))>1);}this.bw=new Browser();
glut={ml:[],ll:[],RMM:null,LMM:null,BMM:null,db:null,am:null,fb:0,mo:0,arrowFont:"Webdings",arrowText:"4",er:"<tr><td style='height: 0px;'></td></tr>"};window.onresize=function(){setTimeout("ump()",100);};Doc.onmouseup=rM;
function rM(e){e=e?e:window.event;var t=e.srcElement?e.srcElement:e.target;if(t.nodeName=="#text")t=t.parentNode;if(!t.className||glut.db&&t.className.indexOf("buttons")!=0||!ct(t.menubar,glut.db))if(glut.db)rs(glut.db,"buttons");else if(glut.am)rs(glut.am.ob);}this.menubar=null;
function Menubar(id){menubar=div();menubar.buttons=[];menubar.id=id?id:"menubar";menubar.className="menubar";menubar.add=add;menubar.addText=addText;menubar.addMenu=menubarAddMenu;menubar.add(fix());menubar.moveByY=moveByY;menubar.setWidth=menubarSetWidth;menubar.keepOnTop=keepOnTop;menubar.sb=0;menubar.fb=0;menubar.useMouseOver=function(on){glut.mo=(on==false)?0:1};fixHeight(menubar);
menubar.onmouseout=function(e){if(!glut.mo||!glut.db)return;e=e?e:window.event;if(e.nodeName=="#text")e=e.parentNode;var rt=e.relatedTarget?e.relatedTarget:e.toElement;var t=e.currentTarget?e.currentTarget:e.srcElement;if(ct(document.documentElement,rt)&&!ct(this,rt)&&!ct(glut.db.m,rt))rs(glut.db,"buttons");};eval(menubar.id+"=menubar");return menubar;}
function fix(){var f=div();with(f){className="buttons";with(style){width=0;margin=0;if(!bw.wIE)border=0;padding=0;fontSize=0;visibility="hidden";};};return f;}
function add(mbi){if(typeof mbi=="string")this.addText(mbi);else if(mbi.className=="menu")this.addMenu(mbi);else if(mbi.isSb){this.sb=1;if(bw.wIE){mbi=Doc.body.appendChild(mbi);mbi.style.height=(mbi.firstChild.offsetHeight)+'px';mbi.style.overflow="hidden";mbi=Doc.body.removeChild(mbi);}if(bw.ns)mbi.getElementsByTagName("input")[0].style.marginBottom="7px";var addH=(bw.wIE&&!bw.ie6)?2:1;if(this.style.height<mbi.offsetHeight)this.style.height=(mbi.offsetHeight+addH)+"px";this.appendChild(mbi);}else this.appendChild(mbi);if(bw.mIE){x=fix();x.style.width="1px";this.appendChild(x);}}
function Searchbox(value,action,formId,inputName){var d=div();var sm=(bw.mIE)?"":"font-size:smaller;";if(bw.mIE){d.style.width="10px";}if(bw.ns)d.style.cssFloat="left";else d.style.styleFloat="left";d.style.padding="0";var form="<form onmouseup='event.cancelBubble=true' style='display:inline;width:0;padding:0;margin:0;white-space:nowrap;' action='"+action+"' id='"+formId+"'><input type='txt' onfocus=\"status='"+value+"'\" onblur='status=defaultStatus' style='display:inline;cursor:text;"+sm+"' size='12' name='"+inputName+"' id='"+formId+"Field' /><button type='submit' style='"+sm+"' value='"+value+"'>"+value+"</button></form>";if(bw.ie)form+=fix().outerHTML;d.innerHTML=form;d.isSb=1;return d;}
function Button(txt,u,id){var b,link=0;if(arguments.length>=2){b=Doc.createElement("a");b.href=u;if(arguments[1].indexOf(".")==-1)alert("ERROR:\nInvalidconstructor:newButton("+arguments[0]+","+arguments[1]+")"+"\nThesecondargumentmustbeaURL"+"\nAurlmusthavea\".\"character");b.id=id;link=1;}if(!link){b=div();b.onmouseover=buttonOver;if(!glut.mo){b.onclick=buttonClick;b.onmouseout=buttonOut;}else b.onmousedown=buttonClick;}b.className="buttons";b.innerHTML=txt;b.menuOffsetTop=menuOffsetTop;b.mol=menuOffsetLeft;b.mor=0;return b;}
function Label(txt){var l=div();l.txt=txt;l.className="label";l.style.position="relative";l.style.whiteSpace="nowrap";if(!bw.ie)l.style.width="auto";if(bw.wIE&&!bw.ie6)l.style.width="100%";l.innerHTML=txt;l.m=null;l.onmouseover=labelOver;l.onmouseup=function(e){e=e?e:window.event;e.cancelBubble=true;};l.menuOffsetTop=submenuOffsetTop;l.mol=submenuOffsetRight;l.mor=submenuOffsetLeft;if(bw.mIE)l.innerHTML+="</td><td><span isArrow=1 style='position:absolute;top:0;right:0;margin:0;font-family:"+glut.arrowFont+";font-weight:900'>"+glut.arrowText+"</span></td>";glut.ll[glut.ll.length]=l;return l;}
function Menu(titl){M=div();M.lt=titl;M.id="Menu"+glut.ml.length;M.className="menu";M.appendChild(T());M.table=(bw.mIE)?M.firstChild:M.firstChild.firstChild;M.addItem=addItem;M.addSeparator=addSeparator;M.addMenu=addMenu;M.setWidth=
function(w){var px="";if(typeof w=="number")px="px";this.style.width=w+px;};M.add=
function(o){if(!o)return;if(o.addItem!=null)this.addMenu(o);else if(o.tagName!="TR"){if(o.isSb){if(bw.mIE)this.table.insertAdjacentHTML("BeforeEnd",glut.er);else if(bw.ns)o.firstChild.firstChild.style.marginBottom="6px";}if(bw.mIE&&bw.ie50&&o.isSb)this.table.insertAdjacentHTML("BeforeEnd","<tr><td>"+o.innerHTML+"</td></tr>");else this.table.appendChild(cwo(o));}else if(o.className!="buttons")this.addItem(o);};M.om=null;M.as=null;M.help="";M.isPos=0;M.stk=1000;glut.ml[glut.ml.length]=M;return Doc.body.appendChild(M);}
function addMenu(m){l=Label(m.lt);l.om=this;l.m=m;l.help=m.help;l.m.ol=l;l.m.om=this;addLabel(this,l);}
function addMenuOrItem(txt,u,id){if(arguments[0].className)this.addMenu(arguments[0]);else this.addItem(txt,u,id);}
function menubarAddMenu(m){var b=m.ob=this.buttons[this.buttons.length++]=Button(m.lt);b.m=m;b.id=this.id+"B"+this.buttons.length;b.menubar=b.m.menubar=this;if(!this.hasAMenu)m.style.marginLeft="-1px";b.msg=m.lt;this.appendChild(b);if(bw.mIE&&!this.sb&&this.hasAMenu)this.appendChild(fix());this.hasAMenu=1;}
function addText(txt){d=div();d.className="buttons";d.innerHTML=txt;this.appendChild(d);}
function addItem(o){o.firstChild.firstChild.om=this;if(bw.mIE)this.table.insertAdjacentHTML("BeforeEnd",glut.er);this.table.appendChild(o);}
function MenuItem(txt,u){var a=Doc.createElement("a");a.className="menuItem";a.onmouseover=itemOver;if(u)a.setAttribute("href",u);if(!bw.wIE)a.style.width="auto";a.innerHTML=txt;return cwo(a);}
function addLabel(m,l){c=cwo(l);if(bw.ie6){c.onmouseover=
function(){if(!this.wideEnoughForIE6){l.style.width=l.offsetWidth-parseInt(l.currentStyle.paddingLeft)-parseInt(l.currentStyle.paddingRight);this.wideEnoughForIE6=1;}}}else if(bw.wIE)l.style.width="100%";if(bw.mIE){m.table.insertAdjacentHTML("BeforeEnd",glut.er);l.style.width="auto";}negArrowHeight=(bw.wIE)?-2:0;m.table.appendChild(c);if(!bw.mIE)l.innerHTML+="<span style='position:absolute;top:0;margin:0;line-height:"+(l.parentNode.offsetHeight+negArrowHeight)+"px;right:0;font-family:"+glut.arrowFont+";font-weight:900' isArrow=1>"+glut.arrowText+"</span>";else l.getElementsByTagName("span")[0].style.lineHeight=18+"px";}
function addSeparator(c){var sep=div();sep.className="separator";with(sep.style){height=0;fontSize=0;lineHeight=0;if(!bw.ie)width="auto";if(!c){borderTop="1px solid ThreeDShadow";borderBottom="1px solid ThreeDHighlight";}else if(bw.ie)border="1px groove "+c;else borderBottom="2px groove "+c;}if(bw.mIE)this.table.insertAdjacentHTML("BeforeEnd",glut.er);this.table.appendChild(cwo(sep));if(bw.ie6)sep.style.marginBottom=(parseInt(sep.currentStyle.marginBottom)-2)+"px";if(bw.mIE)sep.style.marginTop=(parseInt(sep.currentStyle.marginTop)-2)+"px";}
function menubarSetWidth(w,i){this.style.width=w;if(typeof i!="number")i=2;i-=bw.css1?2:0;this.style.width=(this.offsetWidth+i)+"px";}
function setArrow(f,t){glut.arrowFont=f;glut.arrowText=t;for(var i=0;i<glut.ll.length;i++){var spans=glut.ll.getElementsByTagName("span");var arr=spans[0];if(arr&&Boolean(arr.isArrow||arr.getAttribute("isArrow"))){arr.innerHTML="<span style='margin:0;font-family:"+f+"'>"+t+"</span>";}}}
function T(){var t=Doc.createElement("table");t.cellPadding=0;t.cellSpacing=0;t.style.margin=0;if(!bw.mIE)t.appendChild(Doc.createElement("tbody"));return t;}
function cwo(o){r=Doc.createElement("tr");c=Doc.createElement("td");c.appendChild(o);r.appendChild(c);return r}
function div(){return Doc.createElement("div");}
function getObj(s){return typeof s=="string"?Doc.getElementById(s):s;}
function fixHeight(mb){var b=Doc.body.appendChild(Button());var h=b.offsetHeight;h+=bw.css1?2:4;mb.style.height=h+"px";if(bw.ns)mb.style.clip="auto";Doc.body.removeChild(b);}
function getTop(o){if(bw.ie)return o.style.posTop;else return parseInt(Doc.defaultView.getComputedStyle(o,'').getPropertyValue('top'));}
function ct(a,b){return b?(b==a)?1:ct(a,b.parentNode):0;}
function getOffset(el,offset){return el[offset]+(el.offsetParent?getOffset(el.offsetParent,offset):0);}
function gsl(){if(bw.ie)return(Doc.body.scrollLeft);if(bw.ie6)return(Doc.documentElement.scrollLeft);else return(window.pageXOffset);}
function gst(){if(bw.ns)return(window.pageYOffset);if(bw.ie6)return(Doc.documentElement.scrollTop);return(Doc.body.scrollTop);}
function gvw(){if(bw.ie6)return Doc.documentElement.clientWidth;return(window.innerWidth)?window.innerWidth-18:Doc.body.clientWidth-2;}
function getVH(){if(bw.ns)return window.innerHeight-18;if(bw.ie6)return Doc.documentElement.clientHeight;return Doc.body.clientHeight-2;}
function moveByY(deltaY){this.style.top=parseInt(this.style.top)+deltaY+"px";}
function buttonOver(e){if(glut.db==this)return;else if(glut.am&&!ct(this.menubar,glut.am.ob)){this.className="buttonsOver";return;}if(this.m&&!this.m.ob||this.m.ob!=this)this.m.ob=this;sp(this.m);if(glut.db||glut.mo){if(glut.db)rs(glut.db,"buttons");if(glut.am)rM();blmo(this,e);dp(this);glut.db=this;}else this.className="buttonsOver";window.status=this.m.help?this.msg+": "+this.m.help:this.msg;}
function buttonClick(e){if(glut.mo)return;if(glut.am&&glut.am!=this.m)rM();if(this==glut.db)rs(this,"buttonOver");else{blmo(this,e);this.m.ob=this;sp(this.m);dp(this);glut.db=this;}if(bw.mIE)this.style.cursor="default";}
function buttonOut(e){if(glut.db==this)return;this.className="buttons";window.status=window.defaultStatus;}
function dp(b){b.className="buttonsDown";b.m.style.visibility="visible";glut.am=b.m;glut.db=this;if(bw.ns)b.m.style.height="";}
function rs(b,cn){if(b){if(cn)b.className=cn;b.m.style.visibility="hidden";if(b.m.as)rsm(b.m.as);}glut.db=null;glut.am=null;}
function blmo(bl,e){if(glut.mo)bl.m.onmouseout=hm;else bl.m.onmouseout=no;}
function labelOver(e){sp(this.m);if(this.m.ob)this.m.ob=null;this.className="labelOver";if(this.om.as&&this.om.as!=this.m)rsm(this.om.as);this.m.om.as=this.m;blmo(this,e);window.status=this.txt;this.m.style.visibility="visible";if(bw.mIE)Doc.body.appendChild(div());else if(bw.ns)this.m.style.height="";}
function rsm(m){if(m.as)rsm(m.as);if(m.ol){m.ol.className="label";m.om.as=null;}m.style.visibility="hidden";window.status=window.defaultStatus;}
function itemOver(e){if(this.om.as){rsm(this.om.as);this.om.as=null;}}
function sp(m){var b=m.ob?1:0;var l=m.ol?1:0;var uf=glut.fb&&bw.minNS61||bw.moz;m.bl=b?m.ob:m.ol?m.ol:null;if(m.isPos&&(l||b)&&!(bw.ie&&glut.fb))return;var vw=gvw();if(!uf)vw+=gsl();var vh=getVH();if(!uf)vh+=gst();buttonHeight=m.bl.offsetHeight,buttonWidth=l?m.ol.offsetWidth:0,buttonLeft=getOffset(m.bl,"offsetLeft"),bot=m.bl?getOffset(m.bl,"offsetTop"):0;if(uf)m.style.position="fixed";bot+=m.bl.menuOffsetTop;ypos=bot;m.right=m.offsetLeft+m.offsetWidth;m.bottom=ypos+m.offsetHeight;var mp,rp,lp,rvo=0,lvo=0;rp=buttonLeft+buttonWidth;rp+=m.bl.mol;lp=buttonLeft-m.offsetWidth;lp-=m.bl.mor;if(bw.mIE&&l){rp-=parseInt(m.bl.currentStyle.paddingRight)||0;lp-=parseInt(m.bl.currentStyle.paddingLeft)||0;}if(!b)if(rp+m.offsetWidth>vw)rvo=(rp+m.offsetWidth)-vw;if(lp<0)lvo=-lp;if(rvo>=0&&rvo<=lvo){mp=rp;m.iar=1;glut.RMM=glut.RMM?(m.right>glut.RMM.right)?m:glut.RMM:m;}else{mp=lp;m.iar=0;glut.LMM=glut.LMM?(m.offsetLeft>glut.LMM.offsetLeft)?m:glut.LMM:m;}if(!isNaN(mp))m.style.left=mp+"px";if(!m.iar&&lvo>0)m.style.left="0px";if(m.iar&&rvo>0){m.overlap=rvo;urp(m);}m.stk=m.om?m.om.stk+100:10000;m.style.zIndex=m.stk;if(!isNaN(bot))m.style.top=bot+buttonHeight+"px";if(m.bottom>vh){m.vOverlap=m.bottom-vh;ubp(m);}if(m.top<0)m.style.top="0px";if(m.as)sp(m.as);glut.BMM=getBMM(getRM(m));if(b&&m.bl.className&&m.bl.className.indexOf("buttons")==0)m.isPos=1;}
function getRM(m){return m.om?getRM(m.om):m;}
function getBMM(m){if(!m.as)return m;else{glut.BMM=(m.bottom>=m.as.bottom)?m:m.as;getBMM(m.as);}return m;}
function urp(m){m.style.left=getOffset(m,"offsetLeft")-m.overlap+2+"px";}
function ubp(m){m.style.top=getOffset(m,"offsetTop")-m.vOverlap-((m.ol)?m.ol.offsetHeight:2)+"px";}
function ump(e){var m=glut.ml;for(var i=0;i<glut.ml.length;i++)m.isPos=0;if(glut.RMM)sp(glut.RMM);if(glut.BMM)sp(glut.BMM);if(glut.LMM)sp(glut.LMM);}
function showMenu(m,event){if(m.style.visibility=="visible")return false;if(glut.db)rs(glut.db,"buttons");if(glut.am){glut.am.style.visibility="hidden";glut.am=null;}m=getObj(m),scrollTop=gst(),scrollLeft=gsl(),menuWidth=m.offsetWidth;if(window.event){m.ob=event.srcElement;m.left=event.x+gsl();m.top=event.y+scrollTop;}else{event.preventDefault();m.ob=event.target;m.left=event.pageX;m.top=event.pageY;}m.ob.m=m;m.bottom=m.top+m.offsetHeight;if(m.bottom>scrollTop+getVH()){m.top-=((m.top+m.offsetHeight)-(scrollTop+getVH()));glut.BMM=m;}if(m.left+menuWidth>scrollLeft+gvw()){m.left-=((m.left+menuWidth)-(scrollLeft+gvw()));glut.RMM=m;}ump();m.style.left=m.left+"px";m.style.top=m.top+"px";if(bw.mIE)Doc.body.appendChild(Menu());m.style.visibility="visible";glut.am=m;return false;}
function hm(event){e=event?event:window.event;rt=e.toElement?e.toElement:e.relatedTarget;if(rt!=null){if(ct(this,rt)||this.menubar&&this.menubar==rt)return;if(rt&&this.ob&&this.ob==rt||!bw.moz&&this.ob==rt.parentNode)return;if(this.om&&ct(this.om,rt))return;if(this.as&&ct(this.as,rt)){return;}}
if(bw.moz){
if(this.as
&&glut.c.y>getTop(this.as)-3
&&glut.c.y<getTop(this.as)+this.as.offsetHeight+3){
if(this.as.iar){
if(glut.c.x+this.as.offsetWidth/2>this.as.offsetLeft)return;
}
else if(glut.c.x-this.as.offsetWidth/2<getOffset(this.as,"offsetLeft")
+this.as.offsetWidth)return;
}
else if(this.om&&glut.c.y<this.om.offsetTop+this.om.offsetHeight){
if(this.iar){
if(glut.c.x>this.om.offsetLeft&&glut.c.x<this.om.offsetLeft+this.om.offsetWidth+40)return;
}
else if(glut.c.x>this.om.offsetLeft)return;
}
}
if(bw.moz&&glut.c.y<glut.am.offsetTop+2)return;rsm(glut.am);if(glut.db)rs(glut.db,"buttons");else glut.mo=0;glut.am=null;this.isPos=0;return false;}
if(bw.moz){glut.c={x:0,y:0};document.addEventListener("mousemove",function(e){glut.c.x=e.pageX;glut.c.y=e.pageY;},false);}
function no(){status=status;}
function menuHideOnMouseOut(m){m=getObj(m),m.onmouseout=hm;glut.mo=1;return false;}
function keepOnTop(){glut.fb=1;if(this.style.top=="")this.style.top=typeof getTop(this)=="number"?getTop(this):this.offsetTop-1;if(bw.minNS61)this.style.position="fixed";else{viewTop=gst();viewBottom=getVH();if(getTop(this)+this.offsetHeight<viewTop)this.style.top=(viewTop-this.offsetHeight)+"px";if(this.top>viewBottom)this.style.top=viewBottom+"px";dy=Math.round(Math.abs(viewTop-getTop(this))/2);if(glut.db&&dy>0)rs(glut.db,"buttons");if(viewTop<getTop(this))dy=-dy;this.moveByY(dy);var sp=(getTop(this)!=viewTop)?54:400;if(sp==54&&bw.mIE){no();}setTimeout(this.id+".keepOnTop()",sp);}}


< Message edited by Spooky -- 10/27/2005 20:57:26 >

(in reply to rdouglass)
dpf

 

Posts: 7126
Joined: 11/12/2003
From: India-napolis
Status: offline

 
RE: 'as' is null or not an object - 10/27/2005 16:47:30   
Jackie : i know a little about javascript - not an expert but enough. In my opinion, the script you have select is wayyyy more complex than need be for a basic drop down menu - its way too complex for this old boy to trouble shoot

_____________________________

Dan

(in reply to jackie26)
jackie26

 

Posts: 24
Joined: 10/27/2005
Status: offline

 
RE: 'as' is null or not an object - 10/27/2005 16:59:27   
I'm thinking it has something to do with that line 54

function itemOver(e){if(this.om.as){rsm(this.om.as);this.om.as=null;}}

on the MenuAPI4.js page and they way I labeled my extending horizontal menus that pull out from the drop-downs on the init.js page.

Maybe they need to be named differently?

Well if no one can crack this... anyone know of an similar drop-down w/ much less code?

Thanks,

Jackie


(in reply to dpf)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: 'as' is null or not an object - 10/27/2005 20:21:36   
quote:

Maybe they need to be named differently?


That may be the case. It might be a select element. Can you go back to any original samples and check how all form elements / objects / spans / divs / etc are named. Normally in JavaScript IIRC that is a location for a form element or identifyer.

I'd look for items that are named "om" or "as". Here's my thinking:

this.om.as


Look at that string closely. In JvaScript, there is a hierarchy of objects whereas "this" is normally the object being passed to the function and "om" is a child object of "this". Hence "as" is a child of "om" but is still part of "this". Usually forms are "this" but doesn't have to be.

(Confused yet?)

So JavaScript is looking probably (I think anyways) for form elements, divs, or spans called "om" for the "as" information. So if you go back to original examples, you may get lucky looking for those things.

That's how I'd attempt it anyways. Hope it helps.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to jackie26)
jackie26

 

Posts: 24
Joined: 10/27/2005
Status: offline

 
RE: 'as' is null or not an object - 10/28/2005 10:02:23   
I'm not understanding what I need to change/fix once I locate the areas in the script that say 'om' or 'as'. As you can see that is where my error is coming from is from this line...

function itemOver(e){if(this.om.as){rsm(this.om.as);this.om.as=null;}}

Which includes both the 'om' and 'as'.

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: 'as' is null or not an object - 10/28/2005 12:08:27   
quote:

Which includes both the 'om' and 'as'.


Yup. You're right. :)

As Dan said, that is a bear of a script and for me personally, without knowing exactly what you want to do (and ahave a few hours to spare) I wouldn't dare make any suggestions except to consult with the source / developer of the script.

And to throw random ideas at you just doesn't seem fair to me - don't want to lead you down the wrong path.

Can you build an example page from the original and *slowly* add one of your items into it at a time? Keep ckecking as you add, and wait until it breaks?

Sometimes you just have to "plod" thru these things. :)

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to jackie26)
Page:   [1]

All Forums >> Web Development >> General Web Development >> 'as' is null or not an object
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts