Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 785
  • Last Modified:

Javascript error

Not a descriptive subject i know, but couldn't really give it a title.

I'm printing out some javascript from an ASP.NET application, and for some reason i have some other script that seems to clash with it and i get some weird error messages.

This is my script that it prints to the page (a real mess i know)

            <script>var sep = new ItemStyle(2, 0, '', 0, 0, '#AABBCC', '#AABBCC', '',  '', '', '', null, null, 'default', 'default');</script>

      <script>var pMenu = new PopupMenu('pMenu'); with (pMenu) { startMenu('root', false, 8, 8, 15, hBar, '', false); addItem('<nobr/><img src=images/menuSquare.jpg border=0>&nbsp;Options', 'mOptions', 'sm:', null, 75); addItem('<nobr/><img src=images/menuSquare.jpg border=0>&nbsp;Recent Job List', 'mJobList', 'sm:', null, 170); startMenu('mOptions', true, 1, 19, 260, subM, '', false);addItem('Completed Jobs', 'CompletedJobsSummary.aspx', ''); addItem('Job Search', 'JobSearchSpecific.aspx', ''); addItem('', '',  '', sep); addItem('Log Out', 'Signout.aspx', ''); startMenu('mJobList', true, 1, 19, 280, subM, '', false);addItem('3516020 - Mr D Brown', 'JobHeader.aspx?JobNo=3516020', ''); addItem('3516019 - Mr Wekky ', 'JobHeader.aspx?JobNo=3516019', ''); addItem('3516017 - Mrs Hughes', 'JobHeader.aspx?JobNo=3516017', ''); addItem('3516018 - Mr Wekky ', 'JobHeader.aspx?JobNo=3516018', ''); addItem('3516016 - Miss Jenkins', 'JobHeader.aspx?JobNo=3516016', ''); }</script>

      <script language=javascript>document.getElementById('txtCustSurname').focus();</script>

      <script>var subM = new ItemStyle(22, 0, '&gt;', -15, 3, '#FFFFFF', '#EAEAEA', 'lowText', 'highTextHoverInner', 'itemBorder', 'itemBorder', null, null, 'hand', 'default');</script>

      <SCRIPT language=JavaScript1.2 src='menu/pop_events.js' type=text/javascript></SCRIPT>

      <SCRIPT language=JavaScript1.2 src='menu/pop_core.js' type=text/javascript></SCRIPT>

      <script language='javascript'>function KeyDownHandler(btn){if (event.keyCode == 13){event.returnValue=false;event.cancel = true; btn.click();}}</script>

      <script>var hBar = new ItemStyle(40, 0, '', 0, 0, '10#F1F7FF', '10#EFEFEF', 'highText', 'highTextHover', '', '', null, null, 'hand', 'default');</script>

      <script>if (document.getElementById('txtCustSurname') != null) document.getElementById('txtCustSurname').readOnly=true;</script>

Now, when i take out the very last script parts  (<script>if (document.getElementById('txtCustSurname') != null) document.getElementById('txtCustSurname').readOnly=true;</script>)   it works fine, however if i put it back in i get various errors including:

Error: ItemStyle is not defined
Source File: http://localhost/samsweb/JobSearchAdvanced.aspx
Line: 95

Error: PopupMenu is not defined
Source File: http://localhost/samsweb/JobSearchAdvanced.aspx
Line: 97

Error: ItemStyle is not defined
Source File: http://localhost/samsweb/JobSearchAdvanced.aspx
Line: 101

as well as this one:

Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIControllers.removeController]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://browser/content/search.xml :: onxbldestructor :: line 76"  data: no]

Can anyone suggest why this might be happening?

Many Thanks
T25
0
Type25
Asked:
Type25
  • 8
  • 5
1 Solution
 
Type25Author Commented:
I might add, if i take out all the menu script and leave in the last part:  (<script>if (document.getElementById('txtCustSurname') != null) document.getElementById('txtCustSurname').readOnly=true;</script>)  it works great.

So they just don't work together.
0
 
archrajanCommented:
Post ur view source that wud be easier to debug
0
 
Type25Author Commented:
That IS from view source :)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
archrajanCommented:
Where is this in the view source txtCustSurname?
is that a text field? its not there in the code.

Also there are other 2 .js files u have.. we need to see them together to reproduce whats wrong..
0
 
Type25Author Commented:
The two external .js files work fine, i have this working on every other page i have, which are near identical.

you can see the entire page source if you like, not sure it will help though, here you go:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd" >
<HTML>
      <HEAD>
            <title>Job Search</title>
            <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
            <meta name="CODE_LANGUAGE" Content="C#">
            <meta name="vs_defaultClientScript" content="JavaScript">
            <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
            <LINK href="media/tabsStyle.css" type="text/css" rel="stylesheet">

            <LINK href="media/pop_style.css" type="text/css" rel="stylesheet">
            <LINK href="media/samsStyles.css" type="text/css" rel="stylesheet">
      </HEAD>
      <body MS_POSITIONING="GridLayout">
            <form name="Form1" method="post" action="JobSearchAdvanced.aspx" id="Form1">
