function createWindow(url,wid,hei,posx,posy,tit,type,evt,ret){var win,w,h,x,y,str='';w=wid;h=hei;x=(posx!=null&&posx>=0&&evt==null?posx:(evt!=null?getFromSrcElement("x",evt):getCenterPosition("x",wid)));y=(posy!=null&&posy>=0&&evt==null?posy:(evt!=null?getFromSrcElement("y",evt):getCenterPosition("y",hei)));str=(type&1?'toolbar=yes,':'toolbar=no,')+(type&2?'location=yes,':'location=no,')+(type&4?'directories=yes,':'directories=no,')+(type&8?'status=yes,':'status=no,')+(type&16?'menubar=yes,':'menubar=no,')+(type&32?'scrollbars=yes,':'scrollbars=no,')+(type&64?'resizable=yes,':'resizable=no,')+(type&128?'copyhistory=yes,':'copyhistory=no,')+'width='+wid+',height='+hei+',left='+x+',top='+y;if(ret==true)return window.open(url,tit,str);window.open(url,tit,str);}function getCenterPosition(axis,ref){var result=0;switch(axis){case"x":result=parseInt((screen.width-ref)/2);break;case"y":result=parseInt((screen.height-ref)/2);break;}return result;}function getFromSrcElement(axis,evt){var result=0;var ie=document.all;var ns=(document.layers||document.getElementById)&&!document.all;switch(axis){case"x":if(ie)result=(evt.srcElement.width)?evt.screenX-evt.offsetX+evt.srcElement.width+5:(evt.srcElement.innerText)?evt.screenX-evt.offsetX+(evt.srcElement.innerText.length*10)+5:evt.screenX-evt.offsetX+evt.srcElement.offsetWidth;else if(ns)result=(evt.target.x)?evt.target.x+evt.target.width+5:evt.target.offsetLeft+(evt.target.textLength*10)+5;break;case"y":if(ie)result=(evt.srcElement.width)?evt.screenY-evt.offsetY:evt.screenY-10;else if(ns)result=evt.target.offsetTop;break;}return result;}