/*********************************************
 * Javascript Document                       *
 * Created by: Kieran Youngman               *
 * Copyright (C) PC Gaming HQ 2010           *
 * ----------------------------------------- *
 * This document was created to hold all of  *
 * the functions used in PC Gaming HQ.       *
 * ----------------------------------------- *
 * If you want to use this document, please  *
 * link to "PCGamingHQ.com" or add a notice  *
 * saying that it was copied from "PC Gaming *
 * HQ".                                      *
 ********************************************/

/**
 * countLeft - Used for limiting a value
 * in a text field, mainly for telling
 * the user that it is over the limit
 * before sending.
 **/
function countLeft(field, count, iMax)
{
	if (field.value.length > iMax)
	{
		count.value = iMax - field.value.length;
	}
	else
	{
		count.value = iMax - field.value.length;
	}
}

/**
 * showOrHide - Shows or Hides a div
 * based on the style it has.
 **/
function showOrHide(divName)
{
	var div = document.getElementById(divName);
	
	if(div.style.display=='none')
	{
		div.style.display = 'block';
	}
	else if(div.style.display=='block')
	{
		div.style.display = 'none';
	}
}

function sendTo(username)
{
	document.getElementById('mailTo').value = username;
}