<input type="hidden" name="__VIEWSTATE" value="dDwtMTQxNDAwNTkwMTt0PDtsPGk8MT47PjtsPHQ8O2w8aTw1PjtpPDc+O2k8OT47aTwxMT47aTwxMz47aTwxNT47aTwxNz47aTwyMT47aTwyNT47PjtsPHQ8cDxwPGw8VGV4dDs+O2w8XDxiXD5TZXJ2aWNlIENlbnRyZSBVc2VyOlw8L2JcPiBwYmVsbCZuYnNwXDsmbmJzcFw7Jm5ic3BcO1w8Ylw+IE5hbWU6XDwvYlw+IFBhdCBCZWxsJm5ic3BcOyZuYnNwXDsmbmJzcFw7XDxiXD5TZXJ2aWNlIENlbnRyZSBMb2NhdGlvbjpcPC9iXD4gT2ZmaWNlIC0gU2VydmljZSBNYXN0ZXI7Pj47Pjs7Pjt0PHA8O3A8bDxvbkNsaWNrOz47bDx2YXIgc1dpZHRoPXNjcmVlbi53aWR0aC01MjBcOyB3aW5kb3cub3BlbignSGVscC9qb2JTZWFyY2gvZnJhbWUuaHRtJywnJywnaGVpZ2h0PTY4MCx3aWR0aD01MTAsbGVmdD0nK3NXaWR0aCsnLHRvcD0wXDtzY3JvbGxiYXJzPW5vLHN0YXR1cz1ubycpXDs7Pj4+Ozs+O3Q8cDw7cDxsPG9uS2V5RG93bjs+O2w8S2V5RG93bkhhbmRsZXIoYnRuU2VhcmNoKVw7Oz4+Pjs7Pjt0PHA8O3A8bDxvbktleURvd247PjtsPEtleURvd25IYW5kbGVyKGJ0blNlYXJjaClcOzs+Pj47Oz47dDxwPDtwPGw8b25LZXlEb3duOz47bDxLZXlEb3duSGFuZGxlcihidG5TZWFyY2gpXDs7Pj4+Ozs+O3Q8cDw7cDxsPG9uS2V5RG93bjs+O2w8S2V5RG93bkhhbmRsZXIoYnRuU2VhcmNoKVw7Oz4+Pjs7Pjt0PHA8O3A8bDxvbktleURvd247PjtsPEtleURvd25IYW5kbGVyKGJ0blNlYXJjaClcOzs+Pj47Oz47dDxwPDtwPGw8b25LZXlEb3duOz47bDxLZXlEb3duSGFuZGxlcihidG5TZWFyY2gpXDs7Pj4+Ozs+O3Q8cDw7cDxsPG9uS2V5RG93bjs+O2w8S2V5RG93bkhhbmRsZXIoYnRuU2VhcmNoKVw7Oz4+Pjs7Pjs+Pjs+PjtsPGJ0bkZyb21EYXRlO2J0blRvRGF0ZTs+PmOh7VecS+omK7ZPRd3KXUH+d0R0" />

                  <div id="container">
                        <div id="header" style="FONT-WEIGHT:bold; FONT-SIZE:11px; FONT-FAMILY:'Times New Roman'; TEXT-ALIGN:right">Version
                              1.0 BETA &nbsp;</div>

                        <div id="topbanner">
                              <div id="topBannerRight"><input type="submit" name="btnHome" value="Options" id="btnHome" class="smallButton" />&nbsp;
                                    <input type="submit" name="btnSignout" value="Log out" id="btnSignout" class="smallButton" />&nbsp;</div>
                        </div>
                        <div id="lab" style="Z-INDEX: 102; LEFT: 10px; WIDTH: 645px; POSITION: absolute; TOP: 32px; HEIGHT: 15px"><span id="lblSignedIn"><b>Service Centre User:</b> pbell&nbsp;&nbsp;&nbsp;<b> Name:</b> Pat Bell&nbsp;&nbsp;&nbsp;<b>Service Centre Location:</b> Office - Service Master</span></div>

                        <div id="main">
                              <br><hr><div id="help" style="RIGHT:15px; WIDTH:80px; POSITION:absolute; TOP:7px; HEIGHT:20px"><a id="lnkHelp" onClick="var sWidth=screen.width-520; window.open('Help/jobSearch/frame.htm','','height=680,width=510,left='+sWidth+',top=0;scrollbars=no,status=no');" href="javascript:void(0)"><img src="images/help.gif" border="0"></a></div>
                              <br>
                              <div id="pageTitle" style="PADDING-BOTTOM: 20px; FONT: bold 14px Verdana">Job
                                    Search</div>
                              <div id="tabs">
                                    <ul>
                                          <li>
                                                <A href="JobSearchSpecific.aspx">Search</A></li>

                                          <li>
                                                <span>Advanced Search</span></li>
                                    </ul>
                              </div>
                              <div id="tabmain">
                                    <div id="subtabs"></div>
                                    <div id="bodyarea">
                                          <br>

                                          <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                <tr>
                                                      <td width="30">&nbsp;</td>
                                                      <td width="130">Customer Surname:
                                                      </td>
                                                      <td width="180" valign="top"><input name="txtCustSurname" type="text" id="txtCustSurname" onKeyDown="KeyDownHandler(btnSearch);" /></td>
                                                      <td width="136" align="right" style="WIDTH: 136px">Nat Account:&nbsp;
                                                      </td>
                                                      <td><input name="txtNatAcc" type="text" id="txtNatAcc" onKeyDown="KeyDownHandler(btnSearch);" /></td>

                                                </tr>
                                                <tr>
                                                      <td width="30">&nbsp;</td>
                                                      <td align="right" width="130">Claim No: &nbsp;</td>
                                                      <td width="180"><input name="txtClaimNo" type="text" id="txtClaimNo" onKeyDown="KeyDownHandler(btnSearch);" /></td>
                                                      <td width="136" align="right" style="WIDTH: 136px">Policy No:&nbsp;
                                                      </td>
                                                      <td><input name="txtPolicyNo" type="text" id="txtPolicyNo" onKeyDown="KeyDownHandler(btnSearch);" /></td>

                                                </tr>
                                                <tr>
                                                      <td width="30">&nbsp;</td>
                                                      <td align="right" width="130">Postcode: &nbsp;</td>
                                                      <td width="316" colspan="2" style="WIDTH: 316px"><input name="txtPostcode" type="text" id="txtPostcode" onKeyDown="KeyDownHandler(btnSearch);" />
                                                            <br>
                                                            <select name="lstPostcodeQueryType" id="lstPostcodeQueryType">
      <option value="Starts With">Starts With</option>

      <option value="Contains">Contains</option>

