// Copyright Acro Media Inc. 1998-2006, www.acromediainc.com

function copyrightYear(){
	if(document.getElementById('insertYear')) document.getElementById('insertYear').innerHTML = new Date().getFullYear();
}

function externalLinks(){	
		if (!document.getElementsByTagName) return;
		var anchors = document.getElementsByTagName("a");
		for (var i=0; i<anchors.length; i++) {
			if (anchors[i].getAttribute("href") && anchors[i].getAttribute("rel") == "external") anchors[i].target = "_blank";
	}
}

function toggleExpand(section){
	if(document.getElementById([section]).style.display=='block'){
		document.getElementById([section]).style.display='none';
		//document.images[section+'_img'].src="graphics/learn_more.gif";
	}
	else{
		document.getElementById([section]).style.display='block';
		//document.images[section+'_img'].src="graphics/learn_more_02.gif";
	}
}

function closeMe(){
	var linkObj = document.getElementById("learnMore01");
	linkObj.style.display = "none";
}

function checkEmail(myForm){
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(myForm.db_Member_email.value)){
		return (true)
	}

	alert("The email address you entered is not valid. Please provide a proper email address to login.")
	return (false)
}


//Checks to see if safari is on, boolean
var detect = navigator.userAgent.toLowerCase();
var safStatus,thestring;
function checkSafari(){	
	if (checkIt('safari')) safStatus = true;
	else safStatus = false;
	function checkIt(string){
		place = detect.indexOf(string) + 1;
		return place;
	}
}

function addLoadEvent(func){
	var oldOnLoad = window.onload;
	if(typeof window.onload != 'function'){ 
		window.onload = func;
	}
	else{ 
		window.onload = function(){ 
			oldOnLoad();
			func();
		}
	}
}

siteOnLoad = function(){
	checkSafari();
	copyrightYear();
	externalLinks();
}

addLoadEvent(siteOnLoad);

var newWin;
var popup = {
	open : function( pArgs ){return this.named( pArgs.url, pArgs.w, pArgs.h, pArgs.y, pArgs.x, pArgs.scroll, pArgs.resize, pArgs.name, pArgs.pos );},
	named : function(url, width, height, top, left, scroll, resize, name, position){
		if(!scroll) scroll = "no";
		if(!resize) resize = "no";
		if(!name) name = "popup";
		if(!width || !height){
			if(!scroll)	scroll = "yes";
			if(!resize) resize = "yes";
		}
		if(!width) width = screen.availWidth;
		if(!height) height = screen.availHeight;
		if(!top || top == "center") top = (screen.availHeight / 2 - height / 2);
		if(!left || left == "center") left = (screen.availWidth / 2 - width / 2);
		newWin = window.open(url,name,"toolbar=no,menubar=0,width="+width+",height="+height+",top="+top+",left="+left+",scrollbars="+scroll+",resizable="+resize);
		(position == "behind") ? setTimeout('newWin.blur();',100) : setTimeout('newWin.focus();',100);
	}
}


//Show and Hide Function
function hide(el) {
		el_obj = document.getElementById(el)
		el_obj.style.display = 'none';
	}
	
	function show(el) {
		el_obj = document.getElementById(el)
		el_obj.style.display = 'block';
	}


