/***************************************************************
	PHP Code By:
		Telford Internet & Publishing

	Code Created For:
		

	Date:
		2007-10-12

	Version:
		2007.0006
***************************************************************/

// JavaScript Document
	//--	Validate Email Address
	function check_email(email)
	{
		symbol = email.indexOf("@",1)
		if (symbol == -1)
		{	return false;	}
	
		if(email.indexOf("@",symbol+1) > -1)
		{	return false;	}
	
		decimal = email.indexOf(".",symbol)
		if (decimal == -1)
		{	return false;	}
	
		if (decimal+3 > email.length)
		{	return false;	}

		return true;
	}

//--	Warn the user that this action will 
//		delete the item that has been selected.
	function delete_warning()
	{
		if(confirm("Are you sure you want to delete this?"))
		{	return true;	}
		else
		{	return false;	}
	}

	function open_window(url)
	{
		cwin = window.open(url,"attach","width=600,height=500,toolbar=no,scrollbars=yes,resizable=yes");
	}

	function set_end_date()
	{
		if(document.admin.date_end.value == "" || document.admin.date_end.value < document.admin.date_start.value)
		{	document.admin.date_end.value = document.admin.date_start.value;	}
	}

	function setOpacity(obj, opacity) 
	{
		opacity = (opacity == 100)?99.999:opacity;

	// IE/Win
		obj.style.filter = "alpha(opacity:"+opacity+")";

	// Safari<1.2, Konqueror
		obj.style.KHTMLOpacity = opacity/100;

	// Older Mozilla and Firefox
		obj.style.MozOpacity = opacity/100;

	// Safari 1.2, newer Firefox and Mozilla, CSS3
		obj.style.opacity = opacity/100;
	}

	function fadeIn(objId, opacity) 
	{
		if (document.getElementById) 
		{
			obj = document.getElementById(objId);
			if (opacity <= 100) 
			{
				setOpacity(obj, opacity);
				opacity += 10;
				window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
			}
		}
	}

	function fadeOut(objId, opacity) 
	{
		if (document.getElementById) 
		{
			obj = document.getElementById(objId);
			if (opacity >= 70) 
			{
				setOpacity(obj, opacity);
				opacity -= 2;
				window.setTimeout("fadeOut('"+objId+"',"+opacity+")", 100);
			}
			else
			{
				setOpacity(obj, opacity);
				opacity -= 5;
				window.setTimeout("fadeOut('"+objId+"',"+opacity+")", 100);
			}
		}
	}