</select>
                                                      </td>
                                                </tr>
                                                <tr>
                                                      <td>&nbsp;</td>
                                                </tr>
                                                <tr>

                                                      <td width="30">&nbsp;</td>
                                                      <td width="130">Only jobs between: &nbsp;</td>
                                                      <td width="416" valign="top" colspan="2" style="WIDTH: 316px"><input name="txtFromDate" type="text" id="txtFromDate" onKeyDown="KeyDownHandler(btnSearch);" />&nbsp;<input type="image" name="btnFromDate" id="btnFromDate" src="images/cal.jpg" border="0" />
                                                            &nbsp;<input name="txtToDate" type="text" id="txtToDate" onKeyDown="KeyDownHandler(btnSearch);" />&nbsp;<input type="image" name="btnToDate" id="btnToDate" src="images/cal.jpg" border="0" /></td>
                                                </tr>
                                                <tr>
                                                      <td>&nbsp;</td>
                                                </tr>

                                                <tr>
                                                      <td width="30">&nbsp;</td>
                                                      <td align="right" width="130">&nbsp;</td>
                                                      <td width="180">&nbsp;</td>
                                                      <td width="136" align="right" style="WIDTH: 136px">&nbsp;</td>
                                                      <td><input type="submit" name="btnSearch" value="Search" id="btnSearch" class="button" /></td>
                                                </tr>
                                          </table>
                                    </div>

                              </div>
            <script>var sep = new ItemStyle(2, 0, '', 0, 0, '#AABBCC', '#AABBCC', '',  '', '', '', null, null, 'default', 'default');</script>

      <script>var pMenu = new PopupMenu('pMenu'); with (pMenu) { startMenu('root', false, 8, 8, 15, hBar, '', false); addItem('<nobr/><img src=images/menuSquare.jpg border=0>&nbsp;Options', 'mOptions', 'sm:', null, 75); addItem('<nobr/><img src=images/menuSquare.jpg border=0>&nbsp;Recent Job List', 'mJobList', 'sm:', null, 170); startMenu('mOptions', true, 1, 19, 260, subM, '', false);addItem('Completed Jobs', 'CompletedJobsSummary.aspx', ''); addItem('Job Search', 'JobSearchSpecific.aspx', ''); addItem('', '',  '', sep); addItem('Log Out', 'Signout.aspx', ''); startMenu('mJobList', true, 1, 19, 280, subM, '', false);addItem('3516020 - Mr D Brown', 'JobHeader.aspx?JobNo=3516020', ''); addItem('3516019 - Mr Wekky ', 'JobHeader.aspx?JobNo=3516019', ''); addItem('3516017 - Mrs Hughes', 'JobHeader.aspx?JobNo=3516017', ''); addItem('3516018 - Mr Wekky ', 'JobHeader.aspx?JobNo=3516018', ''); addItem('3516016 - Miss Jenkins', 'JobHeader.aspx?JobNo=3516016', ''); }</script>

      <script language=javascript>document.getElementById('txtCustSurname').focus();</script>

      <script>var subM = new ItemStyle(22, 0, '&gt;', -15, 3, '#FFFFFF', '#EAEAEA', 'lowText', 'highTextHoverInner', 'itemBorder', 'itemBorder', null, null, 'hand', 'default');</script>

      <SCRIPT language=JavaScript1.2 src='menu/pop_events.js' type=text/javascript></SCRIPT>

      <SCRIPT language=JavaScript1.2 src='menu/pop_core.js' type=text/javascript></SCRIPT>

      <script language='javascript'>function KeyDownHandler(btn){if (event.keyCode == 13){event.returnValue=false;event.cancel = true; btn.click();}}</script>

      <script>var hBar = new ItemStyle(40, 0, '', 0, 0, '10#F1F7FF', '10#EFEFEF', 'highText', 'highTextHover', '', '', null, null, 'hand', 'default');</script>

      <script>if (document.getElementById('txtCustSurname') != null) document.getElementById('txtCustSurname').readOnly=true;</script>

