function getAppVer(){ var isAppVer = window.navigator.appVersion; var booSafari=false; // trang thai ban dau //var booSafari=true; // dung de test if ((isAppVer.indexOf("Safari")>-1)&&(isAppVer.indexOf("Chrome")==-1)){ booSafari=true; } return booSafari; } try{ $(function(){ //fix gui on ipad if(getAppVer()){ $('iframe[name="Main"]').css({'width': '800px', 'height': ''}); } //show/hide loading fancybox on postback // $('input[onclick*="_doClick"]').click(function(){ // showLoading(); // }); //hideLoading(); }); }catch(e){} function openDBRelativeURL( elemName ){ pathName = location.pathname.split('.nsf'); location.href = pathName[0] + '.nsf/' + elemName; } function doDelete( setSubmitVar) { if ( confirm('B\u1EA1n c\u00F3 mu\u1ED1n xo\u00E1 b\u1EA3n ghi \u0111\u00F3 kh\u00F4ng?') ){ isDocBeingSubmitted = true; location.search = "?DeleteDocument"; } } function trim(aStr) { return aStr.replace(/^\s{1,}/, "").replace(/\s{1,}$/, "") } // thay doi do lon cua frame function ResizeMe(){ try{ var tblMain = document.getElementById("tblMain"); if (tblMain != null){ var oParent = window.parent; if (oParent != null){ var tdFrame = oParent.document.getElementById("tdFrame"); var tdFrame1 = oParent.document.getElementById("tdFrame1"); var iH1 = tblMain.offsetHeight; if (tdFrame1 != null){ if (iH1<461) iH1=460; if (tdFrame1 != null) tdFrame1.style.height = iH1; var oParent1=window.parent.parent; if (oParent1 != null){ var tdFrame = oParent1.document.getElementById("tdFrame"); if (tdFrame != null){ var iH = tblMain.offsetHeight; if ((iH1<461)&&(iH<461)) iH1=460; tdFrame.style.height = iH1; } } } if (tdFrame != null){ var iH = tblMain.offsetHeight+40; if (iH1==460) iH=iH-40; if (iH<461) iH=460; tdFrame.style.height = iH; } } } }catch(e){} } //Ham SelectOne(Sour,Dest,inUse) dung de xu ly lua chon torng listbox //no chuyen mot selectedIndex trong truong Sour chuyen sang truong Dest function SelectOne(Sour,Dest,inUse){ var flag=true; var SLength = Sour.options.length; var DLength = 0; DLength=(Dest.options.length); if(SLength > 0){ if(Sour.options[Sour.selectedIndex].value != "" && Sour.options[Sour.selectedIndex].value != "-1" ){ if(DLength==0){ Dest.options.length = Dest.options.length + 1; Dest.options[Dest.options.length - 1].value=Sour.options[Sour.selectedIndex].value; Dest.options[Dest.options.length - 1].text=Sour.options[Sour.selectedIndex].text;} else{ for(i=0;i0){ for (i=0;i0){ for (i=0;i0) dialogLeft=left; else dialogLeft=150; if (top>0) dialogTop=top; else dialogTop=150; if (width>0) dialogWidth=width; else dialogWidth=400; if (height>0) dialogHeight=height; else dialogHeight=250; var pathname = window.location.pathname.toLowerCase(); pathname=pathname.substring(0,pathname.lastIndexOf('nsf')+3)+"/"; var giatri = window.showModalDialog(pathname+ModalDialog_Name+'?OpenFrameset','Address','status:no;resizable=no;scrollbars:no;dialogLeft:'+dialogLeft+'px;dialogTop:'+dialogTop+'px;dialogWidth:'+dialogWidth+'px;dialogHeight:'+dialogHeight+'px'); if (giatri!=null){ Sour.value=giatri; } return giatri; } function openDialogNhanSuDouble(ModalDialog_Name,Variable,Sour,left,top,width,height){ if (left>0) dialogLeft=left; else dialogLeft=150; if (top>0) dialogTop=top; else dialogTop=150; if (width>0) dialogWidth=width; else dialogWidth=550; if (height>0) dialogHeight=height; else dialogHeight=450; if (Variable=='') dialogVariable='Address'; else dialogVariable= Variable; var pathname = window.location.pathname.toUpperCase(); pathname=pathname.substring(0,pathname.lastIndexOf('NSF')+3); var giatri = window.showModalDialog(pathname.substring(0,(pathname.lastIndexOf('.nsf')+5))+ModalDialog_Name+'?OpenForm',dialogVariable,'status:no;resizable=no;scrollbars:no;dialogLeft:'+dialogLeft+'px;dialogTop:'+dialogTop+'px;dialogWidth:'+dialogWidth+'px;dialogHeight:'+dialogHeight+'px'); if (giatri!=null){ Sour.value=giatri; } return giatri; } //============== end open modal dialog