function checkLoadedValues(){ if (document.getElementById('fldTimeDep')){ ChangeTime(document.getElementById('fldTimeDep')); ChangeTime(document.getElementById('fldTimeArr')); HideShowBackData(); } } function ChangeTime(obj){ if (obj.value=='null') document.getElementById(obj.id+'Opt').disabled =true else document.getElementById(obj.id+'Opt').disabled =false } function showMoreCost(offer,request){ window.open('/pages/forms/cost.php?offer='+offer+'&request='+request,'sas', "height=300,width=520,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no"); } function showTerms(request){ window.open('/pages/forms/terms.php?request='+request,'sas', "height=300,width=520,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no"); } var x=0;y=0; function getY(obj){ if (obj){ y=y+obj.offsetTop getY(obj.offsetParent) }else return y } function getX(obj){ if (obj){ x=x+obj.offsetLeft getX(obj.offsetParent) }else return x } function showSelect(obj,keyValue,keycode){ if (obj.value.length>1){ txt=obj.name.replace('fldName','') if (keyCode==8 ){ if (obj.value.length>3){ oCurObj=obj document.all.smartboxBG.src='/pages/utils/searchTown.php?fld='+txt+'&txt='+obj.value.substring(0,+obj.value.length-1); }else{ clearSelection(); hideSelect(); } }else{ y=0; x=0; getY(obj) getX(obj) y+=obj.clientTop+obj.clientHeight x+=obj.clientLeft document.all.smartboxBG.style.display='block' document.all.smartboxBG.style.top=y document.all.smartboxBG.style.left=x document.all.smartboxBG.style.width=200//obj.clientWidth document.all.smartboxBG.style.width=300//obj.clientWidth oCurObj=obj //alert(keycode+keyValue) if (obj.name=='fldNameCompany') document.all.smartboxBG.src='/pages/utils/searchCompany.php?fld='+txt+'&txt='+obj.value+keyValue; else document.all.smartboxBG.src='/pages/utils/searchTown.php?fld='+txt+'&txt='+obj.value+keyValue; } } } var oCurObj=null; var oCurRow=null; var oCurRowNumber=0; function keyup(obj){ keyCode=window.event.keyCode //alert(keyCode) switch (keyCode){ case 39: case 37: return false; break; case 38: moveSelection(-1,obj) return false; break; case 40: moveSelection(1,obj) return false; break; case 27: clearSelection(); hideSelect(); break; case 8: clearSelection(); keyvalue='' showSelect(obj,keyvalue,keyCode); break; } } function moveSelection(step,obj){ //status=oCurObj if (oCurObj==null) return; if (oCurObj==obj){ wSmartboxBG=window.frames.smartboxBG oCurRowNumber=oCurRowNumber+step row=wSmartboxBG.document.all('divLink'+oCurRowNumber) oCurRow=row if (row==null) oCurRowNumber=oCurRowNumber-step else{ row.className='DivOver' wSmartboxBG.document.all('urlLink'+oCurRowNumber).style.textDecoration='none' rowPrev=wSmartboxBG.document.all('divLink'+(oCurRowNumber-step)) if (rowPrev!=null){ rowPrev.className='DivOut' wSmartboxBG.document.all('urlLink'+(oCurRowNumber-step)).style.textDecoration='underline' } } } } function clearSelection(){ oCurObj=null oCurRowNumber=0 } function keypressed(obj){ keyCode=window.event.keyCode //alert(keyCode) switch (keyCode){ case 13: oCurObj=null if (oCurRow!=null){ wSmartboxBG=window.frames.smartboxBG wSmartboxBG.document.all('urlLink'+oCurRowNumber).click(); clearSelection(); return false; } break; default: clearSelection(); keyvalue=String.fromCharCode(keyCode) showSelect(obj,keyvalue,keyCode); } } function hideSelect(){ if (document.elementFromPoint(window.event.x,window.event.y).id!='smartboxBG') document.all.smartboxBG.style.display='none'; } function showSelector(val){ window.open('/pages/forms/townSelect.php?name='+val+'&code='+document.all('fldCode'+val).value,'sas', "height=300,width=520,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no"); } function showPlane(val){ window.open('http://www.gofly.ru/pages/forms/plane.php?id='+val,null, "height=600,width=620,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no"); } function showPort(val){ window.open('http://www.gofly.ru/pages/forms/ports.php?id='+val,null, "height=600,width=620,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no"); } function showCompany(val){ window.open('http://www.gofly.ru/pages/forms/company.php?id='+val,null, "height=600,width=620,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no"); } function findTown(value, code){ opener.window.document.all('fldName'+document.all.fld.value).value=value opener.window.document.all('fldCode'+document.all.fld.value).value=code close() } function insertTowns(obj,val){ if (obj.value!=-1) window.frames("insertVals").location.href="/pages/utils/insertValues.php?cn="+obj+"&ct="+val } function insertTown(){ if (document.all.city.selectedIndex>-1){ opener.window.document.all('fldName'+document.all.fld.value).value=document.all.city.options[document.all.city.selectedIndex].text opener.window.document.all('fldCode'+document.all.fld.value).value=document.all.city.value window.close(); } } function insertDate(){ if (document.all.txt_dates.value!=''){ //alert(document.all.txt_dates.value); opener.window.document.all('fldDate'+document.all.fld.value).value=document.all.txt_dates.value // alert(document.all.txt_dates.value); opener.window.document.all('fldDate'+document.all.fld.value).click() window.close(); } } function HideShowBackData(){ var col=document.getElementsByTagName("DIV") if (document.all.isBack[1].checked) val='visible' else val='hidden' for (i=0;i