</form>
            </DIV></DIV>
      </body>
</HTML>
0
 
Type25Author Commented:
As i said before, if i take out the last <script> js it works fine - how werid?
0
 
archrajanCommented:
I get object expected error when i try to run ur page,
so i have to comment all these lines out
 <script>//var sep = new ItemStyle(2, 0, '', 0, 0, '#AABBCC', '#AABBCC', '',  '', '', '', null, null, 'default', 'default');</script>

<script>//var pMenu = new PopupMenu('pMenu'); with (pMenu) { startMenu('root', false, 8, 8, 15, hBar, '', false); addItem('<nobr/><img src=images/menuSquare.jpg border=0>&nbsp;Options', 'mOptions', 'sm:', null, 75); addItem('<nobr/><img src=images/menuSquare.jpg border=0>&nbsp;Recent Job List', 'mJobList', 'sm:', null, 170); startMenu('mOptions', true, 1, 19, 260, subM, '', false);addItem('Completed Jobs', 'CompletedJobsSummary.aspx', ''); addItem('Job Search', 'JobSearchSpecific.aspx', ''); addItem('', '',  '', sep); addItem('Log Out', 'Signout.aspx', ''); startMenu('mJobList', true, 1, 19, 280, subM, '', false);addItem('3516020 - Mr D Brown', 'JobHeader.aspx?JobNo=3516020', ''); addItem('3516019 - Mr Wekky ', 'JobHeader.aspx?JobNo=3516019', ''); addItem('3516017 - Mrs Hughes', 'JobHeader.aspx?JobNo=3516017', ''); addItem('3516018 - Mr Wekky ', 'JobHeader.aspx?JobNo=3516018', ''); addItem('3516016 - Miss Jenkins', 'JobHeader.aspx?JobNo=3516016', ''); }</script>

because they are in ur external .js file..

so if i comment them out the script does not give any error
0
 
Type25Author Commented:
pop_core.css   (by the way it was written for speed so it's pretty unmaintable  and readable - i didn't write it)

/*

CASCADING POPUP MENUS v5.2 RC (c) 2001-2004 Angus Turnbull, http://www.twinhelix.com
Altering this notice or redistributing this file is prohibited.

*/

