var mouse_x=0;
var mouse_y=0;
var load_flag=0;
var Temp = new Object;
var plans_options = new Array();
var active_event_id = "";
var active_series_id = "";
var active_day_timestamp = "";
var current_calendar_id = "";
var dialog_box = null;
var info_window = new Object;
var info_window_width = 400;
var info_window_height = 400;
var plans_url = "";
var theme_url = "";
var css_path_url = "";
var page_width = 0;
var page_height = 0;
var event_target = null;
var browser_type = null;
var cal_password = '';
var logged_in = false;
// I hate this kludge!
//var context_menu_visible=false;
var calendars = new Array();
var events = new Array();
var pending_events = new Array();
var users = new Array();
var current_user = null;
var success = false;
var messages = "";
// this should always be called by
"+get_lang('logout')+"";
}
else {
var text = "";
return_text += "
"+plans_lang['add_user_name']+":
";
return_text += "
";
return_text += "
"+plans_lang['user_password']+":
";
return_text += "
";
if (users[user_id]) {
return_text += "
"+plans_lang['user_new_password']+":
";
return_text += "
";
return_text += "
"+plans_lang['repeat_new_password']+":
";
return_text += "
";
}
else {
return_text += "
"+plans_lang['repeat_password']+":
";
return_text += "
";
}
if (!logged_in) {
return_text += "
"+plans_lang['calendar_password']+":
";
return_text += "
";
}
temp = (users[user_id]) ? plans_lang['update_user'] : plans_lang['add_user']
return_text += "
";
if (users[user_id])
return_text += "
";
return_text += "
";
/*
return_text += "";
$lang{permissions_edit_events}
$lang{permissions_edit_calendar}
*/
dialog_box_init();
dialog_box.reset();
temp = (users[user_id]) ? plans_lang['edit_user'] : plans_lang['add_user']
dialog_box.setTitle(temp);
dialog_box.element.style.display = "block";
if (users[user_id]) {
dialog_box.anchor(document.getElementById(user_id+'_edit_user_link'))
} else {
dialog_box.anchor(document.getElementById('add_user_link'))
}
dialog_box.setContents(return_text);
}
function add_edit_user_submit(delete_flag) {
var user_id =(Temp.user_id) ? Temp.user_id : '';
var name = document.getElementById('user_name').value;
var password = document.getElementById('user_password').value;
var new_password = (document.getElementById('user_new_password')) ? document.getElementById('user_new_password').value : "";
var repeat_password = document.getElementById('user_repeat_password').value;
var delete_user = (delete_flag)? 1 : "";
var url = plans_url+"?add_edit_user=1&cal_id="+current_calendar_id+"&user_id="+user_id+"&delete="+delete_user+"&name="+name+"&password="+password+"&new_password="+new_password+"&repeat_password="+repeat_password;
if (document.getElementById('cal_password'))
url+= '&cal_password='+document.getElementById('user_cal_password').value;
//alert("url: "+url);
try {
xmlhttp.open("GET", url, true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
//alert(xmlhttp.responseText);
eval(xmlhttp.responseText);
if (success) list_users();
update_messages(messages);
}
}
xmlhttp.send(null)
} catch (e) {} // do nothing
dialog_box.close();
}
function fade_preview()
{
document.getElementById("bg_preview_e1").style.background = fade("#ffffcc", (1+parseInt(document.update_cal_form.background_events_fade_factor.value)));
document.getElementById("bg_preview_e2").style.background = fade("#ccffff", (1+parseInt(document.update_cal_form.background_events_fade_factor.value)));
}
function fade(color, fade_factor)
{
if (!color.match(/#([0-9]|[A-F]){6}/i)) // valid hex #color?
return false;
var rgb = hex2rgb(color.substring(1,7));
var hsv = rgb2hsv(rgb);
hsv[1] = hsv[1] / fade_factor;
var new_rgb = hsv2rgb(hsv);
return "rgb("+new_rgb[0]+","+new_rgb[1]+","+new_rgb[2]+")";
}
function add_new_ical() {
dialog_box_init();
dialog_box.reset();
;
var text = ''
text += '
'+plans_lang['ical_url']+':
';
text += '
';
text += '
'+plans_lang['add_ical']+' ';
cc}
function add_new_ical_submit() {
ical_url = document.getElementById('ical_url').value;
try {
xmlhttp.open("GET", plans_url+"?add_new_ical=1&ical_url="+ical_url,true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
//alert(xmlhttp.responseText);
eval(xmlhttp.responseText);
update_messages(messages);
if (success) dialog_box.close();
}
}
xmlhttp.send(null)
} catch (e) {} // do nothing
}
function dialog_box_init() {
if (!dialog_box)
{
dialog_box = new DialogBox({'id':'dialog_box','element_id':'plans_dialog_box'});
}
}
function list_users() {
if (!users || users.length == 0) return;
var results = "";
//for (i=0;i
('+get_lang('edit')+') ';
}
if (document.getElementById('select_users'))
document.getElementById('select_users').innerHTML = results;
}
function tab_show(tab_num)
{
if (tab_num == null) return;
var elList, i;
i=0;
// update all tabs.
while (document.getElementById("tab"+i) && i<100)
{
if (i == tab_num)
{
// If the tab is the new active tab, activate it.
document.getElementById("tab"+i).className += " active";
document.getElementById("tab_area"+i).style.display=""
document.getElementById("tab"+i).blur();
}
else
{
// Otherwise, make sure the tab is deactivated.
removename (document.getElementById("tab"+i),"active");
document.getElementById("tab_area"+i).style.display="none"
}
i++;
}
}
function toggle_visible(elname)
{
if (document.getElementById(elname) == null) return;
el = document.getElementById(elname);
if (el.style.display == "none")
el.style.display = ""
else
el.style.display = "none"
}
function toggle_login(elname)
{
toggle_visible(elname);
if ((document.getElementById('login_switch').innerHTML == '[x]'))
{
document.getElementById('login_switch').innerHTML = 'login';
document.getElementById('login_switch').style.top = '0';
document.getElementById('login_switch').style.left = '0';
}
else {
document.getElementById('login_switch').innerHTML = '[x]';
document.getElementById('login_switch').style.top = '-10px';
document.getElementById('login_switch').style.left = '5px';
}
}
function recur_toggle() {
if (document.add_event_form.recurring_event.checked)
{
document.add_event_form.recurrence_type[0].disabled=false;
document.add_event_form.recurrence_type[1].disabled=false;
document.add_event_form.recurrence_type[2].disabled=false;
document.add_event_form.recurrence_type[3].disabled=false;
document.add_event_form.weekday_of_month_type.disabled=false;
document.add_event_form.custom_months.disabled=false;
document.add_event_form.year_fit_type[0].disabled=false;
document.add_event_form.year_fit_type[1].disabled=false;
document.add_event_form.custom_months.disabled=false;
if (!document.add_event_form.recurrence_type[1].checked)
document.add_event_form.weekday_of_month_type.disabled=true;
if (document.add_event_form.year_fit_type[0].checked)
document.add_event_form.custom_months.disabled=true;
document.add_event_form.recur_end_date.disabled=false;
}
else
{
document.add_event_form.recurrence_type[0].disabled=true;
document.add_event_form.recurrence_type[1].disabled=true;
document.add_event_form.recurrence_type[2].disabled=true;
document.add_event_form.recurrence_type[3].disabled=true;
setTimeout("document.add_event_form.every_x_days.disabled=true",100);
setTimeout("document.add_event_form.every_x_weeks.disabled=true",100);
setTimeout("document.add_event_form.weekday_of_month_type.disabled=true",100);
setTimeout("document.add_event_form.custom_months.disabled=true",100);
document.add_event_form.year_fit_type[0].disabled=true;
document.add_event_form.year_fit_type[1].disabled=true;
document.add_event_form.custom_months.disabled=true;
document.add_event_form.recur_end_date.disabled=true;
}
recurrence_type_update();
//alert(document.add_event_form.recurring_event.checked);
}
function recurrence_type_update(last)
{
document.add_event_form.weekday_of_month_type.disabled=true;
document.add_event_form.every_x_days.disabled=true;
document.add_event_form.every_x_weeks.disabled=true;
if (document.add_event_form.recurrence_type[1].checked && !document.add_event_form.recurrence_type[1].disabled)
{
document.add_event_form.weekday_of_month_type.disabled=false;
}
if (document.add_event_form.recurrence_type[2].checked && !document.add_event_form.recurrence_type[2].disabled)
{
document.add_event_form.every_x_days.disabled=false;
}
if (document.add_event_form.recurrence_type[3].checked && !document.add_event_form.recurrence_type[3].disabled)
{
document.add_event_form.every_x_weeks.disabled=false;
}
if (!last) setTimeout("recurrence_type_update(true)",100);
}
function update_remote_calendar_requests()
{
if (!document.update_cal_form || !document.update_cal_form.allow_remote_calendar_requests)
return;
if (document.update_cal_form.allow_remote_calendar_requests.checked)
{
document.update_cal_form.remote_calendar_requests_require_password.disabled = false;
if (document.update_cal_form.remote_calendar_requests_require_password.checked)
document.update_cal_form.remote_calendar_requests_password.disabled = false;
}
}
function show_event_contextmenu(e, event_id, menu_bgcolor, series_id)
{
if (e.ctrlKey || plans_options['right_click_menus_enabled'] != 1) return true;
active_event_id = event_id;
active_series_id = series_id;
var themenu = document.getElementById("contextmenu")
var event_contextmenu_text = "";
themenu.innerHTML = event_contextmenu_text;
document.getElementById("contextmenu_innerbox").style.borderStyle = "solid";
document.getElementById("contextmenu_innerbox").style.borderWidth = "1px";
document.getElementById("contextmenu_innerbox").style.borderTopColor = menu_bgcolor;
document.getElementById("contextmenu_innerbox").style.borderLeftColor = menu_bgcolor;
show_contextmenu(themenu, e);
return false;
}
function show_day_contextmenu(e, day_timestamp)
{
if (e.ctrlKey || plans_options['right_click_menus_enabled'] != 1) return true;
get_page_boundaries();
active_day_timestamp = day_timestamp;
var themenu = document.getElementById("contextmenu")
var day_contextmenu_text = "";
day_contextmenu_text += "";
themenu.innerHTML = day_contextmenu_text;
document.getElementById("contextmenu_innerbox").style.borderStyle = "solid";
document.getElementById("contextmenu_innerbox").style.borderWidth = "1px";
document.getElementById("contextmenu_innerbox").style.borderTopColor = "#ffffff";
document.getElementById("contextmenu_innerbox").style.borderLeftColor = "#ffffff";
show_contextmenu(themenu, e);
return false;
}
function show_contextmenu(contextmenu, event) {
get_page_boundaries();
contextmenu.style.left = mouse_x+"px";
contextmenu.style.top = mouse_y+"px";
contextmenu.style.zIndex = 100000;
contextmenu.style.visibility = "visible";
// adjust menu if near window edge
if (browser_type != "IE")
{
if (distance_to_right_edge < contextmenu.offsetWidth)
contextmenu.style.left = 2+mouse_x - contextmenu.offsetWidth+"px";
if (distance_to_bottom < contextmenu.offsetHeight)
contextmenu.style.top = 2+mouse_y - contextmenu.offsetHeight+"px";
}
// prevent default right-click menu from appearing.
//if (browser_type == "IE")
event.cancelBubble = true;
if (event.stopPropagation) event.stopPropagation();
if (event.preventDefault) event.preventDefault();
}
function hide_contextmenus()
{
document.getElementById("contextmenu").style.visibility = "hidden";
//context_menu_visible = false;
}
function context_menuitem_highlight(element, color)
{
element.className = "context_menuitem_highlight";
}
function context_menuitem_unhighlight(element)
{
element.className = "context_menuitem";
}
function edit_event()
{
window.location.href = plans_url + "?active_tab=1&add_edit_event=edit&evt_id=" + active_event_id + "";
}
function add_event_on_day()
{
window.location.href = plans_url + "?active_tab=1&cal_id="+current_calendar_id+"&add_edit_event=add&add_date_timestamp=" + active_day_timestamp;
}
function delete_event()
{
var info_window_x = window_x()-400;
var info_window_y = window_y();
info_window = this.open("", "info_window", "resizable=yes,status=yes,scrollbars=yes,top="+info_window_y+",left="+info_window_x+",width=400,height=200");
doc = info_window.document;
doc.open('text/html');
doc.write('');
doc.write(''+get_lang('delete_event')+' ');
doc.write(' ');
doc.write(' ');
doc.write('');
var delete_event_text = "";
delete_event_text += ""+get_lang('delete_event')+"
";
delete_event_text += "";
delete_event_text += "
');
doc.write('');
doc.close();
info_window.focus();
}
function approve_pending_events_toggle() {
var results = '';
if (document.getElementById('pending_events').style.display == 'block')
{
document.getElementById('pending_events').style.display = 'none';
return;
}
results += ""
for (var pending_events_id in pending_events)
{
//results += pending_events_id + ' ';
results += generate_pending_event(pending_events[pending_events_id]);
//results += "asdf";
}
results += " ";
results += ""+get_lang('email_reminder_text5')+" ";
results += " ";
document.getElementById('pending_events').innerHTML = results;
document.getElementById('pending_events').style.display = 'block';
}
function approve_pending_events_submit() {
var events_to_approve = new Array();
var events_to_delete = new Array();
// get approved events
for (pending_event_id in pending_events)
{
var approve_el = document.getElementById("pending_event_approve_"+pending_event_id);
var delete_el = document.getElementById("pending_event_delete_"+pending_event_id);
if (approve_el && approve_el.checked)
events_to_approve.push(pending_event_id);
if (delete_el && delete_el.checked)
events_to_delete.push(pending_event_id);
}
if (events_to_approve.length == 0 && events_to_delete.length == 0) {
alert(get_lang('no_pending_events_checked'));
return;
}
if (!logged_in && cal_password == '') {
var text = ''
text += ''+plans_lang['calendar_password']+':
';
text += '
';
text += 'ok ';
dialog_box_init();
dialog_box.reset();
dialog_box.setTitle("Password Needed");
dialog_box.setContents(text);
dialog_box.element.style.display = "block";
dialog_box.anchor(document.getElementById('tab_menu'))
return;
}
var url = plans_url+"?manage_pending_events=1&approve="+events_to_approve+"&delete="+events_to_delete;
if (cal_password != '')
url += "&cal_password="+cal_password;
try {
xmlhttp.open("GET", url, true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
//alert(xmlhttp.responseText);
eval(xmlhttp.responseText);
update_messages(messages);
}
}
xmlhttp.send(null)
} catch (e) {} // do nothing
//alert("events_to_approve: "+ events_to_approve + "\nevents_to_delete: "+ events_to_delete);
}
function do_onresize()
{
if (document.body.clientWidth) {
opener.info_window_width = document.body.clientWidth;
opener.info_window_height = document.body.clientHeight;
} else if (this.outerWidth) {
opener.info_window_width = this.outerWidth;
opener.info_window_height = this.outerHeight;
}
}
function display_event(evt_id)
{
var info_window_x = window_x()-info_window_width;
var info_window_y = window_y();
if (evt_id.match(/^r/)) // remote event
{
var URL_string = remote_event_details[evt_id].url;
info_window = this.open(URL_string, "info_window", "resizable=yes,status=yes,scrollbars=yes,top="+info_window_y+",left="+info_window_x+",width="+info_window_width+",height="+info_window_height);
}
else // local event
{
var URL_string = plans_url+"?view_event=1&evt_id="+evt_id;
info_window = this.open(URL_string, "info_window", "resizable=yes,status=yes,scrollbars=yes,top="+info_window_y+",left="+info_window_x+",width="+info_window_width+",height="+info_window_height);
}
info_window.focus();
}
function display_pending_event(pending_event_id)
{
var info_window_x = window_x()-info_window_width;
var info_window_y = window_y();
var URL_string = plans_url+"?view_pending_event=1&pending_event_id="+pending_event_id;
info_window = this.open(URL_string, "info_window", "resizable=yes,status=yes,scrollbars=yes,top="+info_window_y+",left="+info_window_x+",width="+info_window_width+",height="+info_window_height);
info_window.focus();
}
function generate_pending_event(event) {
var results = "";
results += "";
results += generate_list_event(event, "javascript:display_pending_event("+event.id+")");
results +="
"
return results;
}
function generate_list_event(event, link) {
var results = "";
var date_string;
var weekday_string;
//var start_date = new Date(event.start*1000);
//date_string = plans_lang[] $months_abv[$event_start_timestamp_array[4]] $event_start_timestamp_array[3]";
//weekday_string = $day_names_abv[$event_start_timestamp_array[6]]
var nice_start_date = nice_date(event.start, event.end);
results += ""+nice_start_date;
// else #multi-day event
// {
// @event_end_timestamp_array = gmtime $event{end};
// if ($event_start_timestamp_array[4] eq $event_end_timestamp_array[4])
// {
// $date_string="$months_abv[$event_start_timestamp_array[4]] $event_start_timestamp_array[3]-$event_end_timestamp_array[3]";
// }
// else
// {
//// $date_string="$months_abv[$event_start_timestamp_array[4]] $event_start_timestamp_array[3] - $months_abv[$event_end_timestamp_array[4]] $event_end_timestamp_array[3]";
// }
// $weekday_string = "$day_names_abv[$event_start_timestamp_array[6]]-$day_names_abv[$event_end_timestamp_array[6]]";
// }
if (event.icon && event.icon != "blank") results += " ";
results += ""+event.title+" ";
results += " "
return results;
}
function nice_date(start, end) {
start = new Date(start*1000);
end = new Date(end*1000);
var results = "";
var separator_string = " - ";
if (date_format == 'dd/mm/yy')
{
if (start.getUTCMonth() == end.getUTCMonth() && start.getUTCFullYear() == end.getUTCFullYear() && start.getUTCDate() == end.getUTCDate())
{ //same year, same month, same day
results = start.getUTCDate()+" "+plans_lang['months'][start.getUTCMonth()]+","+start.getUTCFullYear();
}
else if (start.getUTCMonth() == end.getUTCMonth() && start.getUTCFullYear() == end.getUTCFullYear())
{ //same year, same month
results = start.getUTCDate()+separator_string+end.getUTCDate()+plans_lang['months'][start.getUTCMonth()]+","+start.getUTCFullYear();
}
else if (start.getUTCFullYear() != end.getUTCFullYear())
{ //different year
results = start.getUTCDate()+plans_lang['months'][start.getUTCMonth()]+","+start.getUTCFullYear()+separator_string+end.getUTCDate()+plans_lang['months'][end.getUTCMonth()]+","+end.getUTCFullYear();
}
else
{ //same year, different months
results = start.getUTCDate()+plans_lang['months'][start.getUTCMonth()]+separator_string+end.getUTCDate()+plans_lang['months'][end.getUTCMonth()]+","+end.getUTCFullYear();
}
}
else
{
if (start.getUTCMonth() == end.getUTCMonth() && start.getUTCFullYear() == end.getUTCFullYear() && start.getUTCDate() == end.getUTCDate())
{ //same year, same month, same day
results = plans_lang['months'][start.getUTCMonth()]+" "+start.getUTCDate()+","+start.getUTCFullYear();
}
else if (start.getUTCMonth() == end.getUTCMonth() && start.getUTCFullYear() == end.getUTCFullYear())
{ //same year, same month
results = plans_lang['months'][start.getUTCMonth()]+" "+start.getUTCDate()+separator_string+end.getUTCDate()+","+start.getUTCFullYear();
}
else if (start.getUTCFullYear() != end.getUTCFullYear())
{ //different year
results = plans_lang['months'][start.getUTCMonth()]+" "+start.getUTCDate()+","+start.getUTCFullYear()+separator_string+plans_lang['months'][end.getUTCMonth()]+" "+end.getUTCDate()+","+end.getUTCFullYear();
}
else
{ //same year, different months
results = plans_lang['months'][start.getUTCMonth()]+" "+start.getUTCDate()+separator_string+plans_lang['months'][end.getUTCMonth()]+" "+end.getUTCDate()+","+end.getUTCFullYear();
}
}
return results;
}
function xmlhttp_init() {
//alert(" (xmlhttp_init) start");
//if (xmlhttp) return;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
xmlhttp = new XMLHttpRequest();
//alert(" (xmlhttp_init) done");
}
function docjslib_getRealLeft(imgElem) {
xPos = imgElem.offsetLeft;
tempEl = imgElem.offsetParent;
//alert("element " + imgElem.id + "\\nparent "+ tempEl.id);
//alert("element " + imgElem + "\\nparent "+ tempEl);
while (tempEl != null) {
xPos += tempEl.offsetLeft;
tempEl = tempEl.offsetParent;
}
return xPos;
}
function docjslib_getRealTop(imgElem) {
yPos = imgElem.offsetTop;
tempEl = imgElem.offsetParent;
while (tempEl != null) {
yPos += tempEl.offsetTop;
tempEl = tempEl.offsetParent;
}
return yPos;
}
function removename(el, name) {
var i, curList, newList;
// Remove the given class name from the className property of the element.
newList = new Array();
curList = el.className.split(" ");
for (i = 0; i < curList.length; i++)
if (curList[i] != name)
newList.push(curList[i]);
el.className = newList.join(" ");
}
function blink(el, times, onoff)
{
if (times==0)
{
if (onoff == 0 && document.getElementById(el).className.match(/blink/))
removename (document.getElementById(el),"blink");
if (onoff == 1 && !document.getElementById(el).className.match(/blink/))
document.getElementById(el).className += " blink";
return;
}
if (document.getElementById(el).className.match(/blink/))
removename (document.getElementById(el),"blink");
else
document.getElementById(el).className += " blink";
setTimeout("blink('"+el+"',"+(times-1)+", "+onoff+")", 100);
}
function get_lang(key)
{
if (plans_lang[key]) return plans_lang[key];
return '';
}
/**
* Sets a Cookie with the given name and value.
*
* name Name of the cookie
* value Value of the cookie
* [expires] Expiration date of the cookie (default: end of current session)
* [path] Path where the cookie is valid (default: path of calling document)
* [domain] Domain where the cookie is valid
* (default: domain of calling document)
* [secure] Boolean value indicating if the cookie transmission requires a
* secure transmission
*/
function setcookie(name, value, expires, path, domain, secure)
{
document.cookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
function XBrowserAddHandler(target,eventName,handlerName) {
if ( target.addEventListener ) {
target.addEventListener(eventName, function(e){target[handlerName](e);}, false);
} else if ( target.attachEvent ) {
target.attachEvent("on" + eventName, function(e){target[handlerName](e);});
} else {
var originalHandler = target["on" + eventName];
if ( originalHandler ) {
target["on" + eventName] = function(e){originalHandler(e);target[handlerName](e);};
} else {
target["on" + eventName] = target[handlerName];
}
}
}
// classes
function User(i, n) {
this.id = (i) ? i : null; // id must be unique among users
this.name = (n) ? n : "";
}
function Event(properties) {
this.id = (properties['id']) ? properties['id'] : null; // id must be unique among events
this.title = (properties['title']) ? properties['title'] : "";
this.icon = (properties['icon']) ? properties['icon'] : null;
this.start = properties['start'];
this.end = properties['end'];
this.days = properties['days'];
}
function DialogBox(properties) {
this.id = (properties['id']) ? properties['id'] : null;
this.title = (properties['title']) ? properties['title'] : '';
this.element_id = (properties['element_id']) ? properties['element_id'] : null;
this.contents = properties['contents'];
this.element = document.createElement('div'); // the DOM element that holds the dialog box
this.element.style.display = "none";
this.element.className += "dialog_box";
if (this.element_id) {
this.element.id = this.element_id;
} else {
this.element.id = "dialog_box";
if (this.id) this.element.id += "_"+this.id;
}
document.getElementsByTagName("body").item(0).appendChild(this.element);
var temp = '';
temp += '
';
temp += ' ';
temp += ' ';
this.element.innerHTML = temp;
this.hide_element = document.getElementById(this.element.id+"_hide");
//XBrowserAddHandler(this.hide_element,"mousedown","mousedownHandler");
this.hide_element.mousedownHandler = function() {
//var id = this.id.replace(/_hide/, "");
var eval_text = this.id+".close();";
alert(eval_text);
eval(eval_text);
}
this.reset = function() {
document.getElementById(this.element.id+"_title").innerHTML = "";
document.getElementById(this.element.id+"_contents").innerHTML = "";
}
this.setContents = function(contents) {
document.getElementById(this.element.id+"_contents").innerHTML = contents;
}
this.setTitle = function(title) {
document.getElementById(this.element.id+"_title").innerHTML = title;
}
this.close = function() {
this.element.style.display = "none";
}
this.anchor = function(el) {
if (!el) return;
this.element.style.left = docjslib_getRealLeft(el)+10+"px";
this.element.style.top = docjslib_getRealTop(el)+10+"px";
}
}