// JavaScript Document

/******* show/hide all *******/
function expand_all()
{
$$('.expandable').invoke('show');
$$('.minus').each(function(e){e.src='/maiden.bm/userfiles/image/minus.gif';});
$('showall').hide();
$('hideall').show();
}
function hide_all()
{
$$('.expandable').invoke('hide');
$$('.minus').each(function(e){e.src='/maiden.bm/userfiles/image/plus.gif';});
$('showall').show();
$('hideall').hide();
}

function hide_all_expandables(p_this)
{

$$('.expandable').invoke('hide');

if($(p_this).src.endsWith('minus.gif'))
{
  //Put the minus/plus code here so the "endsWith" code above will work
  $$('.minus').each(function(e){e.src='/maiden.bm/userfiles/image/plus.gif';});
  $(p_this).up(1).down('.expandable').hide();
  $(p_this).src='/maiden.bm/userfiles/image/plus.gif';
}
else
{
  //Put the minus/plus code here so the "endsWith" code above will work
  $$('.minus').each(function(e){e.src='/maiden.bm/userfiles/image/plus.gif';});
  $(p_this).up(1).down('.expandable').show();
  $(p_this).src='/maiden.bm/userfiles/image/minus.gif';
}


}


/*******  popwindow *******/
var newwindow;
function popwindow(url)
{
newwindow=window.open(url,'name','height=500,width=900,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,location=yes,directories=yes,status=yes');
}

/*******  show/hide with images*******/

/*<![CDATA[*/
function toggleDiv(img,img1,img2,divid){
var divobj=document.getElementById(divid);
divobj.style.display=(divobj.style.display=='none')?'':'none';
img.src=(divobj.style.display=='none')?img.src.replace(img1,img2):img.src.replace(img2,img1);
}
/*]]>*/



var isALL = 0;
var isID = 0;
var isDHTML = 0;
if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
if (document.all) {isALL = 1; isDHTML = 1;}
}
function checkDOM(object_id) {
if (isID) { return (document.getElementById(object_id).style) ; }
if (isALL) { return (document.all[object_id].style) ; }
}
// DOM check ends
var toggle_status = "on";
function toggle_display(id_name) {
if (toggle_status == "on") {
dom = checkDOM(id_name); //send id_name to use All or ID
dom.display = "none";
toggle_status = "on";
} else {
dom = checkDOM(id_name); //send id_name to use All or ID
dom.display = "block";
toggle_status = "off";
}
}
