/*
' Copyright (c) 2007 Affno (Pvt) Ltd, . All rights reserved.
'
' This software is the confidential and proprietary information of        
' Affno  ("Confidential Information").  You shall not disclose such 
' Confidential Information and shall use it only in accordance with
' the terms of the license agreement you entered into with Affno.
'
'Module Name	: AFF_reUsed
' File Name		: contact_us.js
' Description	: This is the page where we validatethe form.
' Created By	: Roshani de Silva
' Created Date	: 05-Dec-2011
' Modified By	: 
' Modified Date	: 
' Version		: 1.00.000
*/

function checkRadio(){
	if (document.callMe.callMeTime[0].checked == true) {
		document.callMe.time.disabled=true;
	} else if(document.callMe.callMeTime[1].checked = true){
		document.callMe.time.disabled=false;
	} else if(document.callMe.callMeTime[0].checked = false){
		document.callMe.time.disabled=false;
	}else if(document.callMe.callMeTime[1].checked = false){
		document.callMe.time.disabled=true;
	}


}

function checkCallMe(callMe){
//Name
str = document.callMe.callMeName.value	
	if (isEmpty(str)){
		alert(msgError_emptyName)
		document.callMe.callMeName.focus();
		return false;
	} else if (!isName(str)) {
		alert(msgError_validName)
		document.callMe.callMeName.focus();
		return false;
	} else if (str=='Your Name...') {
		alert(msgError_validName)
		document.callMe.callMeName.value=""
		document.callMe.callMeName.focus();
		return false;
	} else if (isSpace(str)){
		alert(msgError_spaceName);
		document.callMe.callMeName.value=""
		document.callMe.callMeName.focus();
		return false;
	}
	
//Telephone
str = document.callMe.callMeTelephone.value
	if (isEmpty(str)){
		alert(msgError_emptyTelephone)
		document.callMe.callMeTelephone.focus();
		return false;
	} else if (!isMobile(str)) {
		alert(msgError_validTelephone)
		document.callMe.callMeTelephone.focus();
		return false;
	} else if (str=='Phone No...') {
		alert(msgError_validTelephone)
		document.callMe.callMeTelephone.value=""
		document.callMe.callMeTelephone.focus();
		return false;
	} else if (isSpace(str)){
		alert(msgError_spaceTelephone);
		document.callMe.callMeTelephone.value=""
		document.callMe.callMeTelephone.focus();
		return false;
	}

//callMeEmail
str = document.callMe.callMeEmail.value
	if (isEmpty(str)){
		alert(msgError_emptyEmail)
		document.callMe.callMeEmail.focus();
		return false;
	} else if (!isEmail(str)) {
		alert(msgError_validEmail)
		document.callMe.callMeEmail.focus();
		return false;
	} else if (str=='Email...') {
		alert(msgError_validEmail)
		document.callMe.callMeEmail.value=""
		document.callMe.callMeEmail.focus();
		return false;
	} else if (isSpace(str)){
		alert(msgError_spaceEmail);
		document.callMe.callMeEmail.value=""
		document.callMe.callMeEmail.focus();
		return false;
	}

	
return true
}
