// ------------------------------------
// AJAX
// ------------------------------------
function toggleDisplay(elm){
	if ( document.getElementById(elm).style.display == 'none' ){ document.getElementById(elm).style.display = ''; }
	else { document.getElementById(elm).style.display = 'none' }
}
// ------------------------------------
function showInfo(elm){
	document.getElementById(elm).style.display = '';
}
// ------------------------------------
function hideInfo(elm){
	document.getElementById(elm).style.display = 'none';
}

// ------------------------------------
// Form Verification
// ------------------------------------
function memAppCheck()
{
	if (document.applymem.fusername.value == "Info not Found"){
			alert("You must be registered and logged into the forums to apply.");
			return false;
	}

	if(document.applymem.clantag.value == ""){
		alert("You did not enter your ClanTag");
		return false;
	}else if(document.applymem.clantag.value == "none"){
		alert("Tag can not be none. Application will be ignored if used.");
		return false;
	}

	if(document.applymem.appfullname.value == ""){
		alert("You did not enter your Name");
		return false;
	}else if(document.applymem.appfullname.value == "none"){
		alert("Name can not be none. Application will be ignored if used.");
		return false;
	}

	if(document.applymem.appwebsite.value == ""){
		alert("You did not enter your Website");
		return false;
	}

	return true;
}
// ------------------------------------
function serverCheck()
{
	if(document.applymem.gameservertype.value == "none")
	{
		document.applymem.serverip.disabled = true;
		document.applymem.serverport.disabled = true;
		document.applymem.serverquery.disabled = true;
		document.applymem.serverip.className = "formitemdisable";
		document.applymem.serverport.className = "formitemdisable";
		document.applymem.serverquery.className = "formitemdisable";
		
	}			
	else
	{
		document.applymem.serverip.disabled = false;
		document.applymem.serverport.disabled = false;
		document.applymem.serverquery.disabled = false;
		document.applymem.serverip.className = "formitem";
		document.applymem.serverport.className = "formitem";
		document.applymem.serverquery.className = "formitem";
	}			
	
}		
// ------------------------------------
function onSubCheck()
{
	if (document.applymem.fusername.value == "Info not Found"){
			alert("You must be registered and logged into the forums to apply.");
			return false;
			
	}
	
	if(document.applymem.joingroup.value == "GameAdmin" || document.applymem.gameservertype.value != "none"){
		if (document.applymem.serverip.value == ""){
			alert("You did not enter your Server IP");
			return false;
		}
		if (document.applymem.serverport.value == ""){
			alert("You did not enter your Server Port");
			return false;
		}
		
	}
	
	if(document.applymem.clantag.value == ""){
		alert("You did not enter your ClanTag");
		return false;
		
	}
	
	if(document.applymem.appfullname.value == ""){
		alert("You did not enter your Name");
		return false;
		
	}
	
	if(document.applymem.appwebsite.value == ""){
		alert("You did not enter your Website");
		return false;
	}			

	return true;	
}	


// ------------------------------------
// Screenshot Image Functions
// ------------------------------------
		
function els()
{
	var elements = new Array;
	
	for( var i=0; i<arguments.length; i++ ){
	
		var element = arguments[i];
		
		if ( typeof( element ) == "string" )
			element = document.getElementById( element );
			
		if ( arguments.length == 1 )
			return element;
		
		elements.push( element );
	
	}
	
	return elements;
}
// ------------------------------------
function displayScreenshot( location ) {

	els("screen-placeholder").style.display	= "";
	document["screenshot"].src	= location;
	document["screenshot"].height="800"
	window.location	= "#screenshot";

}
// ------------------------------------
function hideScreenshot( ) {
	
	els("screen-placeholder").style.display	= "none";

}
