/*-----------------------------------------------------------------------------
===============================================================================
- C2P Utility Library
- Author: Phoenix Snake @ C2P Thailand
- Create: June 24, 2008
- http://www.c2pthailand.com
===============================================================================
-----------------------------------------------------------------------------*/

function newsLetterSignUp()
{
   var c = _( "newsSF" );
   var email = _( "newsSubscribeEmail" );

   if( emailValidate( email ) )
      c.submit();
   else
      alert( "Invalid email address. Try again." );
}

function sendContactInfo()
{
   var c = _( "contactUsCarry" );
   var email = _( "emailValidate" );

   c.submit();
}

function sendClientSubmit()
{
   var c = _( "clientLogin" );
   c.submit();
}

function emailValid( elm )
{
   var estatus = _( "emailStatus" );

   if( emailValidate( elm ) )
      estatus.className = "fconOK";
   else
      estatus.className = "fcon";
   
}

/*
Below is the modification from
http://developer.apple.com/internet/webcontent/validation.html
Modify by Phoenix Snake : March 15, 2008
*/
function emailValidate( o )
{
   var emailFilter=/^.+@.+\..+$/;
   return emailFilter.test( o.value );
}