function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function launch_mp3_old(type, id, length, window_height)
{
	window.open
	("/player/?type="+type+"&id="+id+"&length="+length , 'media_player', 'statusbar=0,toolbar=0,menubar=0,scrollbars=0,resizable=yes,width=320,height='+window_height)
}

function launch_mp3(type, id, length, date)
{
	window.open
	("/player/?media="+type+"&id="+id+"&length="+length+"&date="+date , 'media_player', 'statusbar=0,toolbar=0,menubar=0,scrollbars=0,resizable=yes,width=320,height=250')
}

function launch_fundraiser_info() {
	window.open("/donate/special/about", '', 'statusbar=0,toolbar=0,menubar=0,scrollbars=0,resizable=yes,width=320,height=450')
}

function toggleviewSelect(select) {
	// select is the originating caller

	select = document.getElementById(select);

	var elementOn;
	elementsOff = new Array(select.options.length - 1)

	// get the actual objects by their ids
	var j=0;
	for(i=0; i<select.options.length; i++) {
		if(i == select.selectedIndex)
			elementOn = document.getElementById(select.options[i].value);
		else
			elementsOff[j++] = document.getElementById(select.options[i].value);
	}
	
	for(i=0; i<elementsOff.length; i++) {
		elementsOff[i].style.display = 'none';
	}

	elementOn.style.display = 'inline';
	
	return;
}

function checkEmailAddress(email) {
        var errormessage = new String();

	var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	
	var email = document.getElementById(email).value;

	if (filter.test(email))
		return true;
	else {
		alert('You must type in a valid email address.');
		return false;
	}
}

function setFocus(id) {
	document.getElementById(id).focus();
}


// Copyright 2003 Bontrager Connection, LLC
// Code obtained from http://WillMaster.com/

function idop_required() {
var errormessage = new String();

// Put field checks below this point.

if(WithoutContent(document.idop_order.fname.value))
        { errormessage += "\n\nPlease enter your first name."; }

if(WithoutContent(document.idop_order.lname.value))
        { errormessage += "\n\nPlease enter your last name."; }

if(WithoutContent(document.idop_order.address1.value))
        { errormessage += "\n\nPlease enter your address."; }

if(WithoutContent(document.idop_order.city.value))
        { errormessage += "\n\nPlease enter your city."; }

if(WithoutContent(document.idop_order.state.value))
        { errormessage += "\n\nPlease enter your state."; }

if(WithoutContent(document.idop_order.zip.value))
        { errormessage += "\n\nPlease enter your zip code."; }

if(WithoutContent(document.idop_order.phone.value))
        { errormessage += "\n\nPlease enter your phone number."; }

if(WithoutContent(document.idop_order.email.value))
        { errormessage += "\n\nPlease enter your email address."; }

if(WithoutContent(document.idop_order.card_name.value))
        { errormessage += "\n\nPlease enter the name on your Credit Card."; }

if(WithoutContent(document.idop_order.card_number.value))
        { errormessage += "\n\nPlease enter your Credit Card Number."; }



// Put field checks above this point.
if(errormessage.length > 2) {
        alert('NOTE:' + errormessage);
        return false;
        }
return true;
} // end of function idop_required()


function WithoutContent(ss) {
if(ss.length > 0) { return false; }
return true;
}

function NoneWithContent(ss) {
for(var i = 0; i < ss.length; i++) {
        if(ss[i].value.length > 0) { return false; }
        }
return true;
}

function NoneWithCheck(ss) {
for(var i = 0; i < ss.length; i++) {
        if(ss[i].checked) { return false; }
        }
return true;
}

function WithoutCheck(ss) {
if(ss.checked) { return false; }
return true;
}

function WithoutSelectionValue(ss) {
for(var i = 0; i < ss.length; i++) {
        if(ss[i].selected) {
                if(ss[i].value.length) { return false; }
                }
        }
return true;
}

