//////////////////////////////////////////////////////////////////// // © 2004 SightWorks, LLC. All Rights Reserved. // This programming code is the property of SightWorks. LLC // Reproduction and use of this code is by permission only. // Removal of this text header is unlawful and forbidden. // Contact Information: info@sightworks.com //////////////////////////////////////////////////////////////////// /* fieldFocus - forces input focus to the fieldName input element */ function fieldFocus(fieldName) { try { var oItem = document.getElementById(fieldName); oItem.focus(); oItem.select(); } catch(e) { } } function showLayer(layerID) { ShowLayer(layerID); } function hideLayer(layerID) { HideLayer(layerID); } /* ShowLayer - Makes a hidden and/or non-displayed element visible and sets display to 'block' */ function ShowLayer(layerID) { var style_sheet = getStyleObject(layerID); if (style_sheet) { //hideAll(); changeObjectVisibility(layerID, "visible"); changeObjectDisplay(layerID, "block"); } else { status = "Layer not found: " + layerID; } } /* HideLayer - Makes a visible and/or displayed element hidden and sets display to 'none' */ function HideLayer(layerID) { var style_sheet = getStyleObject(layerID); if (style_sheet) { //hideAll(); changeObjectVisibility(layerID, "hidden"); changeObjectDisplay(layerID, "none"); } else { status = "Layer not found: " + layerID; } } /* getStyleObject - Get the style object for a given element, required for cross-browser compatability */ function getStyleObject(objectId) { // checkW3C DOM, then MSIE 4, then NN 4. // if(document.getElementById && document.getElementById(objectId)) { return document.getElementById(objectId).style; } else if (document.all && document.all(objectId)) { return document.all(objectId).style; } else if (document.layers && document.layers[objectId]) { return document.layers[objectId]; } else { return false; } } /* getObject - Get the object for a given element, required for cross-browser compatability */ function getObject(objectId) { // checkW3C DOM, then MSIE 4, then NN 4. // if(document.getElementById && document.getElementById(objectId)) { return document.getElementById(objectId); } else if (document.all && document.all(objectId)) { return document.all(objectId); } else if (document.layers && document.layers[objectId]) { return document.layers[objectId]; } else { return false; } } function getPageObject(objectId) { // checkW3C DOM, then MSIE 4, then NN 4. // if(document.getElementById && document.getElementById(objectId)) { return document.getElementById(objectId); } else if (document.all && document.all(objectId)) { return document.all(objectId); } else if (document.layers && document.layers[objectId]) { return document.layers[objectId]; } else { return false; } } function changeObjectVisibility(objectId, newVisibility) { // first get the object's stylesheet var styleObject = getStyleObject(objectId); // then if we find a stylesheet, set its visibility // as requested // if (styleObject) { styleObject.visibility = newVisibility; return true; } else { return false; } } function changeObjectDisplay(objectId, newDisplay) { // first get the object's stylesheet var styleObject = getStyleObject(objectId); if (styleObject) { styleObject.display = newDisplay; return true; } else { return false; } } function moveLayer(objectId,x,y) { var styleObject = getStyleObject(objectId); styleObject.top = y; styleObject.left = x; } function showTip(layerID,x,y) { moveLayer(layerID,x,y); ShowLayer(layerID); } function preloadImages() { var d=document; if(d.images){ if(!d.p) d.p=new Array(); var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i= 4) { win.window.focus(); } } // HANDLE TABLE ROW HIGHLIGHT ON MOUSEOVER function listMouseOver(layerID) { if (document.layers) { document.layers[layerID].bgColor='#FFFF99'; } else if (document.all) { document.all[layerID].style.background='#FFFF99'; } } function listMouseOver2(layerID, color) { if (document.layers) { document.layers[layerID].bgColor=color; } else if (document.all) { document.all[layerID].style.background=color; } } function listMouseOut(layerID, oldColor) { if (document.layers) { document.layers[layerID].bgColor=oldColor; } else if (document.all) { document.all[layerID].style.background=oldColor; } } // LINK TO URL WHEN ROW IS CLICKED function listClickRow(URL) { document.location = URL; } // SHOW HIDE LAYER /*function showLayer(id) { document.getElementById(id).style.visibility="visible"; document.getElementById(id).style.display="block"; } // SHOW HIDE LAYER function hideLayer(id) { document.getElementById(id).style.visibility="hidden"; document.getElementById(id).style.display="none"; } */ // CENTERED POP UP WINDOW function newWindow(mypage, myname, w, h, scroll) { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',noresize'; win = window.open(mypage, myname, winprops) if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } } // GET POPUP DATE SET CALENDAR function fillDate(y, m, d) { function setselectbyvalue(theSelect,avalue) { for( var i=0,n=theSelect.options.length; i= startVal && oTween.curVal > endVal) || if ((dtNow - oTween.timeStart ) > oTween.time) { if(callBack != 'undefined') { eval(callBack + "(oTween);"); } return; } else { var val = new Array(4); if(prop == "clip") { for(i = 0; i < startVal.length; i++) { if(startVal[i] == "auto") { val[i] = "auto"; } else { val[i] = Math.ceil(findTweenValue (parseInt(startVal[i]), parseInt(endVal[i]), oTween.timeStart, dtNow, oTween.timeStart + oTween.time, animType,0,0) ); } } oTween.curVal = val; status = oTween.curVal; // alert("oStyle." + oTween.prop + "=\"rect(" + oTween.curVal[0] +oTween.valSuffix[0]+" " + oTween.curVal[1] + // oTween.valSuffix[1]+" " +oTween.curVal[2] +oTween.valSuffix[2]+" " +oTween.curVal[3] +oTween.valSuffix[3]+ ")\";"); eval("oStyle." + oTween.prop + "=\"rect(" + oTween.curVal[0] +oTween.valSuffix[0]+" " + oTween.curVal[1] + oTween.valSuffix[1]+" " +oTween.curVal[2] +oTween.valSuffix[2]+" " +oTween.curVal[3] +oTween.valSuffix[3]+ ")\";"); strTimeout = 'tweenProperty(\'' + layerID + '\',\''+ prop + '\',['+ startVal + '],['+ endVal + '],\''+ oTween.time +'\',\'' + animType + '\',\'' + valSuffix + '\',\'' + callBack +'\',\'' + extra1 +'\',\'' + extra2 + '\');'; } else { var val = findTweenValue (parseInt(startVal), parseInt(endVal), oTween.timeStart, dtNow, oTween.timeStart + oTween.time, animType,0,0) ; // var val = parseInt(oTween.curVal) + parseInt(step); //oTween.curVal = ; //alert(val); oTween.curVal = val; eval("oStyle." + oTween.prop + "='" + oTween.curVal +oTween.valSuffix+ "';"); strTimeout = 'tweenProperty(\'' + layerID + '\',\''+ prop + '\',\''+ startVal + '\',\''+ endVal + '\',\''+ oTween.time +'\',\'' + animType + '\',\'' + valSuffix + '\',\'' + callBack +'\',\'' + extra1 +'\',\'' + extra2 + '\');'; } //status = "oStyle." + oTween.prop + "=" + oTween.curVal + ";" + step +";" ; //alert('tweenProperty(\'' + layerID + '\',\''+ prop + '\',\''+ startVal + '\',\''+ endVal + '\',\''+ oTween.time +'\',\'' + animType + '\',\'' + valSuffix + '\',\'' + callBack +'\',\'' + extra1 +'\',\'' + extra2 + '\');'); try{ //alert(strTimeout); oTween.curTimer = setTimeout(strTimeout,10); } catch(e) { } } } function findTweenValue (_propStart, _propDest, _timeStart, _timeNow, _timeDest, _animType, _extra1, _extra2) { var t = _timeNow - _timeStart; // current time (frames, seconds) var b = _propStart; // beginning value var c = _propDest - _propStart; // change in value var d = _timeDest - _timeStart; // duration (frames, seconds) var a = _extra1; // amplitude (optional - used only on *elastic easing) var p = _extra2; // period (optional - used only on *elastic easing) var s = _extra1; // overshoot ammount (optional - used only on *back easing) var val; var foo = document.getElementById("debug"); //foo.innerHTML += "c=" + c + " : t=" + t + " : d=" + d + " : val=" + val + "anim=" + _animType + "
"; //status = "c=" + c + " : t=" + t + " : d=" + d + " : val=" + val + "
"; switch (_animType.toLowerCase()) { case "linear": // simple linear tweening - no easing return c*t/d + b; case "easeinquad": // quadratic (t^2) easing in - accelerating from zero velocity return c*(t/=d)*t + b; case "easeoutquad": // quadratic (t^2) easing out - decelerating to zero velocity return -c *(t/=d)*(t-2) + b; case "easeinoutquad": // quadratic (t^2) easing in/out - acceleration until halfway, then deceleration if ((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; case "easeincubic": // cubic (t^3) easing in - accelerating from zero velocity return c*(t/=d)*t*t + b; case "easeoutcubic": // cubic (t^3) easing out - decelerating to zero velocity return c*((t=t/d-1)*t*t + 1) + b; case "easeinoutcubic": // cubic (t^3) easing in/out - acceleration until halfway, then deceleration if ((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; case "easeinquart": // quartic (t^4) easing in - accelerating from zero velocity return c*(t/=d)*t*t*t + b; case "easeoutquart": // quartic (t^4) easing out - decelerating to zero velocity return -c * ((t=t/d-1)*t*t*t - 1) + b; case "easeinoutquart": // quartic (t^4) easing in/out - acceleration until halfway, then deceleration if ((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; case "easeinquint": // quintic (t^5) easing in - accelerating from zero velocity return c*(t/=d)*t*t*t*t + b; case "easeoutquint": // quintic (t^5) easing out - decelerating to zero velocity return c*((t=t/d-1)*t*t*t*t + 1) + b; case "easeinoutquint": // quintic (t^5) easing in/out - acceleration until halfway, then deceleration if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; case "easeinsine": // sinusoidal (sin(t)) easing in - accelerating from zero velocity return -c * Math.cos(t/d * (Math.PI/2)) + c + b; case "easeoutsine": // sinusoidal (sin(t)) easing out - decelerating to zero velocity return c * Math.sin(t/d * (Math.PI/2)) + b; case "easeinoutsine": // sinusoidal (sin(t)) easing in/out - acceleration until halfway, then deceleration return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; case "easeinexpo": // exponential (2^t) easing in - accelerating from zero velocity return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; case "easeoutexpo": // exponential (2^t) easing out - decelerating to zero velocity return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; case "easeinoutexpo": // exponential (2^t) easing in/out - acceleration until halfway, then deceleration if (t==0) return b; if (t==d) return b+c; if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; case "easeincirc": // circular (sqrt(1-t^2)) easing in - accelerating from zero velocity //foo.innerHTML += "
" + t +"
"; val = -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; //foo.innerHTML += "b=" + b + " : c=" + c + " : t=" + t + " : d=" + d + " : val=" + val + "

