/* Utility Scripts - Copyright (c) I.T. Beyond Pty Ltd */
if (typeof jQuery != "undefined") var $jq = jQuery.noConflict();

function movePanel(cid, me, offSetX, offSetY) { $jq('#' + cid).css({ top: $jq(me).offset().top + offSetX, left: $jq(me).offset().left + offSetY }); $jq('#' + cid).show(); }
function printPage() { window.print(); }
function WindowPreview(URL, dwidth, dheight) { var height = screen.height; var width = screen.width; if ((dheight == "") || (dheight == 0)) dheight = 250; if ((dwidth == "") || (dwidth == 0)) dwidth == 300; var leftpos = (width / 2) - (dwidth / 2); var toppos = (height / 2) - (dheight / 2); windowprops = 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=' + dwidth + ',height=' + dheight + ',left=' + leftpos + ',top=' + toppos; window.open(URL, "", windowprops) }
var RotateIndex = new Array(); function RotateImg(uid, imgArray, delay) { var instance = this; var timer; this.timer = timer; var cnt = 0; this.uid = uid; this.imgArray = imgArray; this.delay = delay; this.getCnt = function() { cnt += 1; return (cnt); }; this.setCnt = function() { cnt = 0; }; document.getElementById(this.uid).src = this.imgArray[0]; this.setTimer(); }
RotateImg.prototype.rotate = function() { var instance = this; dispcnt = this.getCnt(); if (dispcnt >= this.imgArray.length) { this.setCnt(); dispcnt = 0; }; document.getElementById(this.uid).src = this.imgArray[dispcnt]; this.setTimer(); }
RotateImg.prototype.setTimer = function() { var instance = this; var started = false; for (var i = 0; i < RotateIndex.length; i++) { if (RotateIndex[i].uid == this.uid) { RotateIndex[i].timerID = setTimeout(function() { instance.rotate() }, instance.delay); started = true; } } if (started == false) { var nextID = RotateIndex.length; RotateIndex[nextID] = new Object(); RotateIndex[nextID].uid = this.uid; RotateIndex[nextID].timerID = setTimeout(function() { instance.rotate() }, instance.delay); } }
function StopAllRotateImg() { for (var i = 0; i < RotateIndex.length; i++) { clearTimeout(RotateIndex[i].timerID); } }
function docwrite(src) { document.write(src) }
