dhtml = function() {
this.alert_window_count = 0;
this.layer_list = new Array();
this.post_vars = new Array();
}
/*
This function will display a quick alert box
*/
dhtml.prototype.alert = function(data, single, options) {
if (this.alert_window_count < 0) {
this.alert_window_count = 0;
}
alert_layer_id = "common_alert_layer";
if ((single==undefined || single=="" ) && !document.getElementById(alert_layer_id+"_text")) {
alert_layer = document.createElement("div");
alert_layer.id = alert_layer_id;
alert_layer.style.position = "absolute";
start = this.alert_window_count;
alert_layer.style.top = start+"%";
alert_layer.style.left = start+"%";
str = "
";
str += "(Close | Close All)";
alert_layer.innerHTML = str;
document.body.appendChild(alert_layer);
this.layer_list.push(alert_layer);
this.alert_window_count += 15;
}
else {
textarea = document.getElementById(alert_layer_id+"_text");
}
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
var hours = currentTime.getHours()
var minutes = currentTime.getMinutes()
var seconds = currentTime.getSeconds()
textarea = document.getElementById(alert_layer_id+"_text");
d = month+"/"+day+"/"+year+" "+hours+":"+minutes+":"+seconds;
textarea.value = "*********"+d+"****************\n\n"+data + "\n\n\n\n\n\n\n\n" + textarea.value;
}
/*
function closes a single alert layer
*/
dhtml.prototype.close_alert_layer = function(layer) {
if (typeof(layer) == "string") {
layer = document.getElementById(layer);
}
this.remove_node(layer)
this.alert_window_count -= 2;
return false;
}
/*
function closes every layer that was generated from the alert
*/
dhtml.prototype.close_all_alert_layers = function() {
for (x in this.layer_list) {
this.remove_node(this.layer_list[x]);
}
this.layer_list = new Array();
this.alert_window_count = 0;
}
/*
This function returns the style from the array inline
*/
dhtml.prototype.get_inline_style = function(name, myStyles) {
style_str = "";
style_str += "";
return style_str;
}
/*
This function will show the page as loading
*/
dhtml.prototype.hide_loading = function() {
this.remove_node("dhtml_load_overlay");
this.remove_node("dhtml_load_box");
}
/*
This function will return the entries from a drop down list to a database
*/
dhtml.prototype.load_template_file_from_options = function(site, file_struct, container_id, options, callback) {
ajax_vals = new Object();
options = options.split(",");
for (x=0; x| "+content+" |
"
load_box.innerHTML += str;
container.appendChild(load_box);
}
/*
This function takes the given id and refreshes the data based on the db info
*/
dhtml.prototype.refresh_data = function(data_container, class_name, func_name, params, required, callback) {
if (callback == undefined) {
callback = {
handleSuccess:function(xmlhttp) {
if (document.getElementById(data_container)) {
document.getElementById(data_container).innerHTML = xmlhttp.responseText;
}
}
}
}
ajax.get_function_data(class_name, func_name, params, required, callback);
}
var dhtml = new dhtml();