﻿
function checksubscriptionform(obj)
{
	errorMessage = '';
	
	if (obj.email.value == "")
		errorMessage = errorMessage + "Please input Email!\n";
	else
		if (!ValidateEmail(obj.email.value))
			errorMessage = errorMessage + "Invalid Email!- Please enter the accurate E-mail address";
		else
			if (obj.email.value == "ad@careertimes.com.hk" || obj.email.value == "comment@careertimes.com.hk" || obj.email.value == "fax@careertimes.com.hk" || obj.email.value == "faxadm@careertimes.com.hk" || obj.email.value == "faxreturn@careertimes.com.hk" || obj.email.value == "hrdept@careertimes.com.hk" || obj.email.value == "info@careertimes.com.hk" || obj.email.value == "mailadm@careertimes.com.hk" || obj.email.value == "match@careertimes.com.hk" || obj.email.value == "mkt@careertimes.com.hk"  || obj.email.value == "move@careertimes.com.hk" || obj.email.value == "seminar@careertimes.com.hk" || obj.email.value == "sysadm@careertimes.com.hk" || obj.email.value == "webmaster@careertimes.com.hk")
				errorMessage = errorMessage + "Invalid Email!- Please enter the another E-mail address";

	if (errorMessage != "")
	{
		alert (errorMessage);
		return false;
	}
	else
	{
		return true;
	}
}

 function checkSubscription()
{
    var email;
    var errorMessage = "";
    
    email = document.getElementById('tb_subscribe').value;           
    
    if (email == "")
		errorMessage = errorMessage + "Please input Email!\n";
	else
		if (!ValidateEmail(email))
			errorMessage = errorMessage + "Invalid Email!- Please enter the accurate E-mail address";
		else
			if (email == "ad@careertimes.com.hk" || email == "comment@careertimes.com.hk" || email == "fax@careertimes.com.hk" || email == "faxadm@careertimes.com.hk" || email == "faxreturn@careertimes.com.hk" || email == "hrdept@careertimes.com.hk" || email == "info@careertimes.com.hk" || email == "mailadm@careertimes.com.hk" || email == "match@careertimes.com.hk" || email == "mkt@careertimes.com.hk"  || email == "move@careertimes.com.hk" || email == "seminar@careertimes.com.hk" || email == "sysadm@careertimes.com.hk" || email == "webmaster@careertimes.com.hk")
				errorMessage = errorMessage + "Invalid Email!- Please enter the another E-mail address";

	if (errorMessage != "")
	{
		alert (errorMessage);
		//return false;
	}
	else
	{
		//return true;
		//document.getElementById('checkemail').src="/subscription/checkemail.aspx?e=" + email;
		document.location.href= scription_url + "/subscription/enews_sub.aspx?email=" + email;
	}
    //
}
