Effect.OpenUp = function(element) {
  element = $(element);
  new Effect.BlindDown(element, arguments[1] || {});
}

Effect.CloseDown = function(element) {
  element = $(element);
  new Effect.BlindUp(element, arguments[1] || {});
}

Effect.Combo = function(element) {
  element = $(element);
  
  if(element.style.display == 'none') { 
  		new Effect.OpenUp(element, arguments[1] || { duration: 0.50 }); 
		} else { 
		 new Effect.CloseDown(element, arguments[1] || { duration: 0.50 }); 
		 }
}
Effect.kiosk = function(element) {
	element = $(element);
	if(element.style.display == 'none') {
		new Effect.OpenUp(element, arguments[1] || { duration: 0.50 }); 
	} else if(element.style.display == '') {
		new Effect.OpenUp(element, arguments[1] || { duration: 0.50 }); 
	}
	
}
Effect.mem = function(element) {
  element = $(element);
  
  if(element.style.display == '') { 
  		
		} else { 
		new Effect.OpenUp(element, arguments[1] || { duration: 0.50 }); 
		 }
}
Effect.contact = function(element) {
  element = $(element);
	new Effect.BlindDown(element, arguments[1] || {});
	
}
Effect.server = function(element) {
  element = $(element);
	new Effect.BlindDown(element, arguments[1] || { duration: 0.20 });
	
}
function get_k_groops(tag){
	alert(tag);
}
function MM_jumpMenu(targ,selObj,restore){
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if(restore) selObj.selectedIndex=0;
	}
function conferm(name){
var name = name;
//alert('Are you sure you want to delete '+name+' from this groop?');
var answer = confirm('Are you sure you want to drop '+name+'?')
	if (answer){
		alert("Bye bye!")
		
	}
	else{
		alert("Thanks for sticking around!")
	}
}
function confirmSubmit(name, action) 
{
var action = action;
var name = name;
if(action == 'drop')
{
   var agree=confirm("Are you sure you want to "+action+" "+name+"?");
   if (agree)
	   return true ;
    else
	   return false ;
}
if(action == 'delete')
{
   var agree=confirm("Are you sure you want to "+action+" "+name+"? This will remove this person from the Master List, but not from past attendance records.");
   if (agree)
	   return true ;
    else
	   return false ;
}
if(action == 'destroy')
{
   var agree=confirm("Are you sure you want to "+action+" "+name+"? This will completely remove this person from your database and past records.");
   if (agree)
	   return true ;
    else
	   return false ;
}
if(action == 'hide')
{
   var agree=confirm("Are you sure you want to hide this Loop from your page? You will NOT be able to bring it back. It will be unhidden only if someone else continues the discussion.");
   if (agree)
	   return true ;
    else
	   return false ;
}
}
function delete_groop(name, action)
{
	var action = action;
	var name = name;
	if(action == 'delete')
	{
	   var agree=confirm("Are you sure you want to "+action+" "+name+"? This will be remove this group from your current group listing, but not from past attendance records.");
	   if (agree)
		   return true ;
		else
		   return false ;
}
}
function drop(sid)
{
aobj = document.getElementById("a_"+sid);
divobj = document.getElementById(sid);
divobj.style.top = aobj.offsetBottom+10;
divobj.style.left = aobj.offsetLeft+10;
divobj.style.visibility = "visible";
}
window.onload = initForms;
function initForms()
{
	for (var i=0; i< document.forms.length; i++) {
		document.forms[i].onsubmit = function(){return validForm();}
	}
}
function validForm(){
	var allGood = true;
	var allTags = document.getElementsByTagName("*");
	
	for (var i=0; i<allTags.length; i++){
		if (!validTag(allTags[i])){
			allGood = false;
		}
	}
	return allGood;

function validTag(thisTag){
	var outClass = "";
	var allClasses = thisTag.className.split(" ");
	for (var j=0; j<allClasses.length; j++){
		outClass += validBasedOnClass(allClasses[j]) + " ";
	}
	
	thisTag.className = outClass;
	
	if(outClass.indexOf("invalid") > -1){
		thisTag.focus();
		if(thisTag.nodeName == "INPUT"){
			thisTag.select();
		}
		return false;
	}
	return true;


function validBasedOnClass(thisClass) {
	var classBack = "";
	
	switch(thisClass){
		case "":
		case "invalid":
			break;
		case "reqd":
		if(allGood && thisTag.value == "") classBack = "invalid ";
		classBack += thisClass;
			break;
		default:
			classBack += thisClass;
	}
	return classBack;
}
}
}
function highlightRows(){
	if(!document.getElementsByTagName) return false;
	var rows = document.getElementsByTagName("tr");
	for (var i=0; i<rows.length; i++) {
		rows[i].onmouseover = function() {
			this.style.backgroundColor = "#b2cffb";
			this.style.fontWeight = "bold";
		    }
		rows[i].onmouseout = function(){
			this.style.backgroundColor = "#fff";
			this.style.fontWeight = "normal";
			}
		rows[i].onmousedown = function(){
			this.style.backgroundColor = "#ccc";
			this.style.fontWeight = "normal";
			
			}
		}
		
}
function highlightRowsOnClick()
{
var rows = document.getElementById("present").value;
	for (var i=0; i<rows.length; i++) {
		if (rows[i].checked){
		
			this.style.backgroundColor = "#ffc";
		}
		}
}