"; return val; case "easeoutcirc": // circular (sqrt(1-t^2)) easing out - decelerating to zero velocity return c * Math.sqrt(1 - (t=t/d-1)*t) + b; case "easeinoutcirc": // circular (sqrt(1-t^2)) easing in/out - acceleration until halfway, then deceleration if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; case "easeinelastic": // elastic (exponentially decaying sine wave) if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; case "easeoutelastic": // elastic (exponentially decaying sine wave) if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; case "easeinoutelastic": // elastic (exponentially decaying sine wave) if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; // Robert Penner's explanation for the s parameter (overshoot ammount): // s controls the amount of overshoot: higher s means greater overshoot // s has a default value of 1.70158, which produces an overshoot of 10 percent // s==0 produces cubic easing with no overshoot case "easeinback": // back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing in - backtracking slightly, then reversing direction and moving to target if (s == undefined) s = 1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; case "easeoutback": // back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out - moving towards target, overshooting it slightly, then reversing and coming back to target if (s == undefined) s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; case "easeinoutback": // back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing in/out - backtracking slightly, then reversing direction and moving to target, then overshooting target, reversing, and finally coming back to target if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; // This were changed a bit by me (since I'm not using Penner's own Math.* functions) // So I changed it to call findTweenValue() instead (with some different arguments) case "easeinbounce": // bounce (exponentially decaying parabolic bounce) easing in return c - findTweenValue (0, c, 0, d-t, d, "easeOutBounce") + b; case "easeoutbounce": // bounce (exponentially decaying parabolic bounce) easing out if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; } case "easeinoutbounce": // bounce (exponentially decaying parabolic bounce) easing in/out if (t < d/2) return findTweenValue (0, c, 0, t*2, d, "easeInBounce") * .5 + b; return findTweenValue(0, c, 0, t*2-d, d, "easeOutBounce") * .5 + c*.5 + b; } return val; } //***Cross browser attach event function. For 'evt' pass a string value with the leading "on" omitted //***e.g. AttachEvent(window,'load',MyFunctionNameWithoutParenthesis,false); function AttachEvent(obj,evt,fnc,useCapture){ try { if (!useCapture) useCapture=false; if (obj.addEventListener){ obj.addEventListener(evt,fnc,useCapture); return true; } else if (obj.attachEvent) return obj.attachEvent("on"+evt,fnc); else{ MyAttachEvent(obj,evt,fnc); obj['on'+evt]=function(){ MyFireEvent(obj,evt) }; } } catch(e) { } } //The following are for browsers like NS4 or IE5Mac which don't support either //attachEvent or addEventListener function MyAttachEvent(obj,evt,fnc){ try { if (!obj.myEvents) obj.myEvents={}; if (!obj.myEvents[evt]) obj.myEvents[evt]=[]; var evts = obj.myEvents[evt]; evts[evts.length]=fnc; } catch (e) {} } function MyFireEvent(obj,evt){ try { if (!obj || !obj.myEvents || !obj.myEvents[evt]) return; var evts = obj.myEvents[evt]; for (var i=0,len=evts.length;i