﻿function dropdown_menu_hack(e){var d=document.getElementById(e);if(d!=null){if(d.runtimeStyle.behavior.toLowerCase()=="none"){return}d.runtimeStyle.behavior="none";var b=false;d.ondblclick=function(g){window.event.returnValue=false;return false};if(window.createPopup==null){var f="dropdown_menu_hack_"+Date.parse(new Date());window.createPopup=function(){if(window.createPopup.frameWindow==null){d.insertAdjacentHTML("AfterEnd","<iframe id='"+f+"' name='"+f+"' src='about:blank' frameborder='1' scrolling='no'></></iframe>");var g=document.frames[f];g.document.open();g.document.write("<html><body></body></html>");g.document.close();g.fid=f;var h=document.getElementById(f);h.style.cssText="position:absolute;top:0;left:0;display:none;z-index:99999;";g.show=function(k,i,l,m,j){i=i+j.getBoundingClientRect().top+Math.max(document.body.scrollTop,document.documentElement.scrollTop);k=k+j.getBoundingClientRect().left+Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);h.style.width=l+"px";h.style.height=m+"px";h.style.posLeft=k;h.style.posTop=i;h.style.display="block"};f_hide=function(i){if(window.event&&window.event.srcElement&&window.event.srcElement.tagName&&window.event.srcElement.tagName.toLowerCase()=="select"){return true}h.style.display="none"};g.hide=f_hide;document.attachEvent("onclick",f_hide);document.attachEvent("onkeydown",f_hide)}return g}}function a(){function h(i){var r=document.createElement("option");r.value=i.id;r.innerHTML=i.innerHTML;while(d.options.length>0){d.options[0].removeNode(true)}d.appendChild(r);d.title=r.innerHTML;d.contentIndex=i.selectedIndex;d.menu.hide();if(typeof(d.onchange)!="undefined"){d.fireEvent("onchange")}}d.menu.show(0,d.offsetHeight,10,10,d);var m=d.menu.document.body;m.style.cssText="border:solid 1px black;margin:0;padding:0;overflow-y:auto;overflow-x:auto;background:white;text-aligbn:left;font-family:arial,verdana,sans;font-size:11px;";var q=d.contentHTML;q=q.replace(/<select/gi,"<ul");q=q.replace(/<option/gi,"<li");q=q.replace(/<\/option/gi,"</li");q=q.replace(/<\/select/gi,"</ul");q=q.replace(/value=/gi,"id=");m.innerHTML=q;d.select=m.all.tags("ul")[0];d.select.style.cssText="list-style:none;margin:0;padding:0;";m.options=d.select.getElementsByTagName("li");for(var j=0;j<m.options.length;j++){m.options[j].selectedIndex=j;m.options[j].style.cssText="list-style:none;margin:0;padding:1px 2px;width/**/:100%;height:16px;cursor:hand;cursor:pointer;white-space:nowrap;";m.options[j].title=m.options[j].innerHTML;m.options[j].innerHTML="<nobr>"+m.options[j].innerHTML+"</nobr>";m.options[j].onmouseover=function(){if(m.options.selected){m.options.selected.style.background="white";m.options.selected.style.color="black"}this.style.background="#333366";this.style.color="white"};m.options[j].onmouseout=function(){this.style.background="white";this.style.color="black"};m.options[j].onmousedown=function(){h(this)};m.options[j].onkeydown=function(){h(this)};if(j==d.contentIndex){m.options[j].style.background="#333366";m.options[j].style.color="white";m.options.selected=m.options[j]}}var p=Math.max((d.select.offsetWidth+10),d.offsetWidth+10);p=Math.max(p,(m.scrollWidth+50));var l=m.options.length*15+8;var o=(b)?-3:0;var n=d.offsetHeight-2;var k=document.documentElement.offsetHeight;var g=k-d.getBoundingClientRect().bottom;l=Math.min(l,Math.max((k-d.getBoundingClientRect().top-50),100));if((g<l)){l=Math.max((g-12),10);if(l<100){n=-100}l=Math.max(l,100)}self.focus();d.menu.show(o,n,p,l,d);sync=null;if(m.options.selected){m.scrollTop=m.options.selected.offsetTop}window.onresize=function(){d.menu.hide()}}if(dropdown_menu_hack.menu==null){dropdown_menu_hack.menu=window.createPopup();document.attachEvent("onkeydown",dropdown_menu_hack.menu.hide)}d.menu=dropdown_menu_hack.menu;d.contentOptions=new Array();d.contentIndex=d.selectedIndex;d.contentHTML=d.outerHTML;for(var c=0;c<d.options.length;c++){d.contentOptions[d.contentOptions.length]={value:d.options[c].value,text:d.options[c].innerHTML};if(!d.options[c].selected){d.options[c].removeNode(true);c--}}d.onclick=a}}function foo(c,a,d,g,b,f){var e=document.getElementById(this.fid)};