function emailsermon(sermon_id,grid,res_num,is) {
 window.open ("http://www.powerpointsermons.com/?page=study&sermon_id=" + sermon_id + "&grid=" + grid + "&is=" + is + "&res_num" + res_num +
              "&type=eml", "processing", 'toolbar=no, directories=no, location=no, status=no, menubar=no, resizeable=no, scrollbars=no, width=565, height=535');                    
}

function reviewsermon(sermon_id,grid,res_num,is) {
 window.open ("http://www.powerpointsermons.com/?page=study&sermon_id=" + sermon_id + "&grid=" + grid + "&is=" + is + "&res_num" + res_num +
              "&type=rvw", "processing", 'toolbar=no, directories=no, location=no, status=no, menubar=no, resizeable=no, scrollbars=no, width=565, height=580');                    
}

function otd(type) {
 window.open ("http://www.powerpointsermons.com/?page=home&otd=1&otd_type=" + type + 
              "", "processing", 'toolbar=no, directories=no, location=no, status=no, menubar=no, resizeable=no, scrollbars=yes, width=625, height=580');                    
}


var collapsables = new Array();
var hidables = new Array();

function Collapsable_show(id) {
   for (i = 0; i < collapsables.length; i++) {
      if (collapsables[i].id == id)
         collapsables[i].expand();
      else
         collapsables[i].collapse();
   }
}

function Collapsable_toggle(id) {
   for (i = 0; i < collapsables.length; i++) {
      if (collapsables[i].id == id && collapsables[i].collapsed)
         collapsables[i].expand();
      else 
         collapsables[i].collapse();
   }
}

function Collapsable(id, c) {
   this.style1 = document.getElementById(id).style;
   this.style2 = document.getElementById(id +"_").style;
   this.collapsed = c !== undefined ? c : true;
   this.id = id;
}

Collapsable.prototype.collapse = function() {
   this.style1.display = "block";
   this.style2.display = "none";
   this.collapsed = true;
}

Collapsable.prototype.expand = function() {
   this.style1.display = "none";
   this.style2.display = "block";
   this.collapsed = false;
}


function Hidable_toggle(id) {
   for (i = 0; i < hidables.length; i++) {
      if (hidables[i].id == id && hidables[i].hidden)
         hidables[i].show();
      else if (hidables[i].id != id || !hidables[i].hidden)
         hidables[i].hide();
   }
}

function Hidable_toggle2(id) {
   for (i = 0; i < hidables.length; i++) {
      if (hidables[i].id == id && hidables[i].hidden)
         hidables[i].show2();
      else if (hidables[i].id != id || !hidables[i].hidden)
         hidables[i].hide();
   }
}

function Hidable(id) {
   this.style = getObject(id).style;
   this.hidden = true;
   this.id = id;
   this.alwayshide = arguments[1] ? true : false;
}

Hidable.prototype.hide = function() {
   this.style.display = "none";
   this.hidden = true;
}

Hidable.prototype.show = function() {
   this.style.display = "block";
   this.hidden = false;
}

Hidable.prototype.show2 = function() {
   this.style.top = mousecoords[1] +"px";
   this.style.left = mousecoords[0] +"px";
   this.style.display = "block";
   this.hidden = false;
}