var isDOM=document.getElementById?1:0,isIE=document.all?1:0,isNS4=navigator.appName=='Netscape'&&!isDOM?1:0,isIE4=isIE&&!isDOM?1:0,isOp=self.opera?1:0,isDyn=isDOM||isIE||isNS4;function getRef(i,p){p=!p?document:p.navigator?p.document:p;return isIE?p.all[i]:isDOM?(p.getElementById?p:p.ownerDocument).getElementById(i):isNS4?p.layers[i]:null};function getSty(i,p){var r=getRef(i,p);return r?isNS4?r:r.style:null};if(!self.LayerObj)var LayerObj=new Function('i','p','this.ref=getRef(i,p);this.sty=getSty(i,p);return this');function getLyr(i,p){return new LayerObj(i,p)};function LyrFn(n,f){LayerObj.prototype[n]=new Function('var a=arguments,p=a[0],px=isNS4||isOp?0:"px";with(this){'+f+'}')};LyrFn('x','if(!isNaN(p))sty.left=p+px;else return parseInt(sty.left)');LyrFn('y','if(!isNaN(p))sty.top=p+px;else return parseInt(sty.top)');LyrFn('vis','sty.visibility=p');LyrFn('bgColor','if(isNS4)sty.bgColor=p?p:null;else sty.background=p?p:"transparent"');LyrFn('bgImage','if(isNS4)sty.background.src=p?p:null;else sty.background=p?"url("+p+")":"transparent"');LyrFn('clip','if(isNS4)with(sty.clip){left=a[0];top=a[1];right=a[2];bottom=a[3]}else sty.clip="rect("+a[1]+"px "+a[2]+"px "+a[3]+"px "+a[0]+"px)" ');LyrFn('write','if(isNS4)with(ref.document){write(p);close()}else ref.innerHTML=p');LyrFn('alpha','var f=ref.filters,d=(p==null),o=d?"inherit":p/100;if(f){if(!d&&sty.filter.indexOf("alpha")==-1)sty.filter+=" alpha(opacity="+p+")";else if(f.length&&f.alpha)with(f.alpha){if(d)enabled=false;else{opacity=p;enabled=true}}}else if(isDOM)sty.opacity=sty.MozOpacity=o');function setLyr(v,dw,p){if(!setLyr.seq)setLyr.seq=0;if(!dw)dw=0;var o=!p?isNS4?self:document.body:!isNS4&&p.navigator?p.document.body:p,IA='insertAdjacentHTML',AC='appendChild',id='_sl_'+setLyr.seq++;if(o[IA])o[IA]('beforeEnd','<div id="'+id+'" style="position:absolute; z-order:5000;"></div>');else if(o[AC]){var n=document.createElement('div');o[AC](n);n.id=id;n.style.position='absolute'}else if(isNS4){var n=new Layer(dw,o);id=n.id}var l=getLyr(id,p);with(l)if(ref){vis(v);x(0);y(0);sty.width=dw+(isNS4?0:'px')}return l};if(!self.page)var page={win:self,minW:0,minH:0,MS:isIE&&!isOp};page.db=function(p){with(this.win.document)return(isDOM?documentElement[p]:0)||body[p]||0};page.winW=function(){with(this)return Math.max(minW,MS?db('clientWidth'):win.innerWidth)};page.winH=function(){with(this)return Math.max(minH,MS?db('clientHeight'):win.innerHeight)};page.scrollX=function(){with(this)return MS?db('scrollLeft'):win.pageXOffset};page.scrollY=function(){with(this)return MS?db('scrollTop'):win.pageYOffset};function addProps(obj,data,names,addNull){for(var i=0;i<names.length;i++)if(i<data.length||addNull)obj[names[i]]=data[i]};function PopupMenu(myName){this.myName=myName;this.showTimer=this.hideTimer=this.showDelay=0;this.hideDelay=500;this.menu=[];this.litNow=[];this.litOld=[];this.overM='';this.overI=0;this.hideDocClick=0;this.actMenu=null;PopupMenu.list[myName]=this};PopupMenu.list=[];var PmPt=PopupMenu.prototype;PmPt.callEvt=function(mN,iN,evt){var i=this.menu[mN][iN],r1=this[evt]?this[evt](mN,iN):0,r2;if(i[evt]){if(i[evt].substr)i[evt]=new Function('mN','iN',i[evt]);r2=i[evt](mN,iN)}return typeof r2=='boolean'?r2:r1};PmPt.over=function(mN,iN){with(this){clearTimeout(hideTimer);overM=mN;overI=iN;var evtRtn=iN?callEvt(mN,iN,'onmouseover'):0,rtn=evtRtn||false;litOld=litNow;litNow=[];var litM=mN,litI=iN;if(mN)do{litNow[litM]=litI;litI=menu[litM][0].parentItem;litM=menu[litM][0].parentMenu}while(litM);var same=1;for(var z in menu)same&=(litNow[z]==litOld[z]);if(same)return rtn;clearTimeout(showTimer);for(var thisM in menu)with(menu[thisM][0]){if(!lyr)continue;lI=litNow[thisM];oI=litOld[thisM];if(lI!=oI){if(lI)changeCol(thisM,lI);if(oI)changeCol(thisM,oI)}if(!lI)clickDone=0;if(isRoot)continue;if(lI&&!visNow)doVis(thisM,1);if(!lI&&visNow)doVis(thisM,0)}nextMenu='';if(menu[mN]&&menu[mN][iN].sm&&(evtRtn+''!='false')){var m=menu[mN],t=m[iN].sm;if(!menu[t])return rtn;if(m[0].clickSubs&&!m[0].clickDone)return rtn;nextMenu=t;if(showDelay)showTimer=setTimeout(myName+'.doVis("'+t+'",1)',showDelay);else doVis(t,1)}return rtn}};PmPt.out=function(mN,iN){with(this){if(mN!=overM||iN!=overI)return;var thisI=menu[mN][iN],evtRtn=iN?callEvt(mN,iN,'onmouseout'):0;if(thisI.sm!=nextMenu){clearTimeout(showTimer);nextMenu=''}if(hideDelay&&(evtRtn+''!='false')){var delay=menu[mN][0].isRoot&&!thisI.sm?50:hideDelay;hideTimer=setTimeout(myName+'.over("",0)',delay)}overM='';overI=0}};PmPt.click=function(mN,iN){with(this){var m=menu[mN],evtRtn=callEvt(mN,iN,'onclick');if(evtRtn+''=='false')return false;with(m[iN]){if(sm){if(m[0].clickSubs){m[0].clickDone=1;doVis(sm,1);return evtRtn||false}}else if(type=='js:')eval(href);else if(href){type=type||'window';eval(type+'.location.href="'+href+'"')}}over('',0);return evtRtn||false}};PmPt.changeCol=function(mN,iN,fc){with(this.menu[mN][iN]){if(!lyr||!lyr.ref)return;var bgFn=outCol!=overCol?(outCol.indexOf('.')==-1?'bgColor':'bgImage'):0;var ovr=(this.litNow[mN]==iN)?1:0,doFX=(!fc&&this.litNow[mN]!=this.litOld[mN]);var col=ovr?overCol:outCol;if(fade[0]){clearTimeout(timer);col='#';count=Math.max(0,Math.min(count+(2*ovr-1)*parseInt(fade[ovr][0]),100));var oc,nc,hexD='0123456789ABCDEF';for(var i=1;i<4;i++){oc=parseInt('0x'+fade[0][i]);nc=parseInt(oc+(parseInt('0x'+fade[1][i])-oc)*(count/100));col+=hexD.charAt(Math.floor(nc/16)).toString()+hexD.charAt(nc%16)}if(count%100>0)timer=setTimeout(this.myName+'.changeCol("'+mN+'",'+iN+',1)',50)}if(bgFn&&isNS4)lyr[bgFn](col);var reCSS=(overClass!=outClass||outBorder!=overBorder);if(doFX)with(lyr){if(!this.noRW&&(overText||overInd||isNS4&&reCSS))write(this.getHTML(mN,iN,ovr));if(!isNS4&&reCSS){ref.className=(ovr?overBorder:outBorder);var chl=(isDOM?ref.childNodes:ref.children);if(chl&&!overText)for(var i=0;i<chl.length;i++)chl[i].className=ovr?overClass:outClass}}if(bgFn&&!isNS4)lyr[bgFn](col);if(doFX&&outAlpha!=overAlpha)lyr.alpha(ovr?overAlpha:outAlpha)}};PmPt.position=function(posMN){with(this){for(mN in menu)if(!posMN||posMN==mN)with(menu[mN][0]){if(!lyr||!lyr.ref||!visNow)continue;var pM,pI,newX=eval(offX),newY=eval(offY);if(!isRoot){pM=menu[parentMenu];pI=pM[parentItem].lyr;if(!pI)continue}var eP=eval(par),pW=(eP&&eP.navigator?eP:window);with(pW.page)var sX=scrollX(),wX=sX+winW()||9999,sY=scrollY(),wY=winH()+sY||9999;var sb=page.MS?5:20;if(pM&&typeof(offX)=='number')newX=Math.max(sX,Math.min(newX+pM[0].lyr.x()+pI.x(),wX-menuW-sb));if(pM&&typeof(offY)=='number')newY=Math.max(sY,Math.min(newY+pM[0].lyr.y()+pI.y(),wY-menuH-sb));lyr.x(newX);lyr.y(newY)}}};PmPt.doVis=function(mN,show){with(this){var m=menu[mN],sh=(show?'show':'hide'),mA=sh+'Menu',mE='on'+sh;m[0].visNow=show;if(m&&m[0].lyr&&m[0].lyr.ref){if(show)position(mN);var p=m[0].parentMenu;if(p)m[0].lyr.sty.zIndex=m[0].zIndex=menu[p][0].zIndex+2;if(this[mE])this[mE](mN);if(this[mA])this[mA](mN);else m[0].lyr.vis(show?'visible':'hidden')}}};function ItemStyle(){var names=['len','spacing','popInd','popPos','pad','outCol','overCol','outClass','overClass','outBorder','overBorder','outAlpha','overAlpha','normCursor','nullCursor'];addProps(this,arguments,names,1)};PmPt.startMenu=function(mName){with(this){if(!menu[mName])menu[mName]=[{}];actMenu=menu[mName];aM=actMenu[0];actMenu.length=1;var names=['name','isVert','offX','offY','width','itemSty','par','clickSubs','clickDone','visNow','parentMenu','parentItem','oncreate','isRoot'];addProps(aM,arguments,names,1);aM.extraHTML='';aM.menuW=aM.menuH=0;aM.zIndex=1000;if(!aM.lyr)aM.lyr=null;if(mName.substring(0,4)=='root'){aM.isRoot=1;aM.oncreate=new Function('this.visNow=1;'+myName+'.position("'+mName+'");this.lyr.vis("visible")')}return aM}};PmPt.addItem=function(){with(this)with(actMenu[0]){var aI=actMenu[actMenu.length]=new Object();var names=['text','href','type','itemSty','len','spacing','popInd','popPos','pad','outCol','overCol','outClass','overClass','outBorder','overBorder','outAlpha','overAlpha','normCursor','nullCursor','iX','iY','iW','iH','fW','fH','overText','overInd','sm','lyr','onclick','onmouseover','onmouseout'];addProps(aI,arguments,names,1);var iSty=arguments[3]?arguments[3]:actMenu[0].itemSty;for(prop in iSty)if(aI[prop]+''=='undefined')aI[prop]=iSty[prop];if(aI.type=='sm:'){aI.sm=aI.href;aI.href=''}var r=RegExp,re=/^SWAP:(.*)\^(.*)$/;if(aI.text.match(re)){aI.text=r.$1;aI.overText=r.$2}if(aI.popInd.match(re)){aI.popInd=r.$1;aI.overInd=r.$2}aI.timer=aI.count=0;aI.fade=[];for(var i=0;i<2;i++){var oC=i?'overCol':'outCol';if(aI[oC].match(/^(\d+)\#(..)(..)(..)$/)){aI[oC]='#'+r.$2+r.$3+r.$4;aI.fade[i]=[r.$1,r.$2,r.$3,r.$4]}}if(aI.outBorder&&isNS4)aI.pad++;if(!isIE){if(aI.normCursor=='hand')aI.normCursor='pointer';if(aI.nullCursor=='hand')aI.nullCursor='pointer'}aI.iW=isVert?width:aI.len;aI.iH=isVert?aI.len:width;var lastGap=actMenu.length>2?actMenu[actMenu.length-2].spacing:0;var spc=aI.outBorder&&actMenu.length>2?1:0;if(isVert){menuH+=lastGap-spc;aI.iX=0;aI.iY=menuH;menuW=width;menuH+=aI.iH}else{menuW+=lastGap-spc;aI.iX=menuW;aI.iY=0;menuW+=aI.iW;menuH=width}return aI}};PmPt.getHTML=function(mN,iN,isOver){with(this){var itemStr='';with(menu[mN][iN]){var tC=isOver?overClass:outClass,txt=isOver&&overText?overText:text,popI=isOver&&overInd?overInd:popInd,ln='<a href="'+(href&&type!='js:'?href:'#')+'" onclick="return false" class="'+tC+(isNS4?'" onmouseover="'+myName+'.over(\''+mN+'\','+iN+')"':'"');if(popI&&sm){if(isNS4)itemStr+='<layer z-index=5000 class="'+tC+'" left="'+((popPos+fW)%fW)+'" top="'+pad+'" height="'+(fH-2*pad)+'">'+popI+'</layer>';else itemStr+='<div class="'+tC+'" style="z-order:5000;position:absolute;left:'+((popPos+fW)%fW)+'px;top:'+pad+'px;height:'+(fH-2*pad)+'px">'+popI+'</div>'}if(isNS4)itemStr+=(outBorder?'<span class="'+(isOver?overBorder:outBorder)+'"><spacer type="block" width="'+(fW-8)+'" height="'+(fH-8)+'"></span>':'')+'<layer z-index=5000 left="'+pad+'" top="'+pad+'" width="'+(fW-2*pad)+'" height="'+(fH-2*pad)+'">'+ln+'>'+txt+'</a></layer>';else{itemStr+=(isIE4?'<div class="'+tC+'" ':ln)+' style="z-order:5000;position:absolute;left:'+pad+'px;top:'+pad+'px;width:'+(fW-2*pad)+'px;height:'+(fH-2*pad)+'px;cursor:'+(href?normCursor:nullCursor)+'">'+txt+(isIE4?'</div>':'</a>')}}return itemStr}};PmPt.update=function(docWrite,upMN){with(this){if(!isDyn)return;for(mN in menu)with(menu[mN][0]){if(upMN&&upMN!=mN)continue;var str='',eP=eval(par);with(eP&&eP.navigator?eP:self)var dC=document.compatMode,dT=document.doctype;dFix=(dC&&dC.indexOf('CSS')>-1||isOp&&!dC||dT&&dT.name.indexOf('.dtd')>-1||isDOM&&!isIE)?2:0;for(var iN=1;iN<menu[mN].length;iN++)with(menu[mN][iN]){var tM=menu[sm],itemID=myName+'-'+mN+'-'+iN;if(sm&&tM){tM[0].parentMenu=mN;tM[0].parentItem=iN}if(outBorder){fW=iW-dFix;fH=iH-dFix}else{fW=iW;fH=iH}var isImg=(outCol.indexOf('.')!=-1);if(isDOM||isIE4){str+='<div id="'+itemID+'" '+(outBorder?'class="'+outBorder+'" ':'')+'style="z-order:5000;position:absolute;left:'+iX+'px;top:'+iY+'px;width:'+fW+'px;height:'+fH+'px;z-index:'+zIndex+';'+(outCol?'background:'+(isImg?'url('+outCol+')':outCol):'')+(typeof(outAlpha)=='number'?';filter:alpha(opacity='+outAlpha+');-moz-opacity:'+outAlpha+'%;opacity:'+(outAlpha/100):'')+';cursor:'+(href?normCursor:nullCursor)+'" '}else if(isNS4){str+='<layer z-index=5000 id="'+itemID+'" left="'+iX+'" top="'+iY+'" width="'+fW+'" height="'+fH+'" z-index="'+zIndex+'" '+(outCol?(isImg?'background="':'bgcolor="')+outCol+'" ':'')}var evtMN="('"+mN+"',"+iN+")";str+='onmouseover="return '+myName+'.over'+evtMN+'" onmouseout="'+myName+'.out'+evtMN+'" onclick="return '+myName+'.click'+evtMN+'">'+getHTML(mN,iN,0)+(isNS4?'</layer>':'</div>')}var sR=myName+'.setupRef('+(docWrite?1:0)+',"'+mN+'")';if(isOp)setTimeout(sR,1000);var mVis=isOp&&isRoot?'visible':'hidden';if(docWrite){var targFr=eP&&eP.navigator?eP:window;targFr.document.write('<div id="'+myName+'-'+mN+'" style="z-order:5000;position:absolute;visibility:'+mVis+';left:'+(isOp?-1000:0)+'0px;top:0px;width:'+(menuW+2)+'px;height:'+(menuH+2)+'px;z-index:1000">'+str+extraHTML+'</div>')}else{if(!lyr||!lyr.ref)lyr=setLyr(mVis,menuW,eP);else if(isIE4)setTimeout(myName+'.menu.'+mN+'[0].lyr.sty.width='+(menuW+2),50);with(lyr){sty.zIndex=1000;write(str+extraHTML)}}if(!isOp)setTimeout(sR,100)}}};PmPt.setupRef=function(docWrite,mN){with(this)with(menu[mN][0]){var eP=eval(par);if(docWrite||!lyr||!lyr.ref)lyr=getLyr(myName+'-'+mN,eP);for(var i=1;i<menu[mN].length;i++)menu[mN][i].lyr=getLyr(myName+'-'+mN+'-'+i,isNS4?lyr.ref:eP);menu[mN][0].lyr.clip(0,0,menuW+2,menuH+2);if(menu[mN][0].oncreate)oncreate()}};
0
 
Type25Author Commented:
pop_events.js  

var scFr=self.PopupMenu?self:(parent.PopupMenu?parent:top);function popEvt(str,each){var PML=scFr.PopupMenu.list,mN;for(var objName in PML)with(PML[objName]){if(each)for(mN in menu)with(menu[mN][0]){if((!par&&scFr==self)||(par&&par.substring(par.lastIndexOf('.')+1)==self.name))eval(str)}else eval(str)}};var scrFn,popOL=window.onload,popUL=window.onunload,popOR=window.onresize,popOS=window.onscroll,nsWinW=window.innerWidth,nsWinH=window.innerHeight,nsPX=window.pageXOffset,nsPY=window.pageYOffset;document.popOC=document.onclick;if(scFr.PopupMenu){if(!self.page)var isNS4=scFr.isNS4,page={};if(scFr!=self)for(var f in scFr.page)page[f]=scFr.page[f];page.win=self;popEvt('self[objName]=PML[objName]',0);if(!isNS4)popEvt('update(true,mN)',1);window.onload=function(){if(popOL)popOL();if(isNS4){popEvt('update(false,mN)',1);setInterval(scrFn,50)}if(!scFr.isOp)window.onunload=new Function('if(popUL)popUL();popEvt("for(var i=0;i<menu[mN].length;i++)menu[mN][i].lyr=null",1)')};if(popOS||(''+popOS!='undefined'))window.onscroll=function(){if(popOS)popOS();popEvt('position(mN)',1)};else{scrFn='if(nsPX!=pageXOffset||nsPY!=pageYOffset){nsPX=pageXOffset;nsPY=pageYOffset;popEvt("position(mN)",1)}';if(!isNS4)setInterval(scrFn,50)}function resizeBugCheck(){if(nsWinW!=innerWidth||nsWinH!=innerHeight)location.reload()};if(scFr.isOp&&!document.documentElement&&!self.opFix)self.opFix=setInterval('resizeBugCheck()',500);window.onresize=function(){if(popOR)popOR();if(isNS4)resizeBugCheck();popEvt('position(mN)',1)};if(isNS4)document.captureEvents(Event.CLICK);document.onclick=function(evt){popEvt('if(isNS4&&overI)click(overM,overI);if(!overI&&hideDocClick)over("root",0)',0);return document.popOC?document.popOC(evt):(isNS4?document.routeEvent(evt):self.uNdEfInEd)}}
0
 
archrajanCommented:
Looks like the menu is not defined properly
I am looking into it...
i went to that site and downloaded an example
0
 
Type25Author Commented:
It's just strange, it works on my other pages.....   using same technique.

Thanks for the help
0
 
archrajanCommented:
Well
what you need to do is put the external files just immediately after the <body> tag or in ur head section then u will not
get the errors
0
 
Type25Author Commented:
ah-ha!

Ok, i've added one of the js includes between the <head/> tags and it now works as expected.

I guess it just wasn't inserting all the code quick enough!  

Thanks for that help - much appreciated!

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 8
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now