var arrayPics=new Array();
var c=0;
var num;
var currTaskTab="facts_A";
function timedCount()
{
	document.getElementById('animate_img').src=("images/Gallery/"+arrayPics[(c%num)]);
	c=c+1;
	t=setTimeout("timedCount()",3000);
}

function switchTab(newTabId)
{	
	oldTab=document.getElementById(currTaskTab);

	newTab=document.getElementById(newTabId);

	oldTab.style.display="none";
	newTab.style.display="";
		
	currTaskTab=newTabId;
}

function validate()
{
	var thisform=document.signin;
	if(GenValidation(thisform.uname,'User Name','','')==0)
		return false;
	if(GenValidation(thisform.password,'Password','','')==0)
		return false;
	thisform.formaction.value="signin";	
}

function validateComment()
{
	var thisform=document.visitorcomment;
	if(GenValidation(thisform.visitor_comment,'comment','','')==0)
		return false;
	else if(thisform.visitor_comment.value.length>1000)
	{
		alert("Text cannot exceed 1000 characters!");
		thisform.visitor_comment.focus();
		return false;
	}	
	else if(checkInCharSet(thisform.visitor_comment.value,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ, .") == 0)
	{
		alert("Only the following characters can be used: [a-z],[A-Z],comma, space and period");
		thisform.visitor_comment.focus();
		return false;
	}
	thisform.formaction.value="addcomment";	
}

function viewSchool(refId)
{
	thisform=document.school;
	thisform.refSchool.value=refId;	
	thisform.action="SchoolPage.php";
	thisform.submit();
}