function revealModal_orig(divID) {
	window.onscroll = function () { document.getElementById(divID).style.top = document.body.scrollTop; };
	document.getElementById(divID).style.display = "block";
	document.getElementById(divID).style.top = document.body.scrollTop;
	document.getElementById(divID).style.visibility = "visible"; 
}

function revealModal(divID) {
	window.onscroll = function() {
		document.getElementById(divID).style.top = document.body.scrollTop;	
		document.getElementById(divID).style.height = document.body.offsetHeight;
		document.getElementById(divID).style.left = document.body.offsetLeft;
		document.getElementById(divID).style.zIndex = 10000;
	};
	try {
		document.getElementById(divID).style.display = "block";
		document.getElementById(divID).style.position = "absolute";
		document.getElementById(divID).style.top = document.body.scrollTop ;
		document.getElementById(divID).style.height = document.body.scrollHeight;//document.body.offsetHeight-50;
		document.getElementById(divID+"body").style.top = 150 ;
		document.getElementById(divID+"body").style.left = document.body.scrollWidth/3;	//document.body.scrollLeft + 400 ; 
		document.getElementById(divID).style.visibility = "visible"; 			
		document.getElementById(divID).style.zIndex = 10000;
	} catch(e) {}
}

function hideModal(divID) {
	document.getElementById(divID).style.display = "none";
	document.getElementById(divID).style.visibility = "hidden"; 
}

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('content').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
			}
			else {
				footerElement.style.top = '0px';
			}
		}
	}
}

function inputLink(theURL){
	location=theURL
}


window.onload = function() {
	setFooter();
}
window.onresize = function() {
	setFooter();
}


function expand(thesrcID, thedstID, o){

      if(o){

            if(o.srcElement){
                  o.cancelBubble=true;
                  o.returnValue=false;
            }     

            else{
                  if(o.stopPropagation)o.stopPropagation();
                  if(o.preventDefault)o.preventDefault();
            }
      }

	window.document.getElementById(thesrcID).style.display = 'none';
	window.document.getElementById(thedstID).style.display = '';
}


function closedetail(thesrcID, thedstID,o){

      if(o){

            if(o.srcElement){
                  o.cancelBubble=true;
                  o.returnValue=false;
            }     

            else{
                  if(o.stopPropagation)o.stopPropagation();
                  if(o.preventDefault)o.preventDefault();
            }
      }

	window.document.getElementById(thesrcID).style.display = '';
	window.document.getElementById(thedstID).style.display = 'none';
}
			
function popbrowser(url)
{
	var newwindow=window.open(url,'name','height=550,width=550,left=50,top=10,resizable=yes,scrollbars=yes,toolbar=no,status=yes');
	if (window.focus) {newwindow.focus()}
}

function popbrowserprint(url)
{
	var printwindow=window.open(url,'name','height=550,width=550,left=50,top=10,resizable=yes,menubar=yes,scrollbars=yes,toolbar=yes,status=yes');
	if (window.focus) {printwindow.focus()}
}


function TicketValidation(theForm)
{

  if (theForm.Name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Name.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Name.value.length > 40)
  {
    alert("Please enter at most 40 characters in the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Phone.value == "")
  {
    alert("Please enter a value for the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }

  if (theForm.Phone.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }

  if (theForm.Phone.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }

  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length < 7)
  {
    alert("Please enter at least 7 characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length > 100)
  {
    alert("Please enter at most 100 characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Comment.value == "")
  {
    alert("Please enter a value for the \"Comment\" field.");
    theForm.Comment.focus();
    return (false);
  }
  return (true);
}

function FrontPage_Form1_Validator(theForm)
{

  var checkOK = "0123456789GgRrBbCcDdEeAaJjSsTtHh";
  var checkStr = theForm.OrgNumber.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }

  if (!allValid)
  {
    alert("You have entered an invalid ticket number. Check your ticket and try again.");
    theForm.OrgNumber.focus();
    return (false);
  }

  var checkStr = theForm.TicketNumber.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }

  if (!allValid)
  {
    alert("Ticket numbers contain only numbers, not letters or any other characters. Check your ticket and try again.");
    theForm.TicketNumber.focus();
    return (false);
  }


  var chkVal = theForm.OrgNumber.value;
  var prsVal = parseInt(chkVal);
  if (!(chkVal.charAt(1) == "G") && !(chkVal.charAt(1) == "g") && !(chkVal.charAt(1) == "R") && !(chkVal.charAt(1) == "r") && !(chkVal.charAt(1) == "S") && !(chkVal.charAt(1) == "s") && !(chkVal.charAt(1) == "T") && !(chkVal.charAt(1) == "t") && !(chkVal.charAt(1) == "B") && !(chkVal.charAt(1) == "b") && !(chkVal.charAt(1) == "C") && !(chkVal.charAt(1) == "c") && !(chkVal.charAt(1) == "D") && !(chkVal.charAt(1) == "d") && !(chkVal.charAt(1) == "E") && !(chkVal.charAt(1) == "e") && !(chkVal.charAt(1) == "A") && !(chkVal.charAt(1) == "a") && !(chkVal.charAt(1) == "J") && !(chkVal.charAt(1) == "j") && chkVal != "" )
  {
    alert("This is not a recognized CharityMania ticket number. Check the number on your ticket and try again.");
    theForm.OrgNumber.focus();
    return (false);
  }

  return (true);
}
function printticket() {
if (window.print != null) {
window.print();
} else {
alert("Unfortunately, your browser does not support this shortcut. Please select File and then Print from your browser's menu.");
}
}
function showOffers(){
   alert("You must log in with a valid member ID before viewing the shopping club’s products and services." );
}