/* JS Inline Manager Control.  Author Joe McCormack.  Copyright 2005.  All Rights Reserved. www.virtualsecrets.com */
/* Flag Settings */
	var allow_user_prefs = 1; /* Allow user actions to control windows (on followup pages or return visits to page)?  0 = no, 1 = yes */
	var active_window_zindex = 100; /* Layer value of the active window */
	var active_pad = 1; /* Whether window dragging is allowed.  0 = no, 1 = yes */
	var left_pad = 25; /* Left offset start detection for dragging */
	var right_pad = 50; /* Right offset start detection for dragging */
	var height_pad = 22; /* Height of draggable area */
	var ghost_box_id = "ghost"; /* ID of the ghost box */
	var border_buffer = 4; /* Sensitivity buffer around borders */
	var ifrm_process = 2; /* How to control IFRAME within a window.  1 = restrict window minimum resizing to IFRAME, 2 = scale IFRAME to window resizing */
	var monitor_rclick = 1; /* Monitor for mouse right-clicking?  0 = no, 1 = yes */
	var dyn_minor = 0; /* Allow text and image windows to be created dynamically?  Leave set to 0.  0 = no, 1 = yes */
	var x_ifrm_offset = 0; /* Number of pixels to reduce iframes in windows.  Typically only used when the iframe is inside of a table which has padding or graphics to the left and/or right */
	var y_ifrm_offset = 0; /* Number of pixels to reduce iframes in windows.  Typically only used when the iframe is inside of a table which has padding or graphics to the top and/or bottom */
/* Mouse Menu (right click) */
	mmenu_titles = new Array();
	mmenu_links = new Array();
	mmenu_image = new Array();
	mmenu_type = new Array();
/* Define Mouse Menu Links */
	mmenu_titles[0] = "JIM-Control"; mmenu_links[0] = "http://www.jim-control.com/"; mmenu_image[0] = ""; mmenu_type[0] = 0;
/* Custom Window Bounding Region Windows Are Restricted To */
	var bound_default_width = 150; /* Default window width of window outline */
	var bound_default_height = 150; /* Default window height of window outline */
	var bound_region_x_min = 10;
	var bound_region_y_min = 10;
	var bound_region_x_max = 700;
	var bound_region_y_max = 475;
/* Define Window Arrays */
	window_position_x = new Array();
	window_position_y = new Array();
	window_position_width = new Array();
	window_position_height = new Array();
	window_position_zindex = new Array();
	window_position_id = new Array();
	window_visible = new Array();
	window_ifrm = new Array();
	window_ifrmname = new Array();
	window_title = new Array();
	window_title_class = new Array();
	window_resize = new Array();
/* Define Initial Windows Positions and Attributes */
	var array_index_value = 2; /* Size of the window array (holding window attributes) */
	/* Default Values Content Area #1 */
		window_position_x[1] = 50; window_position_y[1] = 200;
		window_position_width[1] = 150; window_position_height[1] = 150;
		window_position_zindex[1] = 10; window_position_id[1] = "number_one";
		window_visible[1] = "visible"; window_ifrm[1] = "";
		window_ifrmname[1] = ""; window_title[1] = "A Title";
		window_title_class[1] = ""; window_resize[1] = "yes";
	/* Default Values Content Area #2 */
		window_position_x[2] = 450; window_position_y[2] = 200;
		window_position_width[2] = 150; window_position_height[2] = 150;
		window_position_zindex[2] = 10; window_position_id[2] = "number_two";
		window_visible[2] = "visible"; window_ifrm[2] = "";
		window_ifrmname[2] = ""; window_title[2] = "A Title";
		window_title_class[2] = ""; window_resize[2] = "no";
/* Set Default Active Window.  Leave blank to have program attempt to detect default windows when none have been selected. */
	var selected_window = ""; /* Div id of currently selected window */
	var selected_window_id = 0; /* Array index of the currently selected window. 0 by default. */
/* Define Image Paths For Window Tab Options */
	var wdefimg = ""; /* Image path to image representing default window size */
	var wmaximg = ""; /* Image path to image representing maximize window */
	var wclsimg = ""; /* Image path to image representing close window */
/* Define Whether To Allow Default Size, Maximize and Close Options */
	var allowdef = 1; /* Allow default size option in window */
	var allowmax = 1; /* Allow maximize size option in window */
	var allowcls = 1; /* Allow close option in window */
/* Define Whether To Allow Window Options To Use Default Functions, or User-Defined */
	var allowdef_ovride = 0; /* Use custom function (wovride_defsize) for default window size instead of default function?  1 = yes, 0 = no */
	var allowmax_ovride = 0; /* Use custom function (wovride_maxsize) for maximize window size instead of default function?  1 = yes, 0 = no */
	var allowcls_ovride = 0; /* Use custom function (wovride_clswind) for close window instead of default function?  1 = yes, 0 = no */
/* Left Side Window Tab Data (such as an icon or tab) */
	var wlftdata = ""; /* Use HTML code */
/* Window Tab Split Area */
	var left_tab = "65%"; /* Size of the first (left) of the tab area where window title is at */
	var right_tab = "35%"; /* Size of the last (right) of the tab area typically holding window options */
/* Email A Friend Parameters */
	var wef_msg_subject = ""; /* Subject of Email Message */
	var wef_msg_body = ""; /* Message To Put Into Body Of Email Message */
/* XML Related */
	var xml_loaded = 0; /* When XML has been loaded and placed into memory, the value will be 1. */
	xml_node_path = new Array(); /* Node Name */
	xml_node_value = new Array(); /* Node Value */
	/*
		XML Array Notes --
		When the element value of xml_node_path returns "new_xml_row" this indicates the start of an XML data block.
		When xml_node_path[] = "new_xml_row" THEN xml_node_value will equal the row ID number associated with the XML block of data.
		Macintosh: IE does not work with this implimentation of XML.
	*/
function wovride_defsize(id_window) {
/*
  Use this function when the default inline window default size function is not suitable.
  id_window = The ID value of the div layer where the mouse-click event occured.
*/
}
function wovride_maxsize(id_window) {
/*
  Use this function when the default inline window maximize size function is not suitable.
  id_window = The ID value of the div layer where the mouse-click event occured.
*/
}
function wovride_clswind(id_window) {
/*
  Use this function when the default inline window close function is not suitable.
  id_window = The ID value of the div layer where the mouse-click event occured.
*/
}
function wmouseup_custom() {
/* Use this function when you need to know when a mouse up event occurs */
}
function wmousedown_custom() {
/* Use this function when you need to know when a mouse down event occurs */
}
function wmousemove_custom(msx, msy) {
/* Use this function when you need to know the mouse coordinates when the mouse moves */
}
/* Do not use */
	var spec_flag = 0; /* Special catch for browsers doing processing asynchronously */
	var bound_region_bordercolor = "";
	var bound_region_borderwidth = "";
	var bound_region_borderstyle = "";
	var mouse_position_x = 0; /* Current X Position of Mouse */
	var mouse_position_y = 0; /* Current Y Position of Mouse */
	var old_mouse_position_x = 0; /* Old X Position of Mouse */
	var old_mouse_position_y = 0; /* Old Y Position of Mouse */
	var ghost_box_status = 0; /* Whether Window Outline is Active or not */
	var pr_window = ""; /* Div id of previously selected window */
	var pr_window_id = 0; /* Array position of previously selected window */
	var border_selected = ""; /* Currently selected border side */
	var mouse_direction = 0; /* Resize direction.  left, right, top, bottom, box */
	var mouse_click = 0; /* Mouse button status */
	var browser_detect = ""; /* Raw web browser type */
	var net_browser = 0; /* Web browser type flag */
	var msg_event = 0; /* System event messages flag */
	var msg_trap = 0; /* Mouse menu trap */
	/* XML */
	var xml_first_block = "", xml_second_block = "", xml_dot_name = "", xml_dot_value = ""; xml_first_node = "";
	var xml_second_flag = 0, xml_node_count = 0, xml_row_count = 0, xml_parent_count = 0;
	var xml_data, fnode_name = "", fnode_value = "";
	var step = 0, bstep = 0, leadnode = "";
	parent_node_names = new Array();
/* Set Browser Type */
	wbrowsertype();
/* Trap Mouse Activity */
	document.onmousedown = wmousedown;
	if (document.layers) { document.captureEvents(Event.MOUSEMOVE); }
	document.onmousemove = wmousemove;
	document.onmouseup = wmouseup;
	if (monitor_rclick == 1) { document.oncontextmenu = wmousemenu; }
