/* DKD Functions to scroll layers */ function moveUp(obj,amt,limit){ if (limit==undefined) { limit =0; } if(parseInt(obj.style.top)>=limit) { window.clearTimeout(obj.timer); obj.style.top=parseInt(limit)+"px"; } else { obj.style.top=parseInt(obj.style.top)+amt+"px"; obj.timer =window.setTimeout("moveUp($('"+obj.id+"'),"+amt+","+limit+")", 20); } } // ------------- function moveDown(obj,amt,limit){ if (limit==undefined) { limit =(0-parseInt(jQuery(obj).height())); } if(parseInt(obj.style.top)<=limit) { window.clearTimeout(obj.timer); obj.style.top=parseInt(limit)+"px"; } else { obj.style.top=parseInt(obj.style.top)-amt+"px"; obj.timer =window.setTimeout("moveDown($('"+obj.id+"'),"+amt+","+limit+")", 20); } } // ------------- function moveLeft(obj,amt){ if(parseInt(obj.style.left)>=0) { window.clearTimeout(obj.timer); } else { obj.style.left=parseInt(obj.style.left)+amt+"px"; obj.timer =window.setTimeout("moveLeft($('"+obj.id+"'),"+amt+")", 20); } } // ------------- function moveRight(obj,amt){ if(parseInt(obj.style.left)<=((parseInt(obj.clientWidth)/2)-parseInt(obj.clientWidth))) { window.clearTimeout(obj.timer); } else { obj.style.left=parseInt(obj.style.left)-amt+"px"; obj.timer =window.setTimeout("moveRight($('"+obj.id+"'),"+amt+")",20); } } // ------------- function pgUpDn(obj,dir){ if (obj.parentElement.style.height==undefined) { alert('pgUpDn Error: No style set for parent element'); return; } var wHeight = parseInt(jQuery(obj).parent().height()); // window var cHeight = parseInt(jQuery(obj).height()); // content var pCount = parseInt(cHeight/wHeight)<(cHeight/wHeight) ? parseInt(cHeight/wHeight) : parseInt(cHeight/wHeight); var position = jQuery(obj).position(); var pCurrent = Math.round(parseInt(position.top)/wHeight); // current page pCurrent = pCurrent<0 ? pCurrent*-1 : pCurrent; var pNext = pCurrent+dir; window.status = "Page Count="+pCount+", Current="+pCurrent+", Set To ="+(pCurrent+dir)+", Window ="+wHeight; if(pNext>=0 && pNext<=pCount) { var ny =(0-((pCurrent+dir)*wHeight )); var position = jQuery(obj).position(); if(parseInt(position.top)>ny) { moveDown(obj,15,ny); } else if(parseInt(position.top) to_date) { alert(msg); return false; } return true; } function DateCheck(syr, smt, sdt, msg) { hdt=sdt[sdt.selectedIndex].value; hmt=smt[smt.selectedIndex].value; hyr=syr[syr.selectedIndex].value; hms_maxval=31; if ((hmt=="APR") || (hmt=="JUN") || (hmt=="SEP") || (hmt=="NOV")){hms_maxval=30;} if ((hmt=="FEB") && (hyr%4)==0){hms_maxval=29;} if ((hmt=="FEB") && (hyr%4)!=0){hms_maxval=28;} if (parseInt(hdt)>hms_maxval) { alert(msg); return false; } return true; } function validateLogin(form) { ErrorMsg = new Array(); ErrorMsg[0]="------------------------- The Following Errors Occured -------------------------" + String.fromCharCode(13); CheckFieldString("noblank",form.txtusername,"{$lang.signup_js_errors.username_noblank}"); CheckFieldString("noblank",form.txtpassword,"{$lang.signup_js_errors.password_noblank}"); CheckFieldString("alphanum",form.txtusername,"{$lang.signup_js_errors.username_charset}"); CheckFieldString("alphanum",form.txtpassword,"{$lang.signup_js_errors.password_charset}"); /* concat all error messages into one string */ result=""; if( ErrorCount > 0) { alert(ErrorMsg[1]); return false; } return true; } // After clicking a link to delete something, pops up a window asking the user to confirm // If the user clicks ok, it tacks delete=Y to the url. If the user clicks cancel, // it returns false which leaves the user on the page. // // Ex. Delete // function confirmLink(theLink, theMessage) { var is_confirmed = confirm(theMessage); if (is_confirmed) { theLink.href += '&delete=Y'; } return is_confirmed; } // After clicking a submit button, pops up a window asking the user to confirm // If the user clicks ok, it proceeds. If the user clicks cancel, it cancels submitting // the form // // ex. // function confirmButton(theMessage) { var is_confirmed = confirm(theMessage); return is_confirmed; } // The next two functions comprise the text counting for a text box. // function countCheck(countLimit) { if(document.frmCmt.comment.value.length > countLimit) { alert('Too many characters in the comment box!'); document.frmCmt.comment.focus(); return false; } else return true; } function countText(countLimit) { var old = document.frmCmt.counter.value; document.frmCmt.counter.value=document.frmCmt.comment.value.length; if(document.frmCmt.counter.value > countLimit && old <= countLimit) { alert('Too many characters in the comment box!'); if(document.styleSheets) { document.frmCmt.counter.style.fontWeight = 'bold'; document.frmCmt.counter.style.color = '#ff0000'; } } else if(document.frmCmt.counter.value <= countLimit && old > countLimit && document.styleSheets ) { document.frmCmt.counter.style.fontWeight = 'normal'; document.frmCmt.counter.style.color = '#000000'; } } function openInParentWindow(url) { window.opener.document.location.href=url; window.opener.focus(); }