function checkLoginForm()
	{
		var form = document.forms[0];
		var msg = "";
	if ((document.forms[0].username.value=="")|| (document.forms[0].username.value=="USERNAME/EMAIL ADDRESS")) msg+="\nUsername";
	if ((document.forms[0].password.value=="") || (document.forms[0].password.value=="PASSWORD")) msg+="\nPassword";
	if (msg)
	{
		alert ("Please fill in the following field(s)" + msg);
		return false;
	}
	
	return true;
}
function checkDealChannelForm()
{
        var form = document.forms[0];
        var msg = "";

        //if (document.forms[0].deal.selectedIndex =="") msg+="\ndeal";

        if (msg)
        { 
                alert ("Please fill in the following field(s):" + msg);
                return false;
        }   
            
        return true;
} 


function checkForgotForm()
{
	var form = document.forms[0];
	var msg = "";
	
	/** Code to add simple captch to the form **/
    
	var first_random_num = document.getElementById('first_random_num').value;	
	var second_random_num = document.getElementById('second_random_num').value;		
	var add_num =parseInt(first_random_num) + parseInt(second_random_num);	
	var CaptchaInput = document.getElementById('CaptchaInput').value;
	
	if (document.forms[0].email.value=="") msg+="\nEmail address";
    if (CaptchaInput=="")
        msg+="\nCaptcha Input Field";
		
	if (msg)
	{
		alert ("Please fill in the following field(s)" + msg);
		return false;
	}
	else if (CaptchaInput != add_num)
	{
		alert (CaptchaInput + "  Incorrect captcha result !!!");
		return false;
	}
	else
	{
		
	  return true;
	}
	

}

function checkResetPwdForm()
{
	
	var form = document.forms[0];
	var msg = "";
	var new_pwd = document.getElementById('new_pwd').value;	
	var retype_pwd = document.getElementById('retype_pwd').value;

    if (new_pwd=="")
	msg+="\nNew Password";
	if (retype_pwd=="")
	msg+="\nRe-Type Password";
   
	
   if (msg)
	{
		alert ("Please fill in the following field(s)" + msg);
		return false;
	}
	else if (new_pwd != retype_pwd)
	{
		alert ("Password doesnot match");
		return false;
	}
	else
	{
		
	  return true;
	}

}
