function openDefaultWindow(url, name, width, height) { window.open('http://zone.zihni.com.tr/' + url,name,'left=200,top=100,width='+ width +',height='+ height +',scrollbars=yes,resizable=no'); } function openInvoiceDetials(url) { window.open('http://zone.zihni.com.tr/' + url,'theinvoicedetailwindow','left=10,top=10,width='+ screen.width*80/100 +',height='+ screen.width*60/100 +',scrollbars=yes,resizable=no'); } function openVoyageExpDetials(url) { window.open('http://zone.zihni.com.tr/' + url,'thevoyageexpdetailswindow','left=10,top=10,width='+ screen.width*50/100 +',height='+ screen.width*50/100 +',scrollbars=yes,resizable=no'); } function openPartyDetails(url) { window.open('http://zone.zihni.com.tr/' + url,'thepartydetailswindow','left=10,top=10,width='+ screen.width*60/100 +',height='+ screen.width*50/100 +',scrollbars=yes,resizable=no'); } function openPortDetails(url) { window.open('http://zone.zihni.com.tr/' + url,'theportdetailswindow','left=10,top=10,width='+ screen.width*60/100 +',height='+ screen.width*50/100 +',scrollbars=yes,resizable=no'); } function openWindow(url, name, extra) { window.open('http://zone.zihni.com.tr/' + url,name,extra); } function confirmDelete() { return confirm('Are you sure to delete this record?'); } function submitEnter(myfield,e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode == 13) { myfield.form.submit(); return false; } else { return true; } } function getLocalTime() { var theDate = new Date(); var retStr = ""; retStr += (theDate.getDate()<10?"0":"") + theDate.getDate() + "."; var theMonth = theDate.getMonth() + 1; retStr += (theMonth<10?"0":"") + theMonth + "."; retStr += takeYear(theDate) + " "; retStr += (theDate.getHours()<10?"0":"") + theDate.getHours() + ":"; retStr += (theDate.getMinutes()<10?"0":"") + theDate.getMinutes() + ":"; retStr += (theDate.getSeconds()<10?"0":"") + theDate.getSeconds(); return retStr; } function takeYear(theDate) { x = theDate.getYear(); var y = x % 100; y += (y < 38) ? 2000 : 1900; return y; } function hideOrShowFieldset(img, div) { if(($(div).style.display)=='none') { Effect.Appear(div); $(img).src='i/collapse.gif'; } else { Effect.Fade(div); $(img).src='i/expand.gif'; } if(arguments.length==3) { div = arguments[2]; if(($(div).style.display)=='none') { Effect.Appear(div); } else { Effect.Fade(div); } } } function hideOrShowDivWithImg(img, div, src1, scr2) { if(($(div).style.display)=='none') { Effect.Appear(div); $(img).src=scr2; } else { Effect.Fade(div); $(img).src=src1; } } function hideOrShowDeliveryItems(img, div, div2) { if(($(div).style.display)=='none') { //$(div).style.position = ''; //$(div2).style.position = ''; Effect.Appear(div); Effect.Appear(div2); $(img).src='i/collapse.gif'; } else { Effect.Fade(div); Effect.Fade(div2); $(img).src='i/expand.gif'; } } function hideOrShowCrewPersonalItems(img, div) { if(($(div).style.display)=='none') { Effect.Appear(div); $(img).src='i/collapse.gif'; } else { Effect.Fade(div); $(img).src='i/expand.gif'; } } function checkPassword(pwd, strength) { var strongRegex = new RegExp("^(?=.{6,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g"); var mediumRegex = new RegExp("^(?=.{6,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g"); var enoughRegex = new RegExp("(?=.{6,}).*", "g"); if (pwd.value.length==0) { strength.innerHTML = ''; } else if (false == enoughRegex.test(pwd.value)) { strength.innerHTML = 'More Characters!'; } else if (strongRegex.test(pwd.value)) { strength.innerHTML = 'Strong!'; } else if (mediumRegex.test(pwd.value)) { strength.innerHTML = 'Medium!'; } else { strength.innerHTML = 'Weak!'; } } function loadAttachedCategory(select, tmp, a1val, a2val) { eval(tmp); var attached = document.getElementById(select.name + "_attached"); var secondAttached = document.getElementById(select.name + "_secondAttached"); var arr = eval("arr_" + select.name); //1. attached var size = 0; if(typeof arr[0][select.options.selectedIndex] != "undefined") size = arr[0][select.options.selectedIndex].length; attached.options.length = 0; if(size>0) { attached.disabled = false; for(var i=0;i0) { secondAttached.disabled = false; for(var i=0;i