//Fix the Netscape / IE problem with ID tag addressing
function DOMGetElement(o)
{
  if (document.getElementById)
	return document.getElementById(o);
  else if (document.all)
	return document.all[o];
  else if (document.layers)
	return document.layers[o];
	
  return null;
}


//Javascript for 'enter' press button clicking (login boxes implement this)
function clickButton(e, buttonid){ 
      
      var bt = document.getElementById(buttonid); 
      
      if (typeof bt == 'object'){ 
            if(navigator.appName.indexOf("Netscape")>(-1)){ 
                  if (e.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
                  if (event.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  }
            }
      }
}

//Window Opener
function openWindow(url, width, height)
{
	var options = "channelmode=0,directories=0,fullscreen=0,height=" + height + ",left=100,location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,top=100,width=" + width + "'";
	window.open(url,'',options,true);	
}

//Newsletter Opener
function openNewsletter()
{
	var url = '/Newsletter/newsletterSignUp.aspx';
	var width = 500;
	var height = 400;
	var options = "channelmode=0,directories=0,fullscreen=0,height=" + height + ",left=100,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=100,width=" + width + "'";
	window.open(url,'',options,true);
}

function show( divobject )
{
	var objTarget = DOMGetElement( divobject );
	objTarget.style.display = "block";
}

function hide( divobject )
{
	var objTarget = DOMGetElement( divobject );
	objTarget.style.display = "none";
}


//Email address HTML encryption
//=======================================
// <!-- 1314425748
// This script is (C) Copyright 2004 Jim Tucek
// Leave these comments alone!  For more info, visit
// www.jracademy.com/~jtucek/email/ 

// P = 37
// Q = 29

function cut(soul,appearance,airplane) {
	soul += ' ';
	var camera = soul.length;
	var way = 0;
	var square = '';
	for(var body = 0; body < camera; body++) {
	way = 0;
	while(soul.charCodeAt(body) != 32) {
	way = way * 10;
	way = way + soul.charCodeAt(body)-48;
	body++;
	}
	square += String.fromCharCode(stink(way,appearance,airplane));
	}
	parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+square;
}

function sell(waste,goodbye,scene) {
	waste += ' ';
	var fire = waste.length;
	var people = 0;
	for(var hypothesis = 0; hypothesis < fire; hypothesis++) {
	people = 0;
	while(waste.charCodeAt(hypothesis) != 32) {
	people = people * 10;
	people = people + waste.charCodeAt(hypothesis)-48;
	hypothesis++;
	}	
	document.write(String.fromCharCode(stink(people,goodbye,scene)));
	}
}

function stink(humor,information,hieroglyphic) {
	if (hieroglyphic % 2 == 0) {
	side = 1;
	for(var death = 1; death <= hieroglyphic/2; death++) {
	lottery = (humor*humor) % information;
	side = (lottery*side) % information;
	}
	} else {
	side = humor;
	for(var spoon = 1; spoon <= hieroglyphic/2; spoon++) {
	lottery = (humor*humor) % information;
	side = (lottery*side) % information;
	}
	}
	return side;
}