/* Code Developed by Gilbert Martin II. Copyright (c) 2008-2020. Gilbert Martin & REWEB Hosting & Design. All Rights Reserved */
function WarnUserTimeout() {if (window.confirm("Your session has expired. \n\ You have to Log In again.")){window.navigate("default.asp?rct=swscl");}}
function HideContent(d) {if (d.length < 1) {return;} document.getElementById(d).style.display = "none";document.getElementById("showlink").style.display = "block";}
function ShowContent(d) {if (d.length < 1) {return;} document.getElementById(d).style.display = "block";document.getElementById("showlink").style.display = "none";}
function openEdit() {tinyMCE.execCommand('mceAddControl',false,'tmceEditor');tinyMCE.execInstanceCommand('tmceEditor','mceFullScreen');}
var message='';
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) 
{if (document.layers||(document.getElementById&&!document.all)) {if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else {document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function('return false')
var omitformtags=['input', 'textarea', 'select']
omitformtags=omitformtags.join('|')
function disableselect(e){if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1) {return false}}
document.onkeydown = function () {if (122 == event.keyCode) {event.keyCode = 0;return false;}}
function areyousure(url){var message = "Are you sure you want to delete this record?";var return_value = confirm(message);if (return_value == true) {window.navigate(url);} else {return false;}}
function detect(){var framesetpage = "default.asp";if (parent.location.href == window.location.href) {parent.location.href    = framesetpage;}}
function noframes() {if (top.location != location) {top.location.href = document.location.href ;}}
function checkmax(fld,val) {if (parseInt(fld.value) > parseInt(val)) {fld.value = val}}
var DYNIFS = {
iframes: {},
oldresize: null,
ready: false,
dim: [-1,-1],
timerID: 0,
getDim: function(d) {
var w=200, h=200, scr_h, off_h;
if( d.height ) { return [d.width,d.height]; }
with( d.body ) {
if( scrollHeight ) { h=scr_h=scrollHeight; w=scrollWidth; }
if( offsetHeight ) { h=off_h=offsetHeight; w=offsetWidth; }
if( scr_h && off_h ) h=Math.max(scr_h, off_h);
}
return [w,h];
},
onresize: function() {
if( typeof this.oldresize == 'function' ) { this.oldresize(); }
var dim = this.getDim(document);
if( this.dim[0] == dim[0] && this.dim[1] == dim[1] ) return;
if( this.timerID ) return;
this.timerID = setTimeout('DYNIFS.deferred_resize();', 10);
},
deferred_resize: function() {
for( var id in this.iframes ) this.resize(id);
this.dim = this.getDim(document);
this.timerID = 0;
},
resize: function(id) {
if( !window.frames || !window.frames[id] || !document.getElementById || !document.body )
return;
var iframe = window.frames[id];
var div = document.getElementById(id);
if( !div ) return;
if( !this.iframes[id] ) {
this.iframes[id] = true;
}
if( !this.ready ) {
this.ready = true;
this.oldresize = window.onresize;
window.onresize = new Function('DYNIFS.onresize();');
}
if( document.all ) div.style.height = '0px';
var dim = this.getDim(iframe.document);
div.style.height = (dim[1]+30) + 'px';
}
};
