var closeAll = false; // true|false

function ft_formValidate(){
//	Name  : ft_formValidate
//	Author: Marion Dorsett - http://www.FigmentThinking.com
ft_result=true;ft_errors='';c=ft_formValidate.arguments;for(i=0;i<=(c.length-1);i+=3){o=document.getElementById(c[i]);if(o){fieldValue=o.value;c[i+2]=c[i+2].toLowerCase();isRequired=c[i+2].substring(0,1);isEmail=c[i+2].indexOf('isemail');isNum=c[i+2].indexOf('isnum');inRange=c[i+2].indexOf('inrange');if(isRequired=='r'){hasValue=false;switch(o.type){case 'radio':case 'checkbox':f=document.forms;for(e=0;e<=(f.length-1);f++){if(f[e].elements[o.name].length){isChecked=false;for(s=0;s<=(f[e].elements[o.name].length-1);s++){if(f[e].elements[o.name][s].checked){isChecked=true;break;}}if(isChecked){hasValue=true;}}else if(o.type=='checkbox'){isChecked = o.checked;if(isChecked){hasValue=true;}else{hasValue=false;}}else{hasValue=true;}}break;default:if(fieldValue!=''){hasValue=true;}break;}if(!hasValue){ft_errors+=c[i]+' is required.\n';}}if(isEmail>=0){if(fieldValue!=''){if(fieldValue.search(/.{1,}@{1}.{1,}\.{1}.{2,}/gi)==-1){ft_errors+=c[i]+' must be an email address.\n';}}}if(isNum >= 0){if(fieldValue!=''){if(isNaN(parseFloat(fieldValue))){ft_errors+=c[i]+' must be a number.\n';}}}if(inRange>=0){if(fieldValue!=''){rTemp=c[i+2].split(':',2);rStart=parseFloat(rTemp[0].substring(8,c[i+2].indexOf(':')));if(isNaN(rStart)){rStart=0;}rStop=parseFloat(rTemp[1]);fieldNumber=parseFloat(fieldValue);if(isNaN(fieldNumber)){fieldNumber=0;}if(fieldNumber<rStart||fieldNumber>rStop){ft_errors+=c[i]+' must be between '+rStart+' and '+rStop+'.\n';}}}}else{continue;}}if(ft_errors){alert(ft_errors);ft_result = false;}return ft_result;
}
// Preload Over and Down state images
Image1= new Image(10,20);
Image1.src = "http://www.onlinebuttonsecrets.com/covers/abv3Down.gif";
Image2= new Image(10,20);
Image2.src = "http://www.onlinebuttonsecrets.com/covers/abv3Over.gif";

function alexButton(state, ID)
{
	switch(state)
	{
		case "press":
			document.getElementById(ID).style.backgroundImage='url(http://www.onlinebuttonsecrets.com/covers/abv3Down.gif)';
			document.getElementById(ID).style.backgroundPosition='top';
			break;
		case "over":
			document.getElementById(ID).style.backgroundPosition='top';
			document.getElementById(ID).style.backgroundImage='url(http://www.onlinebuttonsecrets.com/covers/abv3Over.gif)';
			break;
		case "up":
		default:
		// Up	
			document.getElementById(ID).style.backgroundPosition='bottom';
			document.getElementById(ID).style.backgroundImage='url(http://www.onlinebuttonsecrets.com/covers/abv3Up.gif)';
			break;
	}
}

function linkify(URL,target, config)
{
	if(target != '')
	{
		// Open in a new window
		window.open(URL, target, config);
	}
	else
	{
		location.href=URL;
	}
}

// Close all <div class="close">
function classChange()
{
	for (i=0;i<document.getElementsByTagName("div").length; i++) 
	{
		if (document.getElementsByTagName("div").item(i).className == "close")
		{
			document.getElementsByTagName("div").item(i).style.display = "none";
		}
	}
}

/* Collapsable/Expandable Div Display Box */
function showDiv(ID, closeAll)
{
	/*
	Author:
		Another Tool by SBC 2005-12-05
	Usage:
		showDiv(ID)
	Purpose:
		Allows a "hidden" div to be placed in a HTML document and displayed when appropritate with
		the use of JavaScript event handlers: onClick, onMouseover and etc.
	Directions:
		Use the <div> statement below to establish your display box.
		
			<div id="Unique_ID_Name_Goes_Here" style="display:none;">
			
		If you want the display box visible when the page loads, change display:none to display:block.
		You can call this function using any JavaScript event handler method.  Below are some examples.
		
		Hyperlink:
			<a href="#" onclick="showDiv('Unique_ID_Name_Goes_Her'); return false">Display or Close Display Box</a>
			
		Input button:
			<input type="button" onclick="showDisplay('Unique_ID_Name_Goes_Her'); return false" value="Display or Close Display Box">
	*/
	// Should all open divs be closed?
	// If there is no div, don't throw a JavaScript error
	if(!document.getElementById(ID)){ alert('The ID `' + ID + '` does not exist on this page.'); return false; }
	
	// Evaluate the current visibility status of the display box.
	if(document.getElementById(ID).style.display == 'none')
	{
		if(closeAll == true){ classChange(); }		
		// The display box is not visible, so we want to display the box
		document.getElementById(ID).style.display='block';
	}
	else
	{
		if(closeAll == true){ classChange(); }				
		// The display box is visible, so we want to hide the display box
		document.getElementById(ID).style.display='none';
	}
}

function bookMark(pageURL, pageTitle) 
{ 
	if (window.external) { window.external.AddFavorite(pageURL,pageTitle) } 
	else { alert("Sorry! Your browser doesn't support this function."); } 
} 