function wcontrolarr_set(windowid, status, staticset) {
/*
  windowid = the ID of the DIV that you wish to change the visiblity of in the array holding the div info
  status = visibility status (visible or hidden)
  staticset = 1 (yes) OR 0 (no).  If set to 1, the function will also set the visibility of the div itself
*/
for (var stwin = 1; stwin <= window_position_id.length; stwin++) {
	if (window_position_id[stwin] == windowid) {
		window_visible[stwin] = status;
						   }
								 }
if (staticset == 1) { try { document.getElementById(windowid).style.visibility = status; } catch(onerror) { /* Invalid Reference */ } }
}
/* Ghost Frame Object */
function wghostcreate() {
ghost_elem = document.createElement("div");
ghost_elem.id = ghost_box_id;
ghost_elem.name = ghost_box_id;
ghost_elem.className = "ghostdiv";
document.body.appendChild(ghost_elem);
}
/* Create Window Object */
function wwincreate(wtargetid, frmwidth, frmheight, frmid, frmsrc, toptitle, topclass, windresize) {
/*
wtargetid = ID of window to create
frmwidth = Width of the window
frmheight = Height of the window
frmid = ID of the IFRAME inside, if any
frmsrc = URL src path loaded into IFRAME inside, if any
toptitle = Window Title
topclass = CSS class associated to title area
windresize = Equals yes if window can be resized, otherwise set it to no
*/
spec_flag = 1;
/* Create Element */
noob_elem = document.createElement("div");
noob_elem.id = wtargetid;
noob_elem.name = wtargetid;
noob_elem.className = "dyndiv";
document.body.appendChild(noob_elem);
/* Add To Array */
window_position_x[array_index_value] = bound_region_x_min + 2; window_position_y[array_index_value] = bound_region_y_min + 2;
window_position_width[array_index_value] = frmwidth; window_position_height[array_index_value] = frmheight;
window_position_zindex[array_index_value] = 10; window_position_id[array_index_value] = wtargetid;
window_visible[array_index_value] = "visible"; window_ifrm[array_index_value] = frmsrc;
window_ifrmname[array_index_value] = frmid; window_title[array_index_value] = toptitle;
window_title_class[array_index_value] = topclass;
if (windresize == "yes") { window_resize[array_index_value] = "yes"; }
else { window_resize[array_index_value] = "no"; }
/* Update Element */
document.getElementById(wtargetid).style.left = bound_region_x_min + 2;
document.getElementById(wtargetid).style.top = bound_region_y_min + 2;
document.getElementById(wtargetid).style.width = frmwidth;
document.getElementById(wtargetid).style.height = frmheight;
document.getElementById(wtargetid).style.zIndex = active_window_zindex;
document.getElementById(wtargetid).style.visibility = "visible";
/* Layer Update */
wdactivate(wtargetid, 0, 0);
}
function wdyninarray(wtargetid, frmwidth, frmheight, frmid, frmsrc, toptitle, topclass, windresize) {
if (spec_flag == 0) {
var inarray = 0; spec_flag = 1;
for (ia = 0; ia <= window_position_x.length; ia++) {
	if (window_position_id[ia] == wtargetid) { inarray = 1; }
						   }
if (inarray == 0) {
	array_index_value = array_index_value + 1;
	window_position_x[array_index_value] = bound_region_x_min + 2; window_position_y[array_index_value] = bound_region_y_min + 2;
	window_position_width[array_index_value] = frmwidth; window_position_height[array_index_value] = frmheight;
	window_position_zindex[array_index_value] = 10; window_position_id[array_index_value] = wtargetid;
	window_visible[array_index_value] = "visible"; window_ifrm[array_index_value] = frmsrc;
	window_ifrmname[array_index_value] = frmid; window_title[array_index_value] = toptitle;
	window_title_class[array_index_value] = topclass;
	if (windresize == "yes") { window_resize[array_index_value] = "yes"; }
	else { window_resize[array_index_value] = "no"; }
	/* Update Element */
	document.getElementById(wtargetid).style.left = bound_region_x_min + 2;
	document.getElementById(wtargetid).style.top = bound_region_y_min + 2;
	document.getElementById(wtargetid).style.width = frmwidth;
	document.getElementById(wtargetid).style.height = frmheight;
	document.getElementById(wtargetid).style.zIndex = active_window_zindex;
	document.getElementById(wtargetid).style.visibility = "visible";
	/* Layer Update */
	wdactivate(wtargetid, 0, 0);
		  }
		    }
}
/* Populate Window Methods */
function wtxtpopulate(wtargetid, toptab, toptitle, typetab, deftab, defmax, defclose, stream, topclass, windresize) {
/*
wtargetid = ID of window to effect
toptab = Use tab at top of window?  0 = no, 1 = yes
toptitle = Window Title
typetab = Window Option Display Type.  0 = text, 1 = images
deftab = Add default window size option?  0 = no, 1 = yes
defmax = Add maximize window size option? 0 = no, 1 = yes
defclose = Add close window option?  0 = no, 1 = yes
stream = Data to put into window (such as text or html code)
topclass = CSS class associated to title area
windresize = Equals yes if window can be resized, otherwise set it to no
*/
	if (dyn_minor == 1) { if(!document.getElementById(wtargetid)) { if (spec_flag == 0) { spec_flag = 1; array_index_value = array_index_value + 1; wwincreate(wtargetid, bound_default_width, bound_default_height, '', '', toptitle, topclass, windresize); } } }
	if (document.getElementById(wtargetid)) {
		if (dyn_minor == 1) { wdyninarray(wtargetid, bound_default_width, bound_default_height, '', '', toptitle, topclass, windresize); }
		var compiler = "";
		if (toptab == 0) { compiler = stream; }
		else {
		      compiler = compiler + "<table class=\"tabcolor\"><tr>";
		      if (topclass.length > 0) {
				compiler = compiler + "<td width=\""+left_tab+"\" align=\"left\" class=\""+topclass+"\">"+wlftdata+"&nbsp;"+toptitle+"</td>";
					       }
		      else {
		            compiler = compiler + "<td width=\""+left_tab+"\" align=\"left\" class=\"tabtitle\">"+wlftdata+"&nbsp;"+toptitle+"</td>";
			   }
		      compiler = compiler + "<td width=\""+right_tab+"\" align=\"right\">";
		        if (deftab == 1) {
				if (allowdef_ovride == 1) {
					compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wovride_defsize('"+wtargetid+"');\" class=\"tablinkahref\">";
							  }
				else {
				      compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wdefwin('"+wtargetid+"');\" class=\"tablinkahref\">";
				     }
				if (typetab == 1) {
					compiler = compiler + "<img src=\""+wdefimg+"\" border=\"0\" alt=\"Default Size\" />";
						  }
				else {
				      compiler = compiler + "<span class=\"tablinktxt\">-</span>&nbsp;";
				     }
				compiler = compiler + "</a>";
				         }
		        if (defmax == 1) {
				if (allowmax_ovride == 1) {
					compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wovride_maxsize('"+wtargetid+"');\" class=\"tablinkahref\">";
							  }
				else {
				      compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wmaxwin('"+wtargetid+"');\" class=\"tablinkahref\">";
				     }
				if (typetab == 1) {
					compiler = compiler + "<img src=\""+wmaximg+"\" border=\"0\" alt=\"Maximize\" />";
						  }
				else {
				      compiler = compiler + "<span class=\"tablinktxt\">+</span>&nbsp;";
				     }
				compiler = compiler + "</a>";
				         }
		        if (defclose == 1) {
				if (allowcls_ovride == 1) {
					compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wovride_clswind('"+wtargetid+"');\" class=\"tablinkahref\">";
							  }
				else {
				      if (spec_flag == 0) {
						compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wdeactivate('"+wtargetid+"');\" class=\"tablinkahref\">";
							  }
				      else {
					    compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wdeactivatedyn('"+wtargetid+"');\" class=\"tablinkahref\">";
					   }
				     }
				if (typetab == 1) {
					compiler = compiler + "<img src=\""+wclsimg+"\" border=\"0\" alt=\"Close\" />";
						  }
				else {
				      compiler = compiler + "<span class=\"tablinktxt\">X</span>&nbsp;";
				     }
				compiler = compiler + "</a>";
					   }
		      if (deftab != 1 && defmax != 1 && defclose != 1) { compiler = compiler + "&nbsp;"; }
		      compiler = compiler + "</td></tr></table>";
		      compiler = compiler + stream;
		     }
		document.getElementById(wtargetid).innerHTML = compiler;
						}
}
function wfrmpopulate(wtargetid, toptab, toptitle, typetab, deftab, defmax, defclose, frmid, frmscale, frmscroll, frmwidth, frmheight, frmborder, frmclass, frmsrc, topclass, windresize) {
/*
wtargetid = ID of window to effect
toptab = Use tab at top of window?  0 = no, 1 = yes
toptitle = Window Title
typetab = Window Option Display Type.  0 = text, 1 = images
deftab = Add default window size option?  0 = no, 1 = yes
defmax = Add maximize window size option? 0 = no, 1 = yes
defclose = Add close window option?  0 = no, 1 = yes
frmid = ID of the IFRAME
frmscale = Scale window to size of IFRAME?  0 = no, 1 = yes
frmscroll = Allow IFRAME content to be scrollable?  yes, no
frmwidth = Width of the IFRAME
frmheight = Height of the IFRAME
frmborder = Whether or not the IFRAME has a visible border.  0 = no border, 1 = border
frmclass = CSS class associated with the IFRAME
frmsrc = URL src path loaded into IFRAME
topclass = CSS class associated to title area
windresize = Equals yes if window can be resized, otherwise set it to no
*/
	if(!document.getElementById(wtargetid)) { if (spec_flag == 0) { spec_flag = 1; array_index_value = array_index_value + 1; wwincreate(wtargetid, frmwidth, frmheight, frmid, frmsrc, toptitle, topclass, windresize); } }
	if (document.getElementById(wtargetid)) {
		wdyninarray(wtargetid, frmwidth, frmheight, frmid, frmsrc, toptitle, topclass, windresize);
		var compiler = "";
		if (toptab == 1) {
			compiler = compiler + "<table class=\"tabcolor\"><tr>";
			if (topclass.length > 0) {
				compiler = compiler + "<td width=\""+left_tab+"\" align=\"left\" class=\""+topclass+"\">"+wlftdata+"&nbsp;"+toptitle+"</td>";
						 }
			else {
			      compiler = compiler + "<td width=\""+left_tab+"\" align=\"left\" class=\"tabtitle\">"+wlftdata+"&nbsp;"+toptitle+"</td>";
			     }
			compiler = compiler + "<td width=\""+right_tab+"\" align=\"right\">";
		        if (deftab == 1) {
				if (allowdef_ovride == 1) {
					compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wovride_defsize('"+wtargetid+"');\" class=\"tablinkahref\">";
							  }
				else {
				      compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wdefwin('"+wtargetid+"');\" class=\"tablinkahref\">";
				     }
				if (typetab == 1) {
					compiler = compiler + "<img src=\""+wdefimg+"\" border=\"0\" alt=\"Default Size\" />";
						  }
				else {
				      compiler = compiler + "<span class=\"tablinktxt\">-</span>&nbsp;";
				     }
				compiler = compiler + "</a>";
				         }
		        if (defmax == 1) {
				if (allowmax_ovride == 1) {
					compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wovride_maxsize('"+wtargetid+"');\" class=\"tablinkahref\">";
							  }
				else {
				      compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wmaxwin('"+wtargetid+"');\" class=\"tablinkahref\">";
				     }
				if (typetab == 1) {
					compiler = compiler + "<img src=\""+wmaximg+"\" border=\"0\" alt=\"Maximize\" />";
						  }
				else {
				      compiler = compiler + "<span class=\"tablinktxt\">+</span>&nbsp;";
				     }
				compiler = compiler + "</a>";
				         }
		        if (defclose == 1) {
				if (allowcls_ovride == 1) {
					compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wovride_clswind('"+wtargetid+"');\" class=\"tablinkahref\">";
							  }
				else {
				      if (spec_flag == 0) {
						compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wdeactivate('"+wtargetid+"');\" class=\"tablinkahref\">";
							  }
				      else {
					    compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wdeactivatedyn('"+wtargetid+"');\" class=\"tablinkahref\">";
					   }
				     }
				if (typetab == 1) {
					compiler = compiler + "<img src=\""+wclsimg+"\" border=\"0\" alt=\"Close\" />";
						  }
				else {
				      compiler = compiler + "<span class=\"tablinktxt\">X</span>&nbsp;";
				     }
				compiler = compiler + "</a>";
					   }
			if (deftab != 1 && defmax != 1 && defclose != 1) { compiler = compiler + "&nbsp;"; }
			compiler = compiler + "</td></tr></table>";
				 }
		/* Adjust IFRAME based on browser */
		var fx = 0, fy = 0;
		if (net_browser == 3 || net_browser == 11 || net_browser == 19) {
			if (frmborder > 0) { fx = frmwidth - 3; fy = frmheight; }
			else { fx = frmwidth - 2; fy = frmheight - 3; }
										}
		else {
		      if (frmborder > 0) { fx = frmwidth - 4; fy = frmheight - 8; }
		      else { fx = frmwidth; fy = frmheight - 5; }
		     }
		if (frmclass.length > 0) {
		      compiler = compiler + "<iframe id=\""+frmid+"\" src=\""+frmsrc+"\" frameborder=\""+frmborder+"\" class=\""+frmclass+"\" width=\""+ (fx+x_ifrm_offset) +"\" height=\""+ (fy+y_ifrm_offset) +"\" scrolling=\""+frmscroll+"\"></iframe>";
					 }
		else {
		      compiler = compiler + "<iframe id=\""+frmid+"\" src=\""+frmsrc+"\" frameborder=\""+frmborder+"\" width=\""+ (fx+x_ifrm_offset) +"\" height=\""+ (fy+y_ifrm_offset) +"\" scrolling=\""+frmscroll+"\"></iframe>";
		     }
		document.getElementById(wtargetid).innerHTML = compiler;
		if (frmscale == 1) {
				    for (sw = 1; sw <= window_position_x.length; sw++) {
					if (window_position_id[sw] == wtargetid) {
						window_ifrm[sw] = frmsrc; window_ifrmname[sw] = frmid;
						window_position_width[sw] = frmwidth;
						document.getElementById(wtargetid).style.width = frmwidth;
						window_position_height[sw] = frmheight + height_pad;
						document.getElementById(wtargetid).style.height = frmheight + height_pad;
						if ((window_position_x[sw] + window_position_width[sw]) > bound_region_x_max) {
							var x_diff = bound_region_x_max - window_position_width[sw];
							if (x_diff < bound_region_x_min) { x_diff = bound_region_x_min; }
							window_position_x[sw] = x_diff;
							document.getElementById(wtargetid).style.left = x_diff;
															      }
						if ((window_position_y[sw] + window_position_height[sw]) > bound_region_y_max) {
							var y_diff = bound_region_y_max - window_position_height[sw];
							if (y_diff < bound_region_y_min) { y_diff = bound_region_y_min; }
							window_position_y[sw] = y_diff;
							document.getElementById(wtargetid).style.top = y_diff;
															       }
										 }
										       }
				   }
		/* Update */
		for (sw = 1; sw <= window_position_x.length; sw++) {
			if (window_position_id[sw] == wtargetid) {
				window_ifrm[sw] = frmsrc; window_ifrmname[sw] = frmid;
				wsetpreferences();
								 }
								   }
						}
}
function wimgpopulate(wtargetid, toptab, toptitle, typetab, deftab, defmax, defclose, imagepath, caption, link, btarget, topclass, windresize) {
/*
wtargetid = ID of window to effect
toptab = Use tab at top of window?  0 = no, 1 = yes
toptitle = Window Title
typetab = Window Option Display Type.  0 = text, 1 = images
deftab = Add default window size option?  0 = no, 1 = yes
defmax = Add maximize window size option? 0 = no, 1 = yes
defclose = Add close window option?  0 = no, 1 = yes
imagepath = Image URL
caption = Text caption to show below image
link = Hyperlink for image / caption
btarget = Window target (such as _blank)
topclass = CSS class associated to title area
windresize = Equals yes if window can be resized, otherwise set it to no
*/
	if (dyn_minor == 1) { if(!document.getElementById(wtargetid)) { if (spec_flag == 0) { spec_flag = 1; wwincreate(wtargetid, bound_default_width, bound_default_height, '', '', toptitle, topclass, windresize); } } }
	if (document.getElementById(wtargetid)) {
		if (dyn_minor == 1) { wdyninarray(wtargetid, bound_default_width, bound_default_height, '', '', toptitle, topclass, windresize); }
		var compiler = ""; var wtarget = "_blank";
		if (btarget.length > 0) { wtarget = btarget; }
		if (toptab == 0) {
		      		  compiler = compiler + "<p style=\"text-align:center;\">";
		      		  if (link.length > 0) { compiler = compiler + "<a href=\""+link+"\" target=\""+wtarget+"\" class=\"tablinkahref\">"; }
		      		  if (imagepath.length > 0) { compiler = compiler + "<img id=\"dyn"+wtargetid+"\" src=\""+imagepath+"\" border=\"0\" alt=\""+caption+"\" /><br clear=\"all\" />\n"; }
		      		  if (caption.length > 0) { compiler = compiler + "<span class=\"wcaption\">" + caption + "</span>"; }
		      		  if (link.length > 0) { compiler = compiler + "</a>"; }
		      		  compiler = compiler + "</p>";
				 }
		else {
		      compiler = compiler + "<table name=\"tdyn"+wtargetid+"\" id=\"tdyn"+wtargetid+"\" class=\"tabcolor\"><tr>";
		      if (topclass.length > 0) {
				compiler = compiler + "<td width=\""+left_tab+"\" align=\"left\" class=\""+topclass+"\">"+wlftdata+"&nbsp;"+toptitle+"</td>";
					       }
		      else {
		            compiler = compiler + "<td width=\""+left_tab+"\" align=\"left\" class=\"tabtitle\">"+wlftdata+"&nbsp;"+toptitle+"</td>";
			   }
		      compiler = compiler + "<td width=\""+right_tab+"\" align=\"right\">";
		      if (deftab == 1) {
				if (allowdef_ovride == 1) {
					compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wovride_defsize('"+wtargetid+"');\" class=\"tablinkahref\">";
							  }
				else {
				      compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wdefwin('"+wtargetid+"');\" class=\"tablinkahref\">";
				     }
				if (typetab == 1) {
					compiler = compiler + "<img src=\""+wdefimg+"\" border=\"0\" alt=\"Default Size\" />";
						  }
				else {
				      compiler = compiler + "<span class=\"tablinktxt\">-</span>&nbsp;";
				     }
				compiler = compiler + "</a>";
				       }
		      if (defmax == 1) {
				if (allowmax_ovride == 1) {
					compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wovride_maxsize('"+wtargetid+"');\" class=\"tablinkahref\">";
							  }
				else {
				      compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wmaxwin('"+wtargetid+"');\" class=\"tablinkahref\">";
				     }
				if (typetab == 1) {
					compiler = compiler + "<img src=\""+wmaximg+"\" border=\"0\" alt=\"Maximize\" />";
						  }
				else {
				      compiler = compiler + "<span class=\"tablinktxt\">+</span>&nbsp;";
				     }
				compiler = compiler + "</a>";
				       }
		      if (defclose == 1) {
				if (allowcls_ovride == 1) {
					compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wovride_clswind('"+wtargetid+"');\" class=\"tablinkahref\">";
							  }
				else {
				      if (spec_flag == 0) {
						compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wdeactivate('"+wtargetid+"');\" class=\"tablinkahref\">";
							  }
				      else {
					    compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wdeactivatedyn('"+wtargetid+"');\" class=\"tablinkahref\">";
					   }
				     }
				if (typetab == 1) {
					compiler = compiler + "<img src=\""+wclsimg+"\" border=\"0\" alt=\"Close\" />";
						  }
				else {
				      compiler = compiler + "<span class=\"tablinktxt\">X</span>&nbsp;";
				     }
				compiler = compiler + "</a>";
					 }
		      if (deftab != 1 && defmax != 1 && defclose != 1) { compiler = compiler + "&nbsp;"; }
		      compiler = compiler + "</td></tr></table><br />";
		      compiler = compiler + "<p style=\"text-align:center;\">";
		      if (link.length > 0) { compiler = compiler + "<a href=\""+link+"\" target=\""+wtarget+"\" class=\"tablinkahref\">"; }
		      if (imagepath.length > 0) { compiler = compiler + "<img id=\"dyn"+wtargetid+"\" src=\""+imagepath+"\" border=\"0\" alt=\""+caption+"\" /><br clear=\"all\" />\n"; }
		      if (caption.length > 0) { compiler = compiler + "<span class=\"wcaption\">" + caption + "</span>"; }
		      if (link.length > 0) { compiler = compiler + "</a>"; }
		      compiler = compiler + "</p>";
		     }
		document.getElementById(wtargetid).innerHTML = compiler;
		wresizewin(wtargetid);
						}
}
/* Read User Preferences */
function wuserpreferences() {
if (allow_user_prefs == 1) {
	var wcookieMan = document.cookie; var raw_data = ""; var cookie_count = 0; var wholder;
	if (definition(wcookieMan, "activewins")) {
		raw_data = cookievalue(wcookieMan, "activewins");
		wholder = raw_data.split("|");
		selected_window = wholder[0]; selected_window_id = wholder[1]; pr_window = wholder[2]; pr_window_id = wholder[3];
						  }
	if (definition(wcookieMan, "activecnt")) {
		cookie_count = cookievalue(wcookieMan, "activecnt");
		array_index_value = cookie_count;
		for (dc = 0; dc <= cookie_count; dc++) {
			var dcstr = "" + dc + "";
			try {
			raw_data = cookievalue(wcookieMan, dcstr);
			wholder = raw_data.split("|");
			window_position_x[dc] = parseInt(wholder[0]);
			window_position_y[dc] = parseInt(wholder[1]);
			window_position_width[dc] = parseInt(wholder[2]);
			window_position_height[dc] = parseInt(wholder[3]);
			window_position_zindex[dc] = parseInt(wholder[4]);
			window_position_id[dc] = "" + wholder[5] + "";
			window_visible[dc] = "" + wholder[6] + "";
			window_ifrm[dc] = "" + wholder[7] + "";
			window_ifrmname[dc] = "" + wholder[8] + "";
			window_title[dc] = unescape(wholder[9]);
			window_title_class[dc] = wholder[10];
			window_resize[dc] = wholder[11];
			    }
			catch(onerror) { /* Trap For Browsers That Unroll Loops Differently */ }
						       }
		var actual_count = 0;
		for (ep = 0; ep <= window_position_x.length; ep++) {
			var sspec_flag = 0; var sieze = 0;
			var phys_id = window_position_id[ep];
			if (typeof phys_id != 'null' && typeof phys_id != 'undefined') {
			if (phys_id.length > 0 && phys_id != 'null' && phys_id != 'undefined') {
				actual_count = actual_count + 1; array_index_value = actual_count;
				if (sieze == 0) { sieze = 1; array_index_value = array_index_value + 1; }
				if(!document.getElementById(phys_id)) {
					sspec_flag = 1;
					noob_elem = document.createElement("div");
					noob_elem.id = phys_id;
					noob_elem.name = phys_id;
					noob_elem.className = "dyndiv";
					document.body.appendChild(noob_elem);
								      }
			try {
			document.getElementById(phys_id).style.left = window_position_x[ep];
			document.getElementById(phys_id).style.top = window_position_y[ep];
			document.getElementById(phys_id).style.width = window_position_width[ep];
			document.getElementById(phys_id).style.height = window_position_height[ep];
			document.getElementById(phys_id).style.zIndex = window_position_zindex[ep];
			document.getElementById(phys_id).style.visibility = window_visible[ep];
			if (window_ifrm[ep].length > 0 && window_ifrmname[ep].length > 0) {
				/* Adjust IFRAME based on browser */
				document.getElementById(phys_id).innerHTML = "";
				var fx = 0, fy = 0; var imgwidth = 0, imgheight = 0;
				imgwidth = window_position_width[ep]; imgheight = window_position_height[ep];
				if (net_browser == 3 || net_browser == 11 || net_browser == 19) { fx = imgwidth - 2; fy = imgheight - (height_pad + 4); }
				else { fx = imgwidth; fy = imgheight - (height_pad + 4); }
				compiler = ""; typetab = 0;
				if (wdefimg.length > 0 && wmaximg.length > 0 && wclsimg.length > 0) { typetab = 1; }
				compiler = compiler + "<table class=\"tabcolor\"><tr>";
				if (window_title_class[ep].length > 0) {
					compiler = compiler + "<td width=\""+left_tab+"\" align=\"left\" class=\""+window_title_class[ep]+"\">"+wlftdata+"&nbsp;"+window_title[ep]+"</td>";
								       }
				else {
				      compiler = compiler + "<td width=\""+left_tab+"\" align=\"left\" class=\"tabtitle\">"+wlftdata+"&nbsp;"+window_title[ep]+"</td>";
				     }
				compiler = compiler + "<td width=\""+right_tab+"\" align=\"right\">";
				if (allowdef == 1) {
					if (allowdef_ovride == 1) {
						compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wovride_defsize('"+phys_id+"');\" class=\"tablinkahref\">";
								  }
					else {
					      compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wdefwin('"+phys_id+"');\" class=\"tablinkahref\">";
					     }
					if (wdefimg.length > 0) {
						compiler = compiler + "<img src=\""+wdefimg+"\" border=\"0\" alt=\"Default Size\" />";
								}
					else {
					      compiler = compiler + "<span class=\"tablinktxt\">-</span>&nbsp;";
					     }
					compiler = compiler + "</a>";
						   }
				if (allowmax == 1) {
					if (allowmax_ovride == 1) {
						compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wovride_maxsize('"+phys_id+"');\" class=\"tablinkahref\">";
								  }
					else {
					      compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wmaxwin('"+phys_id+"');\" class=\"tablinkahref\">";
					     }
					if (wmaximg.length > 0) {
						compiler = compiler + "<img src=\""+wmaximg+"\" border=\"0\" alt=\"Maximize\" />";
								}
					else {
					      compiler = compiler + "<span class=\"tablinktxt\">+</span>&nbsp;";
					     }
					compiler = compiler + "</a>";
						   }
				if (allowcls == 1) {
					if (allowcls_ovride == 1) {
						compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wovride_clswind('"+phys_id+"');\" class=\"tablinkahref\">";
								  }
					else {
					      if (sspec_flag == 0) {
							compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wdeactivate('"+phys_id+"');\" class=\"tablinkahref\">";
								   }
					      else {
					            compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wdeactivatedyn('"+phys_id+"');\" class=\"tablinkahref\">";
						   }
					     }
					if (wmaximg.length > 0) {
						compiler = compiler + "<img src=\""+wclsimg+"\" border=\"0\" alt=\"Close\" />";
								}
					else {
					      compiler = compiler + "<span class=\"tablinktxt\">X</span>&nbsp;";
					     }
					compiler = compiler + "</a>";
						   }
				if (wdefimg.length < 1 && wmaximg.length < 1 && wclsimg.length < 1) { compiler = compiler + "&nbsp;"; }
				compiler = compiler + "</td></tr></table>";
				compiler = compiler + "<iframe id=\""+window_ifrmname[ep]+"\" src=\""+window_ifrm[ep]+"\" frameborder=\"0\" width=\""+ (fx + x_ifrm_offset) +"\" height=\""+ (fy + y_ifrm_offset) +"\"></iframe>";
				document.getElementById(phys_id).innerHTML = compiler;
											  }
			    }
			catch(onerror) { /* Trap For Browsers That Unroll Loops Differently */ }
											       }
										       }
						       		   }
		if (selected_window.length > 0) { document.getElementById(selected_window).style.zIndex = active_window_zindex; }
						}
			   }
}
/* Set / Update Cookies */
function wsetpreferences() {
if (allow_user_prefs == 1) {
var cookieMan; var cookie_data = ""; var cookie_count = 0; var cookiedate = new Date();
cookiedate.setTime(cookiedate.getTime()); var lifetime = new Date(cookiedate.getTime() + 86400000);
/* Save Active State */
cookie_data = selected_window + "|" + selected_window_id + "|" + pr_window + "|" + pr_window_id;
cookieMan = "activewins" + '=' + cookie_data + ';expires=' + lifetime.toGMTString();
document.cookie = cookieMan;
/* Save History */
for (var hs = 1; hs <= window_position_x.length; hs++) {
	cookie_data = window_position_x[hs] + "|" + window_position_y[hs] + "|" + window_position_width[hs] + "|" + window_position_height[hs] + "|" + window_position_zindex[hs] + "|" + window_position_id[hs] + "|" + window_visible[hs] + "|" + window_ifrm[hs] + "|" + window_ifrmname[hs] + "|" + escape(window_title[hs]) + "|" + window_title_class[hs] + "|" + window_resize[hs];
	cookieMan = "" + hs + "" + '=' + cookie_data + ';expires=' + lifetime.toGMTString();
	document.cookie = cookieMan;
	cookie_count = hs;
					               }
/* Save Cookie Count */
cookie_data = cookie_count;
cookieMan = "activecnt" + '=' + cookie_data + ';expires=' + lifetime.toGMTString();
document.cookie = cookieMan;
			   }
}
function definition(thename,thevalue) {
var z = removespace(thename);
var pairs = z.split(";");
for (var i = 0; i < pairs.length; ++i) {
var splitter = pairs[i].split("=");
if (splitter[0] == thevalue) { return true; }
}
return false;
}
function removespace(block) {
var theresult = "";
for (var j = 0; j < block.length; ++j) {
var thevalue = block.charAt(j);
if (thevalue != " ") { theresult += thevalue; }
}
return theresult;
}
function removeschars(string) {
var results = "";
for (i=0; i < string.length; i++) {
if (string.charAt(i) != '\n' && string.charAt(i) != '\r' && string.charAt(i) != '\t') {
results += string.charAt(i);
}
}
return results;
}
function cookievalue(thename,thevalue) {
var q = removespace(thename);
var pairs = q.split(";");
for (var k = 0; k < pairs.length; ++k) {
var answer = pairs[k].split("=");
if (answer[0] == thevalue) { return answer[1]; }
}
return "";
}
/* Max Window */
function wmaxwin(wtargetid) {
for (wx = 1; wx <= window_position_x.length; wx++) {
	if (window_position_id[wx] == wtargetid) {
		if (window_visible[wx] == "visible") {
			if (wtargetid == pr_window) {
				if (selected_window.length > 0) {
					document.getElementById(selected_window).style.zIndex = window_position_zindex[selected_window_id];
					pr_window = selected_window; pr_window_id = selected_window_id;
								}
						    }
			else if (wtargetid != selected_window) {
				if (selected_window.length > 0 && pr_window.length > 0) {
					document.getElementById(pr_window).style.zIndex = window_position_zindex[pr_window_id];
					document.getElementById(selected_window).style.zIndex = window_position_zindex[selected_window_id];
					pr_window = selected_window; pr_window_id = selected_window_id;
											}
				else if (selected_window.length > 0 && pr_window.length < 1) {
					document.getElementById(selected_window).style.zIndex = window_position_zindex[selected_window_id];
					pr_window = selected_window; pr_window_id = selected_window_id;
											     }
			     				       }
			document.getElementById(wtargetid).style.left = bound_region_x_min + border_buffer;
			document.getElementById(wtargetid).style.top = bound_region_y_min + border_buffer;
			document.getElementById(wtargetid).style.width = ((bound_region_x_max - bound_region_x_min) - border_buffer) - 4;
			document.getElementById(wtargetid).style.height = ((bound_region_y_max - bound_region_y_min) - border_buffer) - 4;
			document.getElementById(wtargetid).style.zIndex = active_window_zindex;
			window_position_x[wx] = bound_region_x_min + border_buffer;
			window_position_y[wx] = bound_region_y_min + border_buffer;
			window_position_width[wx] = ((bound_region_x_max - bound_region_x_min) - border_buffer) - 4;
			window_position_height[wx] = ((bound_region_y_max - bound_region_y_min) - border_buffer) - 4;
			selected_window = wtargetid; selected_window_id = wx;
			wresizewin(wtargetid);
			wsetpreferences();
						     }
						 }
						   }
}
/* Restore To Default Size */
function wdefwin(wtargetid) {
for (wx = 1; wx <= window_position_x.length; wx++) {
	if (window_position_id[wx] == wtargetid) {
		if (window_visible[wx] == "visible") {
			if (wtargetid == pr_window) {
				if (selected_window.length > 0) {
					document.getElementById(selected_window).style.zIndex = window_position_zindex[selected_window_id];
					pr_window = selected_window; pr_window_id = selected_window_id;
								}
						    }
			else if (wtargetid != selected_window) {
				if (selected_window.length > 0 && pr_window.length > 0) {
					document.getElementById(pr_window).style.zIndex = window_position_zindex[pr_window_id];
					document.getElementById(selected_window).style.zIndex = window_position_zindex[selected_window_id];
					pr_window = selected_window; pr_window_id = selected_window_id;
											}
				else if (selected_window.length > 0 && pr_window.length < 1) {
					document.getElementById(selected_window).style.zIndex = window_position_zindex[selected_window_id];
					pr_window = selected_window; pr_window_id = selected_window_id;
											     }
			     				       }
			document.getElementById(wtargetid).style.width = bound_default_width;
			document.getElementById(wtargetid).style.height = bound_default_height;
			document.getElementById(wtargetid).style.zIndex = active_window_zindex;
			window_position_width[wx] = bound_default_width;
			window_position_height[wx] = bound_default_height;
			selected_window = wtargetid; selected_window_id = wx;
			wresizewin(wtargetid);
			wsetpreferences();
						     }
						 }
						   }
}
/* Activate (Show) */
function wdactivate(wtargetid, walignx, waligny) {
/*
wtargetid = ID of window to effect
walignx = Align window to user's mouse X position?  0 = no, 1 = yes
waligny = Align window to user's mouse Y position?  0 = no, 1 = yes
*/
var xplace = 0, yplace = 0;
for (wx = 1; wx <= window_position_x.length; wx++) {
	if (window_position_id[wx] == wtargetid) {
		if (selected_window.length > 0) {
			/* This window is not the currently active window */
			if (selected_window != window_position_id[wx]) {
				if (pr_window.length > 0) {
					document.getElementById(pr_window).style.zIndex = window_position_zindex[pr_window_id];
					document.getElementById(selected_window).style.zIndex = window_position_zindex[selected_window_id];
					pr_window = selected_window; pr_window_id = selected_window_id;
					selected_window = window_position_id[wx]; selected_window_id = wx;
							  }
				else {
				      document.getElementById(selected_window).style.zIndex = window_position_zindex[selected_window_id];
				      pr_window = selected_window; pr_window_id = selected_window_id;
				      selected_window = window_position_id[wx]; selected_window_id = wx;
				     }
			     					       }
						}
		else { selected_window = window_position_id[wx]; selected_window_id = wx; }
		xplace = window_position_x[wx]; yplace = window_position_y[wx];
		if (walignx == 1) { window_position_x[wx] = mouse_position_x; xplace = mouse_position_x; }
		if (waligny == 1) { window_position_y[wx] = mouse_position_y; yplace = mouse_position_y; }
		window_visible[wx] = "visible";
		document.getElementById(wtargetid).style.zIndex = active_window_zindex;
		document.getElementById(wtargetid).style.left = xplace;
		document.getElementById(wtargetid).style.top = yplace;
		document.getElementById(wtargetid).style.visibility = "visible";
		wsetpreferences();
						 }
						   }
}
/* Purge Dynamic */
function wdeactivatedyn(wtargetid) {
var wpx = new Array();
var wpy = new Array();
var wpw = new Array();
var wph = new Array();
var wpz = new Array();
var wpi = new Array();
var wv = new Array();
var wifr = new Array();
var wifrn = new Array();
var wti = new Array();
var wtc = new Array();
var wrs = new Array();
document.getElementById(wtargetid).style.visibility = "hidden";
document.getElementById(wtargetid).innerHTML = "";
if (selected_window.length > 0) {
	for (var swh = 0; swh <= window_position_x.length; swh++) {
		if (window_position_id[swh] == selected_window) { document.getElementById(selected_window).style.zIndex = window_position_zindex[swh]; }
								  }
				}
if (pr_window.length > 0) {
	for (var swp = 0; swp <= window_position_x.length; swp++) {
		if (window_position_id[swp] == pr_window) { document.getElementById(pr_window).style.zIndex = window_position_zindex[swp]; }
								  }
			  }
selected_window = ""; selected_window_id = 0; pr_window = ""; pr_window_id = 0;
var arrindex = 0; var nbcount = 0;
for (var ap = 0; ap <= array_index_value; ap++) {
	if (wtargetid != window_position_id[ap]) {
		wpx[nbcount] = window_position_x[ap];
		wpy[nbcount] = window_position_y[ap];
		wpw[nbcount] = window_position_width[ap];
		wph[nbcount] = window_position_height[ap];
		wpz[nbcount] = window_position_zindex[ap];
		wpi[nbcount] = window_position_id[ap];
		wv[nbcount] = window_visible[ap];
		wifr[nbcount] = window_ifrm[ap];
		wifrn[nbcount] = window_ifrmname[ap];
		wti[nbcount] = window_title[ap];
		wtc[nbcount] = window_title_class[ap];
		wrs[nbcount] = window_resize[ap];
		nbcount = nbcount + 1;
						 }
						}
window_position_x = new Array();
window_position_y = new Array();
window_position_width = new Array();
window_position_height = new Array();
window_position_zindex = new Array();
window_position_id = new Array();
window_visible = new Array();
window_ifrm = new Array();
window_ifrmname = new Array();
window_title = new Array();
window_title_class = new Array();
window_resize = new Array();
for (var tb = 0; tb <= wpx.length; tb++) {
	window_position_x[tb] = wpx[tb];
	window_position_y[tb] = wpy[tb];
	window_position_width[tb] = wpw[tb];
	window_position_height[tb] = wph[tb];
	window_position_zindex[tb] = wpz[tb];
	window_position_id[tb] = wpi[tb];
	window_visible[tb] = wv[tb];
	window_ifrm[tb] = wifr[tb];
	window_ifrmname[tb] = wifrn[tb];
	window_title[tb] = wti[tb];
	window_title_class[tb] = wtc[tb];
	window_resize[tb] = wrs[tb];
				 	 }
wsetpreferences();
}
/* Deactivate Embedded (Hide) */
function wdeactivate(wtargetid) {
mouse_direction = ""; mouse_click = 0;
for (wx = 1; wx <= window_position_x.length; wx++) {
	if (window_position_id[wx] == wtargetid) {
		if (selected_window == window_position_id[wx]) {
			/* Deactivating currently active window */
			if (pr_window.length > 0) {
				document.getElementById(selected_window).style.zIndex = window_position_zindex[selected_window_id];
				window_visible[selected_window_id] = "hidden";
				document.getElementById(selected_window).style.visibility = "hidden";
				selected_window = pr_window; selected_window_id = pr_window_id;
				pr_window = ""; pr_window_id = 0;
				document.getElementById(selected_window).style.zIndex = active_window_zindex;
						  }
			else {
			      document.getElementById(selected_window).style.zIndex = window_position_zindex[selected_window_id];
			      window_visible[selected_window_id] = "hidden";
			      document.getElementById(selected_window).style.visibility = "hidden";
			      selected_window = ""; selected_window_id = 0;
			     }
							       }
		else {
		      if (pr_window == window_position_id[wx]) {
				document.getElementById(pr_window).style.zIndex = window_position_zindex[pr_window_id];
				window_visible[pr_window_id] = "hidden";
				document.getElementById(pr_window).style.visibility = "hidden";
				pr_window = ""; pr_window_id = 0;
							       }
		      else {
			    document.getElementById(wtargetid).style.visibility = "hidden";
			    for (wy = 1; wy <= window_position_x.length; wy++) {
				if (window_position_id[wy] == wtargetid) {
					window_visible[wy] = "hidden";
					document.getElementById(wtargetid).style.zIndex = window_position_zindex[wy];
									 }
									       }
			   }
		     }
	wsetpreferences();
						 }
						   }
}
/* OS / Browser Detect */
function wbrowsertype() {
/*
__ net_browser flag values based on OS/Browser __
	0 = Undetermined OS / Browser
	17 = Undetermined OS / Browser
MAC OS:
	2 = Unknown Browser
	3 = Internet Explorer
	4 = Safari
	5 = Firefox
	6 = Netscape
	7 = Opera
	8 = Camino
	9 = Firebird
	26 = Google Chrome
WINDOWS OS:
	10 = Unknown Browser
	11 = Internet Explorer
	12 = Firefox
	13 = Netscape
	14 = Opera
	15 = Camino
	16 = Firebird
	25 = Google Chrome
UNKNOWN OS:
	17 = Unknown Browser
	18 = Safari
	19 = Internet Explorer
	20 = Firefox
	21 = Netscape
	22 = Opera
	23 = Camino
	24 = Firebird
	27 = Google Chrome
*/
var btfound = 0; browser_detect = navigator.userAgent.toLowerCase();
if ((browser_detect.indexOf("konqueror") + 1)) { btfound = 1; net_browser = 1; }
if ((browser_detect.indexOf("mac_powerpc") + 1)) { btfound = 1; net_browser = 3; }
if (btfound == 0) {
	// MAC OS
	if ((browser_detect.indexOf("macintosh") + 1)) {
		if ((browser_detect.indexOf("safari") + 1)) { btfound = 1; net_browser = 4; }
		else if ((browser_detect.indexOf("firefox") + 1)) { btfound = 1; net_browser = 5; }
		else if ((browser_detect.indexOf("netscape") + 1)) { btfound = 1; net_browser = 6; }
		else if ((browser_detect.indexOf("opera") + 1)) { btfound = 1; net_browser = 7; }
		else if ((browser_detect.indexOf("camino") + 1)) { btfound = 1; net_browser = 8; }
		else if ((browser_detect.indexOf("firebird") + 1)) { btfound = 1; net_browser = 9; }
		else if ((browser_detect.indexOf("chrome") + 1)) { btfound = 1; net_browser = 26; }
		else { btfound = 1; net_browser = 2; }
						       }
	// Windows OS
	if ((browser_detect.indexOf("windows") + 1) && btfound == 0) {
		if ((browser_detect.indexOf("msie") + 1)) { btfound = 1; net_browser = 11; }
		else if ((browser_detect.indexOf("firefox") + 1)) { btfound = 1; net_browser = 12; }
		else if ((browser_detect.indexOf("netscape") + 1)) { btfound = 1; net_browser = 13; }
		else if ((browser_detect.indexOf("opera") + 1)) { btfound = 1; net_browser = 14; }
		else if ((browser_detect.indexOf("camino") + 1)) { btfound = 1; net_browser = 15; }
		else if ((browser_detect.indexOf("firebird") + 1)) { btfound = 1; net_browser = 16; }
		else if ((browser_detect.indexOf("chrome") + 1)) { btfound = 1; net_browser = 25; }
		else { btfound = 1; net_browser = 10; }
						     		     }
	// Unknown OS
	if (btfound == 0) {
		if ((browser_detect.indexOf("safari") + 1)) { net_browser = 18; }
		else if ((browser_detect.indexOf("msie") + 1)) { net_browser = 19; }
		else if ((browser_detect.indexOf("firefox") + 1)) { net_browser = 20; }
		else if ((browser_detect.indexOf("netscape") + 1)) { net_browser = 21; }
		else if ((browser_detect.indexOf("opera") + 1)) { net_browser = 22; }
		else if ((browser_detect.indexOf("camino") + 1)) { net_browser = 23; }
		else if ((browser_detect.indexOf("firebird") + 1)) { net_browser = 24; }
		else if ((browser_detect.indexOf("chrome") + 1)) { net_browser = 27; }
		else { net_browser = 17; }
			  }
		  }
/* In most cases, Google Chrome will behave the same as Firefox.  If not you can remove these value overwrites. */
if (net_browser == 25) { net_browser = 12; }
else if (net_browser == 26) { net_browser = 5; }
else if (net_browser == 27) { net_browser = 20; }
}
/* Detect and Set Window Area */
function wdocsize() {
/* If this function is used, it will overwrite Max values defined in the custom bounding region */
if (net_browser != 2 && net_browser != 11 && net_browser != 19) {
	if (window.outerHeight > 0) {
		bound_region_x_max = window.outerWidth - 35;
		bound_region_y_max = window.outerHeight;
				    }
	else {
	      bound_region_x_max = (window.innerWidth + window.pageXOffset) - 16;
	      bound_region_y_max = (window.innerHeight + window.pageYOffset) - 16;
	     }
								}
else {
      if (screen.Height > 0) {
		bound_region_x_max = screen.availWidth - 40;
		bound_region_y_max = screen.availHeight;
			     }
      else {
            bound_region_x_max = (document.body.offsetWidth + document.body.scrollLeft) - 20;
            bound_region_y_max = (document.body.offsetHeight + document.body.scrollTop) - 20;
	   }
     }
}
/* Selection State Swapping */
function wdrag_monitor() {
if (mouse_click == 1) {	return false; }
else { return true; }
}
/* Resize around child */
function wresizewin(inputs) {
	var fx = 0, fy = 0, fz = 0;
	var imgname = "", imgwidth = 0, imgheight = 0, x_diff = 0, y_diff = 0; var frmborder = ""; var tblref = "tdyn" + inputs; var imghunt = "dyn" + inputs; var goahead = 0;
	var sneak = document.getElementById(inputs);
	var peek = sneak.getElementsByTagName('IMG');
	if (peek.length > 0) {
	for (sp = 0; sp < peek.length; sp++) {
		if (peek[sp].id == imghunt) { goahead = 1; }
					     }
			     }
	if (goahead == 1) {
		var wchildimg = peek;
		if (wchildimg.length > 0) {
			for (sp = 0; sp < wchildimg.length; sp++) {
				if (wchildimg[sp].id == imghunt) {
					imgwidth = parseInt(wchildimg[sp].width);
					imgheight = parseInt(wchildimg[sp].height);
						  		 }
			  					  }
					  }
		if (imgwidth > 0 || imgheight > 0) {
			for (gp = 1; gp <= window_position_x.length; gp++) {
				if (window_position_id[gp] == inputs) {
					if (window_position_width[gp] < imgwidth) {
						window_position_width[gp] = imgwidth + ((border_buffer * 2) + 2);
						document.getElementById(inputs).style.width = imgwidth + ((border_buffer * 2) + 2);
									          }
					if ((window_position_height[gp] - (height_pad + (border_buffer * 2))) < imgheight) {
						window_position_height[gp] = (imgheight / 2) + height_pad + imgheight + ((border_buffer * 2) + 2);
						document.getElementById(inputs).style.height = (imgheight / 2) + height_pad + imgheight + ((border_buffer * 2) + 2);
										    					   }
					if ((window_position_x[gp] + window_position_width[gp]) > bound_region_x_max) {
						x_diff = bound_region_x_max - window_position_width[gp];
						if (x_diff < bound_region_x_min) { x_diff = bound_region_x_min; }
						window_position_x[gp] = x_diff;
						document.getElementById(inputs).style.left = x_diff;
														      }
					if ((window_position_y[gp] + window_position_height[gp]) > bound_region_y_max) {
						y_diff = bound_region_y_max - window_position_height[gp];
						if (y_diff < bound_region_y_min) { y_diff = bound_region_y_min; }
						window_position_y[gp] = y_diff;
						document.getElementById(inputs).style.top = y_diff;
														       }
								      }
								           }
						   }
		if (document.getElementById(tblref)) { document.getElementById(tblref).style.width = "100%"; }
			   }
	else {
	      /* Resize window (if shrinking window) to iframe.  Resize IFRAME (if window growing) to DIV. */
	      peek = sneak.getElementsByTagName('IFRAME');
	      if (peek.length > 0) {
	      for (sp = 0; sp < peek.length; sp++) {
		if (peek[sp].src.length > 0) { imghunt = peek[sp].id; frmborder = peek[sp].frameborder; goahead = 1; }
					     	   }
			     	   }
	      if (goahead == 1) {
		var wchildimg = peek;
		if (wchildimg.length > 0) {
			for (sp = 0; sp < wchildimg.length; sp++) {
				if (wchildimg[sp].id == imghunt) {
					imgwidth = parseInt(wchildimg[sp].width);
					imgheight = parseInt(wchildimg[sp].height);
						  		 }
			  					  }
					  }
		if (imgwidth > 0 || imgheight > 0) {
		if (ifrm_process == 1) {
			for (gp = 1; gp <= window_position_x.length; gp++) {
				if (window_position_id[gp] == inputs) {
					if (window_position_width[gp] < imgwidth) {
						window_position_width[gp] = imgwidth;
						document.getElementById(inputs).style.width = imgwidth;
									          }
					if (window_position_height[gp] < imgheight) {
						window_position_height[gp] = imgheight + height_pad + 1;
						document.getElementById(inputs).style.height = imgheight + height_pad + 1;
										     }
					if ((window_position_x[gp] + window_position_width[gp]) > bound_region_x_max) {
						x_diff = bound_region_x_max - window_position_width[gp];
						if (x_diff < bound_region_x_min) { x_diff = bound_region_x_min; }
						window_position_x[gp] = x_diff;
						document.getElementById(inputs).style.left = x_diff;
														      }
					if ((window_position_y[gp] + window_position_height[gp]) > bound_region_y_max) {
						y_diff = bound_region_y_max - window_position_height[gp];
						if (y_diff < bound_region_y_min) { y_diff = bound_region_y_min; }
						window_position_y[gp] = y_diff;
						document.getElementById(inputs).style.top = y_diff;
														       }
								      }
								           }
				       }
		if (ifrm_process == 2) {
			for (gp = 1; gp <= window_position_x.length; gp++) {
				if (window_position_id[gp] == inputs) {
					document.getElementById(imghunt).width = window_position_width[gp];
					document.getElementById(imghunt).height = window_position_height[gp] - height_pad;
					imgwidth = window_position_width[gp]; imgheight = window_position_height[gp] - height_pad;
					if ((window_position_x[gp] + window_position_width[gp]) > bound_region_x_max) {
						x_diff = bound_region_x_max - window_position_width[gp];
						if (x_diff < bound_region_x_min) { x_diff = bound_region_x_min; }
						window_position_x[gp] = x_diff;
						document.getElementById(inputs).style.left = x_diff;
														      }
					if ((window_position_y[gp] + window_position_height[gp]) > bound_region_y_max) {
						y_diff = bound_region_y_max - window_position_height[gp];
						if (y_diff < bound_region_y_min) { y_diff = bound_region_y_min; }
						window_position_y[gp] = y_diff;
						document.getElementById(inputs).style.top = y_diff;
														       }
					/* Determine size of IFRAME */
					if (window_ifrmname[gp].length > 0) {
						fz = 1;
						if (net_browser == 3 || net_browser == 11 || net_browser == 19) {
							if (frmborder > 0) { fx = imgwidth - 3; fy = imgheight; }
							else { fx = imgwidth - 2; fy = imgheight - 3; }
													        }
						else {
		      				      if (frmborder > 0) { fx = imgwidth - 4; fy = imgheight - 8; }
		      				      else { fx = imgwidth; fy = imgheight - 5; }
		     	     			     }
						fx = fx + x_ifrm_offset; fy = fy + y_ifrm_offset;
									    }
								      }
								           }
				       }
		/* Adjust IFRAME based on browser */
		if (fz == 0) {
			if (net_browser == 3 || net_browser == 11 || net_browser == 19) {
				if (frmborder > 0) { fx = imgwidth - 3; fy = imgheight; }
				else { fx = imgwidth - 2; fy = imgheight - 3; }
											}
			else {
		      		if (frmborder > 0) { fx = imgwidth - 4; fy = imgheight - 8; }
		      		else { fx = imgwidth; fy = imgheight - 5; }
		     	     }
			     }
		document.getElementById(imghunt).width = fx;
		document.getElementById(imghunt).height = fy;
						   }
				}
	     }
}
/* Mouse Functions */
function wmouseup() {
spec_flag = 0;
if (selected_window.length > 0) {
	if (mouse_click == 1) {
		document.getElementById(selected_window).style.top = parseInt(document.getElementById(ghost_box_id).style.top);
		document.getElementById(selected_window).style.left = parseInt(document.getElementById(ghost_box_id).style.left);
		document.getElementById(selected_window).style.width = parseInt(document.getElementById(ghost_box_id).style.width);
		document.getElementById(selected_window).style.height = parseInt(document.getElementById(ghost_box_id).style.height);
		window_position_x[selected_window_id] = parseInt(document.getElementById(ghost_box_id).style.left);
		window_position_y[selected_window_id] = parseInt(document.getElementById(ghost_box_id).style.top);
		window_position_width[selected_window_id] = parseInt(document.getElementById(ghost_box_id).style.width);
		window_position_height[selected_window_id] = parseInt(document.getElementById(ghost_box_id).style.height);
		wresizewin(selected_window);
		wsetpreferences();
			      }
				}
	if (msg_trap > 0) {
		document.getElementById(ghost_box_id).style.borderColor = bound_region_bordercolor; bound_region_bordercolor = "";
		document.getElementById(ghost_box_id).style.borderWidth = bound_region_borderwidth; bound_region_borderwidth = "";
		document.getElementById(ghost_box_id).style.borderStyle = bound_region_borderstyle; bound_region_borderstyle = "";
		document.getElementById(ghost_box_id).innerHTML = "";
		msg_trap = 0; msg_event = 0;
			  }
	if (msg_event == 0) {
		document.getElementById(ghost_box_id).style.visibility = "hidden";
		document.getElementById(ghost_box_id).style.top = 0;
		document.getElementById(ghost_box_id).style.left = 0;
		document.getElementById(ghost_box_id).style.width = 0;
		document.getElementById(ghost_box_id).style.height = 0;
			    }
	mouse_direction = ""; ghost_box_status = 0;
	document.body.style.cursor = "default";
	mouse_position_x = 0; mouse_position_y = 0;
	old_mouse_position_x = 0; old_mouse_position_y = 0;
	mouse_click = 0;
wmouseup_custom();
}
/* Mouse Alt Button Menu */
function wmousemenu(e) {
if (!e) { var e = window.event; }
if (e.pageX || e.pageY) {
			 mouse_position_x = e.pageX;
			 mouse_position_y = e.pageY;
			}
else {
      mouse_position_x = event.clientX + ((document.all) ? document.body.scrollLeft : window.pageXOffset);
      mouse_position_y = event.clientY + ((document.all) ? document.body.scrollTop : window.pageYOffset);
     }
if (monitor_rclick == 1 && msg_event == 0 && msg_trap == 0) {
	var compiler = "";
	msg_event = 1; msg_trap = 1;
	compiler = "<table class=\"mousemenubox\"><tr>";
	for (mm = 0; mm < mmenu_titles.length; mm++) {
		compiler = compiler + "<td class=\"mousemenutxt\">";
		if (mmenu_titles[mm].length > 0) {
			if (mmenu_links[mm].length > 0) {
				if (mmenu_type[mm] == 0) {
					compiler = compiler + "<a href=\""+mmenu_links[mm]+"\" onmouseover=\"window.status='';\" onmouseout=\"window.status='';\" class=\"tablinkahref\">";
							 }
				else {
				      compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\""+mmenu_links[mm]+"\" onmouseover=\"window.status='';\" onmouseout=\"window.status='';\" class=\"tablinkahref\">";
				     }
				if (mmenu_image[mm].length > 0) { compiler = compiler + "<img src=\""+mmenu_image[mm]+"\" border=\"0\" alt=\"\" />&nbsp;&nbsp;"; }
				compiler = compiler + mmenu_titles[mm]+"</a>";
							}
			else {
			      if (mmenu_image[mm].length > 0) { compiler = compiler + "<img src=\""+mmenu_image[mm]+"\" border=\"0\" alt=\"\" />&nbsp;&nbsp;"; }
			      compiler = compiler + mmenu_titles[mm];
		     	     }
						 }
		compiler = compiler + "</td></tr><tr>";
						     }
	compiler = compiler + "</tr></table>";
	var m_width = bound_default_width, m_height = bound_default_height; var data_chunk = "";
	bound_region_bordercolor = document.getElementById(ghost_box_id).style.borderColor;
	bound_region_borderwidth = document.getElementById(ghost_box_id).style.borderWidth;
	bound_region_borderstyle = document.getElementById(ghost_box_id).style.borderStyle;
	document.getElementById(ghost_box_id).style.borderColor = "";
	document.getElementById(ghost_box_id).style.borderWidth = 0;
	document.getElementById(ghost_box_id).style.borderStyle = "none";
	data_chunk = wfind_css_class('.mousemenubox', 'width');
	if (data_chunk.length > 0) { m_width = parseInt(data_chunk); data_chunk = ""; }
	data_chunk = wfind_css_class('.mousemenubox', 'height');
	if (data_chunk.length > 0) { m_height = parseInt(data_chunk); data_chunk = ""; }
	document.getElementById(ghost_box_id).style.width = m_width;
	document.getElementById(ghost_box_id).style.height = m_height;
	document.getElementById(ghost_box_id).style.left = mouse_position_x;
	document.getElementById(ghost_box_id).style.top = mouse_position_y;
	document.getElementById(ghost_box_id).innerHTML = compiler;
	/* Reposition Menu if Needed */
	if (mouse_position_x < bound_region_x_min) { document.getElementById(ghost_box_id).style.left = bound_region_x_min + 2; }
	if (mouse_position_y < bound_region_y_min) { document.getElementById(ghost_box_id).style.top = bound_region_y_min + 2; }
	if ((mouse_position_x + m_width) > bound_region_x_max) { document.getElementById(ghost_box_id).style.left = bound_region_x_max - m_width; }
	if ((mouse_position_y + m_height) > bound_region_y_max) { document.getElementById(ghost_box_id).style.top = bound_region_y_max - m_height; }
	document.getElementById(ghost_box_id).style.visibility = "visible";
							    }
return false;
}
function wmousedown(z) {
var border_selected = "", border_match = 0; var window_front = ""; var already_selected = 0;
var left_min_x_left = 0, left_max_x_right = 0, right_min_x_left = 0, right_max_x_right = 0;
var top_min_y_top = 0, top_max_y_top = 0, btm_min_y_btm = 0, btm_max_y_btm = 0, x = 0;
for (x = 1; x <= window_position_x.length; x++) {
if (window_visible[x] == "visible") {
//border_selected = ""; border_match = 0; window_front = "";
left_min_x_left = window_position_x[x] - border_buffer;
left_max_x_right = window_position_x[x] + border_buffer;
right_min_x_left = (window_position_x[x] + window_position_width[x]) - border_buffer;
right_max_x_right = (window_position_x[x] + window_position_width[x]) + border_buffer;
top_min_y_top = window_position_y[x] - border_buffer;
top_max_y_top = window_position_y[x] + border_buffer;
btm_min_y_btm = (window_position_y[x] + window_position_height[x]) - border_buffer;
btm_max_y_btm = (window_position_y[x] + window_position_height[x]) + border_buffer;
if (mouse_position_x >= left_min_x_left) {
	if (mouse_position_x <= left_max_x_right) {
		if (mouse_position_y >= window_position_y[x]) {
			if (mouse_position_y <= (window_position_y[x] + window_position_height[x])) {
				if (window_resize[x] == "yes") {
					border_selected = "left"; border_match = 1; window_front = window_position_id[x];
							       }
												    }
					    		      }
						  }
					 }
if (mouse_position_x >= right_min_x_left) {
	if (mouse_position_x <= right_max_x_right) {
		if (mouse_position_y >= window_position_y[x]) {
			if (mouse_position_y <= (window_position_y[x] + window_position_height[x])) {
				if (window_resize[x] == "yes") {
					border_selected = "right"; border_match = 1; window_front = window_position_id[x];
							       }
												    }
					    		      }
						  }
					 }
if (mouse_position_x >= window_position_x[x]) {
	if (mouse_position_x <= (window_position_x[x] + window_position_width[x])) {
		if (mouse_position_y >= top_min_y_top) {
			if (mouse_position_y <= top_max_y_top) {
				if (window_resize[x] == "yes") {
					border_selected = "top"; border_match = 1; window_front = window_position_id[x];
							       }
							       }
						       }
				    						   }
					      }
if (mouse_position_x >= window_position_x[x]) {
	if (mouse_position_x <= (window_position_x[x] + window_position_width[x])) {
		if (mouse_position_y >= btm_min_y_btm) {
			if (mouse_position_y <= btm_max_y_btm) {
				if (window_resize[x] == "yes") {
					border_selected = "bottom"; border_match = 1; window_front = window_position_id[x];
							       }
							       }
						       }
				    						   }
					      }
if (mouse_position_x >= left_min_x_left && mouse_position_x <= left_max_x_right) {
	if (mouse_position_y >= top_min_y_top && mouse_position_y <= top_max_y_top) {
		if (window_resize[x] == "yes") {
			border_selected = "tleft"; border_match = 1; window_front = window_position_id[x];
					       }
										    }
				         					 }
if (mouse_position_x >= left_min_x_left && mouse_position_x <= left_max_x_right) {
	if (mouse_position_y >= btm_min_y_btm && mouse_position_y <= btm_max_y_btm) {
		if (window_resize[x] == "yes") {
			border_selected = "bleft"; border_match = 1; window_front = window_position_id[x];
					       }
										    }
				         					 }
if (mouse_position_x >= right_min_x_left && mouse_position_x <= right_max_x_right) {
	if (mouse_position_y >= top_min_y_top && mouse_position_y <= top_max_y_top) {
		if (window_resize[x] == "yes") {
			border_selected = "tright"; border_match = 1; window_front = window_position_id[x];
					       }
										    }
				         					   }
if (mouse_position_x >= right_min_x_left && mouse_position_x <= right_max_x_right) {
	if (mouse_position_y >= btm_min_y_btm && mouse_position_y <= btm_max_y_btm) {
		if (window_resize[x] == "yes") {
			border_selected = "bright"; border_match = 1; window_front = window_position_id[x];
					       }
										    }
				         					   }
if (border_match == 0 && active_pad == 1) {
	/* Left Start */
	if (mouse_position_x > (window_position_x[x] + left_pad)) {
		/* Right End */
		if (mouse_position_x < ((window_position_x[x] + window_position_width[x]) - right_pad)) {
			/* Within Height */
			if (mouse_position_y > (window_position_y[x] + 4)) {
				if (mouse_position_y < (window_position_y[x] + height_pad)) {
					border_selected = "box"; border_match = 1;
					window_front = window_position_id[x];
											    }
						   			   }
					   								}
								  }
					  }
if (already_selected == 0) {
	if (border_match == 0) {
		ghost_box_status = 0;
		mouse_direction = "";
		mouse_click = 0;
		       	       }
	else {
	      if (window_front != selected_window || (window_front == selected_window && border_match == 1)) {
			old_mouse_position_x = 0; old_mouse_position_y = 0;
			ghost_box_status = 1; mouse_click = 1;
			mouse_direction = border_selected;
			if (pr_window.length > 0) {
				document.getElementById(pr_window).style.zIndex = window_position_zindex[pr_window_id];
						  }
			if (selected_window.length > 0) {
				document.getElementById(selected_window).style.zIndex = window_position_zindex[selected_window_id];
				pr_window = selected_window; pr_window_id = selected_window_id;
							}
			selected_window = window_position_id[x];
			selected_window_id = x;
			document.getElementById(selected_window).style.zIndex = active_window_zindex;
			document.getElementById(ghost_box_id).style.visibility = "visible";
			document.getElementById(ghost_box_id).style.top = window_position_y[x];
			document.getElementById(ghost_box_id).style.left = window_position_x[x];
			document.getElementById(ghost_box_id).style.width = window_position_width[x];
			document.getElementById(ghost_box_id).style.height = window_position_height[x];
						   							     }
	      already_selected = 1;
     	     }
			   }
				    }
						} // End For Loop
if (mouse_click == 0 && border_selected.length < 1 && monitor_rclick == 1) {
	if (document.layers) {
		if (z.which > 1) { wmousemenu(); }
			     }
						    			   }
wmousedown_custom();
}
function wmousemove(e) {
/* Overlay window and resize it according to mouse */
var x_buffer = 0, y_buffer = 0;
if (!e) { var e = window.event; }
if (e.pageX || e.pageY) {
			 mouse_position_x = e.pageX;
			 mouse_position_y = e.pageY;
			}
else {
      mouse_position_x = event.clientX + ((document.all) ? document.body.scrollLeft : window.pageXOffset);
      mouse_position_y = event.clientY + ((document.all) ? document.body.scrollTop : window.pageYOffset);
     }
if (old_mouse_position_x == 0) { old_mouse_position_x = mouse_position_x; }
if (old_mouse_position_y == 0) { old_mouse_position_y = mouse_position_y; }
if (ghost_box_status == 1) {
	if (mouse_direction == "left") {
		x_buffer = old_mouse_position_x - mouse_position_x;
		old_mouse_position_x = mouse_position_x;
		if (mouse_position_x <= (bound_region_x_min + 4)) { mouse_position_x = bound_region_x_min + 4; x_buffer = 0; }
		if (mouse_position_x >= ((window_position_x[selected_window_id] + window_position_width[selected_window_id]) - 4)) { mouse_position_x = (window_position_x[selected_window_id] + window_position_width[selected_window_id]) - 4; x_buffer = 0; }
		document.getElementById(ghost_box_id).style.left = mouse_position_x;
		/* Resize.  Trap error that IE throws by default after it completes action */
		try { document.getElementById(ghost_box_id).style.width = parseInt(document.getElementById(ghost_box_id).style.width) + x_buffer; }
		catch(onerror) { /* Trap */ }
				       }
	if (mouse_direction == "right") {
		x_buffer = mouse_position_x - old_mouse_position_x;
		old_mouse_position_x = mouse_position_x;
		if (mouse_position_x >= (bound_region_x_max - 4)) { mouse_position_x = bound_region_x_max - 4; x_buffer = 0; }
		if (mouse_position_x <= (window_position_x[selected_window_id] + 4)) { mouse_position_x = window_position_x[selected_window_id] + 4; x_buffer = 0; }
		/* Resize.  Trap error that IE throws by default after it completes action */
		try { document.getElementById(ghost_box_id).style.width = parseInt(document.getElementById(ghost_box_id).style.width) + x_buffer; }
		catch(onerror) { /* Trap */ }
					}
	if (mouse_direction == "top") {
		y_buffer = old_mouse_position_y - mouse_position_y;
		old_mouse_position_y = mouse_position_y;
		if (mouse_position_y <= (bound_region_x_min + 4)) { mouse_position_y = bound_region_x_min + 4; y_buffer = 0; }
		if (mouse_position_y >= ((window_position_y[selected_window_id] + window_position_height[selected_window_id]) - 4)) { mouse_position_y = (window_position_y[selected_window_id] + window_position_height[selected_window_id]) - 4; y_buffer = 0; }
		document.getElementById(ghost_box_id).style.top = mouse_position_y;
		/* Resize.  Trap error that IE throws by default after it completes action */
		try { document.getElementById(ghost_box_id).style.height = parseInt(document.getElementById(ghost_box_id).style.height) + y_buffer; }
		catch(onerror) { /* Trap */ }
				      }
	if (mouse_direction == "bottom") {
		y_buffer = mouse_position_y - old_mouse_position_y;
		old_mouse_position_y = mouse_position_y;
		if (mouse_position_y >= (bound_region_y_max - 4)) { mouse_position_y = bound_region_y_max - 4; y_buffer = 0; }
		if (mouse_position_y <= (window_position_y[selected_window_id] + 4)) { mouse_position_y = window_position_y[selected_window_id] + 4; y_buffer = 0; }
		/* Resize.  Trap error that IE throws by default after it completes action */
		try { document.getElementById(ghost_box_id).style.height = parseInt(document.getElementById(ghost_box_id).style.height) + y_buffer; }
		catch(onerror) { /* Trap */ }
					 }
	if (mouse_direction == "tleft") {
		x_buffer = old_mouse_position_x - mouse_position_x; old_mouse_position_x = mouse_position_x;
		y_buffer = old_mouse_position_y - mouse_position_y; old_mouse_position_y = mouse_position_y;
		if (mouse_position_x <= (bound_region_x_min + 4)) { mouse_position_x = bound_region_x_min + 4; x_buffer = 0; }
		if (mouse_position_x >= ((window_position_x[selected_window_id] + window_position_width[selected_window_id]) - 4)) { mouse_position_x = (window_position_x[selected_window_id] + window_position_width[selected_window_id]) - 4; x_buffer = 0; }
		if (mouse_position_y <= (bound_region_x_min + 4)) { mouse_position_y = bound_region_x_min + 4; y_buffer = 0; }
		if (mouse_position_y >= ((window_position_y[selected_window_id] + window_position_height[selected_window_id]) - 4)) { mouse_position_y = (window_position_y[selected_window_id] + window_position_height[selected_window_id]) - 4; y_buffer = 0; }
		document.getElementById(ghost_box_id).style.left = mouse_position_x;
		document.getElementById(ghost_box_id).style.top = mouse_position_y;
		/* Resize.  Trap error that IE throws by default after it completes action */
		try { document.getElementById(ghost_box_id).style.width = parseInt(document.getElementById(ghost_box_id).style.width) + x_buffer; }
		catch(onerror) { /* Trap */ }
		try { document.getElementById(ghost_box_id).style.height = parseInt(document.getElementById(ghost_box_id).style.height) + y_buffer; }
		catch(onerror) { /* Trap */ }
					}
	if (mouse_direction == "tright") {
		y_buffer = old_mouse_position_y - mouse_position_y; old_mouse_position_y = mouse_position_y;
		x_buffer = mouse_position_x - old_mouse_position_x; old_mouse_position_x = mouse_position_x;
		if (mouse_position_x >= (bound_region_x_max - 4)) { mouse_position_x = bound_region_x_max - 4; x_buffer = 0; }
		if (mouse_position_x <= (window_position_x[selected_window_id] + 4)) { mouse_position_x = window_position_x[selected_window_id] + 4; x_buffer = 0; }
		if (mouse_position_y <= (bound_region_x_min + 4)) { mouse_position_y = bound_region_x_min + 4; y_buffer = 0; }
		if (mouse_position_y >= ((window_position_y[selected_window_id] + window_position_height[selected_window_id]) - 4)) { mouse_position_y = (window_position_y[selected_window_id] + window_position_height[selected_window_id]) - 4; y_buffer = 0; }
		document.getElementById(ghost_box_id).style.top = mouse_position_y;
		/* Resize.  Trap error that IE throws by default after it completes action */
		try { document.getElementById(ghost_box_id).style.height = parseInt(document.getElementById(ghost_box_id).style.height) + y_buffer; }
		catch(onerror) { /* Trap */ }
		try { document.getElementById(ghost_box_id).style.width = parseInt(document.getElementById(ghost_box_id).style.width) + x_buffer; }
		catch(onerror) { /* Trap */ }
					 }
	if (mouse_direction == "bleft") {
		x_buffer = old_mouse_position_x - mouse_position_x; old_mouse_position_x = mouse_position_x;
		y_buffer = mouse_position_y - old_mouse_position_y; old_mouse_position_y = mouse_position_y;
		if (mouse_position_x <= (bound_region_x_min + 4)) { mouse_position_x = bound_region_x_min + 4; x_buffer = 0; }
		if (mouse_position_x >= ((window_position_x[selected_window_id] + window_position_width[selected_window_id]) - 4)) { mouse_position_x = (window_position_x[selected_window_id] + window_position_width[selected_window_id]) - 4; x_buffer = 0; }
		if (mouse_position_y >= (bound_region_y_max - 4)) { mouse_position_y = bound_region_y_max - 4; y_buffer = 0; }
		if (mouse_position_y <= (window_position_y[selected_window_id] + 4)) { mouse_position_y = window_position_y[selected_window_id] + 4; y_buffer = 0; }
		document.getElementById(ghost_box_id).style.left = mouse_position_x;
		/* Resize.  Trap error that IE throws by default after it completes action */
		try { document.getElementById(ghost_box_id).style.width = parseInt(document.getElementById(ghost_box_id).style.width) + x_buffer; }
		catch(onerror) { /* Trap */ }
		try { document.getElementById(ghost_box_id).style.height = parseInt(document.getElementById(ghost_box_id).style.height) + y_buffer; }
		catch(onerror) { /* Trap */ }
					}
	if (mouse_direction == "bright") {
		x_buffer = mouse_position_x - old_mouse_position_x; old_mouse_position_x = mouse_position_x;
		y_buffer = mouse_position_y - old_mouse_position_y; old_mouse_position_y = mouse_position_y;
		if (mouse_position_x >= (bound_region_x_max - 4)) { mouse_position_x = bound_region_x_max - 4; x_buffer = 0; }
		if (mouse_position_x <= (window_position_x[selected_window_id] + 4)) { mouse_position_x = window_position_x[selected_window_id] + 4; x_buffer = 0; }
		if (mouse_position_y >= (bound_region_y_max - 4)) { mouse_position_y = bound_region_y_max - 4; y_buffer = 0; }
		if (mouse_position_y <= (window_position_y[selected_window_id] + 4)) { mouse_position_y = window_position_y[selected_window_id] + 4; y_buffer = 0; }
		/* Resize.  Trap error that IE throws by default after it completes action */
		try { document.getElementById(ghost_box_id).style.width = parseInt(document.getElementById(ghost_box_id).style.width) + x_buffer; }
		catch(onerror) { /* Trap */ }
		try { document.getElementById(ghost_box_id).style.height = parseInt(document.getElementById(ghost_box_id).style.height) + y_buffer; }
		catch(onerror) { /* Trap */ }
					 }
	if (mouse_direction == "box") {
		temp_set = 0; x_buffer = 0; y_buffer = 0;
		if (mouse_position_x < old_mouse_position_x) {
			temp_set = 0; x_buffer = old_mouse_position_x - mouse_position_x;
			temp_set = parseInt(document.getElementById(ghost_box_id).style.left) - x_buffer;
			if (temp_set >= (bound_region_x_min + 4)) { document.getElementById(ghost_box_id).style.left = parseInt(document.getElementById(ghost_box_id).style.left) - x_buffer; }
			old_mouse_position_x = mouse_position_x;
							     }
		if (mouse_position_x > old_mouse_position_x) {
			temp_set = 0; x_buffer = mouse_position_x - old_mouse_position_x;
			temp_set = (parseInt(document.getElementById(ghost_box_id).style.left) + parseInt(document.getElementById(ghost_box_id).style.width)) + x_buffer;
			if (temp_set <= (bound_region_x_max - 4)) { document.getElementById(ghost_box_id).style.left = parseInt(document.getElementById(ghost_box_id).style.left) + x_buffer; }
			old_mouse_position_x = mouse_position_x;
							     }
		if (old_mouse_position_y > mouse_position_y) {
			temp_set = 0; y_buffer = old_mouse_position_y - mouse_position_y;
			temp_set = parseInt(document.getElementById(ghost_box_id).style.top) - y_buffer;
			if (temp_set >= (bound_region_y_min + 4)) { document.getElementById(ghost_box_id).style.top = parseInt(document.getElementById(ghost_box_id).style.top) - y_buffer; }
			old_mouse_position_y = mouse_position_y;
							     }
		if (old_mouse_position_y < mouse_position_y) {
			temp_set = 0; y_buffer = mouse_position_y - old_mouse_position_y;
			temp_set = (parseInt(document.getElementById(ghost_box_id).style.top) + parseInt(document.getElementById(ghost_box_id).style.height)) + y_buffer;
			if (temp_set <= (bound_region_y_max - 4)) { document.getElementById(ghost_box_id).style.top = parseInt(document.getElementById(ghost_box_id).style.top) + y_buffer; }
			old_mouse_position_y = mouse_position_y;
							     }
				      }
			   }
if (mouse_direction != "box") { wmouse_locale(); }
wmousemove_custom(mouse_position_x, mouse_position_y);
}
function wmouse_locale() {
var border_match = 0; var drag_find = 0; var window_front = ""; var resize_marker = 0;
var left_min_x_left = 0, left_max_x_right = 0, right_min_x_left = 0, right_max_x_right = 0;
var top_min_y_top = 0, top_max_y_top = 0, btm_min_y_btm = 0, btm_max_y_btm = 0, x = 0;
for (x = 1; x <= window_position_x.length; x++) {
if (window_visible[x] == "visible") {
//border_match = 0; drag_find = 0; window_front = "";
drag_find = 0;
left_min_x_left = window_position_x[x] - border_buffer;
left_max_x_right = window_position_x[x] + border_buffer;
right_min_x_left = (window_position_x[x] + window_position_width[x]) - border_buffer;
right_max_x_right = (window_position_x[x] + window_position_width[x]) + border_buffer;
top_min_y_top = window_position_y[x] - border_buffer;
top_max_y_top = window_position_y[x] + border_buffer;
btm_min_y_btm = (window_position_y[x] + window_position_height[x]) - border_buffer;
btm_max_y_btm = (window_position_y[x] + window_position_height[x]) + border_buffer;
if (mouse_position_x >= left_min_x_left) {
	if (mouse_position_x <= left_max_x_right) {
		if (mouse_position_y >= window_position_y[x]) {
			if (mouse_position_y <= (window_position_y[x] + window_position_height[x])) {
				if (window_resize[x] == "yes") {
					resize_marker = 1; border_match = 1; window_front = window_position_id[x];
							       }
												    }
					    		      }
						  }
					 }
if (mouse_position_x >= right_min_x_left) {
	if (mouse_position_x <= right_max_x_right) {
		if (mouse_position_y >= window_position_y[x]) {
			if (mouse_position_y <= (window_position_y[x] + window_position_height[x])) {
				if (window_resize[x] == "yes") {
					resize_marker = 2; border_match = 1; window_front = window_position_id[x];
							       }
												    }
					    		      }
						   }
					  }
if (mouse_position_x >= window_position_x[x]) {
	if (mouse_position_x <= (window_position_x[x] + window_position_width[x])) {
		if (mouse_position_y >= top_min_y_top) {
			if (mouse_position_y <= top_max_y_top) {
				if (window_resize[x] == "yes") {
					resize_marker = 3; border_match = 1; window_front = window_position_id[x];
							       }
							       }
						       }
				    						   }
					      }
if (mouse_position_x >= window_position_x[x]) {
	if (mouse_position_x <= (window_position_x[x] + window_position_width[x])) {
		if (mouse_position_y >= btm_min_y_btm) {
			if (mouse_position_y <= btm_max_y_btm) {
				if (window_resize[x] == "yes") {
					resize_marker = 4; border_match = 1; window_front = window_position_id[x];
							       }
							       }
						       }
				    						   }
					      }
if (mouse_position_x >= left_min_x_left && mouse_position_x <= left_max_x_right) {
	if (mouse_position_y >= top_min_y_top && mouse_position_y <= top_max_y_top) {
		if (window_resize[x] == "yes") {
			resize_marker = 5; border_match = 1; window_front = window_position_id[x];
					       }
										    }
				         					 }
if (mouse_position_x >= left_min_x_left && mouse_position_x <= left_max_x_right) {
	if (mouse_position_y >= btm_min_y_btm && mouse_position_y <= btm_max_y_btm) {
		if (window_resize[x] == "yes") {
			resize_marker = 6; border_match = 1; window_front = window_position_id[x];
					       }
										    }
				         					 }
if (mouse_position_x >= right_min_x_left && mouse_position_x <= right_max_x_right) {
	if (mouse_position_y >= top_min_y_top && mouse_position_y <= top_max_y_top) {
		if (window_resize[x] == "yes") {
			resize_marker = 7; border_match = 1; window_front = window_position_id[x];
					       }
										    }
				         					   }
if (mouse_position_x >= right_min_x_left && mouse_position_x <= right_max_x_right) {
	if (mouse_position_y >= btm_min_y_btm && mouse_position_y <= btm_max_y_btm) {
		if (window_resize[x] == "yes") {
			resize_marker = 8; border_match = 1; window_front = window_position_id[x];
					       }
										    }
				         					   }
if (border_match == 1) {
	if (selected_window.length > 0) {
		if (selected_window != window_front) {
			border_match = 0;
						     }
					}
		       }
if (border_match == 0 && active_pad == 1) {
	if (selected_window == window_position_id[x] || (selected_window.length < 1 && pr_window.length < 1)) {
		/* Left Start */
		if (mouse_position_x > (window_position_x[x] + left_pad)) {
			/* Right End */
			if (mouse_position_x < ((window_position_x[x] + window_position_width[x]) - right_pad)) {
				/* Within Height */
				if (mouse_position_y > (window_position_y[x] + 4)) {
					if (mouse_position_y < (window_position_y[x] + height_pad)) { drag_find = 1; }
					else { drag_find = 0; document.body.style.cursor = "default"; }
						   			   	   }
				else { drag_find = 0; document.body.style.cursor = "default"; }
					   									}
			else { drag_find = 0; document.body.style.cursor = "default"; }
								  	  }
		//else { drag_find = 0; document.body.style.cursor = "default"; }
													      }
					  }
if (border_match == 0 && active_pad == 1 && drag_find == 1) {
	if (selected_window.length > 0 && pr_window.length < 1) {
		if (selected_window == window_position_id[x]) {
			if (parseInt(document.getElementById(selected_window).style.zIndex) == active_window_zindex) { document.body.style.cursor = "move"; }
			else { drag_find = 0; document.body.style.cursor = "default"; }
							      }
								}
	if (selected_window.length < 1 && pr_window.length > 0) {
		if (pr_window == window_position_id[x]) {
			if (parseInt(document.getElementById(pr_window).style.zIndex) == active_window_zindex) { document.body.style.cursor = "move"; }
			else { drag_find = 0; document.body.style.cursor = "default"; }
					       	        }
								}
	if (selected_window.length > 0 && pr_window.length > 0) {
		if (selected_window == window_position_id[x]) {
			if (parseInt(document.getElementById(selected_window).style.zIndex) == active_window_zindex) { document.body.style.cursor = "move"; }
			else { drag_find = 0; document.body.style.cursor = "default"; }
							      }
								}
	if (selected_window.length < 1 && pr_window.length < 1) {
		document.body.style.cursor = "move";
								}
							    }
if (border_match == 1) {
	if (resize_marker == 1) { drag_find = 1; document.body.style.cursor = "e-resize"; }
	else if (resize_marker == 2) { drag_find = 1; document.body.style.cursor = "w-resize"; }
	else if (resize_marker == 3) { drag_find = 1; document.body.style.cursor = "n-resize"; }
	else if (resize_marker == 4) { drag_find = 1; document.body.style.cursor = "s-resize"; }
	else if (resize_marker == 5) { drag_find = 1; document.body.style.cursor = "nw-resize"; }
	else if (resize_marker == 6) { drag_find = 1; document.body.style.cursor = "sw-resize"; }
	else if (resize_marker == 7) { drag_find = 1; document.body.style.cursor = "ne-resize"; }
	else if (resize_marker == 8) { drag_find = 1; document.body.style.cursor = "se-resize"; }
	else { drag_find = 1; document.body.style.cursor = "default"; }
		       }
						} // End For
				    }
}
/* Pull specific CSS class style attributes */
function wfind_css_class(element_label, element_chunk) {
/*
element_label = Name of css class to pull style attributes from.  Example: '.mousemenubox'
element_chunk = Style attribute to return the value of.  Example: 'width'
*/
var style_matches = ""; var local_find = 0;
/* Embedded Stylesheet */
for (es = 0; es < document.all.length; es++) {
	if (document.all(es).tagName == "STYLE") {
		var embedded_sheet = document.all(es).innerHTML;
		var css_chunks = new Array();
		css_chunks = embedded_sheet.split("}");
		for (cc = 0; cc < css_chunks.length; cc++) {
			if ((css_chunks[cc].indexOf(element_label) + 1)) {
				var css_block = new Array(); css_block = css_chunks[cc].split("{");
				var css_contents = new Array(); css_contents = css_block[1].split(";");
				for (telems = 0; telems < css_contents.length; telems++) {
					if ((css_contents[telems].indexOf(":") + 1)) {
						var name_vals = new Array(); name_vals = css_contents[telems].split(":");
						var ename = removeschars(removespace(name_vals[0])); var evalue = removeschars(name_vals[1]);
						if (ename.length > 0 && evalue.length > 0) {
							var mname = removespace(element_chunk);
							if (mname.toLowerCase() == ename) {
								style_matches = evalue; local_find = 1;
										  	  }
										   	   }
										      }
										         }
									 }
							   }
						 }
					     }
/* External Stylesheets */
if (local_find == 0) {
if (document.styleSheets) {
	if (net_browser == 3 || net_browser == 11 || net_browser == 19) {
	/* IE */
	var css_sheets = new Array();
	css_sheets = document.styleSheets;
	for (sheet = 0; sheet < css_sheets.length; sheet++) {
		var css_data = document.styleSheets[sheet].cssText;
		var css_elements = new Array();
		css_elements = css_data.split("}");
		for (element = 0; element < css_elements.length; element++) {
			if ((css_elements[element].indexOf(element_label) + 1)) {
				var css_style = new Array();
				css_style = css_elements[element].split(";");
				for (styles = 1; styles < css_style.length; styles++) {
					var css_line = css_style[styles].toLowerCase();
					var name_value = new Array(); name_value = css_line.split(":");
					var cname = removespace(name_value[0]); var cvalue = name_value[1];
					if (cname.length > 0 && cvalue.length > 0) {
						var style_names = removespace(element_chunk);
						if (style_names.toLowerCase() == cname) {
							style_matches = cvalue;
										        }
										   }
										      }
										}
							    		    }
							    }
									}
	else {
	      /* Mozilla */
	      var css_sheets = new Array();
	      css_sheets = document.styleSheets;
	      for (sheet = 0; sheet < css_sheets.length; sheet++) {
			var css_length = document.styleSheets[sheet].cssRules.length;
			var css_data = document.styleSheets[sheet].cssRules;
			for (element = 0; element < css_length; element++) {
				var css_element = document.styleSheets[sheet].cssRules[element].cssText;
				if ((css_element.indexOf(element_label) + 1)) {
					var css_lead = new Array(); css_lead = css_element.split("{");
					var css_trail = new Array(); css_trail = css_lead[1].split("}");
					var css_content = new Array(); css_content = css_trail[0].split(";");
					for (gimp = 0; gimp < css_content.length; gimp++) {
						var name_value = new Array(); name_value = css_content[gimp].split(":");
						var cname = removespace(name_value[0]); var cvalue = name_value[1];
						if (cname.length > 0 && cvalue.length > 0) {
							var style_names = removespace(element_chunk);
							if (style_names.toLowerCase() == cname) {
								style_matches = cvalue;
												}
									   		   }
									  		  }
							      		      }
							   		   }
						    		  }
	     }
			  }
		     }
return style_matches;
}
/* Close Message Prompt */
function wpromptclose() {
msg_event = 0;
document.getElementById(ghost_box_id).style.left = 0;
document.getElementById(ghost_box_id).style.top = 0;
document.getElementById(ghost_box_id).style.width = 0;
document.getElementById(ghost_box_id).style.height = 0;
document.getElementById(ghost_box_id).style.visibility = "hidden";
document.getElementById(ghost_box_id).innerHTML = "";
}
/* Get Page Title */
function wparsetitle() {
var thetitle = "Title Page";
if (document.getElementsByTagName("TITLE")) {
	for (fv = 0; fv < document.all.length; fv++) {
		if (document.all(fv).tagName == "TITLE") {
			thetitle = document.all(fv).innerHTML;
							 }
						     }
					    }
return (thetitle);
}
/* Get the URL */
function wgeturl() {
var theurl = window.location.href;
return (theurl);
}
/* Add To Favorite Menu */
function wfavorites() {
var thetitle = "Favorite Page";
var theurl = wgeturl();
thetitle = wparsetitle();
if (net_browser == 3 || net_browser == 11 || net_browser == 19) {
try { window.external.AddFavorite(theurl, thetitle); }
catch(onerror) {
		/* Security Notice */
		var compiler = ""; msg_event = 1;
		compiler = "<table cellpadding=\"2\" cellspacing=\"0\" class=\"msgevents\"><tr><td width=\"100%\" class=\"wcaption\">";
		compiler = compiler + "<strong>Add To Favorites</strong><br />Security settings in your web browser have prevented this web page from being added to your favorites.  You can use the key combination CONTROL + D to add this page.<br /><br />";
		compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wpromptclose();\" class=\"tablinkahref\">[x] Close</a>";
		compiler = compiler + "</td></tr></table>";
		document.getElementById(ghost_box_id).style.left = mouse_position_x;
		document.getElementById(ghost_box_id).style.top = mouse_position_y;
		document.getElementById(ghost_box_id).style.width = 200;
		document.getElementById(ghost_box_id).innerHTML = compiler;
		document.getElementById(ghost_box_id).style.visibility = "visible";
	       }
								}
else {
	var compiler = ""; msg_event = 1;
	compiler = "<table cellpadding=\"2\" cellspacing=\"0\" class=\"msgevents\"><tr><td width=\"100%\" class=\"wcaption\">";
	compiler = compiler + "<strong>Add To Favorites</strong><br />You can use one of the key combinations provided below to add this page as a favorite:<br />";
	compiler = compiler + "Browsers: CONTROL + D<br />Opera: CONTROL + T<br /><br />";
	compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wpromptclose();\" class=\"tablinkahref\">[x] Close</a>";
	compiler = compiler + "</td></tr></table>";
	document.getElementById(ghost_box_id).style.left = mouse_position_x;
	document.getElementById(ghost_box_id).style.top = mouse_position_y;
	document.getElementById(ghost_box_id).style.width = 200;
	document.getElementById(ghost_box_id).innerHTML = compiler;
	document.getElementById(ghost_box_id).style.visibility = "visible";
     }
}
/* Set Home Page */
function wsethome() {
var theurl = wgeturl();
if (net_browser == 3 || net_browser == 11 || net_browser == 19) {
try {
     document.body.style.behavior='url(#default#homepage)';
     document.body.setHomePage(theurl);
    }
catch(onerror) {
		/* Security Notice */
		var compiler = ""; msg_event = 1;
		compiler = "<table cellpadding=\"2\" cellspacing=\"0\" class=\"msgevents\"><tr><td width=\"100%\" class=\"wcaption\">";
		compiler = compiler + "<strong>Set As Homepage</strong><br />Security settings in your web browser have prevented this web page from being set as your homepage.  You can, however, set the homepage or start page in your web browser.<br /><br />";
		compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wpromptclose();\" class=\"tablinkahref\">[x] Close</a>";
		compiler = compiler + "</td></tr></table>";
		document.getElementById(ghost_box_id).style.left = mouse_position_x;
		document.getElementById(ghost_box_id).style.top = mouse_position_y;
		document.getElementById(ghost_box_id).style.width = 200;
		document.getElementById(ghost_box_id).innerHTML = compiler;
		document.getElementById(ghost_box_id).style.visibility = "visible";
	       }
								}
else {
	if (net_browser == 6 || net_browser == 13 || net_browser == 21) {
		try {
		     netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite");
		     navigator.preference("browser.startup.homepage", theurl);
		    }
		catch(onerror) {
				/* Security Notice */
				var compiler = ""; msg_event = 1;
				compiler = "<table cellpadding=\"2\" cellspacing=\"0\" class=\"msgevents\"><tr><td width=\"100%\" class=\"wcaption\">";
				compiler = compiler + "<strong>Set As Homepage</strong><br />Security settings in your web browser have prevented this web page from being set as your homepage.  You can, however, set the homepage or start page in your web browser.<br /><br />";
				compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wpromptclose();\" class=\"tablinkahref\">[x] Close</a>";
				compiler = compiler + "</td></tr></table>";
				document.getElementById(ghost_box_id).style.left = mouse_position_x;
				document.getElementById(ghost_box_id).style.top = mouse_position_y;
				document.getElementById(ghost_box_id).style.width = 200;
				document.getElementById(ghost_box_id).innerHTML = compiler;
				document.getElementById(ghost_box_id).style.visibility = "visible";
			       }
	      								}
	else {
	      var compiler = ""; msg_event = 1;
	      compiler = "<table cellpadding=\"2\" cellspacing=\"0\" class=\"msgevents\"><tr><td width=\"100%\" class=\"wcaption\">";
	      compiler = compiler + "<strong>Set As Homepage</strong><br />Please use your web browser's homepage or start page section to set your homepage to this page.<br /><br />";
	      compiler = compiler + "<a href=\"javascript:void();\" onmousedown=\"javascript:wpromptclose();\" class=\"tablinkahref\">[x] Close</a>";
	      compiler = compiler + "</td></tr></table>";
	      document.getElementById(ghost_box_id).style.left = mouse_position_x;
	      document.getElementById(ghost_box_id).style.top = mouse_position_y;
	      document.getElementById(ghost_box_id).style.width = 200;
	      document.getElementById(ghost_box_id).innerHTML = compiler;
	      document.getElementById(ghost_box_id).style.visibility = "visible";
	     }
     }
}
/* Email Friend */
function wemail_friend() {
var compiler = "";
var thetitle = wparsetitle();
var theurl = wgeturl();
if (wef_msg_subject.length == 0) { wef_msg_subject = " "; }
compiler = "When you get a chance, please check out the following web page:\n%0A%0D";
compiler = compiler + thetitle + "\n%0A%0D" + theurl + "\n%0A%0D" + wef_msg_body;
window.location = "mailto:?&subject="+wef_msg_subject+"&body="+compiler+"";
}
/* Read Cookie */
function wread_cookie(cookiename) {
var cookiechunk = document.cookie; var cvalue = "";
if (definition(cookiechunk, cookiename)) { cvalue = cookievalue(cookiechunk, cookiename); }
return (cvalue);
}
/* Set Cookie */
function wset_cookie(cookiename, cookievalue, lifetime) {
var compiler = ""; var cookiedate = new Date();
cookiedate.setTime(cookiedate.getTime());
if (lifetime == 0) { compiler = "" + cookiename + "" + '=' + escape(cookievalue) + ';expires='; }
else {
      lifetime = lifetime * 86400000;
      lifetime = new Date(cookiedate.getTime() + lifetime);
      compiler = "" + cookiename + "" + '=' + escape(cookievalue) + ';expires=' + lifetime.toGMTString();
     }
if (compiler.length > 0) { document.cookie = compiler; }
}
function warray_push(array_name, value) {
var size = array_name.length;
array_name[size] = value;
}
function wname_real(rname) {
if (rname != '#text') { return true; }
return false;
}
/* Load XML File */
function wxml_load(datafile, leader) {
/*
datafile = XML File
leader = Master Node Name (Capitalization Sensitive.)
*/
leadnode = leader;
if (net_browser == 11) {
	/* PC IE */
	xml_data = new ActiveXObject("Microsoft.XMLDOM");
	xml_data.async = false;
	xml_data.load(datafile);
	while (xml_data.readyState != 4) { /* Hook Progress */ }
	wxml_mieparse(xml_data.documentElement);
	xml_loaded = 1;
		       }
else {
      xml_data = new XMLHttpRequest();
      xml_data.onreadystatechange = wxml_status;
      xml_data.open("GET", datafile, true);
      xml_data.send(null);
     }
}
function wxml_status() {
if (xml_data.readyState == 4) {
	if (xml_data.status == 200) {
		      var jumpstart = xml_data.responseXML.getElementsByTagName(leadnode);
		      wxml_mfoparse(jumpstart);
			            }
			      }
}
function wxml_mfoparse(node_name) {
var cycle = 0, tier = "", n_name = "", n_value = ""; step = 0; bstep = 0;
var old_name = "", current_name = "";
/* Get Parent Nodes In Master Node */
for (pd = 0; pd < node_name[0].childNodes.length; pd++) {
	n_name = node_name[0].childNodes[pd].nodeName;
	n_value = node_name[0].childNodes[pd].nodeValue;
	if (wname_real(n_name)) {
		if (cycle == 0) { tier = n_name; cycle = 1; }
		else { tier = tier + "|" + n_name; }
				}
						        }
/* Save Parent Tier */
tier_data = new Array(); tier_data = tier.split("|");
for (td = 0; td < tier_data.length; td++) {
	warray_push(parent_node_names, tier_data[td]);
				          }
/* Get Node Names/Values In Each Parent Node */
for (cn = 0; cn < parent_node_names.length; cn++) {
	if (current_name.length > 0) { old_name = current_name; }
	var nlayer_name = xml_data.responseXML.getElementsByTagName(parent_node_names[cn]);
	if (cn == 0 && bstep == 0) {
				    step = 0; current_name = parent_node_names[cn];
				    xml_row_count = xml_row_count + 1;
				    xml_node_path[xml_node_count] = "new_xml_row";
				    xml_node_value[xml_node_count] = xml_row_count;
				    xml_node_count = xml_node_count + 1;
				   }
	else {
	      current_name = parent_node_names[cn];
	      if (current_name != old_name) { step = 0; bstep = 0; }
	      else { step = step + 1; bstep = 1; }
	      xml_row_count = xml_row_count + 1;
	      xml_node_path[xml_node_count] = "new_xml_row";
	      xml_node_value[xml_node_count] = xml_row_count;
	      xml_node_count = xml_node_count + 1;
	     }
	wxmlchild_nvs(nlayer_name[step]);
						  }
xml_loaded = 1;
}
function wxml_mieparse(node_probe) {
var parent_count = 0; parent_count = node_probe.childNodes.length;
if (parent_count > 0) {
	for (pd = 0; pd < parent_count; pd++) {
		warray_push(parent_node_names, node_probe.childNodes[pd].nodeName);
					      }
	wxml_parse(node_probe);
		      }
}
/* Parse XML - Mozilla, Safari, Etc */
function wxmlchild_nvs(node_probe) {
var cnode_name, cnode_value, cnode_probe;
if (node_probe.hasChildNodes()) {
	for (var sn = 0; sn < node_probe.childNodes.length; sn++) {
		fnode_name = node_probe.firstChild.nodeName;
		fnode_value = node_probe.firstChild.nodeValue;
	        cnode_name = node_probe.childNodes[sn].nodeName;
	        cnode_value = node_probe.childNodes[sn].nodeValue;
		cnode_probe = xml_data.responseXML.getElementsByTagName(cnode_name);
		if (wname_real(cnode_name)) {
			wxmlchild_nvs(cnode_probe[step]);
					    }
		if (wname_real(cnode_name)) {
			xml_node_path[xml_node_count] = cnode_name;
			xml_node_value[xml_node_count] = fnode_value;
			xml_node_count = xml_node_count + 1;
					    }
								  }
				}
}
/* Parse XML - PC IE.  Mac IE does not work. */
function wxml_parse(xml_nest) {
if(xml_nest.hasChildNodes()) {
	if (xml_dot_name.length > 0) {
		xml_dot_name = xml_nest.nodeName;
		if (xml_second_flag == 0) { xml_second_block = xml_nest.nodeName; }
		if (xml_nest.nodeName == xml_second_block && xml_parent_count > 0) {
			xml_dot_name = xml_nest.nodeName;
			xml_row_count = xml_row_count + 1;
			xml_node_path[xml_node_count] = "new_xml_row";
			xml_node_value[xml_node_count] = xml_row_count;
			xml_node_count = xml_node_count + 1;
							   			   }
		xml_second_flag += 1;
		if (xml_dot_name == parent_node_names[xml_parent_count]) { xml_second_flag = 0; xml_parent_count = xml_parent_count + 1; }
				     }
	else { xml_dot_name = xml_nest.nodeName; xml_first_block = xml_nest.nodeName; }
	for(var xn = 0; xn < xml_nest.childNodes.length; xn++) {
		wxml_parse(xml_nest.childNodes(xn));
						               }
			     }
else {
      xml_node_path[xml_node_count] = xml_dot_name;
      xml_node_value[xml_node_count] = xml_nest.nodeValue;
      xml_node_count = xml_node_count + 1;
     }
}
function wxml_getrow(rowid) {
var compiler = ""; var flag = 0; var chunked = 0;
for (var trail = 0; trail < xml_node_path.length; trail++) {
	if (flag == 1 && xml_node_path[trail] == "new_xml_row") { flag = 0; }
	if (flag == 1) {
		if (chunked == 0) { compiler = xml_node_path[trail] + "=" + xml_node_value[trail]; chunked = 1; }
		else { compiler = compiler + "," + xml_node_path[trail] + "=" + xml_node_value[trail]; }
		       }
	if (xml_node_path[trail] == "new_xml_row" && xml_node_value[trail] == rowid) { flag = 1; }
							   }
return compiler;
}
function wxml_getrowcol(rowid, column) {
var flag = 0; var chunked = 0;
for (var trail = 0; trail < xml_node_path.length; trail++) {
	if (flag == 1 && xml_node_path[trail] == "new_xml_row") { flag = 0; }
	if (flag == 1) {
		if (xml_node_path[trail] == column) { return xml_node_value[trail]; }
		       }
	if (xml_node_path[trail] == "new_xml_row" && xml_node_value[trail] == rowid) { flag = 1; }
							   }
return;
}
function wxml_getnumrows() {
var num_rows = 0;
for (var trail = 0; trail < xml_node_path.length; trail++) {
	if (xml_node_path[trail] == "new_xml_row") { num_rows = xml_node_value[trail]; }
							   }
return num_rows;
}
function wxml_getnumatches(column, value) {
var compiler = ""; var chunked = 0; var current_row = 0;
for (var trail = 0; trail < xml_node_path.length; trail++) {
	if (xml_node_path[trail] == column) {
		if (xml_node_value[trail] == value) {
			if (chunked == 0) { compiler = current_row; chunked = 1; }
			else { compiler = compiler + "," + current_row; }
						    }
					    }
	if (xml_node_path[trail] == "new_xml_row") { current_row = xml_node_value[trail]; }
							   }
return compiler;
}
function wxml_getgrmatches(column, value) {
var compiler = ""; var chunked = 0; var current_row = 0;
for (var trail = 0; trail < xml_node_path.length; trail++) {
	if (xml_node_path[trail] == column) {
		if (xml_node_value[trail] > value) {
			if (chunked == 0) { compiler = current_row; chunked = 1; }
			else { compiler = compiler + "," + current_row; }
						   }
					    }
	if (xml_node_path[trail] == "new_xml_row") { current_row = xml_node_value[trail]; }
							   }
return compiler;
}
function wxml_getlsmatches(column, value) {
var compiler = ""; var chunked = 0; var current_row = 0;
for (var trail = 0; trail < xml_node_path.length; trail++) {
	if (xml_node_path[trail] == column) {
		if (xml_node_value[trail] < value) {
			if (chunked == 0) { compiler = current_row; chunked = 1; }
			else { compiler = compiler + "," + current_row; }
						   }
					    }
	if (xml_node_path[trail] == "new_xml_row") { current_row = xml_node_value[trail]; }
							   }
return compiler;
}
function wxml_gettxtmatches(column, value) {
var compiler = ""; var chunked = 0; var current_row = 0; var input_value = value.toLowerCase();
for (var trail = 0; trail < xml_node_path.length; trail++) {
	if (xml_node_path[trail] == column) {
		var array_value = xml_node_value[trail].toLowerCase();
		if ((array_value.indexOf(input_value) + 1)) {
			if (chunked == 0) { compiler = current_row; chunked = 1; }
			else { compiler = compiler + "," + current_row; }
							    }
					    }
	if (xml_node_path[trail] == "new_xml_row") { current_row = xml_node_value[trail]; }
							   }
return compiler;
}
