function siteMapExpand(siteLink)
{
	var siteLi = document.getElementById( siteLink );
	if(siteLi.className.match(" on")) 
	{
		siteLi.className=siteLi.className.replace(" on", "");
	}
	else
	{
		siteLi.className += ' on';
	}	
	
	var leftCol = document.getElementById( 'leftCol' );
	
	//alert(siteLi.className);
	//alert(leftCol.style.left);
}
/****************************/

/* SKIN CHANGING FUNCTIONS */
function showSkin(skinName)
{
	var	skinTag = document.getElementById( 'skinDisplay' );
	var skinWrapTag = document.getElementById( skinName );
	skinTag.innerHTML = '<img src="http://www.graxdomain.co.uk/images/skinGrabs/'+skinName+'.jpg" alt="'+skinName+'" />';	
	skinTag.className += ' on';
}
function hideSkin()
{
	var	skinTag = document.getElementById( 'skinDisplay' );
	skinTag.innerHTML = '';	
	skinTag.className=skinTag.className.replace(" on", "");	
}
/****************************/


/*	COMMENT FORM VALIDATING	*/
function validate(thisForm)
{
	if (thisForm.name.value == "" || thisForm.name.value == null)
	{
		alert("You need to include a name before you submit.");
		return false;
	}
	/*
	else if (thisForm.email.value == "" || thisForm.email.value == null)
	{
		alert("You need to include an email before you submit.");
		return false;
	}	
	else if( echeck(thisForm.email.value) == false) 
	{
		alert("This email appears to be invalid. Check and try again.");
		return false;
	}
	*/
	else if (thisForm.comment.value == "" || thisForm.name.value == null)
		{
			alert("You need to write a comment.");
			return false;
	}
	else if (!thisForm.spam_check.checked)
		{
			alert("You need to tick the checkbox to prove that you're not a spammer.");
			return false;
	}	
	else
	{
		//alert('yay');
		return true;
	}
}

function echeck(str)
{
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){ return false }
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ return false }
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ return false }
	if (str.indexOf(at,(lat+1))!=-1){ return false }
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ return false }
	if (str.indexOf(dot,(lat+2))==-1){ return false }
	if (str.indexOf(" ")!=-1){ return false }
}
/****************************/

function fValidateBall()
{
	if (frm8Ball.name.value == "")
	{
		alert("Tsk tsk child. You must tell me your name before I can answer your question.");
		return false;
	}
	else if (frm8Ball.question.value == "")
		{
			alert("Fool! You dare to push the button without asking a question!?!?!?.");
			return false;
	}
	else
	{
		return true;
	}
}
